From 112745d6fae6e864a60c503b2ad0f10215c383d0 Mon Sep 17 00:00:00 2001 From: arnaucode Date: Fri, 3 Feb 2017 08:56:51 +0100 Subject: [PATCH] init --- README.md | 18 + server/controllers/adminController.js | 109 + server/controllers/chefController.js | 125 + server/controllers/contactController.js | 42 + server/controllers/conversationController.js | 202 + server/controllers/dietController.js | 251 + server/controllers/publicationController.js | 269 + server/controllers/routineController.js | 303 + server/controllers/runController.js | 107 + server/controllers/trainerController.js | 433 + server/controllers/userController.js | 791 + server/models/contactModel.js | 12 + server/models/conversationModel.js | 27 + server/models/dietModel.js | 46 + server/models/publicationModel.js | 22 + server/models/routineModel.js | 37 + server/models/runModel.js | 25 + server/models/userModel.js | 140 + server/node_modules/accepts/HISTORY.md | 74 + server/node_modules/accepts/LICENSE | 22 + server/node_modules/accepts/README.md | 94 + server/node_modules/accepts/index.js | 160 + server/node_modules/accepts/package.json | 125 + server/node_modules/after/.npmignore | 2 + server/node_modules/after/.travis.yml | 12 + server/node_modules/after/LICENCE | 19 + server/node_modules/after/README.md | 115 + server/node_modules/after/index.js | 28 + server/node_modules/after/package.json | 103 + server/node_modules/after/test/after-test.js | 120 + .../node_modules/arraybuffer.slice/.npmignore | 17 + .../node_modules/arraybuffer.slice/Makefile | 8 + .../node_modules/arraybuffer.slice/README.md | 17 + .../node_modules/arraybuffer.slice/index.js | 29 + .../arraybuffer.slice/package.json | 72 + .../arraybuffer.slice/test/slice-buffer.js | 227 + server/node_modules/backo2/.npmignore | 1 + server/node_modules/backo2/History.md | 12 + server/node_modules/backo2/Makefile | 8 + server/node_modules/backo2/Readme.md | 34 + server/node_modules/backo2/component.json | 11 + server/node_modules/backo2/index.js | 85 + server/node_modules/backo2/package.json | 78 + server/node_modules/backo2/test/index.js | 18 + .../base64-arraybuffer/.npmignore | 3 + .../base64-arraybuffer/.travis.yml | 19 + .../base64-arraybuffer/LICENSE-MIT | 22 + .../node_modules/base64-arraybuffer/README.md | 20 + .../lib/base64-arraybuffer.js | 67 + .../base64-arraybuffer/package.json | 96 + server/node_modules/base64id/.npmignore | 3 + server/node_modules/base64id/LICENSE | 22 + server/node_modules/base64id/README.md | 18 + server/node_modules/base64id/lib/base64id.js | 103 + server/node_modules/base64id/package.json | 89 + server/node_modules/better-assert/.npmignore | 4 + server/node_modules/better-assert/History.md | 15 + server/node_modules/better-assert/Makefile | 5 + server/node_modules/better-assert/Readme.md | 61 + server/node_modules/better-assert/example.js | 10 + server/node_modules/better-assert/index.js | 38 + .../node_modules/better-assert/package.json | 100 + server/node_modules/blob/.npmignore | 2 + server/node_modules/blob/.zuul.yml | 14 + server/node_modules/blob/Makefile | 14 + server/node_modules/blob/README.md | 14 + server/node_modules/blob/index.js | 96 + server/node_modules/blob/package.json | 77 + server/node_modules/blob/test/index.js | 94 + server/node_modules/callsite/.npmignore | 4 + server/node_modules/callsite/History.md | 10 + server/node_modules/callsite/Makefile | 6 + server/node_modules/callsite/Readme.md | 44 + server/node_modules/callsite/index.js | 10 + server/node_modules/callsite/package.json | 77 + server/node_modules/component-bind/.npmignore | 4 + server/node_modules/component-bind/History.md | 13 + server/node_modules/component-bind/Makefile | 7 + server/node_modules/component-bind/Readme.md | 64 + .../component-bind/component.json | 13 + server/node_modules/component-bind/index.js | 23 + .../node_modules/component-bind/package.json | 81 + .../node_modules/component-emitter/.npmignore | 2 + .../component-emitter/.travis.yml | 4 + .../node_modules/component-emitter/History.md | 52 + .../node_modules/component-emitter/Makefile | 7 + .../node_modules/component-emitter/Readme.md | 74 + .../node_modules/component-emitter/bower.json | 21 + .../component-emitter/component.json | 14 + .../node_modules/component-emitter/index.js | 164 + .../component-emitter/package.json | 81 + .../node_modules/component-inherit/.npmignore | 3 + .../node_modules/component-inherit/History.md | 5 + .../node_modules/component-inherit/Makefile | 16 + .../node_modules/component-inherit/Readme.md | 24 + .../component-inherit/component.json | 10 + .../node_modules/component-inherit/index.js | 7 + .../component-inherit/package.json | 78 + .../component-inherit/test/inherit.js | 21 + .../content-disposition/HISTORY.md | 40 + .../node_modules/content-disposition/LICENSE | 22 + .../content-disposition/README.md | 141 + .../node_modules/content-disposition/index.js | 443 + .../content-disposition/package.json | 100 + .../node_modules/cookie-signature/.npmignore | 4 + .../node_modules/cookie-signature/History.md | 27 + server/node_modules/cookie-signature/Makefile | 7 + .../node_modules/cookie-signature/Readme.md | 42 + server/node_modules/cookie-signature/index.js | 51 + .../cookie-signature/package.json | 89 + server/node_modules/cookie/.npmignore | 2 + server/node_modules/cookie/LICENSE | 9 + server/node_modules/cookie/README.md | 44 + server/node_modules/cookie/index.js | 75 + server/node_modules/cookie/package.json | 86 + server/node_modules/crc/.npmignore | 5 + server/node_modules/crc/LICENSE | 22 + server/node_modules/crc/README.md | 98 + server/node_modules/crc/lib/crc.js | 71 + server/node_modules/crc/lib/crc1.js | 21 + server/node_modules/crc/lib/crc16.js | 25 + server/node_modules/crc/lib/crc16_ccitt.js | 25 + server/node_modules/crc/lib/crc16_modbus.js | 25 + server/node_modules/crc/lib/crc24.js | 25 + server/node_modules/crc/lib/crc32.js | 25 + server/node_modules/crc/lib/crc8.js | 25 + server/node_modules/crc/lib/crc8_1wire.js | 25 + server/node_modules/crc/lib/create.js | 11 + server/node_modules/crc/lib/hex.js | 9 + server/node_modules/crc/lib/index.js | 11 + server/node_modules/crc/package.json | 92 + server/node_modules/debug/.jshintrc | 3 + server/node_modules/debug/.npmignore | 6 + server/node_modules/debug/History.md | 186 + server/node_modules/debug/Makefile | 33 + server/node_modules/debug/Readme.md | 178 + server/node_modules/debug/bower.json | 28 + server/node_modules/debug/browser.js | 175 + server/node_modules/debug/component.json | 19 + server/node_modules/debug/debug.js | 197 + server/node_modules/debug/node.js | 209 + server/node_modules/debug/package.json | 108 + server/node_modules/depd/History.md | 75 + server/node_modules/depd/LICENSE | 22 + server/node_modules/depd/Readme.md | 274 + server/node_modules/depd/index.js | 529 + .../depd/lib/compat/buffer-concat.js | 33 + .../depd/lib/compat/callsite-tostring.js | 101 + server/node_modules/depd/lib/compat/index.js | 69 + server/node_modules/depd/package.json | 101 + server/node_modules/destroy/README.md | 38 + server/node_modules/destroy/index.js | 36 + server/node_modules/destroy/package.json | 101 + server/node_modules/ee-first/LICENSE | 22 + server/node_modules/ee-first/README.md | 80 + server/node_modules/ee-first/index.js | 68 + server/node_modules/ee-first/package.json | 98 + .../node_modules/engine.io-client/History.md | 627 + server/node_modules/engine.io-client/LICENSE | 22 + .../node_modules/engine.io-client/README.md | 295 + .../engine.io-client/engine.io.js | 4671 ++ server/node_modules/engine.io-client/index.js | 2 + .../engine.io-client/lib/index.js | 10 + .../engine.io-client/lib/socket.js | 738 + .../engine.io-client/lib/transport.js | 157 + .../engine.io-client/lib/transports/index.js | 53 + .../lib/transports/polling-jsonp.js | 231 + .../lib/transports/polling-xhr.js | 424 + .../lib/transports/polling.js | 245 + .../lib/transports/websocket.js | 285 + .../engine.io-client/lib/xmlhttprequest.js | 37 + .../node_modules/component-emitter/History.md | 68 + .../node_modules/component-emitter/LICENSE | 24 + .../node_modules/component-emitter/Readme.md | 74 + .../node_modules/component-emitter/index.js | 163 + .../component-emitter/package.json | 216 + .../node_modules/debug/.jshintrc | 3 + .../node_modules/debug/.npmignore | 7 + .../node_modules/debug/CHANGELOG.md | 235 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 37 + .../node_modules/debug/Readme.md | 199 + .../node_modules/debug/bower.json | 29 + .../node_modules/debug/browser.js | 177 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/debug.js | 200 + .../node_modules/debug/index.js | 10 + .../node_modules/debug/node.js | 213 + .../node_modules/debug/package.json | 134 + .../node_modules/ms/LICENSE.md | 21 + .../node_modules/ms/README.md | 52 + .../engine.io-client/node_modules/ms/index.js | 149 + .../node_modules/ms/package.json | 120 + .../engine.io-client/package.json | 150 + .../node_modules/engine.io-parser/History.md | 141 + server/node_modules/engine.io-parser/LICENSE | 22 + .../node_modules/engine.io-parser/Readme.md | 202 + server/node_modules/engine.io-parser/index.js | 2 + .../engine.io-parser/lib/browser.js | 609 + .../engine.io-parser/lib/index.js | 474 + .../node_modules/engine.io-parser/lib/keys.js | 19 + .../engine.io-parser/package.json | 101 + server/node_modules/engine.io/History.md | 554 + server/node_modules/engine.io/LICENSE | 19 + server/node_modules/engine.io/README.md | 537 + server/node_modules/engine.io/index.js | 4 + .../node_modules/engine.io/lib/engine.io.js | 126 + server/node_modules/engine.io/lib/server.js | 481 + server/node_modules/engine.io/lib/socket.js | 479 + .../node_modules/engine.io/lib/transport.js | 128 + .../engine.io/lib/transports/index.js | 36 + .../engine.io/lib/transports/polling-jsonp.js | 75 + .../engine.io/lib/transports/polling-xhr.js | 69 + .../engine.io/lib/transports/polling.js | 408 + .../engine.io/lib/transports/websocket.js | 134 + .../engine.io/node_modules/accepts/HISTORY.md | 212 + .../engine.io/node_modules/accepts/LICENSE | 23 + .../engine.io/node_modules/accepts/README.md | 135 + .../engine.io/node_modules/accepts/index.js | 231 + .../node_modules/accepts/package.json | 112 + .../engine.io/node_modules/cookie/HISTORY.md | 118 + .../engine.io/node_modules/cookie/LICENSE | 24 + .../engine.io/node_modules/cookie/README.md | 220 + .../engine.io/node_modules/cookie/index.js | 195 + .../node_modules/cookie/package.json | 106 + .../engine.io/node_modules/debug/.jshintrc | 3 + .../engine.io/node_modules/debug/.npmignore | 7 + .../engine.io/node_modules/debug/CHANGELOG.md | 235 + .../engine.io/node_modules/debug/LICENSE | 19 + .../engine.io/node_modules/debug/Makefile | 37 + .../engine.io/node_modules/debug/Readme.md | 199 + .../engine.io/node_modules/debug/bower.json | 29 + .../engine.io/node_modules/debug/browser.js | 177 + .../node_modules/debug/component.json | 19 + .../engine.io/node_modules/debug/debug.js | 200 + .../engine.io/node_modules/debug/index.js | 10 + .../engine.io/node_modules/debug/node.js | 213 + .../engine.io/node_modules/debug/package.json | 134 + .../engine.io/node_modules/mime-db/HISTORY.md | 391 + .../engine.io/node_modules/mime-db/LICENSE | 22 + .../engine.io/node_modules/mime-db/README.md | 82 + .../engine.io/node_modules/mime-db/db.json | 6751 +++ .../engine.io/node_modules/mime-db/index.js | 11 + .../node_modules/mime-db/package.json | 138 + .../node_modules/mime-types/HISTORY.md | 216 + .../engine.io/node_modules/mime-types/LICENSE | 23 + .../node_modules/mime-types/README.md | 103 + .../node_modules/mime-types/index.js | 188 + .../node_modules/mime-types/package.json | 127 + .../engine.io/node_modules/ms/LICENSE.md | 21 + .../engine.io/node_modules/ms/README.md | 52 + .../engine.io/node_modules/ms/index.js | 149 + .../engine.io/node_modules/ms/package.json | 120 + .../node_modules/negotiator/HISTORY.md | 98 + .../engine.io/node_modules/negotiator/LICENSE | 24 + .../node_modules/negotiator/README.md | 203 + .../node_modules/negotiator/index.js | 124 + .../node_modules/negotiator/lib/charset.js | 169 + .../node_modules/negotiator/lib/encoding.js | 184 + .../node_modules/negotiator/lib/language.js | 179 + .../node_modules/negotiator/lib/mediaType.js | 294 + .../node_modules/negotiator/package.json | 125 + server/node_modules/engine.io/package.json | 133 + server/node_modules/escape-html/.npmignore | 2 + server/node_modules/escape-html/Makefile | 11 + server/node_modules/escape-html/Readme.md | 15 + .../node_modules/escape-html/component.json | 10 + server/node_modules/escape-html/index.js | 16 + server/node_modules/escape-html/package.json | 83 + server/node_modules/etag/HISTORY.md | 55 + server/node_modules/etag/LICENSE | 22 + server/node_modules/etag/README.md | 141 + server/node_modules/etag/index.js | 171 + server/node_modules/etag/package.json | 109 + server/node_modules/express/History.md | 2466 ++ server/node_modules/express/LICENSE | 22 + server/node_modules/express/Readme.md | 135 + server/node_modules/express/index.js | 2 + .../node_modules/express/lib/application.js | 571 + server/node_modules/express/lib/express.js | 93 + .../express/lib/middleware/init.js | 26 + .../express/lib/middleware/query.js | 30 + server/node_modules/express/lib/request.js | 460 + server/node_modules/express/lib/response.js | 971 + .../node_modules/express/lib/router/index.js | 576 + .../node_modules/express/lib/router/layer.js | 166 + .../node_modules/express/lib/router/route.js | 173 + server/node_modules/express/lib/utils.js | 283 + server/node_modules/express/lib/view.js | 142 + server/node_modules/express/package.json | 200 + server/node_modules/finalhandler/HISTORY.md | 51 + server/node_modules/finalhandler/LICENSE | 22 + server/node_modules/finalhandler/README.md | 133 + server/node_modules/finalhandler/index.js | 171 + server/node_modules/finalhandler/package.json | 114 + server/node_modules/forwarded/HISTORY.md | 4 + server/node_modules/forwarded/LICENSE | 22 + server/node_modules/forwarded/README.md | 53 + server/node_modules/forwarded/index.js | 35 + server/node_modules/forwarded/package.json | 99 + server/node_modules/fresh/HISTORY.md | 24 + server/node_modules/fresh/LICENSE | 22 + server/node_modules/fresh/README.md | 58 + server/node_modules/fresh/index.js | 53 + server/node_modules/fresh/package.json | 112 + server/node_modules/has-binary/.npmignore | 15 + server/node_modules/has-binary/History.md | 19 + server/node_modules/has-binary/LICENSE | 20 + server/node_modules/has-binary/Makefile | 3 + server/node_modules/has-binary/README.md | 4 + server/node_modules/has-binary/index.js | 59 + server/node_modules/has-binary/package.json | 75 + server/node_modules/has-binary/test.js | 73 + server/node_modules/has-cors/.npmignore | 3 + server/node_modules/has-cors/History.md | 21 + server/node_modules/has-cors/Makefile | 11 + server/node_modules/has-cors/Readme.md | 24 + server/node_modules/has-cors/component.json | 13 + server/node_modules/has-cors/index.js | 17 + server/node_modules/has-cors/package.json | 96 + server/node_modules/has-cors/test.js | 24 + server/node_modules/indexof/.npmignore | 2 + server/node_modules/indexof/Makefile | 11 + server/node_modules/indexof/Readme.md | 15 + server/node_modules/indexof/component.json | 10 + server/node_modules/indexof/index.js | 10 + server/node_modules/indexof/package.json | 67 + server/node_modules/ipaddr.js/.npmignore | 2 + server/node_modules/ipaddr.js/.travis.yml | 10 + server/node_modules/ipaddr.js/Cakefile | 18 + server/node_modules/ipaddr.js/LICENSE | 19 + server/node_modules/ipaddr.js/README.md | 161 + server/node_modules/ipaddr.js/bower.json | 29 + server/node_modules/ipaddr.js/ipaddr.min.js | 1 + server/node_modules/ipaddr.js/lib/ipaddr.js | 467 + server/node_modules/ipaddr.js/package.json | 93 + .../node_modules/ipaddr.js/src/ipaddr.coffee | 396 + .../ipaddr.js/test/ipaddr.test.coffee | 282 + server/node_modules/isarray/README.md | 54 + server/node_modules/isarray/build/build.js | 209 + server/node_modules/isarray/component.json | 19 + server/node_modules/isarray/index.js | 3 + server/node_modules/isarray/package.json | 87 + server/node_modules/json3/LICENSE | 20 + server/node_modules/json3/README.md | 152 + server/node_modules/json3/lib/json3.js | 902 + server/node_modules/json3/lib/json3.min.js | 17 + server/node_modules/json3/package.json | 148 + server/node_modules/media-typer/HISTORY.md | 22 + server/node_modules/media-typer/LICENSE | 22 + server/node_modules/media-typer/README.md | 81 + server/node_modules/media-typer/index.js | 270 + server/node_modules/media-typer/package.json | 93 + .../node_modules/merge-descriptors/.npmignore | 59 + .../node_modules/merge-descriptors/README.md | 49 + .../merge-descriptors/component.json | 10 + .../node_modules/merge-descriptors/index.js | 8 + .../merge-descriptors/package.json | 78 + server/node_modules/methods/.npmignore | 1 + server/node_modules/methods/History.md | 20 + server/node_modules/methods/LICENSE | 23 + server/node_modules/methods/Readme.md | 4 + server/node_modules/methods/index.js | 41 + server/node_modules/methods/package.json | 92 + server/node_modules/methods/test/methods.js | 33 + server/node_modules/mime-db/HISTORY.md | 212 + server/node_modules/mime-db/LICENSE | 22 + server/node_modules/mime-db/README.md | 76 + server/node_modules/mime-db/db.json | 6359 +++ server/node_modules/mime-db/index.js | 11 + server/node_modules/mime-db/package.json | 128 + server/node_modules/mime-types/HISTORY.md | 115 + server/node_modules/mime-types/LICENSE | 22 + server/node_modules/mime-types/README.md | 102 + server/node_modules/mime-types/index.js | 63 + server/node_modules/mime-types/package.json | 118 + server/node_modules/mime/LICENSE | 19 + server/node_modules/mime/README.md | 66 + server/node_modules/mime/mime.js | 114 + server/node_modules/mime/package.json | 90 + server/node_modules/mime/test.js | 84 + server/node_modules/mime/types/mime.types | 1588 + server/node_modules/mime/types/node.types | 77 + server/node_modules/ms/.npmignore | 5 + server/node_modules/ms/LICENSE | 20 + server/node_modules/ms/README.md | 35 + server/node_modules/ms/index.js | 123 + server/node_modules/ms/package.json | 81 + server/node_modules/negotiator/LICENSE | 23 + server/node_modules/negotiator/README.md | 161 + server/node_modules/negotiator/lib/charset.js | 87 + .../node_modules/negotiator/lib/encoding.js | 117 + .../node_modules/negotiator/lib/language.js | 100 + .../node_modules/negotiator/lib/mediaType.js | 122 + .../node_modules/negotiator/lib/negotiator.js | 37 + server/node_modules/negotiator/package.json | 113 + server/node_modules/object-assign/index.js | 83 + server/node_modules/object-assign/license | 21 + .../node_modules/object-assign/package.json | 114 + server/node_modules/object-assign/readme.md | 56 + .../node_modules/object-component/.npmignore | 3 + .../node_modules/object-component/History.md | 10 + server/node_modules/object-component/Makefile | 16 + .../node_modules/object-component/Readme.md | 31 + .../object-component/component.json | 10 + server/node_modules/object-component/index.js | 84 + .../object-component/package.json | 69 + .../object-component/test/object.js | 48 + server/node_modules/on-finished/HISTORY.md | 71 + server/node_modules/on-finished/LICENSE | 23 + server/node_modules/on-finished/README.md | 102 + server/node_modules/on-finished/index.js | 191 + server/node_modules/on-finished/package.json | 106 + server/node_modules/options/.npmignore | 7 + server/node_modules/options/Makefile | 12 + server/node_modules/options/README.md | 69 + server/node_modules/options/lib/options.js | 86 + server/node_modules/options/package.json | 84 + server/node_modules/parsejson/.npmignore | 2 + server/node_modules/parsejson/LICENSE | 21 + server/node_modules/parsejson/Makefile | 3 + server/node_modules/parsejson/README.md | 2 + server/node_modules/parsejson/index.js | 32 + server/node_modules/parsejson/package.json | 87 + server/node_modules/parsejson/test.js | 21 + server/node_modules/parseqs/.npmignore | 3 + server/node_modules/parseqs/LICENSE | 21 + server/node_modules/parseqs/Makefile | 3 + server/node_modules/parseqs/README.md | 1 + server/node_modules/parseqs/index.js | 37 + server/node_modules/parseqs/package.json | 87 + server/node_modules/parseqs/test.js | 27 + server/node_modules/parseuri/.npmignore | 2 + server/node_modules/parseuri/History.md | 5 + server/node_modules/parseuri/LICENSE | 21 + server/node_modules/parseuri/Makefile | 3 + server/node_modules/parseuri/README.md | 2 + server/node_modules/parseuri/index.js | 39 + server/node_modules/parseuri/package.json | 86 + server/node_modules/parseuri/test.js | 51 + server/node_modules/parseurl/HISTORY.md | 47 + server/node_modules/parseurl/LICENSE | 24 + server/node_modules/parseurl/README.md | 120 + server/node_modules/parseurl/index.js | 138 + server/node_modules/parseurl/package.json | 124 + server/node_modules/path-to-regexp/.npmignore | 2 + server/node_modules/path-to-regexp/History.md | 16 + server/node_modules/path-to-regexp/Readme.md | 33 + .../path-to-regexp/component.json | 15 + server/node_modules/path-to-regexp/index.js | 70 + .../node_modules/path-to-regexp/package.json | 196 + server/node_modules/path-to-regexp/test.js | 616 + server/node_modules/proxy-addr/HISTORY.md | 80 + server/node_modules/proxy-addr/LICENSE | 22 + server/node_modules/proxy-addr/README.md | 137 + server/node_modules/proxy-addr/index.js | 347 + server/node_modules/proxy-addr/package.json | 123 + server/node_modules/qs/.jshintignore | 1 + server/node_modules/qs/.jshintrc | 10 + server/node_modules/qs/.npmignore | 18 + server/node_modules/qs/.travis.yml | 4 + server/node_modules/qs/CHANGELOG.md | 61 + server/node_modules/qs/CONTRIBUTING.md | 1 + server/node_modules/qs/LICENSE | 28 + server/node_modules/qs/Makefile | 8 + server/node_modules/qs/README.md | 220 + server/node_modules/qs/index.js | 1 + server/node_modules/qs/lib/index.js | 15 + server/node_modules/qs/lib/parse.js | 156 + server/node_modules/qs/lib/stringify.js | 77 + server/node_modules/qs/lib/utils.js | 132 + server/node_modules/qs/package.json | 90 + server/node_modules/qs/test/parse.js | 406 + server/node_modules/qs/test/stringify.js | 177 + server/node_modules/range-parser/HISTORY.md | 40 + server/node_modules/range-parser/LICENSE | 22 + server/node_modules/range-parser/README.md | 57 + server/node_modules/range-parser/index.js | 63 + server/node_modules/range-parser/package.json | 110 + server/node_modules/send/History.md | 221 + server/node_modules/send/LICENSE | 23 + server/node_modules/send/Readme.md | 182 + server/node_modules/send/index.js | 773 + .../send/node_modules/ms/.npmignore | 5 + .../send/node_modules/ms/README.md | 33 + .../send/node_modules/ms/index.js | 111 + .../send/node_modules/ms/package.json | 79 + server/node_modules/send/package.json | 120 + server/node_modules/serve-static/HISTORY.md | 206 + server/node_modules/serve-static/LICENSE | 25 + server/node_modules/serve-static/README.md | 165 + server/node_modules/serve-static/index.js | 137 + server/node_modules/serve-static/package.json | 117 + .../node_modules/socket.io-adapter/.npmignore | 1 + .../node_modules/socket.io-adapter/History.md | 41 + server/node_modules/socket.io-adapter/LICENSE | 20 + .../node_modules/socket.io-adapter/Readme.md | 16 + .../node_modules/socket.io-adapter/index.js | 249 + .../node_modules/debug/.jshintrc | 3 + .../node_modules/debug/.npmignore | 7 + .../node_modules/debug/CHANGELOG.md | 235 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 37 + .../node_modules/debug/Readme.md | 199 + .../node_modules/debug/bower.json | 29 + .../node_modules/debug/browser.js | 177 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/debug.js | 200 + .../node_modules/debug/index.js | 10 + .../node_modules/debug/node.js | 213 + .../node_modules/debug/package.json | 134 + .../node_modules/ms/LICENSE.md | 21 + .../node_modules/ms/README.md | 52 + .../node_modules/ms/index.js | 149 + .../node_modules/ms/package.json | 120 + .../socket.io-adapter/package.json | 84 + .../node_modules/socket.io-client/History.md | 511 + server/node_modules/socket.io-client/LICENSE | 22 + .../node_modules/socket.io-client/README.md | 190 + .../socket.io-client/dist/socket.io.js | 8201 ++++ .../socket.io-client/dist/socket.io.js.map | 1 + .../socket.io-client/dist/socket.io.min.js | 3 + .../socket.io-client/dist/socket.io.slim.js | 6053 +++ .../dist/socket.io.slim.js.map | 1 + .../dist/socket.io.slim.min.js | 2 + .../socket.io-client/lib/index.js | 109 + .../socket.io-client/lib/manager.js | 560 + .../node_modules/socket.io-client/lib/on.js | 24 + .../socket.io-client/lib/socket.js | 419 + .../node_modules/socket.io-client/lib/url.js | 75 + .../node_modules/component-emitter/History.md | 68 + .../node_modules/component-emitter/LICENSE | 24 + .../node_modules/component-emitter/Readme.md | 74 + .../node_modules/component-emitter/index.js | 163 + .../component-emitter/package.json | 216 + .../node_modules/debug/.jshintrc | 3 + .../node_modules/debug/.npmignore | 7 + .../node_modules/debug/CHANGELOG.md | 235 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 37 + .../node_modules/debug/Readme.md | 199 + .../node_modules/debug/bower.json | 29 + .../node_modules/debug/browser.js | 177 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/debug.js | 200 + .../node_modules/debug/index.js | 10 + .../node_modules/debug/node.js | 213 + .../node_modules/debug/package.json | 134 + .../node_modules/ms/LICENSE.md | 21 + .../node_modules/ms/README.md | 52 + .../socket.io-client/node_modules/ms/index.js | 149 + .../node_modules/ms/package.json | 120 + .../socket.io-client/package.json | 156 + .../node_modules/socket.io-parser/History.md | 127 + server/node_modules/socket.io-parser/LICENSE | 20 + .../node_modules/socket.io-parser/Readme.md | 73 + .../node_modules/socket.io-parser/binary.js | 141 + server/node_modules/socket.io-parser/index.js | 404 + .../socket.io-parser/is-buffer.js | 13 + .../node_modules/debug/.jshintrc | 3 + .../node_modules/debug/.npmignore | 6 + .../node_modules/debug/History.md | 195 + .../node_modules/debug/Makefile | 36 + .../node_modules/debug/Readme.md | 188 + .../node_modules/debug/bower.json | 28 + .../node_modules/debug/browser.js | 168 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/debug.js | 197 + .../node_modules/debug/node.js | 209 + .../node_modules/debug/package.json | 106 + .../node_modules/ms/.npmignore | 5 + .../node_modules/ms/History.md | 66 + .../socket.io-parser/node_modules/ms/LICENSE | 20 + .../node_modules/ms/README.md | 35 + .../socket.io-parser/node_modules/ms/index.js | 125 + .../node_modules/ms/package.json | 82 + .../socket.io-parser/package.json | 101 + server/node_modules/socket.io/History.md | 638 + server/node_modules/socket.io/LICENSE | 22 + server/node_modules/socket.io/Readme.md | 489 + server/node_modules/socket.io/lib/client.js | 254 + server/node_modules/socket.io/lib/index.js | 443 + .../node_modules/socket.io/lib/namespace.js | 275 + server/node_modules/socket.io/lib/socket.js | 546 + .../socket.io/node_modules/debug/.jshintrc | 3 + .../socket.io/node_modules/debug/.npmignore | 7 + .../socket.io/node_modules/debug/CHANGELOG.md | 235 + .../socket.io/node_modules/debug/LICENSE | 19 + .../socket.io/node_modules/debug/Makefile | 37 + .../socket.io/node_modules/debug/Readme.md | 199 + .../socket.io/node_modules/debug/bower.json | 29 + .../socket.io/node_modules/debug/browser.js | 177 + .../node_modules/debug/component.json | 19 + .../socket.io/node_modules/debug/debug.js | 200 + .../socket.io/node_modules/debug/index.js | 10 + .../socket.io/node_modules/debug/node.js | 213 + .../socket.io/node_modules/debug/package.json | 122 + .../socket.io/node_modules/ms/LICENSE.md | 21 + .../socket.io/node_modules/ms/README.md | 52 + .../socket.io/node_modules/ms/index.js | 149 + .../socket.io/node_modules/ms/package.json | 108 + server/node_modules/socket.io/package.json | 136 + server/node_modules/to-array/.npmignore | 3 + server/node_modules/to-array/LICENCE | 19 + server/node_modules/to-array/README.md | 22 + server/node_modules/to-array/index.js | 13 + server/node_modules/to-array/package.json | 98 + server/node_modules/type-is/HISTORY.md | 115 + server/node_modules/type-is/LICENSE | 21 + server/node_modules/type-is/README.md | 117 + server/node_modules/type-is/index.js | 228 + server/node_modules/type-is/package.json | 126 + server/node_modules/ultron/.npmignore | 3 + server/node_modules/ultron/.travis.yml | 21 + server/node_modules/ultron/LICENSE | 22 + server/node_modules/ultron/README.md | 97 + server/node_modules/ultron/index.js | 129 + server/node_modules/ultron/package.json | 108 + server/node_modules/ultron/test.js | 327 + server/node_modules/utils-merge/.travis.yml | 6 + server/node_modules/utils-merge/LICENSE | 20 + server/node_modules/utils-merge/README.md | 34 + server/node_modules/utils-merge/index.js | 23 + server/node_modules/utils-merge/package.json | 94 + server/node_modules/vary/HISTORY.md | 23 + server/node_modules/vary/LICENSE | 22 + server/node_modules/vary/README.md | 91 + server/node_modules/vary/index.js | 117 + server/node_modules/vary/package.json | 106 + server/node_modules/ws/.npmignore | 11 + server/node_modules/ws/.travis.yml | 15 + server/node_modules/ws/Makefile | 45 + server/node_modules/ws/README.md | 235 + server/node_modules/ws/SECURITY.md | 33 + server/node_modules/ws/index.js | 49 + server/node_modules/ws/lib/BufferPool.js | 63 + .../ws/lib/BufferUtil.fallback.js | 47 + server/node_modules/ws/lib/BufferUtil.js | 13 + server/node_modules/ws/lib/ErrorCodes.js | 24 + server/node_modules/ws/lib/Extensions.js | 70 + .../node_modules/ws/lib/PerMessageDeflate.js | 337 + server/node_modules/ws/lib/Receiver.hixie.js | 194 + server/node_modules/ws/lib/Receiver.js | 793 + server/node_modules/ws/lib/Sender.hixie.js | 124 + server/node_modules/ws/lib/Sender.js | 324 + .../ws/lib/Validation.fallback.js | 11 + server/node_modules/ws/lib/Validation.js | 13 + server/node_modules/ws/lib/WebSocket.js | 987 + server/node_modules/ws/lib/WebSocketServer.js | 554 + server/node_modules/ws/package.json | 117 + server/node_modules/wtf-8/LICENSE-MIT.txt | 20 + server/node_modules/wtf-8/README.md | 105 + server/node_modules/wtf-8/package.json | 98 + server/node_modules/wtf-8/wtf-8.js | 234 + .../node_modules/xmlhttprequest-ssl/LICENSE | 22 + .../node_modules/xmlhttprequest-ssl/README.md | 61 + .../xmlhttprequest-ssl/autotest.watchr | 8 + .../xmlhttprequest-ssl/example/demo.js | 16 + .../xmlhttprequest-ssl/lib/XMLHttpRequest.js | 650 + .../xmlhttprequest-ssl/package.json | 98 + .../tests/test-constants.js | 13 + .../xmlhttprequest-ssl/tests/test-events.js | 50 + .../tests/test-exceptions.js | 59 + .../xmlhttprequest-ssl/tests/test-headers.js | 76 + .../tests/test-redirect-302.js | 41 + .../tests/test-redirect-303.js | 41 + .../tests/test-redirect-307.js | 43 + .../tests/test-request-methods.js | 62 + .../tests/test-request-protocols.js | 32 + .../xmlhttprequest-ssl/tests/testdata.txt | 1 + server/node_modules/yeast/LICENSE | 22 + server/node_modules/yeast/README.md | 82 + server/node_modules/yeast/index.js | 68 + server/node_modules/yeast/package.json | 100 + server/npm-debug.log | 45 + server/package.json | 9 + server/server.js | 33 + www/app.js | 24 + www/bower.json | 9 + .../angular-animate/.bower.json | 20 + .../angular-animate/LICENSE.md | 21 + .../angular-animate/README.md | 68 + .../angular-animate/angular-animate.js | 4154 ++ .../angular-animate/angular-animate.min.js | 57 + .../angular-animate.min.js.map | 8 + .../angular-animate/bower.json | 10 + www/bower_components/angular-animate/index.js | 2 + .../angular-animate/package.json | 33 + www/bower_components/angular-aria/.bower.json | 20 + www/bower_components/angular-aria/LICENSE.md | 21 + www/bower_components/angular-aria/README.md | 67 + .../angular-aria/angular-aria.js | 402 + .../angular-aria/angular-aria.min.js | 14 + .../angular-aria/angular-aria.min.js.map | 8 + www/bower_components/angular-aria/bower.json | 10 + www/bower_components/angular-aria/index.js | 2 + .../angular-aria/package.json | 34 + .../angular-material/.bower.json | 26 + .../angular-material/.gitignore | 5 + .../angular-material/CHANGELOG.md | 4067 ++ www/bower_components/angular-material/LICENSE | 21 + .../angular-material/README.md | 229 + .../angular-material-mocks.js | 186 + .../angular-material/angular-material.css | 23807 ++++++++++ .../angular-material/angular-material.js | 35749 ++++++++++++++++ .../angular-material/angular-material.min.css | 6 + .../angular-material/angular-material.min.js | 18 + .../angular-material/angular-material.scss | 7423 ++++ .../angular-material/bower.json | 16 + .../angular-material/index.js | 12 + .../angular-material.layout-attributes.css | 19057 ++++++++ ...angular-material.layout-attributes.min.css | 6 + .../angular-material.layout-attributes.scss | 992 + .../layouts/angular-material.layouts.css | 18204 ++++++++ .../angular-material.layouts.ie_fixes.css | 104 + .../layouts/angular-material.layouts.min.css | 6 + .../layouts/angular-material.layouts.scss | 1066 + .../autocomplete-default-theme.css | 23 + .../autocomplete-default-theme.min.css | 6 + .../closure/autocomplete/autocomplete.css | 196 + .../closure/autocomplete/autocomplete.js | 1698 + .../closure/autocomplete/autocomplete.min.css | 6 + .../closure/autocomplete/autocomplete.min.js | 7 + .../backdrop/backdrop-default-theme.css | 10 + .../backdrop/backdrop-default-theme.min.css | 6 + .../modules/closure/backdrop/backdrop.css | 42 + .../modules/closure/backdrop/backdrop.js | 93 + .../modules/closure/backdrop/backdrop.min.css | 6 + .../modules/closure/backdrop/backdrop.min.js | 7 + .../bottomSheet/bottomSheet-default-theme.css | 15 + .../bottomSheet-default-theme.min.css | 6 + .../closure/bottomSheet/bottomSheet.css | 170 + .../closure/bottomSheet/bottomSheet.js | 302 + .../closure/bottomSheet/bottomSheet.min.css | 6 + .../closure/bottomSheet/bottomSheet.min.js | 7 + .../closure/button/button-default-theme.css | 118 + .../button/button-default-theme.min.css | 6 + .../modules/closure/button/button.css | 205 + .../modules/closure/button/button.js | 194 + .../modules/closure/button/button.min.css | 6 + .../modules/closure/button/button.min.js | 7 + .../closure/card/card-default-theme.css | 19 + .../closure/card/card-default-theme.min.css | 6 + .../modules/closure/card/card.css | 202 + .../modules/closure/card/card.js | 142 + .../modules/closure/card/card.min.css | 6 + .../modules/closure/card/card.min.js | 7 + .../checkbox/checkbox-default-theme.css | 92 + .../checkbox/checkbox-default-theme.min.css | 6 + .../modules/closure/checkbox/checkbox.css | 150 + .../modules/closure/checkbox/checkbox.js | 219 + .../modules/closure/checkbox/checkbox.min.css | 6 + .../modules/closure/checkbox/checkbox.min.js | 7 + .../closure/chips/chips-default-theme.css | 42 + .../closure/chips/chips-default-theme.min.css | 6 + .../modules/closure/chips/chips.css | 186 + .../modules/closure/chips/chips.js | 1802 + .../modules/closure/chips/chips.min.css | 6 + .../modules/closure/chips/chips.min.js | 7 + .../modules/closure/colors/colors.js | 410 + .../modules/closure/colors/colors.min.js | 7 + .../closure/content/content-default-theme.css | 9 + .../content/content-default-theme.min.css | 6 + .../modules/closure/content/content.css | 20 + .../modules/closure/content/content.js | 102 + .../modules/closure/content/content.min.css | 6 + .../modules/closure/content/content.min.js | 7 + .../closure/core/core-default-theme.css | 10 + .../closure/core/core-default-theme.min.css | 6 + .../modules/closure/core/core.css | 18471 ++++++++ .../modules/closure/core/core.js | 7701 ++++ .../modules/closure/core/core.min.css | 6 + .../modules/closure/core/core.min.js | 10 + .../modules/closure/core/default-theme.js | 4 + .../datepicker/datepicker-default-theme.css | 84 + .../datepicker-default-theme.min.css | 6 + .../modules/closure/datepicker/datepicker.css | 311 + .../modules/closure/datepicker/datepicker.js | 3049 ++ .../closure/datepicker/datepicker.min.css | 6 + .../closure/datepicker/datepicker.min.js | 8 + .../closure/dialog/dialog-default-theme.css | 12 + .../dialog/dialog-default-theme.min.css | 6 + .../modules/closure/dialog/dialog.css | 131 + .../modules/closure/dialog/dialog.js | 1287 + .../modules/closure/dialog/dialog.min.css | 6 + .../modules/closure/dialog/dialog.min.js | 7 + .../closure/divider/divider-default-theme.css | 16 + .../divider/divider-default-theme.min.css | 6 + .../modules/closure/divider/divider.css | 26 + .../modules/closure/divider/divider.js | 45 + .../modules/closure/divider/divider.min.css | 6 + .../modules/closure/divider/divider.min.js | 7 + .../modules/closure/fabActions/fabActions.js | 60 + .../closure/fabActions/fabActions.min.js | 7 + .../closure/fabSpeedDial/fabSpeedDial.css | 154 + .../closure/fabSpeedDial/fabSpeedDial.js | 575 + .../closure/fabSpeedDial/fabSpeedDial.min.css | 6 + .../closure/fabSpeedDial/fabSpeedDial.min.js | 7 + .../modules/closure/fabToolbar/fabToolbar.css | 119 + .../modules/closure/fabToolbar/fabToolbar.js | 209 + .../closure/fabToolbar/fabToolbar.min.css | 6 + .../closure/fabToolbar/fabToolbar.min.js | 7 + .../modules/closure/fabTrigger/fabTrigger.js | 46 + .../closure/fabTrigger/fabTrigger.min.js | 7 + .../gridList/gridList-default-theme.css | 6 + .../modules/closure/gridList/gridList.css | 77 + .../modules/closure/gridList/gridList.js | 774 + .../modules/closure/gridList/gridList.min.css | 6 + .../modules/closure/gridList/gridList.min.js | 7 + .../closure/icon/icon-default-theme.css | 14 + .../closure/icon/icon-default-theme.min.css | 6 + .../modules/closure/icon/icon.css | 22 + .../modules/closure/icon/icon.js | 934 + .../modules/closure/icon/icon.min.css | 6 + .../modules/closure/icon/icon.min.js | 7 + .../closure/input/input-default-theme.css | 92 + .../closure/input/input-default-theme.min.css | 6 + .../modules/closure/input/input.css | 316 + .../modules/closure/input/input.js | 1100 + .../modules/closure/input/input.min.css | 6 + .../modules/closure/input/input.min.js | 7 + .../closure/list/list-default-theme.css | 28 + .../closure/list/list-default-theme.min.css | 6 + .../modules/closure/list/list.css | 401 + .../modules/closure/list/list.js | 600 + .../modules/closure/list/list.min.css | 6 + .../modules/closure/list/list.min.js | 7 + .../closure/menu/menu-default-theme.css | 18 + .../closure/menu/menu-default-theme.min.css | 6 + .../modules/closure/menu/menu.css | 151 + .../modules/closure/menu/menu.js | 1096 + .../modules/closure/menu/menu.min.css | 6 + .../modules/closure/menu/menu.min.js | 7 + .../closure/menuBar/menuBar-default-theme.css | 35 + .../menuBar/menuBar-default-theme.min.css | 6 + .../modules/closure/menuBar/menuBar.css | 99 + .../modules/closure/menuBar/menuBar.js | 616 + .../modules/closure/menuBar/menuBar.min.css | 6 + .../modules/closure/menuBar/menuBar.min.js | 7 + .../closure/navBar/navBar-default-theme.css | 16 + .../navBar/navBar-default-theme.min.css | 6 + .../modules/closure/navBar/navBar.css | 61 + .../modules/closure/navBar/navBar.js | 588 + .../modules/closure/navBar/navBar.min.css | 6 + .../modules/closure/navBar/navBar.min.js | 7 + .../closure/panel/panel-default-theme.css | 8 + .../closure/panel/panel-default-theme.min.css | 6 + .../modules/closure/panel/panel.css | 57 + .../modules/closure/panel/panel.js | 3546 ++ .../modules/closure/panel/panel.min.css | 6 + .../modules/closure/panel/panel.min.js | 7 + .../progressCircular-default-theme.css | 14 + .../progressCircular-default-theme.min.css | 6 + .../progressCircular/progressCircular.css | 35 + .../progressCircular/progressCircular.js | 459 + .../progressCircular/progressCircular.min.css | 6 + .../progressCircular/progressCircular.min.js | 7 + .../progressLinear-default-theme.css | 37 + .../progressLinear-default-theme.min.css | 6 + .../closure/progressLinear/progressLinear.css | 261 + .../closure/progressLinear/progressLinear.js | 213 + .../progressLinear/progressLinear.min.css | 6 + .../progressLinear/progressLinear.min.js | 7 + .../radioButton/radioButton-default-theme.css | 98 + .../radioButton-default-theme.min.css | 6 + .../closure/radioButton/radioButton.css | 144 + .../closure/radioButton/radioButton.js | 362 + .../closure/radioButton/radioButton.min.css | 6 + .../closure/radioButton/radioButton.min.js | 7 + .../closure/select/select-default-theme.css | 121 + .../select/select-default-theme.min.css | 6 + .../modules/closure/select/select.css | 356 + .../modules/closure/select/select.js | 1694 + .../modules/closure/select/select.min.css | 6 + .../modules/closure/select/select.min.js | 7 + .../modules/closure/showHide/showHide.js | 58 + .../modules/closure/showHide/showHide.min.js | 7 + .../closure/sidenav/sidenav-default-theme.css | 8 + .../sidenav/sidenav-default-theme.min.css | 6 + .../modules/closure/sidenav/sidenav.css | 110 + .../modules/closure/sidenav/sidenav.js | 560 + .../modules/closure/sidenav/sidenav.min.css | 6 + .../modules/closure/sidenav/sidenav.min.js | 7 + .../closure/slider/slider-default-theme.css | 125 + .../slider/slider-default-theme.min.css | 6 + .../modules/closure/slider/slider.css | 439 + .../modules/closure/slider/slider.js | 606 + .../modules/closure/slider/slider.min.css | 6 + .../modules/closure/slider/slider.min.js | 7 + .../modules/closure/sticky/sticky.css | 20 + .../modules/closure/sticky/sticky.js | 364 + .../modules/closure/sticky/sticky.min.css | 6 + .../modules/closure/sticky/sticky.min.js | 7 + .../subheader/subheader-default-theme.css | 15 + .../subheader/subheader-default-theme.min.css | 6 + .../modules/closure/subheader/subheader.css | 57 + .../modules/closure/subheader/subheader.js | 132 + .../closure/subheader/subheader.min.css | 6 + .../closure/subheader/subheader.min.js | 7 + .../modules/closure/swipe/swipe.js | 108 + .../modules/closure/swipe/swipe.min.js | 7 + .../closure/switch/switch-default-theme.css | 56 + .../switch/switch-default-theme.min.css | 6 + .../modules/closure/switch/switch.css | 153 + .../modules/closure/switch/switch.js | 190 + .../modules/closure/switch/switch.min.css | 6 + .../modules/closure/switch/switch.min.js | 7 + .../modules/closure/tabs/tabs-arrow.svg | 7 + .../closure/tabs/tabs-default-theme.css | 87 + .../closure/tabs/tabs-default-theme.min.css | 6 + .../modules/closure/tabs/tabs.css | 313 + .../modules/closure/tabs/tabs.js | 1399 + .../modules/closure/tabs/tabs.min.css | 6 + .../modules/closure/tabs/tabs.min.js | 7 + .../textField/textField-default-theme.css | 30 + .../modules/closure/textField/textField.css | 111 + .../modules/closure/textField/textField.js | 145 + .../closure/toast/toast-default-theme.css | 17 + .../closure/toast/toast-default-theme.min.css | 6 + .../modules/closure/toast/toast.css | 173 + .../modules/closure/toast/toast.js | 490 + .../modules/closure/toast/toast.min.css | 6 + .../modules/closure/toast/toast.min.js | 7 + .../closure/toolbar/toolbar-default-theme.css | 29 + .../toolbar/toolbar-default-theme.min.css | 6 + .../modules/closure/toolbar/toolbar.css | 147 + .../modules/closure/toolbar/toolbar.js | 270 + .../modules/closure/toolbar/toolbar.min.css | 6 + .../modules/closure/toolbar/toolbar.min.js | 7 + .../closure/tooltip/tooltip-default-theme.css | 9 + .../tooltip/tooltip-default-theme.min.css | 6 + .../modules/closure/tooltip/tooltip.css | 67 + .../modules/closure/tooltip/tooltip.js | 480 + .../modules/closure/tooltip/tooltip.min.css | 6 + .../modules/closure/tooltip/tooltip.min.js | 7 + .../modules/closure/truncate/truncate.css | 14 + .../modules/closure/truncate/truncate.js | 97 + .../modules/closure/truncate/truncate.min.css | 6 + .../modules/closure/truncate/truncate.min.js | 7 + .../closure/virtualRepeat/virtualRepeat.css | 51 + .../closure/virtualRepeat/virtualRepeat.js | 999 + .../virtualRepeat/virtualRepeat.min.css | 6 + .../virtualRepeat/virtualRepeat.min.js | 7 + .../modules/closure/whiteframe/whiteframe.css | 85 + .../modules/closure/whiteframe/whiteframe.js | 81 + .../closure/whiteframe/whiteframe.min.css | 6 + .../closure/whiteframe/whiteframe.min.js | 7 + .../autocomplete-default-theme.css | 23 + .../autocomplete-default-theme.min.css | 6 + .../modules/js/autocomplete/autocomplete.css | 196 + .../modules/js/autocomplete/autocomplete.js | 1697 + .../js/autocomplete/autocomplete.min.css | 6 + .../js/autocomplete/autocomplete.min.js | 7 + .../modules/js/autocomplete/bower.json | 9 + .../js/backdrop/backdrop-default-theme.css | 10 + .../backdrop/backdrop-default-theme.min.css | 6 + .../modules/js/backdrop/backdrop.css | 42 + .../modules/js/backdrop/backdrop.js | 94 + .../modules/js/backdrop/backdrop.min.css | 6 + .../modules/js/backdrop/backdrop.min.js | 7 + .../modules/js/backdrop/bower.json | 7 + .../bottomSheet/bottomSheet-default-theme.css | 15 + .../bottomSheet-default-theme.min.css | 6 + .../modules/js/bottomSheet/bottomSheet.css | 170 + .../modules/js/bottomSheet/bottomSheet.js | 302 + .../js/bottomSheet/bottomSheet.min.css | 6 + .../modules/js/bottomSheet/bottomSheet.min.js | 7 + .../modules/js/bottomSheet/bower.json | 8 + .../modules/js/button/bower.json | 7 + .../js/button/button-default-theme.css | 118 + .../js/button/button-default-theme.min.css | 6 + .../modules/js/button/button.css | 205 + .../modules/js/button/button.js | 195 + .../modules/js/button/button.min.css | 6 + .../modules/js/button/button.min.js | 7 + .../modules/js/card/bower.json | 7 + .../modules/js/card/card-default-theme.css | 19 + .../js/card/card-default-theme.min.css | 6 + .../angular-material/modules/js/card/card.css | 202 + .../angular-material/modules/js/card/card.js | 143 + .../modules/js/card/card.min.css | 6 + .../modules/js/card/card.min.js | 7 + .../modules/js/checkbox/bower.json | 7 + .../js/checkbox/checkbox-default-theme.css | 92 + .../checkbox/checkbox-default-theme.min.css | 6 + .../modules/js/checkbox/checkbox.css | 150 + .../modules/js/checkbox/checkbox.js | 220 + .../modules/js/checkbox/checkbox.min.css | 6 + .../modules/js/checkbox/checkbox.min.js | 7 + .../modules/js/chips/bower.json | 8 + .../modules/js/chips/chips-default-theme.css | 42 + .../js/chips/chips-default-theme.min.css | 6 + .../modules/js/chips/chips.css | 186 + .../modules/js/chips/chips.js | 1802 + .../modules/js/chips/chips.min.css | 6 + .../modules/js/chips/chips.min.js | 7 + .../modules/js/colors/bower.json | 7 + .../modules/js/colors/colors.js | 411 + .../modules/js/colors/colors.min.js | 7 + .../modules/js/content/bower.json | 7 + .../js/content/content-default-theme.css | 9 + .../js/content/content-default-theme.min.css | 6 + .../modules/js/content/content.css | 20 + .../modules/js/content/content.js | 103 + .../modules/js/content/content.min.css | 6 + .../modules/js/content/content.min.js | 7 + .../modules/js/core/bower.json | 12 + .../modules/js/core/core-default-theme.css | 10 + .../js/core/core-default-theme.min.css | 6 + .../angular-material/modules/js/core/core.css | 18471 ++++++++ .../angular-material/modules/js/core/core.js | 7697 ++++ .../modules/js/core/core.min.css | 6 + .../modules/js/core/core.min.js | 10 + .../modules/js/core/default-theme.js | 4 + .../modules/js/datepicker/bower.json | 9 + .../datepicker/datepicker-default-theme.css | 84 + .../datepicker-default-theme.min.css | 6 + .../modules/js/datepicker/datepicker.css | 311 + .../modules/js/datepicker/datepicker.js | 3048 ++ .../modules/js/datepicker/datepicker.min.css | 6 + .../modules/js/datepicker/datepicker.min.js | 8 + .../modules/js/dialog/bower.json | 8 + .../js/dialog/dialog-default-theme.css | 12 + .../js/dialog/dialog-default-theme.min.css | 6 + .../modules/js/dialog/dialog.css | 131 + .../modules/js/dialog/dialog.js | 1287 + .../modules/js/dialog/dialog.min.css | 6 + .../modules/js/dialog/dialog.min.js | 7 + .../modules/js/divider/bower.json | 7 + .../js/divider/divider-default-theme.css | 16 + .../js/divider/divider-default-theme.min.css | 6 + .../modules/js/divider/divider.css | 26 + .../modules/js/divider/divider.js | 46 + .../modules/js/divider/divider.min.css | 6 + .../modules/js/divider/divider.min.js | 7 + .../modules/js/fabActions/bower.json | 7 + .../modules/js/fabActions/fabActions.js | 61 + .../modules/js/fabActions/fabActions.min.js | 7 + .../modules/js/fabSpeedDial/bower.json | 7 + .../modules/js/fabSpeedDial/fabSpeedDial.css | 154 + .../modules/js/fabSpeedDial/fabSpeedDial.js | 576 + .../js/fabSpeedDial/fabSpeedDial.min.css | 6 + .../js/fabSpeedDial/fabSpeedDial.min.js | 7 + .../modules/js/fabToolbar/bower.json | 9 + .../modules/js/fabToolbar/fabToolbar.css | 119 + .../modules/js/fabToolbar/fabToolbar.js | 208 + .../modules/js/fabToolbar/fabToolbar.min.css | 6 + .../modules/js/fabToolbar/fabToolbar.min.js | 7 + .../modules/js/fabTrigger/bower.json | 7 + .../modules/js/fabTrigger/fabTrigger.js | 47 + .../modules/js/fabTrigger/fabTrigger.min.js | 7 + .../modules/js/gridList/bower.json | 7 + .../modules/js/gridList/gridList.css | 77 + .../modules/js/gridList/gridList.js | 775 + .../modules/js/gridList/gridList.min.css | 6 + .../modules/js/gridList/gridList.min.js | 7 + .../modules/js/icon/bower.json | 7 + .../modules/js/icon/icon-default-theme.css | 14 + .../js/icon/icon-default-theme.min.css | 6 + .../angular-material/modules/js/icon/icon.css | 22 + .../angular-material/modules/js/icon/icon.js | 935 + .../modules/js/icon/icon.min.css | 6 + .../modules/js/icon/icon.min.js | 7 + .../modules/js/input/bower.json | 7 + .../modules/js/input/input-default-theme.css | 92 + .../js/input/input-default-theme.min.css | 6 + .../modules/js/input/input.css | 316 + .../modules/js/input/input.js | 1101 + .../modules/js/input/input.min.css | 6 + .../modules/js/input/input.min.js | 7 + .../modules/js/list/bower.json | 7 + .../modules/js/list/list-default-theme.css | 28 + .../js/list/list-default-theme.min.css | 6 + .../angular-material/modules/js/list/list.css | 401 + .../angular-material/modules/js/list/list.js | 601 + .../modules/js/list/list.min.css | 6 + .../modules/js/list/list.min.js | 7 + .../modules/js/menu/bower.json | 8 + .../modules/js/menu/menu-default-theme.css | 18 + .../js/menu/menu-default-theme.min.css | 6 + .../angular-material/modules/js/menu/menu.css | 151 + .../angular-material/modules/js/menu/menu.js | 1096 + .../modules/js/menu/menu.min.css | 6 + .../modules/js/menu/menu.min.js | 7 + .../modules/js/menuBar/bower.json | 9 + .../js/menuBar/menuBar-default-theme.css | 35 + .../js/menuBar/menuBar-default-theme.min.css | 6 + .../modules/js/menuBar/menuBar.css | 99 + .../modules/js/menuBar/menuBar.js | 615 + .../modules/js/menuBar/menuBar.min.css | 6 + .../modules/js/menuBar/menuBar.min.js | 7 + .../modules/js/navBar/bower.json | 7 + .../js/navBar/navBar-default-theme.css | 16 + .../js/navBar/navBar-default-theme.min.css | 6 + .../modules/js/navBar/navBar.css | 61 + .../modules/js/navBar/navBar.js | 589 + .../modules/js/navBar/navBar.min.css | 6 + .../modules/js/navBar/navBar.min.js | 7 + .../modules/js/panel/bower.json | 8 + .../modules/js/panel/panel-default-theme.css | 8 + .../js/panel/panel-default-theme.min.css | 6 + .../modules/js/panel/panel.css | 57 + .../modules/js/panel/panel.js | 3546 ++ .../modules/js/panel/panel.min.css | 6 + .../modules/js/panel/panel.min.js | 7 + .../modules/js/progressCircular/bower.json | 7 + .../progressCircular-default-theme.css | 14 + .../progressCircular-default-theme.min.css | 6 + .../js/progressCircular/progressCircular.css | 35 + .../js/progressCircular/progressCircular.js | 460 + .../progressCircular/progressCircular.min.css | 6 + .../progressCircular/progressCircular.min.js | 7 + .../modules/js/progressLinear/bower.json | 7 + .../progressLinear-default-theme.css | 37 + .../progressLinear-default-theme.min.css | 6 + .../js/progressLinear/progressLinear.css | 261 + .../js/progressLinear/progressLinear.js | 214 + .../js/progressLinear/progressLinear.min.css | 6 + .../js/progressLinear/progressLinear.min.js | 7 + .../modules/js/radioButton/bower.json | 7 + .../radioButton/radioButton-default-theme.css | 98 + .../radioButton-default-theme.min.css | 6 + .../modules/js/radioButton/radioButton.css | 144 + .../modules/js/radioButton/radioButton.js | 363 + .../js/radioButton/radioButton.min.css | 6 + .../modules/js/radioButton/radioButton.min.js | 7 + .../modules/js/select/bower.json | 8 + .../js/select/select-default-theme.css | 121 + .../js/select/select-default-theme.min.css | 6 + .../modules/js/select/select.css | 356 + .../modules/js/select/select.js | 1694 + .../modules/js/select/select.min.css | 6 + .../modules/js/select/select.min.js | 7 + .../modules/js/showHide/bower.json | 7 + .../modules/js/showHide/showHide.js | 59 + .../modules/js/showHide/showHide.min.js | 7 + .../modules/js/sidenav/bower.json | 8 + .../js/sidenav/sidenav-default-theme.css | 8 + .../js/sidenav/sidenav-default-theme.min.css | 6 + .../modules/js/sidenav/sidenav.css | 110 + .../modules/js/sidenav/sidenav.js | 560 + .../modules/js/sidenav/sidenav.min.css | 6 + .../modules/js/sidenav/sidenav.min.js | 7 + .../modules/js/slider/bower.json | 7 + .../js/slider/slider-default-theme.css | 125 + .../js/slider/slider-default-theme.min.css | 6 + .../modules/js/slider/slider.css | 439 + .../modules/js/slider/slider.js | 607 + .../modules/js/slider/slider.min.css | 6 + .../modules/js/slider/slider.min.js | 7 + .../modules/js/sticky/bower.json | 8 + .../modules/js/sticky/sticky.css | 20 + .../modules/js/sticky/sticky.js | 364 + .../modules/js/sticky/sticky.min.css | 6 + .../modules/js/sticky/sticky.min.js | 7 + .../modules/js/subheader/bower.json | 8 + .../js/subheader/subheader-default-theme.css | 15 + .../subheader/subheader-default-theme.min.css | 6 + .../modules/js/subheader/subheader.css | 57 + .../modules/js/subheader/subheader.js | 132 + .../modules/js/subheader/subheader.min.css | 6 + .../modules/js/subheader/subheader.min.js | 7 + .../modules/js/swipe/bower.json | 7 + .../modules/js/swipe/swipe.js | 109 + .../modules/js/swipe/swipe.min.js | 7 + .../modules/js/switch/bower.json | 8 + .../js/switch/switch-default-theme.css | 56 + .../js/switch/switch-default-theme.min.css | 6 + .../modules/js/switch/switch.css | 153 + .../modules/js/switch/switch.js | 190 + .../modules/js/switch/switch.min.css | 6 + .../modules/js/switch/switch.min.js | 7 + .../modules/js/tabs/bower.json | 8 + .../modules/js/tabs/tabs-default-theme.css | 87 + .../js/tabs/tabs-default-theme.min.css | 6 + .../angular-material/modules/js/tabs/tabs.css | 313 + .../angular-material/modules/js/tabs/tabs.js | 1399 + .../modules/js/tabs/tabs.min.css | 6 + .../modules/js/tabs/tabs.min.js | 7 + .../modules/js/textField/bower.json | 7 + .../js/textField/textField-default-theme.css | 30 + .../textField/textField-default-theme.min.css | 6 + .../modules/js/textField/textField.css | 111 + .../modules/js/textField/textField.js | 143 + .../modules/js/textField/textField.min.css | 6 + .../modules/js/textField/textField.min.js | 7 + .../modules/js/toast/bower.json | 8 + .../modules/js/toast/toast-default-theme.css | 17 + .../js/toast/toast-default-theme.min.css | 6 + .../modules/js/toast/toast.css | 173 + .../modules/js/toast/toast.js | 490 + .../modules/js/toast/toast.min.css | 6 + .../modules/js/toast/toast.min.js | 7 + .../modules/js/toolbar/bower.json | 8 + .../js/toolbar/toolbar-default-theme.css | 29 + .../js/toolbar/toolbar-default-theme.min.css | 6 + .../modules/js/toolbar/toolbar.css | 147 + .../modules/js/toolbar/toolbar.js | 270 + .../modules/js/toolbar/toolbar.min.css | 6 + .../modules/js/toolbar/toolbar.min.js | 7 + .../modules/js/tooltip/bower.json | 8 + .../js/tooltip/tooltip-default-theme.css | 9 + .../js/tooltip/tooltip-default-theme.min.css | 6 + .../modules/js/tooltip/tooltip.css | 67 + .../modules/js/tooltip/tooltip.js | 480 + .../modules/js/tooltip/tooltip.min.css | 6 + .../modules/js/tooltip/tooltip.min.js | 7 + .../modules/js/truncate/bower.json | 7 + .../modules/js/truncate/truncate.css | 14 + .../modules/js/truncate/truncate.js | 98 + .../modules/js/truncate/truncate.min.css | 6 + .../modules/js/truncate/truncate.min.js | 7 + .../modules/js/virtualRepeat/bower.json | 8 + .../js/virtualRepeat/virtualRepeat.css | 51 + .../modules/js/virtualRepeat/virtualRepeat.js | 999 + .../js/virtualRepeat/virtualRepeat.min.css | 6 + .../js/virtualRepeat/virtualRepeat.min.js | 7 + .../modules/js/whiteframe/bower.json | 7 + .../modules/js/whiteframe/whiteframe.css | 85 + .../modules/js/whiteframe/whiteframe.js | 82 + .../modules/js/whiteframe/whiteframe.min.css | 6 + .../modules/js/whiteframe/whiteframe.min.js | 7 + .../angular-material.layout-attributes.css | 19057 ++++++++ ...angular-material.layout-attributes.min.css | 6 + .../layouts/angular-material.layouts.css | 18204 ++++++++ .../angular-material.layouts.ie_fixes.css | 104 + .../layouts/angular-material.layouts.min.css | 6 + .../angular-material.layout-attributes.scss | 992 + .../scss/angular-material.layouts.scss | 1066 + .../modules/scss/angular-material.scss | 7423 ++++ .../angular-material/package.json | 47 + .../angular-messages/.bower.json | 20 + .../angular-messages/LICENSE.md | 21 + .../angular-messages/README.md | 68 + .../angular-messages/angular-messages.js | 739 + .../angular-messages/angular-messages.min.js | 12 + .../angular-messages.min.js.map | 8 + .../angular-messages/bower.json | 10 + .../angular-messages/index.js | 2 + .../angular-messages/package.json | 32 + .../angular-route/.bower.json | 20 + www/bower_components/angular-route/LICENSE.md | 21 + www/bower_components/angular-route/README.md | 68 + .../angular-route/angular-route.js | 1216 + .../angular-route/angular-route.min.js | 17 + .../angular-route/angular-route.min.js.map | 8 + www/bower_components/angular-route/bower.json | 10 + www/bower_components/angular-route/index.js | 2 + .../angular-route/package.json | 33 + .../angular-socket-io/.bower.json | 21 + .../angular-socket-io/.gitignore | 3 + .../angular-socket-io/.travis.yml | 10 + .../angular-socket-io/README.md | 250 + .../angular-socket-io/bower.json | 11 + .../angular-socket-io/gulpfile.js | 15 + .../angular-socket-io/karma.conf.js | 28 + .../angular-socket-io/mock/socket-io.js | 49 + .../angular-socket-io/npm-install.sh | 2 + .../angular-socket-io/package.json | 23 + .../angular-socket-io/socket.js | 103 + .../angular-socket-io/socket.min.js | 8 + .../angular-socket-io/socket.min.js.map | 1 + .../angular-socket-io/socket.spec.js | 263 + www/bower_components/angular/.bower.json | 18 + www/bower_components/angular/LICENSE.md | 21 + www/bower_components/angular/README.md | 64 + www/bower_components/angular/angular-csp.css | 21 + www/bower_components/angular/angular.js | 32982 ++++++++++++++ www/bower_components/angular/angular.min.js | 330 + .../angular/angular.min.js.gzip | Bin 0 -> 58025 bytes .../angular/angular.min.js.map | 8 + www/bower_components/angular/bower.json | 9 + www/bower_components/angular/index.js | 2 + www/bower_components/angular/package.json | 25 + www/chat/chat.html | 9 + www/chat/chat.js | 22 + www/css/colors.css | 218 + www/css/main.css | 0 www/index.html | 31 + www/index.js | 22 + www/node_modules/.bin/ecstatic | 1 + www/node_modules/.bin/he | 1 + www/node_modules/.bin/hs | 1 + www/node_modules/.bin/http-server | 1 + www/node_modules/.bin/mime | 1 + www/node_modules/.bin/mkdirp | 1 + www/node_modules/.bin/opener | 1 + www/node_modules/async/.travis.yml | 3 + www/node_modules/async/LICENSE | 19 + www/node_modules/async/README.md | 1646 + www/node_modules/async/component.json | 11 + www/node_modules/async/lib/async.js | 1123 + www/node_modules/async/package.json | 94 + www/node_modules/colors/.travis.yml | 6 + www/node_modules/colors/MIT-LICENSE.txt | 23 + www/node_modules/colors/ReadMe.md | 167 + .../colors/examples/normal-usage.js | 74 + .../colors/examples/safe-string.js | 76 + www/node_modules/colors/lib/colors.js | 176 + www/node_modules/colors/lib/custom/trap.js | 45 + www/node_modules/colors/lib/custom/zalgo.js | 104 + .../colors/lib/extendStringPrototype.js | 118 + www/node_modules/colors/lib/index.js | 12 + www/node_modules/colors/lib/maps/america.js | 12 + www/node_modules/colors/lib/maps/rainbow.js | 13 + www/node_modules/colors/lib/maps/random.js | 8 + www/node_modules/colors/lib/maps/zebra.js | 5 + www/node_modules/colors/lib/styles.js | 77 + .../colors/lib/system/supports-colors.js | 61 + www/node_modules/colors/package.json | 87 + www/node_modules/colors/safe.js | 9 + .../colors/screenshots/colors.png | Bin 0 -> 79787 bytes www/node_modules/colors/tests/basic-test.js | 50 + www/node_modules/colors/tests/safe-test.js | 45 + .../colors/themes/generic-logging.js | 12 + www/node_modules/corser/.npmignore | 2 + www/node_modules/corser/.travis.yml | 4 + www/node_modules/corser/LICENSE | 19 + www/node_modules/corser/README.md | 202 + www/node_modules/corser/lib/corser.js | 228 + www/node_modules/corser/package.json | 97 + www/node_modules/ecstatic/.npmignore | 19 + www/node_modules/ecstatic/.travis.yml | 8 + www/node_modules/ecstatic/CHANGELOG.md | 84 + www/node_modules/ecstatic/CONTRIBUTING.md | 86 + www/node_modules/ecstatic/CONTRIBUTORS.md | 57 + www/node_modules/ecstatic/LICENSE.txt | 22 + www/node_modules/ecstatic/README.md | 220 + www/node_modules/ecstatic/example/core.js | 10 + www/node_modules/ecstatic/example/express.js | 12 + .../ecstatic/example/public/beep/index.html | 1 + .../ecstatic/example/public/hello.txt | 1 + .../ecstatic/example/public/subdir/world.txt | 1 + .../ecstatic/example/public/turtle.png | Bin 0 -> 195848 bytes www/node_modules/ecstatic/example/union.js | 10 + www/node_modules/ecstatic/lib/ecstatic.js | 371 + .../ecstatic/lib/ecstatic/aliases.json | 34 + .../ecstatic/lib/ecstatic/defaults.json | 17 + .../ecstatic/lib/ecstatic/etag.js | 7 + .../ecstatic/lib/ecstatic/opts.js | 180 + .../ecstatic/lib/ecstatic/showdir.js | 224 + .../ecstatic/lib/ecstatic/status-handlers.js | 104 + www/node_modules/ecstatic/package.json | 111 + www/node_modules/ecstatic/test.js | 7 + www/node_modules/eventemitter3/LICENSE | 21 + www/node_modules/eventemitter3/README.md | 89 + www/node_modules/eventemitter3/index.js | 289 + www/node_modules/eventemitter3/package.json | 119 + www/node_modules/he/LICENSE-MIT.txt | 20 + www/node_modules/he/README.md | 336 + www/node_modules/he/bin/he | 143 + www/node_modules/he/he.js | 329 + www/node_modules/he/man/he.1 | 78 + www/node_modules/he/package.json | 116 + www/node_modules/http-proxy/.npmignore | 7 + www/node_modules/http-proxy/LICENSE | 23 + www/node_modules/http-proxy/README.md | 493 + www/node_modules/http-proxy/index.js | 13 + www/node_modules/http-proxy/lib/http-proxy.js | 66 + .../http-proxy/lib/http-proxy/common.js | 249 + .../http-proxy/lib/http-proxy/index.js | 184 + .../lib/http-proxy/passes/web-incoming.js | 180 + .../lib/http-proxy/passes/web-outgoing.js | 138 + .../lib/http-proxy/passes/ws-incoming.js | 156 + www/node_modules/http-proxy/package.json | 117 + www/node_modules/http-server/.npmignore | 3 + www/node_modules/http-server/.travis.yml | 22 + www/node_modules/http-server/LICENSE | 20 + www/node_modules/http-server/README.md | 69 + www/node_modules/http-server/bin/http-server | 174 + .../http-server/lib/http-server.js | 139 + www/node_modules/http-server/package.json | 145 + www/node_modules/http-server/public/404.html | 10 + .../http-server/public/img/turtle.png | Bin 0 -> 195848 bytes .../http-server/public/index.html | 12 + .../http-server/screenshots/directory.png | Bin 0 -> 24885 bytes .../http-server/screenshots/public.png | Bin 0 -> 231635 bytes .../http-server/screenshots/start.png | Bin 0 -> 20171 bytes .../test/fixtures/root/canYouSeeMe | 2 + .../http-server/test/fixtures/root/file | 2 + .../http-server/test/http-server-test.js | 158 + www/node_modules/mime/.npmignore | 0 www/node_modules/mime/LICENSE | 19 + www/node_modules/mime/README.md | 90 + www/node_modules/mime/build/build.js | 11 + www/node_modules/mime/build/test.js | 57 + www/node_modules/mime/cli.js | 8 + www/node_modules/mime/mime.js | 108 + www/node_modules/mime/package.json | 106 + www/node_modules/mime/types.json | 1 + www/node_modules/minimist/.travis.yml | 8 + www/node_modules/minimist/LICENSE | 18 + www/node_modules/minimist/example/parse.js | 2 + www/node_modules/minimist/index.js | 236 + www/node_modules/minimist/package.json | 105 + www/node_modules/minimist/readme.markdown | 91 + www/node_modules/minimist/test/all_bool.js | 32 + www/node_modules/minimist/test/bool.js | 166 + www/node_modules/minimist/test/dash.js | 31 + .../minimist/test/default_bool.js | 35 + www/node_modules/minimist/test/dotted.js | 22 + www/node_modules/minimist/test/kv_short.js | 16 + www/node_modules/minimist/test/long.js | 31 + www/node_modules/minimist/test/num.js | 36 + www/node_modules/minimist/test/parse.js | 197 + .../minimist/test/parse_modified.js | 9 + www/node_modules/minimist/test/short.js | 67 + www/node_modules/minimist/test/stop_early.js | 15 + www/node_modules/minimist/test/unknown.js | 102 + www/node_modules/minimist/test/whitespace.js | 8 + www/node_modules/mkdirp/.travis.yml | 8 + www/node_modules/mkdirp/LICENSE | 21 + www/node_modules/mkdirp/bin/cmd.js | 33 + www/node_modules/mkdirp/bin/usage.txt | 12 + www/node_modules/mkdirp/examples/pow.js | 6 + www/node_modules/mkdirp/index.js | 98 + .../mkdirp/node_modules/minimist/.travis.yml | 4 + .../mkdirp/node_modules/minimist/LICENSE | 18 + .../node_modules/minimist/example/parse.js | 2 + .../mkdirp/node_modules/minimist/index.js | 187 + .../mkdirp/node_modules/minimist/package.json | 101 + .../node_modules/minimist/readme.markdown | 73 + .../mkdirp/node_modules/minimist/test/dash.js | 24 + .../minimist/test/default_bool.js | 20 + .../node_modules/minimist/test/dotted.js | 16 + .../mkdirp/node_modules/minimist/test/long.js | 31 + .../node_modules/minimist/test/parse.js | 318 + .../minimist/test/parse_modified.js | 9 + .../node_modules/minimist/test/short.js | 67 + .../node_modules/minimist/test/whitespace.js | 8 + www/node_modules/mkdirp/package.json | 93 + www/node_modules/mkdirp/readme.markdown | 100 + www/node_modules/mkdirp/test/chmod.js | 41 + www/node_modules/mkdirp/test/clobber.js | 38 + www/node_modules/mkdirp/test/mkdirp.js | 28 + www/node_modules/mkdirp/test/opts_fs.js | 29 + www/node_modules/mkdirp/test/opts_fs_sync.js | 27 + www/node_modules/mkdirp/test/perm.js | 32 + www/node_modules/mkdirp/test/perm_sync.js | 36 + www/node_modules/mkdirp/test/race.js | 37 + www/node_modules/mkdirp/test/rel.js | 32 + www/node_modules/mkdirp/test/return.js | 25 + www/node_modules/mkdirp/test/return_sync.js | 24 + www/node_modules/mkdirp/test/root.js | 19 + www/node_modules/mkdirp/test/sync.js | 32 + www/node_modules/mkdirp/test/umask.js | 28 + www/node_modules/mkdirp/test/umask_sync.js | 32 + www/node_modules/opener/LICENSE.txt | 47 + www/node_modules/opener/opener.js | 60 + www/node_modules/opener/package.json | 93 + www/node_modules/optimist/.travis.yml | 4 + www/node_modules/optimist/LICENSE | 21 + www/node_modules/optimist/example/bool.js | 10 + .../optimist/example/boolean_double.js | 7 + .../optimist/example/boolean_single.js | 7 + .../optimist/example/default_hash.js | 8 + .../optimist/example/default_singles.js | 7 + www/node_modules/optimist/example/divide.js | 8 + .../optimist/example/line_count.js | 20 + .../optimist/example/line_count_options.js | 29 + .../optimist/example/line_count_wrap.js | 29 + www/node_modules/optimist/example/nonopt.js | 4 + www/node_modules/optimist/example/reflect.js | 2 + www/node_modules/optimist/example/short.js | 3 + www/node_modules/optimist/example/string.js | 11 + .../optimist/example/usage-options.js | 19 + www/node_modules/optimist/example/xup.js | 10 + www/node_modules/optimist/index.js | 343 + .../node_modules/minimist/.travis.yml | 4 + .../optimist/node_modules/minimist/LICENSE | 18 + .../node_modules/minimist/example/parse.js | 2 + .../optimist/node_modules/minimist/index.js | 187 + .../node_modules/minimist/package.json | 101 + .../node_modules/minimist/readme.markdown | 73 + .../node_modules/minimist/test/bool.js | 119 + .../node_modules/minimist/test/dash.js | 24 + .../minimist/test/default_bool.js | 20 + .../node_modules/minimist/test/dotted.js | 22 + .../node_modules/minimist/test/long.js | 31 + .../node_modules/minimist/test/num.js | 36 + .../node_modules/minimist/test/parse.js | 197 + .../minimist/test/parse_modified.js | 9 + .../node_modules/minimist/test/short.js | 67 + .../node_modules/minimist/test/whitespace.js | 8 + www/node_modules/optimist/package.json | 97 + www/node_modules/optimist/readme.markdown | 513 + www/node_modules/optimist/test/_.js | 71 + www/node_modules/optimist/test/_/argv.js | 2 + www/node_modules/optimist/test/_/bin.js | 3 + www/node_modules/optimist/test/dash.js | 31 + www/node_modules/optimist/test/parse.js | 446 + .../optimist/test/parse_modified.js | 14 + www/node_modules/optimist/test/short.js | 16 + www/node_modules/optimist/test/usage.js | 292 + www/node_modules/optimist/test/whitespace.js | 8 + www/node_modules/portfinder/.npmignore | 2 + www/node_modules/portfinder/.travis.yml | 21 + www/node_modules/portfinder/LICENSE | 22 + www/node_modules/portfinder/README.md | 38 + www/node_modules/portfinder/lib/portfinder.js | 218 + www/node_modules/portfinder/package.json | 93 + .../portfinder/test/fixtures/.gitkeep | 0 .../test/port-finder-multiple-test.js | 67 + .../test/port-finder-socket-test.js | 92 + .../portfinder/test/port-finder-test.js | 67 + www/node_modules/qs/.jshintignore | 1 + www/node_modules/qs/.jshintrc | 10 + www/node_modules/qs/.npmignore | 18 + www/node_modules/qs/.travis.yml | 4 + www/node_modules/qs/CHANGELOG.md | 68 + www/node_modules/qs/CONTRIBUTING.md | 1 + www/node_modules/qs/LICENSE | 28 + www/node_modules/qs/Makefile | 8 + www/node_modules/qs/README.md | 222 + www/node_modules/qs/index.js | 1 + www/node_modules/qs/lib/index.js | 15 + www/node_modules/qs/lib/parse.js | 157 + www/node_modules/qs/lib/stringify.js | 77 + www/node_modules/qs/lib/utils.js | 132 + www/node_modules/qs/package.json | 92 + www/node_modules/qs/test/parse.js | 413 + www/node_modules/qs/test/stringify.js | 179 + www/node_modules/requires-port/.npmignore | 2 + www/node_modules/requires-port/.travis.yml | 19 + www/node_modules/requires-port/LICENSE | 22 + www/node_modules/requires-port/README.md | 47 + www/node_modules/requires-port/index.js | 38 + www/node_modules/requires-port/package.json | 110 + www/node_modules/requires-port/test.js | 98 + www/node_modules/union/.npmignore | 7 + www/node_modules/union/.travis.yml | 12 + www/node_modules/union/CHANGELOG.md | 7 + www/node_modules/union/LICENSE | 19 + www/node_modules/union/README.md | 323 + .../union/examples/after/index.js | 26 + .../union/examples/simple/favicon.png | Bin 0 -> 545 bytes .../examples/simple/middleware/favicon.js | 96 + .../examples/simple/middleware/gzip-decode.js | 26 + .../examples/simple/middleware/gzip-encode.js | 40 + .../union/examples/simple/simple.js | 60 + .../union/examples/simple/spdy.js | 30 + .../union/examples/socketio/README | 13 + .../union/examples/socketio/index.html | 8 + .../union/examples/socketio/server.js | 30 + www/node_modules/union/lib/buffered-stream.js | 141 + www/node_modules/union/lib/core.js | 108 + www/node_modules/union/lib/http-stream.js | 52 + www/node_modules/union/lib/index.js | 24 + www/node_modules/union/lib/request-stream.js | 58 + www/node_modules/union/lib/response-stream.js | 203 + www/node_modules/union/lib/routing-stream.js | 126 + www/node_modules/union/package.json | 106 + www/node_modules/union/test/after-test.js | 37 + .../union/test/body-parser-test.js | 50 + .../union/test/double-write-test.js | 62 + www/node_modules/union/test/ecstatic-test.js | 44 + www/node_modules/union/test/fixtures/index.js | 0 .../union/test/fixtures/static/some-file.txt | 1 + www/node_modules/union/test/header-test.js | 36 + www/node_modules/union/test/helpers/index.js | 0 www/node_modules/union/test/helpers/macros.js | 17 + www/node_modules/union/test/prop-test.js | 45 + www/node_modules/union/test/simple-test.js | 97 + .../union/test/status-code-test.js | 31 + www/node_modules/union/test/streaming-test.js | 68 + www/node_modules/union/union.png | Bin 0 -> 10826 bytes www/node_modules/url-join/.npmignore | 2 + www/node_modules/url-join/.travis.yml | 5 + www/node_modules/url-join/README.md | 47 + www/node_modules/url-join/bower.json | 22 + www/node_modules/url-join/lib/url-join.js | 38 + www/node_modules/url-join/package.json | 92 + www/node_modules/url-join/test/tests.js | 51 + www/node_modules/wordwrap/LICENSE | 18 + www/node_modules/wordwrap/README.markdown | 70 + www/node_modules/wordwrap/example/center.js | 10 + www/node_modules/wordwrap/example/meat.js | 3 + www/node_modules/wordwrap/index.js | 76 + www/node_modules/wordwrap/package.json | 97 + www/node_modules/wordwrap/test/break.js | 30 + www/node_modules/wordwrap/test/idleness.txt | 63 + www/node_modules/wordwrap/test/wrap.js | 31 + www/package.json | 14 + www/views/chat/chat.html | 18 + www/views/chat/chat.js | 22 + 1585 files changed, 450241 insertions(+) create mode 100644 server/controllers/adminController.js create mode 100644 server/controllers/chefController.js create mode 100644 server/controllers/contactController.js create mode 100644 server/controllers/conversationController.js create mode 100644 server/controllers/dietController.js create mode 100644 server/controllers/publicationController.js create mode 100644 server/controllers/routineController.js create mode 100644 server/controllers/runController.js create mode 100644 server/controllers/trainerController.js create mode 100644 server/controllers/userController.js create mode 100644 server/models/contactModel.js create mode 100644 server/models/conversationModel.js create mode 100644 server/models/dietModel.js create mode 100644 server/models/publicationModel.js create mode 100644 server/models/routineModel.js create mode 100644 server/models/runModel.js create mode 100644 server/models/userModel.js create mode 100644 server/node_modules/accepts/HISTORY.md create mode 100644 server/node_modules/accepts/LICENSE create mode 100644 server/node_modules/accepts/README.md create mode 100644 server/node_modules/accepts/index.js create mode 100644 server/node_modules/accepts/package.json create mode 100644 server/node_modules/after/.npmignore create mode 100644 server/node_modules/after/.travis.yml create mode 100644 server/node_modules/after/LICENCE create mode 100644 server/node_modules/after/README.md create mode 100644 server/node_modules/after/index.js create mode 100644 server/node_modules/after/package.json create mode 100644 server/node_modules/after/test/after-test.js create mode 100644 server/node_modules/arraybuffer.slice/.npmignore create mode 100644 server/node_modules/arraybuffer.slice/Makefile create mode 100644 server/node_modules/arraybuffer.slice/README.md create mode 100644 server/node_modules/arraybuffer.slice/index.js create mode 100644 server/node_modules/arraybuffer.slice/package.json create mode 100644 server/node_modules/arraybuffer.slice/test/slice-buffer.js create mode 100644 server/node_modules/backo2/.npmignore create mode 100644 server/node_modules/backo2/History.md create mode 100644 server/node_modules/backo2/Makefile create mode 100644 server/node_modules/backo2/Readme.md create mode 100644 server/node_modules/backo2/component.json create mode 100644 server/node_modules/backo2/index.js create mode 100644 server/node_modules/backo2/package.json create mode 100644 server/node_modules/backo2/test/index.js create mode 100644 server/node_modules/base64-arraybuffer/.npmignore create mode 100644 server/node_modules/base64-arraybuffer/.travis.yml create mode 100644 server/node_modules/base64-arraybuffer/LICENSE-MIT create mode 100644 server/node_modules/base64-arraybuffer/README.md create mode 100644 server/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js create mode 100644 server/node_modules/base64-arraybuffer/package.json create mode 100644 server/node_modules/base64id/.npmignore create mode 100644 server/node_modules/base64id/LICENSE create mode 100644 server/node_modules/base64id/README.md create mode 100644 server/node_modules/base64id/lib/base64id.js create mode 100644 server/node_modules/base64id/package.json create mode 100644 server/node_modules/better-assert/.npmignore create mode 100644 server/node_modules/better-assert/History.md create mode 100644 server/node_modules/better-assert/Makefile create mode 100644 server/node_modules/better-assert/Readme.md create mode 100644 server/node_modules/better-assert/example.js create mode 100644 server/node_modules/better-assert/index.js create mode 100644 server/node_modules/better-assert/package.json create mode 100644 server/node_modules/blob/.npmignore create mode 100644 server/node_modules/blob/.zuul.yml create mode 100644 server/node_modules/blob/Makefile create mode 100644 server/node_modules/blob/README.md create mode 100644 server/node_modules/blob/index.js create mode 100644 server/node_modules/blob/package.json create mode 100644 server/node_modules/blob/test/index.js create mode 100644 server/node_modules/callsite/.npmignore create mode 100644 server/node_modules/callsite/History.md create mode 100644 server/node_modules/callsite/Makefile create mode 100644 server/node_modules/callsite/Readme.md create mode 100644 server/node_modules/callsite/index.js create mode 100644 server/node_modules/callsite/package.json create mode 100644 server/node_modules/component-bind/.npmignore create mode 100644 server/node_modules/component-bind/History.md create mode 100644 server/node_modules/component-bind/Makefile create mode 100644 server/node_modules/component-bind/Readme.md create mode 100644 server/node_modules/component-bind/component.json create mode 100644 server/node_modules/component-bind/index.js create mode 100644 server/node_modules/component-bind/package.json create mode 100644 server/node_modules/component-emitter/.npmignore create mode 100644 server/node_modules/component-emitter/.travis.yml create mode 100644 server/node_modules/component-emitter/History.md create mode 100644 server/node_modules/component-emitter/Makefile create mode 100644 server/node_modules/component-emitter/Readme.md create mode 100644 server/node_modules/component-emitter/bower.json create mode 100644 server/node_modules/component-emitter/component.json create mode 100644 server/node_modules/component-emitter/index.js create mode 100644 server/node_modules/component-emitter/package.json create mode 100644 server/node_modules/component-inherit/.npmignore create mode 100644 server/node_modules/component-inherit/History.md create mode 100644 server/node_modules/component-inherit/Makefile create mode 100644 server/node_modules/component-inherit/Readme.md create mode 100644 server/node_modules/component-inherit/component.json create mode 100644 server/node_modules/component-inherit/index.js create mode 100644 server/node_modules/component-inherit/package.json create mode 100644 server/node_modules/component-inherit/test/inherit.js create mode 100644 server/node_modules/content-disposition/HISTORY.md create mode 100644 server/node_modules/content-disposition/LICENSE create mode 100644 server/node_modules/content-disposition/README.md create mode 100644 server/node_modules/content-disposition/index.js create mode 100644 server/node_modules/content-disposition/package.json create mode 100644 server/node_modules/cookie-signature/.npmignore create mode 100644 server/node_modules/cookie-signature/History.md create mode 100644 server/node_modules/cookie-signature/Makefile create mode 100644 server/node_modules/cookie-signature/Readme.md create mode 100644 server/node_modules/cookie-signature/index.js create mode 100644 server/node_modules/cookie-signature/package.json create mode 100644 server/node_modules/cookie/.npmignore create mode 100644 server/node_modules/cookie/LICENSE create mode 100644 server/node_modules/cookie/README.md create mode 100644 server/node_modules/cookie/index.js create mode 100644 server/node_modules/cookie/package.json create mode 100644 server/node_modules/crc/.npmignore create mode 100644 server/node_modules/crc/LICENSE create mode 100644 server/node_modules/crc/README.md create mode 100644 server/node_modules/crc/lib/crc.js create mode 100644 server/node_modules/crc/lib/crc1.js create mode 100644 server/node_modules/crc/lib/crc16.js create mode 100644 server/node_modules/crc/lib/crc16_ccitt.js create mode 100644 server/node_modules/crc/lib/crc16_modbus.js create mode 100644 server/node_modules/crc/lib/crc24.js create mode 100644 server/node_modules/crc/lib/crc32.js create mode 100644 server/node_modules/crc/lib/crc8.js create mode 100644 server/node_modules/crc/lib/crc8_1wire.js create mode 100644 server/node_modules/crc/lib/create.js create mode 100644 server/node_modules/crc/lib/hex.js create mode 100644 server/node_modules/crc/lib/index.js create mode 100644 server/node_modules/crc/package.json create mode 100644 server/node_modules/debug/.jshintrc create mode 100644 server/node_modules/debug/.npmignore create mode 100644 server/node_modules/debug/History.md create mode 100644 server/node_modules/debug/Makefile create mode 100644 server/node_modules/debug/Readme.md create mode 100644 server/node_modules/debug/bower.json create mode 100644 server/node_modules/debug/browser.js create mode 100644 server/node_modules/debug/component.json create mode 100644 server/node_modules/debug/debug.js create mode 100644 server/node_modules/debug/node.js create mode 100644 server/node_modules/debug/package.json create mode 100644 server/node_modules/depd/History.md create mode 100644 server/node_modules/depd/LICENSE create mode 100644 server/node_modules/depd/Readme.md create mode 100644 server/node_modules/depd/index.js create mode 100644 server/node_modules/depd/lib/compat/buffer-concat.js create mode 100644 server/node_modules/depd/lib/compat/callsite-tostring.js create mode 100644 server/node_modules/depd/lib/compat/index.js create mode 100644 server/node_modules/depd/package.json create mode 100644 server/node_modules/destroy/README.md create mode 100644 server/node_modules/destroy/index.js create mode 100644 server/node_modules/destroy/package.json create mode 100644 server/node_modules/ee-first/LICENSE create mode 100644 server/node_modules/ee-first/README.md create mode 100644 server/node_modules/ee-first/index.js create mode 100644 server/node_modules/ee-first/package.json create mode 100644 server/node_modules/engine.io-client/History.md create mode 100644 server/node_modules/engine.io-client/LICENSE create mode 100644 server/node_modules/engine.io-client/README.md create mode 100644 server/node_modules/engine.io-client/engine.io.js create mode 100644 server/node_modules/engine.io-client/index.js create mode 100644 server/node_modules/engine.io-client/lib/index.js create mode 100644 server/node_modules/engine.io-client/lib/socket.js create mode 100644 server/node_modules/engine.io-client/lib/transport.js create mode 100755 server/node_modules/engine.io-client/lib/transports/index.js create mode 100644 server/node_modules/engine.io-client/lib/transports/polling-jsonp.js create mode 100755 server/node_modules/engine.io-client/lib/transports/polling-xhr.js create mode 100644 server/node_modules/engine.io-client/lib/transports/polling.js create mode 100644 server/node_modules/engine.io-client/lib/transports/websocket.js create mode 100644 server/node_modules/engine.io-client/lib/xmlhttprequest.js create mode 100644 server/node_modules/engine.io-client/node_modules/component-emitter/History.md create mode 100644 server/node_modules/engine.io-client/node_modules/component-emitter/LICENSE create mode 100644 server/node_modules/engine.io-client/node_modules/component-emitter/Readme.md create mode 100644 server/node_modules/engine.io-client/node_modules/component-emitter/index.js create mode 100644 server/node_modules/engine.io-client/node_modules/component-emitter/package.json create mode 100644 server/node_modules/engine.io-client/node_modules/debug/.jshintrc create mode 100644 server/node_modules/engine.io-client/node_modules/debug/.npmignore create mode 100644 server/node_modules/engine.io-client/node_modules/debug/CHANGELOG.md create mode 100644 server/node_modules/engine.io-client/node_modules/debug/LICENSE create mode 100644 server/node_modules/engine.io-client/node_modules/debug/Makefile create mode 100644 server/node_modules/engine.io-client/node_modules/debug/Readme.md create mode 100644 server/node_modules/engine.io-client/node_modules/debug/bower.json create mode 100644 server/node_modules/engine.io-client/node_modules/debug/browser.js create mode 100644 server/node_modules/engine.io-client/node_modules/debug/component.json create mode 100644 server/node_modules/engine.io-client/node_modules/debug/debug.js create mode 100644 server/node_modules/engine.io-client/node_modules/debug/index.js create mode 100644 server/node_modules/engine.io-client/node_modules/debug/node.js create mode 100644 server/node_modules/engine.io-client/node_modules/debug/package.json create mode 100644 server/node_modules/engine.io-client/node_modules/ms/LICENSE.md create mode 100644 server/node_modules/engine.io-client/node_modules/ms/README.md create mode 100644 server/node_modules/engine.io-client/node_modules/ms/index.js create mode 100644 server/node_modules/engine.io-client/node_modules/ms/package.json create mode 100644 server/node_modules/engine.io-client/package.json create mode 100644 server/node_modules/engine.io-parser/History.md create mode 100644 server/node_modules/engine.io-parser/LICENSE create mode 100644 server/node_modules/engine.io-parser/Readme.md create mode 100644 server/node_modules/engine.io-parser/index.js create mode 100644 server/node_modules/engine.io-parser/lib/browser.js create mode 100644 server/node_modules/engine.io-parser/lib/index.js create mode 100644 server/node_modules/engine.io-parser/lib/keys.js create mode 100644 server/node_modules/engine.io-parser/package.json create mode 100644 server/node_modules/engine.io/History.md create mode 100644 server/node_modules/engine.io/LICENSE create mode 100644 server/node_modules/engine.io/README.md create mode 100644 server/node_modules/engine.io/index.js create mode 100644 server/node_modules/engine.io/lib/engine.io.js create mode 100644 server/node_modules/engine.io/lib/server.js create mode 100644 server/node_modules/engine.io/lib/socket.js create mode 100644 server/node_modules/engine.io/lib/transport.js create mode 100644 server/node_modules/engine.io/lib/transports/index.js create mode 100644 server/node_modules/engine.io/lib/transports/polling-jsonp.js create mode 100644 server/node_modules/engine.io/lib/transports/polling-xhr.js create mode 100644 server/node_modules/engine.io/lib/transports/polling.js create mode 100644 server/node_modules/engine.io/lib/transports/websocket.js create mode 100644 server/node_modules/engine.io/node_modules/accepts/HISTORY.md create mode 100644 server/node_modules/engine.io/node_modules/accepts/LICENSE create mode 100644 server/node_modules/engine.io/node_modules/accepts/README.md create mode 100644 server/node_modules/engine.io/node_modules/accepts/index.js create mode 100644 server/node_modules/engine.io/node_modules/accepts/package.json create mode 100644 server/node_modules/engine.io/node_modules/cookie/HISTORY.md create mode 100644 server/node_modules/engine.io/node_modules/cookie/LICENSE create mode 100644 server/node_modules/engine.io/node_modules/cookie/README.md create mode 100644 server/node_modules/engine.io/node_modules/cookie/index.js create mode 100644 server/node_modules/engine.io/node_modules/cookie/package.json create mode 100644 server/node_modules/engine.io/node_modules/debug/.jshintrc create mode 100644 server/node_modules/engine.io/node_modules/debug/.npmignore create mode 100644 server/node_modules/engine.io/node_modules/debug/CHANGELOG.md create mode 100644 server/node_modules/engine.io/node_modules/debug/LICENSE create mode 100644 server/node_modules/engine.io/node_modules/debug/Makefile create mode 100644 server/node_modules/engine.io/node_modules/debug/Readme.md create mode 100644 server/node_modules/engine.io/node_modules/debug/bower.json create mode 100644 server/node_modules/engine.io/node_modules/debug/browser.js create mode 100644 server/node_modules/engine.io/node_modules/debug/component.json create mode 100644 server/node_modules/engine.io/node_modules/debug/debug.js create mode 100644 server/node_modules/engine.io/node_modules/debug/index.js create mode 100644 server/node_modules/engine.io/node_modules/debug/node.js create mode 100644 server/node_modules/engine.io/node_modules/debug/package.json create mode 100644 server/node_modules/engine.io/node_modules/mime-db/HISTORY.md create mode 100644 server/node_modules/engine.io/node_modules/mime-db/LICENSE create mode 100644 server/node_modules/engine.io/node_modules/mime-db/README.md create mode 100644 server/node_modules/engine.io/node_modules/mime-db/db.json create mode 100644 server/node_modules/engine.io/node_modules/mime-db/index.js create mode 100644 server/node_modules/engine.io/node_modules/mime-db/package.json create mode 100644 server/node_modules/engine.io/node_modules/mime-types/HISTORY.md create mode 100644 server/node_modules/engine.io/node_modules/mime-types/LICENSE create mode 100644 server/node_modules/engine.io/node_modules/mime-types/README.md create mode 100644 server/node_modules/engine.io/node_modules/mime-types/index.js create mode 100644 server/node_modules/engine.io/node_modules/mime-types/package.json create mode 100644 server/node_modules/engine.io/node_modules/ms/LICENSE.md create mode 100644 server/node_modules/engine.io/node_modules/ms/README.md create mode 100644 server/node_modules/engine.io/node_modules/ms/index.js create mode 100644 server/node_modules/engine.io/node_modules/ms/package.json create mode 100644 server/node_modules/engine.io/node_modules/negotiator/HISTORY.md create mode 100644 server/node_modules/engine.io/node_modules/negotiator/LICENSE create mode 100644 server/node_modules/engine.io/node_modules/negotiator/README.md create mode 100644 server/node_modules/engine.io/node_modules/negotiator/index.js create mode 100644 server/node_modules/engine.io/node_modules/negotiator/lib/charset.js create mode 100644 server/node_modules/engine.io/node_modules/negotiator/lib/encoding.js create mode 100644 server/node_modules/engine.io/node_modules/negotiator/lib/language.js create mode 100644 server/node_modules/engine.io/node_modules/negotiator/lib/mediaType.js create mode 100644 server/node_modules/engine.io/node_modules/negotiator/package.json create mode 100644 server/node_modules/engine.io/package.json create mode 100644 server/node_modules/escape-html/.npmignore create mode 100644 server/node_modules/escape-html/Makefile create mode 100644 server/node_modules/escape-html/Readme.md create mode 100644 server/node_modules/escape-html/component.json create mode 100644 server/node_modules/escape-html/index.js create mode 100644 server/node_modules/escape-html/package.json create mode 100644 server/node_modules/etag/HISTORY.md create mode 100644 server/node_modules/etag/LICENSE create mode 100644 server/node_modules/etag/README.md create mode 100644 server/node_modules/etag/index.js create mode 100644 server/node_modules/etag/package.json create mode 100644 server/node_modules/express/History.md create mode 100644 server/node_modules/express/LICENSE create mode 100644 server/node_modules/express/Readme.md create mode 100644 server/node_modules/express/index.js create mode 100644 server/node_modules/express/lib/application.js create mode 100644 server/node_modules/express/lib/express.js create mode 100644 server/node_modules/express/lib/middleware/init.js create mode 100644 server/node_modules/express/lib/middleware/query.js create mode 100644 server/node_modules/express/lib/request.js create mode 100644 server/node_modules/express/lib/response.js create mode 100644 server/node_modules/express/lib/router/index.js create mode 100644 server/node_modules/express/lib/router/layer.js create mode 100644 server/node_modules/express/lib/router/route.js create mode 100644 server/node_modules/express/lib/utils.js create mode 100644 server/node_modules/express/lib/view.js create mode 100644 server/node_modules/express/package.json create mode 100644 server/node_modules/finalhandler/HISTORY.md create mode 100644 server/node_modules/finalhandler/LICENSE create mode 100644 server/node_modules/finalhandler/README.md create mode 100644 server/node_modules/finalhandler/index.js create mode 100644 server/node_modules/finalhandler/package.json create mode 100644 server/node_modules/forwarded/HISTORY.md create mode 100644 server/node_modules/forwarded/LICENSE create mode 100644 server/node_modules/forwarded/README.md create mode 100644 server/node_modules/forwarded/index.js create mode 100644 server/node_modules/forwarded/package.json create mode 100644 server/node_modules/fresh/HISTORY.md create mode 100644 server/node_modules/fresh/LICENSE create mode 100644 server/node_modules/fresh/README.md create mode 100644 server/node_modules/fresh/index.js create mode 100644 server/node_modules/fresh/package.json create mode 100644 server/node_modules/has-binary/.npmignore create mode 100644 server/node_modules/has-binary/History.md create mode 100644 server/node_modules/has-binary/LICENSE create mode 100644 server/node_modules/has-binary/Makefile create mode 100644 server/node_modules/has-binary/README.md create mode 100644 server/node_modules/has-binary/index.js create mode 100644 server/node_modules/has-binary/package.json create mode 100644 server/node_modules/has-binary/test.js create mode 100644 server/node_modules/has-cors/.npmignore create mode 100644 server/node_modules/has-cors/History.md create mode 100644 server/node_modules/has-cors/Makefile create mode 100644 server/node_modules/has-cors/Readme.md create mode 100644 server/node_modules/has-cors/component.json create mode 100644 server/node_modules/has-cors/index.js create mode 100644 server/node_modules/has-cors/package.json create mode 100644 server/node_modules/has-cors/test.js create mode 100644 server/node_modules/indexof/.npmignore create mode 100644 server/node_modules/indexof/Makefile create mode 100644 server/node_modules/indexof/Readme.md create mode 100644 server/node_modules/indexof/component.json create mode 100644 server/node_modules/indexof/index.js create mode 100644 server/node_modules/indexof/package.json create mode 100644 server/node_modules/ipaddr.js/.npmignore create mode 100644 server/node_modules/ipaddr.js/.travis.yml create mode 100644 server/node_modules/ipaddr.js/Cakefile create mode 100644 server/node_modules/ipaddr.js/LICENSE create mode 100644 server/node_modules/ipaddr.js/README.md create mode 100644 server/node_modules/ipaddr.js/bower.json create mode 100644 server/node_modules/ipaddr.js/ipaddr.min.js create mode 100644 server/node_modules/ipaddr.js/lib/ipaddr.js create mode 100644 server/node_modules/ipaddr.js/package.json create mode 100644 server/node_modules/ipaddr.js/src/ipaddr.coffee create mode 100644 server/node_modules/ipaddr.js/test/ipaddr.test.coffee create mode 100644 server/node_modules/isarray/README.md create mode 100644 server/node_modules/isarray/build/build.js create mode 100644 server/node_modules/isarray/component.json create mode 100644 server/node_modules/isarray/index.js create mode 100644 server/node_modules/isarray/package.json create mode 100644 server/node_modules/json3/LICENSE create mode 100644 server/node_modules/json3/README.md create mode 100644 server/node_modules/json3/lib/json3.js create mode 100644 server/node_modules/json3/lib/json3.min.js create mode 100644 server/node_modules/json3/package.json create mode 100644 server/node_modules/media-typer/HISTORY.md create mode 100644 server/node_modules/media-typer/LICENSE create mode 100644 server/node_modules/media-typer/README.md create mode 100644 server/node_modules/media-typer/index.js create mode 100644 server/node_modules/media-typer/package.json create mode 100644 server/node_modules/merge-descriptors/.npmignore create mode 100644 server/node_modules/merge-descriptors/README.md create mode 100644 server/node_modules/merge-descriptors/component.json create mode 100644 server/node_modules/merge-descriptors/index.js create mode 100644 server/node_modules/merge-descriptors/package.json create mode 100644 server/node_modules/methods/.npmignore create mode 100644 server/node_modules/methods/History.md create mode 100644 server/node_modules/methods/LICENSE create mode 100644 server/node_modules/methods/Readme.md create mode 100644 server/node_modules/methods/index.js create mode 100644 server/node_modules/methods/package.json create mode 100644 server/node_modules/methods/test/methods.js create mode 100644 server/node_modules/mime-db/HISTORY.md create mode 100644 server/node_modules/mime-db/LICENSE create mode 100644 server/node_modules/mime-db/README.md create mode 100644 server/node_modules/mime-db/db.json create mode 100644 server/node_modules/mime-db/index.js create mode 100644 server/node_modules/mime-db/package.json create mode 100644 server/node_modules/mime-types/HISTORY.md create mode 100644 server/node_modules/mime-types/LICENSE create mode 100644 server/node_modules/mime-types/README.md create mode 100644 server/node_modules/mime-types/index.js create mode 100644 server/node_modules/mime-types/package.json create mode 100644 server/node_modules/mime/LICENSE create mode 100644 server/node_modules/mime/README.md create mode 100644 server/node_modules/mime/mime.js create mode 100644 server/node_modules/mime/package.json create mode 100644 server/node_modules/mime/test.js create mode 100644 server/node_modules/mime/types/mime.types create mode 100644 server/node_modules/mime/types/node.types create mode 100644 server/node_modules/ms/.npmignore create mode 100644 server/node_modules/ms/LICENSE create mode 100644 server/node_modules/ms/README.md create mode 100644 server/node_modules/ms/index.js create mode 100644 server/node_modules/ms/package.json create mode 100644 server/node_modules/negotiator/LICENSE create mode 100644 server/node_modules/negotiator/README.md create mode 100644 server/node_modules/negotiator/lib/charset.js create mode 100644 server/node_modules/negotiator/lib/encoding.js create mode 100644 server/node_modules/negotiator/lib/language.js create mode 100644 server/node_modules/negotiator/lib/mediaType.js create mode 100644 server/node_modules/negotiator/lib/negotiator.js create mode 100644 server/node_modules/negotiator/package.json create mode 100644 server/node_modules/object-assign/index.js create mode 100644 server/node_modules/object-assign/license create mode 100644 server/node_modules/object-assign/package.json create mode 100644 server/node_modules/object-assign/readme.md create mode 100644 server/node_modules/object-component/.npmignore create mode 100644 server/node_modules/object-component/History.md create mode 100644 server/node_modules/object-component/Makefile create mode 100644 server/node_modules/object-component/Readme.md create mode 100644 server/node_modules/object-component/component.json create mode 100644 server/node_modules/object-component/index.js create mode 100644 server/node_modules/object-component/package.json create mode 100644 server/node_modules/object-component/test/object.js create mode 100644 server/node_modules/on-finished/HISTORY.md create mode 100644 server/node_modules/on-finished/LICENSE create mode 100644 server/node_modules/on-finished/README.md create mode 100644 server/node_modules/on-finished/index.js create mode 100644 server/node_modules/on-finished/package.json create mode 100644 server/node_modules/options/.npmignore create mode 100644 server/node_modules/options/Makefile create mode 100644 server/node_modules/options/README.md create mode 100644 server/node_modules/options/lib/options.js create mode 100644 server/node_modules/options/package.json create mode 100644 server/node_modules/parsejson/.npmignore create mode 100644 server/node_modules/parsejson/LICENSE create mode 100644 server/node_modules/parsejson/Makefile create mode 100644 server/node_modules/parsejson/README.md create mode 100644 server/node_modules/parsejson/index.js create mode 100644 server/node_modules/parsejson/package.json create mode 100644 server/node_modules/parsejson/test.js create mode 100644 server/node_modules/parseqs/.npmignore create mode 100644 server/node_modules/parseqs/LICENSE create mode 100644 server/node_modules/parseqs/Makefile create mode 100644 server/node_modules/parseqs/README.md create mode 100644 server/node_modules/parseqs/index.js create mode 100644 server/node_modules/parseqs/package.json create mode 100644 server/node_modules/parseqs/test.js create mode 100644 server/node_modules/parseuri/.npmignore create mode 100644 server/node_modules/parseuri/History.md create mode 100644 server/node_modules/parseuri/LICENSE create mode 100644 server/node_modules/parseuri/Makefile create mode 100644 server/node_modules/parseuri/README.md create mode 100644 server/node_modules/parseuri/index.js create mode 100644 server/node_modules/parseuri/package.json create mode 100644 server/node_modules/parseuri/test.js create mode 100644 server/node_modules/parseurl/HISTORY.md create mode 100644 server/node_modules/parseurl/LICENSE create mode 100644 server/node_modules/parseurl/README.md create mode 100644 server/node_modules/parseurl/index.js create mode 100644 server/node_modules/parseurl/package.json create mode 100644 server/node_modules/path-to-regexp/.npmignore create mode 100644 server/node_modules/path-to-regexp/History.md create mode 100644 server/node_modules/path-to-regexp/Readme.md create mode 100644 server/node_modules/path-to-regexp/component.json create mode 100644 server/node_modules/path-to-regexp/index.js create mode 100644 server/node_modules/path-to-regexp/package.json create mode 100644 server/node_modules/path-to-regexp/test.js create mode 100644 server/node_modules/proxy-addr/HISTORY.md create mode 100644 server/node_modules/proxy-addr/LICENSE create mode 100644 server/node_modules/proxy-addr/README.md create mode 100644 server/node_modules/proxy-addr/index.js create mode 100644 server/node_modules/proxy-addr/package.json create mode 100644 server/node_modules/qs/.jshintignore create mode 100644 server/node_modules/qs/.jshintrc create mode 100644 server/node_modules/qs/.npmignore create mode 100644 server/node_modules/qs/.travis.yml create mode 100644 server/node_modules/qs/CHANGELOG.md create mode 100644 server/node_modules/qs/CONTRIBUTING.md create mode 100755 server/node_modules/qs/LICENSE create mode 100644 server/node_modules/qs/Makefile create mode 100755 server/node_modules/qs/README.md create mode 100644 server/node_modules/qs/index.js create mode 100755 server/node_modules/qs/lib/index.js create mode 100755 server/node_modules/qs/lib/parse.js create mode 100755 server/node_modules/qs/lib/stringify.js create mode 100755 server/node_modules/qs/lib/utils.js create mode 100755 server/node_modules/qs/package.json create mode 100755 server/node_modules/qs/test/parse.js create mode 100755 server/node_modules/qs/test/stringify.js create mode 100644 server/node_modules/range-parser/HISTORY.md create mode 100644 server/node_modules/range-parser/LICENSE create mode 100644 server/node_modules/range-parser/README.md create mode 100644 server/node_modules/range-parser/index.js create mode 100644 server/node_modules/range-parser/package.json create mode 100644 server/node_modules/send/History.md create mode 100644 server/node_modules/send/LICENSE create mode 100644 server/node_modules/send/Readme.md create mode 100644 server/node_modules/send/index.js create mode 100644 server/node_modules/send/node_modules/ms/.npmignore create mode 100644 server/node_modules/send/node_modules/ms/README.md create mode 100644 server/node_modules/send/node_modules/ms/index.js create mode 100644 server/node_modules/send/node_modules/ms/package.json create mode 100644 server/node_modules/send/package.json create mode 100644 server/node_modules/serve-static/HISTORY.md create mode 100644 server/node_modules/serve-static/LICENSE create mode 100644 server/node_modules/serve-static/README.md create mode 100644 server/node_modules/serve-static/index.js create mode 100644 server/node_modules/serve-static/package.json create mode 100644 server/node_modules/socket.io-adapter/.npmignore create mode 100644 server/node_modules/socket.io-adapter/History.md create mode 100644 server/node_modules/socket.io-adapter/LICENSE create mode 100644 server/node_modules/socket.io-adapter/Readme.md create mode 100644 server/node_modules/socket.io-adapter/index.js create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/.jshintrc create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/.npmignore create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/CHANGELOG.md create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/LICENSE create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/Makefile create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/Readme.md create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/bower.json create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/browser.js create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/component.json create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/debug.js create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/index.js create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/node.js create mode 100644 server/node_modules/socket.io-adapter/node_modules/debug/package.json create mode 100644 server/node_modules/socket.io-adapter/node_modules/ms/LICENSE.md create mode 100644 server/node_modules/socket.io-adapter/node_modules/ms/README.md create mode 100644 server/node_modules/socket.io-adapter/node_modules/ms/index.js create mode 100644 server/node_modules/socket.io-adapter/node_modules/ms/package.json create mode 100644 server/node_modules/socket.io-adapter/package.json create mode 100644 server/node_modules/socket.io-client/History.md create mode 100644 server/node_modules/socket.io-client/LICENSE create mode 100644 server/node_modules/socket.io-client/README.md create mode 100644 server/node_modules/socket.io-client/dist/socket.io.js create mode 100644 server/node_modules/socket.io-client/dist/socket.io.js.map create mode 100644 server/node_modules/socket.io-client/dist/socket.io.min.js create mode 100644 server/node_modules/socket.io-client/dist/socket.io.slim.js create mode 100644 server/node_modules/socket.io-client/dist/socket.io.slim.js.map create mode 100644 server/node_modules/socket.io-client/dist/socket.io.slim.min.js create mode 100644 server/node_modules/socket.io-client/lib/index.js create mode 100644 server/node_modules/socket.io-client/lib/manager.js create mode 100644 server/node_modules/socket.io-client/lib/on.js create mode 100644 server/node_modules/socket.io-client/lib/socket.js create mode 100644 server/node_modules/socket.io-client/lib/url.js create mode 100644 server/node_modules/socket.io-client/node_modules/component-emitter/History.md create mode 100644 server/node_modules/socket.io-client/node_modules/component-emitter/LICENSE create mode 100644 server/node_modules/socket.io-client/node_modules/component-emitter/Readme.md create mode 100644 server/node_modules/socket.io-client/node_modules/component-emitter/index.js create mode 100644 server/node_modules/socket.io-client/node_modules/component-emitter/package.json create mode 100644 server/node_modules/socket.io-client/node_modules/debug/.jshintrc create mode 100644 server/node_modules/socket.io-client/node_modules/debug/.npmignore create mode 100644 server/node_modules/socket.io-client/node_modules/debug/CHANGELOG.md create mode 100644 server/node_modules/socket.io-client/node_modules/debug/LICENSE create mode 100644 server/node_modules/socket.io-client/node_modules/debug/Makefile create mode 100644 server/node_modules/socket.io-client/node_modules/debug/Readme.md create mode 100644 server/node_modules/socket.io-client/node_modules/debug/bower.json create mode 100644 server/node_modules/socket.io-client/node_modules/debug/browser.js create mode 100644 server/node_modules/socket.io-client/node_modules/debug/component.json create mode 100644 server/node_modules/socket.io-client/node_modules/debug/debug.js create mode 100644 server/node_modules/socket.io-client/node_modules/debug/index.js create mode 100644 server/node_modules/socket.io-client/node_modules/debug/node.js create mode 100644 server/node_modules/socket.io-client/node_modules/debug/package.json create mode 100644 server/node_modules/socket.io-client/node_modules/ms/LICENSE.md create mode 100644 server/node_modules/socket.io-client/node_modules/ms/README.md create mode 100644 server/node_modules/socket.io-client/node_modules/ms/index.js create mode 100644 server/node_modules/socket.io-client/node_modules/ms/package.json create mode 100644 server/node_modules/socket.io-client/package.json create mode 100644 server/node_modules/socket.io-parser/History.md create mode 100644 server/node_modules/socket.io-parser/LICENSE create mode 100644 server/node_modules/socket.io-parser/Readme.md create mode 100644 server/node_modules/socket.io-parser/binary.js create mode 100644 server/node_modules/socket.io-parser/index.js create mode 100644 server/node_modules/socket.io-parser/is-buffer.js create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/.jshintrc create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/.npmignore create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/History.md create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/Makefile create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/Readme.md create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/bower.json create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/browser.js create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/component.json create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/debug.js create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/node.js create mode 100644 server/node_modules/socket.io-parser/node_modules/debug/package.json create mode 100644 server/node_modules/socket.io-parser/node_modules/ms/.npmignore create mode 100644 server/node_modules/socket.io-parser/node_modules/ms/History.md create mode 100644 server/node_modules/socket.io-parser/node_modules/ms/LICENSE create mode 100644 server/node_modules/socket.io-parser/node_modules/ms/README.md create mode 100644 server/node_modules/socket.io-parser/node_modules/ms/index.js create mode 100644 server/node_modules/socket.io-parser/node_modules/ms/package.json create mode 100644 server/node_modules/socket.io-parser/package.json create mode 100644 server/node_modules/socket.io/History.md create mode 100644 server/node_modules/socket.io/LICENSE create mode 100644 server/node_modules/socket.io/Readme.md create mode 100644 server/node_modules/socket.io/lib/client.js create mode 100644 server/node_modules/socket.io/lib/index.js create mode 100644 server/node_modules/socket.io/lib/namespace.js create mode 100644 server/node_modules/socket.io/lib/socket.js create mode 100644 server/node_modules/socket.io/node_modules/debug/.jshintrc create mode 100644 server/node_modules/socket.io/node_modules/debug/.npmignore create mode 100644 server/node_modules/socket.io/node_modules/debug/CHANGELOG.md create mode 100644 server/node_modules/socket.io/node_modules/debug/LICENSE create mode 100644 server/node_modules/socket.io/node_modules/debug/Makefile create mode 100644 server/node_modules/socket.io/node_modules/debug/Readme.md create mode 100644 server/node_modules/socket.io/node_modules/debug/bower.json create mode 100644 server/node_modules/socket.io/node_modules/debug/browser.js create mode 100644 server/node_modules/socket.io/node_modules/debug/component.json create mode 100644 server/node_modules/socket.io/node_modules/debug/debug.js create mode 100644 server/node_modules/socket.io/node_modules/debug/index.js create mode 100644 server/node_modules/socket.io/node_modules/debug/node.js create mode 100644 server/node_modules/socket.io/node_modules/debug/package.json create mode 100644 server/node_modules/socket.io/node_modules/ms/LICENSE.md create mode 100644 server/node_modules/socket.io/node_modules/ms/README.md create mode 100644 server/node_modules/socket.io/node_modules/ms/index.js create mode 100644 server/node_modules/socket.io/node_modules/ms/package.json create mode 100644 server/node_modules/socket.io/package.json create mode 100644 server/node_modules/to-array/.npmignore create mode 100644 server/node_modules/to-array/LICENCE create mode 100644 server/node_modules/to-array/README.md create mode 100644 server/node_modules/to-array/index.js create mode 100644 server/node_modules/to-array/package.json create mode 100644 server/node_modules/type-is/HISTORY.md create mode 100644 server/node_modules/type-is/LICENSE create mode 100644 server/node_modules/type-is/README.md create mode 100644 server/node_modules/type-is/index.js create mode 100644 server/node_modules/type-is/package.json create mode 100644 server/node_modules/ultron/.npmignore create mode 100644 server/node_modules/ultron/.travis.yml create mode 100644 server/node_modules/ultron/LICENSE create mode 100644 server/node_modules/ultron/README.md create mode 100644 server/node_modules/ultron/index.js create mode 100644 server/node_modules/ultron/package.json create mode 100644 server/node_modules/ultron/test.js create mode 100644 server/node_modules/utils-merge/.travis.yml create mode 100644 server/node_modules/utils-merge/LICENSE create mode 100644 server/node_modules/utils-merge/README.md create mode 100644 server/node_modules/utils-merge/index.js create mode 100644 server/node_modules/utils-merge/package.json create mode 100644 server/node_modules/vary/HISTORY.md create mode 100644 server/node_modules/vary/LICENSE create mode 100644 server/node_modules/vary/README.md create mode 100644 server/node_modules/vary/index.js create mode 100644 server/node_modules/vary/package.json create mode 100644 server/node_modules/ws/.npmignore create mode 100644 server/node_modules/ws/.travis.yml create mode 100644 server/node_modules/ws/Makefile create mode 100644 server/node_modules/ws/README.md create mode 100644 server/node_modules/ws/SECURITY.md create mode 100644 server/node_modules/ws/index.js create mode 100644 server/node_modules/ws/lib/BufferPool.js create mode 100644 server/node_modules/ws/lib/BufferUtil.fallback.js create mode 100644 server/node_modules/ws/lib/BufferUtil.js create mode 100644 server/node_modules/ws/lib/ErrorCodes.js create mode 100644 server/node_modules/ws/lib/Extensions.js create mode 100644 server/node_modules/ws/lib/PerMessageDeflate.js create mode 100644 server/node_modules/ws/lib/Receiver.hixie.js create mode 100644 server/node_modules/ws/lib/Receiver.js create mode 100644 server/node_modules/ws/lib/Sender.hixie.js create mode 100644 server/node_modules/ws/lib/Sender.js create mode 100644 server/node_modules/ws/lib/Validation.fallback.js create mode 100644 server/node_modules/ws/lib/Validation.js create mode 100644 server/node_modules/ws/lib/WebSocket.js create mode 100644 server/node_modules/ws/lib/WebSocketServer.js create mode 100644 server/node_modules/ws/package.json create mode 100644 server/node_modules/wtf-8/LICENSE-MIT.txt create mode 100644 server/node_modules/wtf-8/README.md create mode 100644 server/node_modules/wtf-8/package.json create mode 100644 server/node_modules/wtf-8/wtf-8.js create mode 100644 server/node_modules/xmlhttprequest-ssl/LICENSE create mode 100644 server/node_modules/xmlhttprequest-ssl/README.md create mode 100644 server/node_modules/xmlhttprequest-ssl/autotest.watchr create mode 100644 server/node_modules/xmlhttprequest-ssl/example/demo.js create mode 100644 server/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js create mode 100644 server/node_modules/xmlhttprequest-ssl/package.json create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-constants.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-events.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-exceptions.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-headers.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-redirect-302.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-redirect-303.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-redirect-307.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-request-methods.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/test-request-protocols.js create mode 100644 server/node_modules/xmlhttprequest-ssl/tests/testdata.txt create mode 100644 server/node_modules/yeast/LICENSE create mode 100644 server/node_modules/yeast/README.md create mode 100644 server/node_modules/yeast/index.js create mode 100644 server/node_modules/yeast/package.json create mode 100644 server/npm-debug.log create mode 100644 server/package.json create mode 100644 server/server.js create mode 100644 www/app.js create mode 100644 www/bower.json create mode 100644 www/bower_components/angular-animate/.bower.json create mode 100644 www/bower_components/angular-animate/LICENSE.md create mode 100644 www/bower_components/angular-animate/README.md create mode 100644 www/bower_components/angular-animate/angular-animate.js create mode 100644 www/bower_components/angular-animate/angular-animate.min.js create mode 100644 www/bower_components/angular-animate/angular-animate.min.js.map create mode 100644 www/bower_components/angular-animate/bower.json create mode 100644 www/bower_components/angular-animate/index.js create mode 100644 www/bower_components/angular-animate/package.json create mode 100644 www/bower_components/angular-aria/.bower.json create mode 100644 www/bower_components/angular-aria/LICENSE.md create mode 100644 www/bower_components/angular-aria/README.md create mode 100644 www/bower_components/angular-aria/angular-aria.js create mode 100644 www/bower_components/angular-aria/angular-aria.min.js create mode 100644 www/bower_components/angular-aria/angular-aria.min.js.map create mode 100644 www/bower_components/angular-aria/bower.json create mode 100644 www/bower_components/angular-aria/index.js create mode 100644 www/bower_components/angular-aria/package.json create mode 100644 www/bower_components/angular-material/.bower.json create mode 100644 www/bower_components/angular-material/.gitignore create mode 100644 www/bower_components/angular-material/CHANGELOG.md create mode 100644 www/bower_components/angular-material/LICENSE create mode 100644 www/bower_components/angular-material/README.md create mode 100644 www/bower_components/angular-material/angular-material-mocks.js create mode 100644 www/bower_components/angular-material/angular-material.css create mode 100644 www/bower_components/angular-material/angular-material.js create mode 100644 www/bower_components/angular-material/angular-material.min.css create mode 100644 www/bower_components/angular-material/angular-material.min.js create mode 100644 www/bower_components/angular-material/angular-material.scss create mode 100644 www/bower_components/angular-material/bower.json create mode 100644 www/bower_components/angular-material/index.js create mode 100644 www/bower_components/angular-material/layouts/angular-material.layout-attributes.css create mode 100644 www/bower_components/angular-material/layouts/angular-material.layout-attributes.min.css create mode 100644 www/bower_components/angular-material/layouts/angular-material.layout-attributes.scss create mode 100644 www/bower_components/angular-material/layouts/angular-material.layouts.css create mode 100644 www/bower_components/angular-material/layouts/angular-material.layouts.ie_fixes.css create mode 100644 www/bower_components/angular-material/layouts/angular-material.layouts.min.css create mode 100644 www/bower_components/angular-material/layouts/angular-material.layouts.scss create mode 100644 www/bower_components/angular-material/modules/closure/autocomplete/autocomplete-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/autocomplete/autocomplete-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/autocomplete/autocomplete.css create mode 100644 www/bower_components/angular-material/modules/closure/autocomplete/autocomplete.js create mode 100644 www/bower_components/angular-material/modules/closure/autocomplete/autocomplete.min.css create mode 100644 www/bower_components/angular-material/modules/closure/autocomplete/autocomplete.min.js create mode 100644 www/bower_components/angular-material/modules/closure/backdrop/backdrop-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/backdrop/backdrop-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/backdrop/backdrop.css create mode 100644 www/bower_components/angular-material/modules/closure/backdrop/backdrop.js create mode 100644 www/bower_components/angular-material/modules/closure/backdrop/backdrop.min.css create mode 100644 www/bower_components/angular-material/modules/closure/backdrop/backdrop.min.js create mode 100644 www/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.css create mode 100644 www/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.js create mode 100644 www/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.min.css create mode 100644 www/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.min.js create mode 100644 www/bower_components/angular-material/modules/closure/button/button-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/button/button-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/button/button.css create mode 100644 www/bower_components/angular-material/modules/closure/button/button.js create mode 100644 www/bower_components/angular-material/modules/closure/button/button.min.css create mode 100644 www/bower_components/angular-material/modules/closure/button/button.min.js create mode 100644 www/bower_components/angular-material/modules/closure/card/card-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/card/card-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/card/card.css create mode 100644 www/bower_components/angular-material/modules/closure/card/card.js create mode 100644 www/bower_components/angular-material/modules/closure/card/card.min.css create mode 100644 www/bower_components/angular-material/modules/closure/card/card.min.js create mode 100644 www/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/checkbox/checkbox.css create mode 100644 www/bower_components/angular-material/modules/closure/checkbox/checkbox.js create mode 100644 www/bower_components/angular-material/modules/closure/checkbox/checkbox.min.css create mode 100644 www/bower_components/angular-material/modules/closure/checkbox/checkbox.min.js create mode 100644 www/bower_components/angular-material/modules/closure/chips/chips-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/chips/chips-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/chips/chips.css create mode 100644 www/bower_components/angular-material/modules/closure/chips/chips.js create mode 100644 www/bower_components/angular-material/modules/closure/chips/chips.min.css create mode 100644 www/bower_components/angular-material/modules/closure/chips/chips.min.js create mode 100644 www/bower_components/angular-material/modules/closure/colors/colors.js create mode 100644 www/bower_components/angular-material/modules/closure/colors/colors.min.js create mode 100644 www/bower_components/angular-material/modules/closure/content/content-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/content/content-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/content/content.css create mode 100644 www/bower_components/angular-material/modules/closure/content/content.js create mode 100644 www/bower_components/angular-material/modules/closure/content/content.min.css create mode 100644 www/bower_components/angular-material/modules/closure/content/content.min.js create mode 100644 www/bower_components/angular-material/modules/closure/core/core-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/core/core-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/core/core.css create mode 100644 www/bower_components/angular-material/modules/closure/core/core.js create mode 100644 www/bower_components/angular-material/modules/closure/core/core.min.css create mode 100644 www/bower_components/angular-material/modules/closure/core/core.min.js create mode 100644 www/bower_components/angular-material/modules/closure/core/default-theme.js create mode 100644 www/bower_components/angular-material/modules/closure/datepicker/datepicker-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/datepicker/datepicker-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/datepicker/datepicker.css create mode 100644 www/bower_components/angular-material/modules/closure/datepicker/datepicker.js create mode 100644 www/bower_components/angular-material/modules/closure/datepicker/datepicker.min.css create mode 100644 www/bower_components/angular-material/modules/closure/datepicker/datepicker.min.js create mode 100644 www/bower_components/angular-material/modules/closure/dialog/dialog-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/dialog/dialog-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/dialog/dialog.css create mode 100644 www/bower_components/angular-material/modules/closure/dialog/dialog.js create mode 100644 www/bower_components/angular-material/modules/closure/dialog/dialog.min.css create mode 100644 www/bower_components/angular-material/modules/closure/dialog/dialog.min.js create mode 100644 www/bower_components/angular-material/modules/closure/divider/divider-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/divider/divider-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/divider/divider.css create mode 100644 www/bower_components/angular-material/modules/closure/divider/divider.js create mode 100644 www/bower_components/angular-material/modules/closure/divider/divider.min.css create mode 100644 www/bower_components/angular-material/modules/closure/divider/divider.min.js create mode 100644 www/bower_components/angular-material/modules/closure/fabActions/fabActions.js create mode 100644 www/bower_components/angular-material/modules/closure/fabActions/fabActions.min.js create mode 100644 www/bower_components/angular-material/modules/closure/fabSpeedDial/fabSpeedDial.css create mode 100644 www/bower_components/angular-material/modules/closure/fabSpeedDial/fabSpeedDial.js create mode 100644 www/bower_components/angular-material/modules/closure/fabSpeedDial/fabSpeedDial.min.css create mode 100644 www/bower_components/angular-material/modules/closure/fabSpeedDial/fabSpeedDial.min.js create mode 100644 www/bower_components/angular-material/modules/closure/fabToolbar/fabToolbar.css create mode 100644 www/bower_components/angular-material/modules/closure/fabToolbar/fabToolbar.js create mode 100644 www/bower_components/angular-material/modules/closure/fabToolbar/fabToolbar.min.css create mode 100644 www/bower_components/angular-material/modules/closure/fabToolbar/fabToolbar.min.js create mode 100644 www/bower_components/angular-material/modules/closure/fabTrigger/fabTrigger.js create mode 100644 www/bower_components/angular-material/modules/closure/fabTrigger/fabTrigger.min.js create mode 100644 www/bower_components/angular-material/modules/closure/gridList/gridList-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/gridList/gridList.css create mode 100644 www/bower_components/angular-material/modules/closure/gridList/gridList.js create mode 100644 www/bower_components/angular-material/modules/closure/gridList/gridList.min.css create mode 100644 www/bower_components/angular-material/modules/closure/gridList/gridList.min.js create mode 100644 www/bower_components/angular-material/modules/closure/icon/icon-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/icon/icon-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/icon/icon.css create mode 100644 www/bower_components/angular-material/modules/closure/icon/icon.js create mode 100644 www/bower_components/angular-material/modules/closure/icon/icon.min.css create mode 100644 www/bower_components/angular-material/modules/closure/icon/icon.min.js create mode 100644 www/bower_components/angular-material/modules/closure/input/input-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/input/input-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/input/input.css create mode 100644 www/bower_components/angular-material/modules/closure/input/input.js create mode 100644 www/bower_components/angular-material/modules/closure/input/input.min.css create mode 100644 www/bower_components/angular-material/modules/closure/input/input.min.js create mode 100644 www/bower_components/angular-material/modules/closure/list/list-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/list/list-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/list/list.css create mode 100644 www/bower_components/angular-material/modules/closure/list/list.js create mode 100644 www/bower_components/angular-material/modules/closure/list/list.min.css create mode 100644 www/bower_components/angular-material/modules/closure/list/list.min.js create mode 100644 www/bower_components/angular-material/modules/closure/menu/menu-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/menu/menu-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/menu/menu.css create mode 100644 www/bower_components/angular-material/modules/closure/menu/menu.js create mode 100644 www/bower_components/angular-material/modules/closure/menu/menu.min.css create mode 100644 www/bower_components/angular-material/modules/closure/menu/menu.min.js create mode 100644 www/bower_components/angular-material/modules/closure/menuBar/menuBar-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/menuBar/menuBar-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/menuBar/menuBar.css create mode 100644 www/bower_components/angular-material/modules/closure/menuBar/menuBar.js create mode 100644 www/bower_components/angular-material/modules/closure/menuBar/menuBar.min.css create mode 100644 www/bower_components/angular-material/modules/closure/menuBar/menuBar.min.js create mode 100644 www/bower_components/angular-material/modules/closure/navBar/navBar-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/navBar/navBar-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/navBar/navBar.css create mode 100644 www/bower_components/angular-material/modules/closure/navBar/navBar.js create mode 100644 www/bower_components/angular-material/modules/closure/navBar/navBar.min.css create mode 100644 www/bower_components/angular-material/modules/closure/navBar/navBar.min.js create mode 100644 www/bower_components/angular-material/modules/closure/panel/panel-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/panel/panel-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/panel/panel.css create mode 100644 www/bower_components/angular-material/modules/closure/panel/panel.js create mode 100644 www/bower_components/angular-material/modules/closure/panel/panel.min.css create mode 100644 www/bower_components/angular-material/modules/closure/panel/panel.min.js create mode 100644 www/bower_components/angular-material/modules/closure/progressCircular/progressCircular-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/progressCircular/progressCircular-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/progressCircular/progressCircular.css create mode 100644 www/bower_components/angular-material/modules/closure/progressCircular/progressCircular.js create mode 100644 www/bower_components/angular-material/modules/closure/progressCircular/progressCircular.min.css create mode 100644 www/bower_components/angular-material/modules/closure/progressCircular/progressCircular.min.js create mode 100644 www/bower_components/angular-material/modules/closure/progressLinear/progressLinear-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/progressLinear/progressLinear-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/progressLinear/progressLinear.css create mode 100644 www/bower_components/angular-material/modules/closure/progressLinear/progressLinear.js create mode 100644 www/bower_components/angular-material/modules/closure/progressLinear/progressLinear.min.css create mode 100644 www/bower_components/angular-material/modules/closure/progressLinear/progressLinear.min.js create mode 100644 www/bower_components/angular-material/modules/closure/radioButton/radioButton-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/radioButton/radioButton-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/radioButton/radioButton.css create mode 100644 www/bower_components/angular-material/modules/closure/radioButton/radioButton.js create mode 100644 www/bower_components/angular-material/modules/closure/radioButton/radioButton.min.css create mode 100644 www/bower_components/angular-material/modules/closure/radioButton/radioButton.min.js create mode 100644 www/bower_components/angular-material/modules/closure/select/select-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/select/select-default-theme.min.css create mode 100755 www/bower_components/angular-material/modules/closure/select/select.css create mode 100755 www/bower_components/angular-material/modules/closure/select/select.js create mode 100755 www/bower_components/angular-material/modules/closure/select/select.min.css create mode 100755 www/bower_components/angular-material/modules/closure/select/select.min.js create mode 100644 www/bower_components/angular-material/modules/closure/showHide/showHide.js create mode 100644 www/bower_components/angular-material/modules/closure/showHide/showHide.min.js create mode 100644 www/bower_components/angular-material/modules/closure/sidenav/sidenav-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/sidenav/sidenav-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/sidenav/sidenav.css create mode 100644 www/bower_components/angular-material/modules/closure/sidenav/sidenav.js create mode 100644 www/bower_components/angular-material/modules/closure/sidenav/sidenav.min.css create mode 100644 www/bower_components/angular-material/modules/closure/sidenav/sidenav.min.js create mode 100644 www/bower_components/angular-material/modules/closure/slider/slider-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/slider/slider-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/slider/slider.css create mode 100644 www/bower_components/angular-material/modules/closure/slider/slider.js create mode 100644 www/bower_components/angular-material/modules/closure/slider/slider.min.css create mode 100644 www/bower_components/angular-material/modules/closure/slider/slider.min.js create mode 100644 www/bower_components/angular-material/modules/closure/sticky/sticky.css create mode 100644 www/bower_components/angular-material/modules/closure/sticky/sticky.js create mode 100644 www/bower_components/angular-material/modules/closure/sticky/sticky.min.css create mode 100644 www/bower_components/angular-material/modules/closure/sticky/sticky.min.js create mode 100644 www/bower_components/angular-material/modules/closure/subheader/subheader-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/subheader/subheader-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/subheader/subheader.css create mode 100644 www/bower_components/angular-material/modules/closure/subheader/subheader.js create mode 100644 www/bower_components/angular-material/modules/closure/subheader/subheader.min.css create mode 100644 www/bower_components/angular-material/modules/closure/subheader/subheader.min.js create mode 100644 www/bower_components/angular-material/modules/closure/swipe/swipe.js create mode 100644 www/bower_components/angular-material/modules/closure/swipe/swipe.min.js create mode 100644 www/bower_components/angular-material/modules/closure/switch/switch-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/switch/switch-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/switch/switch.css create mode 100644 www/bower_components/angular-material/modules/closure/switch/switch.js create mode 100644 www/bower_components/angular-material/modules/closure/switch/switch.min.css create mode 100644 www/bower_components/angular-material/modules/closure/switch/switch.min.js create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs-arrow.svg create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs.css create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs.js create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs.min.css create mode 100644 www/bower_components/angular-material/modules/closure/tabs/tabs.min.js create mode 100644 www/bower_components/angular-material/modules/closure/textField/textField-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/textField/textField.css create mode 100644 www/bower_components/angular-material/modules/closure/textField/textField.js create mode 100644 www/bower_components/angular-material/modules/closure/toast/toast-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/toast/toast-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/toast/toast.css create mode 100644 www/bower_components/angular-material/modules/closure/toast/toast.js create mode 100644 www/bower_components/angular-material/modules/closure/toast/toast.min.css create mode 100644 www/bower_components/angular-material/modules/closure/toast/toast.min.js create mode 100644 www/bower_components/angular-material/modules/closure/toolbar/toolbar-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/toolbar/toolbar-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/toolbar/toolbar.css create mode 100644 www/bower_components/angular-material/modules/closure/toolbar/toolbar.js create mode 100644 www/bower_components/angular-material/modules/closure/toolbar/toolbar.min.css create mode 100644 www/bower_components/angular-material/modules/closure/toolbar/toolbar.min.js create mode 100644 www/bower_components/angular-material/modules/closure/tooltip/tooltip-default-theme.css create mode 100644 www/bower_components/angular-material/modules/closure/tooltip/tooltip-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/closure/tooltip/tooltip.css create mode 100644 www/bower_components/angular-material/modules/closure/tooltip/tooltip.js create mode 100644 www/bower_components/angular-material/modules/closure/tooltip/tooltip.min.css create mode 100644 www/bower_components/angular-material/modules/closure/tooltip/tooltip.min.js create mode 100644 www/bower_components/angular-material/modules/closure/truncate/truncate.css create mode 100644 www/bower_components/angular-material/modules/closure/truncate/truncate.js create mode 100644 www/bower_components/angular-material/modules/closure/truncate/truncate.min.css create mode 100644 www/bower_components/angular-material/modules/closure/truncate/truncate.min.js create mode 100644 www/bower_components/angular-material/modules/closure/virtualRepeat/virtualRepeat.css create mode 100644 www/bower_components/angular-material/modules/closure/virtualRepeat/virtualRepeat.js create mode 100644 www/bower_components/angular-material/modules/closure/virtualRepeat/virtualRepeat.min.css create mode 100644 www/bower_components/angular-material/modules/closure/virtualRepeat/virtualRepeat.min.js create mode 100644 www/bower_components/angular-material/modules/closure/whiteframe/whiteframe.css create mode 100644 www/bower_components/angular-material/modules/closure/whiteframe/whiteframe.js create mode 100644 www/bower_components/angular-material/modules/closure/whiteframe/whiteframe.min.css create mode 100644 www/bower_components/angular-material/modules/closure/whiteframe/whiteframe.min.js create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/autocomplete-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/autocomplete-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/autocomplete.css create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/autocomplete.js create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/autocomplete.min.css create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/autocomplete.min.js create mode 100644 www/bower_components/angular-material/modules/js/autocomplete/bower.json create mode 100644 www/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/backdrop/backdrop.css create mode 100644 www/bower_components/angular-material/modules/js/backdrop/backdrop.js create mode 100644 www/bower_components/angular-material/modules/js/backdrop/backdrop.min.css create mode 100644 www/bower_components/angular-material/modules/js/backdrop/backdrop.min.js create mode 100644 www/bower_components/angular-material/modules/js/backdrop/bower.json create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.css create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.js create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.css create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.js create mode 100644 www/bower_components/angular-material/modules/js/bottomSheet/bower.json create mode 100644 www/bower_components/angular-material/modules/js/button/bower.json create mode 100644 www/bower_components/angular-material/modules/js/button/button-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/button/button-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/button/button.css create mode 100644 www/bower_components/angular-material/modules/js/button/button.js create mode 100644 www/bower_components/angular-material/modules/js/button/button.min.css create mode 100644 www/bower_components/angular-material/modules/js/button/button.min.js create mode 100644 www/bower_components/angular-material/modules/js/card/bower.json create mode 100644 www/bower_components/angular-material/modules/js/card/card-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/card/card-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/card/card.css create mode 100644 www/bower_components/angular-material/modules/js/card/card.js create mode 100644 www/bower_components/angular-material/modules/js/card/card.min.css create mode 100644 www/bower_components/angular-material/modules/js/card/card.min.js create mode 100644 www/bower_components/angular-material/modules/js/checkbox/bower.json create mode 100644 www/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/checkbox/checkbox.css create mode 100644 www/bower_components/angular-material/modules/js/checkbox/checkbox.js create mode 100644 www/bower_components/angular-material/modules/js/checkbox/checkbox.min.css create mode 100644 www/bower_components/angular-material/modules/js/checkbox/checkbox.min.js create mode 100644 www/bower_components/angular-material/modules/js/chips/bower.json create mode 100644 www/bower_components/angular-material/modules/js/chips/chips-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/chips/chips-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/chips/chips.css create mode 100644 www/bower_components/angular-material/modules/js/chips/chips.js create mode 100644 www/bower_components/angular-material/modules/js/chips/chips.min.css create mode 100644 www/bower_components/angular-material/modules/js/chips/chips.min.js create mode 100644 www/bower_components/angular-material/modules/js/colors/bower.json create mode 100644 www/bower_components/angular-material/modules/js/colors/colors.js create mode 100644 www/bower_components/angular-material/modules/js/colors/colors.min.js create mode 100644 www/bower_components/angular-material/modules/js/content/bower.json create mode 100644 www/bower_components/angular-material/modules/js/content/content-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/content/content-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/content/content.css create mode 100644 www/bower_components/angular-material/modules/js/content/content.js create mode 100644 www/bower_components/angular-material/modules/js/content/content.min.css create mode 100644 www/bower_components/angular-material/modules/js/content/content.min.js create mode 100644 www/bower_components/angular-material/modules/js/core/bower.json create mode 100644 www/bower_components/angular-material/modules/js/core/core-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/core/core-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/core/core.css create mode 100644 www/bower_components/angular-material/modules/js/core/core.js create mode 100644 www/bower_components/angular-material/modules/js/core/core.min.css create mode 100644 www/bower_components/angular-material/modules/js/core/core.min.js create mode 100644 www/bower_components/angular-material/modules/js/core/default-theme.js create mode 100644 www/bower_components/angular-material/modules/js/datepicker/bower.json create mode 100644 www/bower_components/angular-material/modules/js/datepicker/datepicker-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/datepicker/datepicker-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/datepicker/datepicker.css create mode 100644 www/bower_components/angular-material/modules/js/datepicker/datepicker.js create mode 100644 www/bower_components/angular-material/modules/js/datepicker/datepicker.min.css create mode 100644 www/bower_components/angular-material/modules/js/datepicker/datepicker.min.js create mode 100644 www/bower_components/angular-material/modules/js/dialog/bower.json create mode 100644 www/bower_components/angular-material/modules/js/dialog/dialog-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/dialog/dialog-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/dialog/dialog.css create mode 100644 www/bower_components/angular-material/modules/js/dialog/dialog.js create mode 100644 www/bower_components/angular-material/modules/js/dialog/dialog.min.css create mode 100644 www/bower_components/angular-material/modules/js/dialog/dialog.min.js create mode 100644 www/bower_components/angular-material/modules/js/divider/bower.json create mode 100644 www/bower_components/angular-material/modules/js/divider/divider-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/divider/divider-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/divider/divider.css create mode 100644 www/bower_components/angular-material/modules/js/divider/divider.js create mode 100644 www/bower_components/angular-material/modules/js/divider/divider.min.css create mode 100644 www/bower_components/angular-material/modules/js/divider/divider.min.js create mode 100644 www/bower_components/angular-material/modules/js/fabActions/bower.json create mode 100644 www/bower_components/angular-material/modules/js/fabActions/fabActions.js create mode 100644 www/bower_components/angular-material/modules/js/fabActions/fabActions.min.js create mode 100644 www/bower_components/angular-material/modules/js/fabSpeedDial/bower.json create mode 100644 www/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.css create mode 100644 www/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.js create mode 100644 www/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.min.css create mode 100644 www/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.min.js create mode 100644 www/bower_components/angular-material/modules/js/fabToolbar/bower.json create mode 100644 www/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.css create mode 100644 www/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.js create mode 100644 www/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.min.css create mode 100644 www/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.min.js create mode 100644 www/bower_components/angular-material/modules/js/fabTrigger/bower.json create mode 100644 www/bower_components/angular-material/modules/js/fabTrigger/fabTrigger.js create mode 100644 www/bower_components/angular-material/modules/js/fabTrigger/fabTrigger.min.js create mode 100644 www/bower_components/angular-material/modules/js/gridList/bower.json create mode 100644 www/bower_components/angular-material/modules/js/gridList/gridList.css create mode 100644 www/bower_components/angular-material/modules/js/gridList/gridList.js create mode 100644 www/bower_components/angular-material/modules/js/gridList/gridList.min.css create mode 100644 www/bower_components/angular-material/modules/js/gridList/gridList.min.js create mode 100644 www/bower_components/angular-material/modules/js/icon/bower.json create mode 100644 www/bower_components/angular-material/modules/js/icon/icon-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/icon/icon-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/icon/icon.css create mode 100644 www/bower_components/angular-material/modules/js/icon/icon.js create mode 100644 www/bower_components/angular-material/modules/js/icon/icon.min.css create mode 100644 www/bower_components/angular-material/modules/js/icon/icon.min.js create mode 100644 www/bower_components/angular-material/modules/js/input/bower.json create mode 100644 www/bower_components/angular-material/modules/js/input/input-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/input/input-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/input/input.css create mode 100644 www/bower_components/angular-material/modules/js/input/input.js create mode 100644 www/bower_components/angular-material/modules/js/input/input.min.css create mode 100644 www/bower_components/angular-material/modules/js/input/input.min.js create mode 100644 www/bower_components/angular-material/modules/js/list/bower.json create mode 100644 www/bower_components/angular-material/modules/js/list/list-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/list/list-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/list/list.css create mode 100644 www/bower_components/angular-material/modules/js/list/list.js create mode 100644 www/bower_components/angular-material/modules/js/list/list.min.css create mode 100644 www/bower_components/angular-material/modules/js/list/list.min.js create mode 100644 www/bower_components/angular-material/modules/js/menu/bower.json create mode 100644 www/bower_components/angular-material/modules/js/menu/menu-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/menu/menu-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/menu/menu.css create mode 100644 www/bower_components/angular-material/modules/js/menu/menu.js create mode 100644 www/bower_components/angular-material/modules/js/menu/menu.min.css create mode 100644 www/bower_components/angular-material/modules/js/menu/menu.min.js create mode 100644 www/bower_components/angular-material/modules/js/menuBar/bower.json create mode 100644 www/bower_components/angular-material/modules/js/menuBar/menuBar-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/menuBar/menuBar-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/menuBar/menuBar.css create mode 100644 www/bower_components/angular-material/modules/js/menuBar/menuBar.js create mode 100644 www/bower_components/angular-material/modules/js/menuBar/menuBar.min.css create mode 100644 www/bower_components/angular-material/modules/js/menuBar/menuBar.min.js create mode 100644 www/bower_components/angular-material/modules/js/navBar/bower.json create mode 100644 www/bower_components/angular-material/modules/js/navBar/navBar-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/navBar/navBar-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/navBar/navBar.css create mode 100644 www/bower_components/angular-material/modules/js/navBar/navBar.js create mode 100644 www/bower_components/angular-material/modules/js/navBar/navBar.min.css create mode 100644 www/bower_components/angular-material/modules/js/navBar/navBar.min.js create mode 100644 www/bower_components/angular-material/modules/js/panel/bower.json create mode 100644 www/bower_components/angular-material/modules/js/panel/panel-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/panel/panel-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/panel/panel.css create mode 100644 www/bower_components/angular-material/modules/js/panel/panel.js create mode 100644 www/bower_components/angular-material/modules/js/panel/panel.min.css create mode 100644 www/bower_components/angular-material/modules/js/panel/panel.min.js create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/bower.json create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/progressCircular.css create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/progressCircular.js create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.css create mode 100644 www/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.js create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/bower.json create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/progressLinear.css create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/progressLinear.js create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.css create mode 100644 www/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.js create mode 100644 www/bower_components/angular-material/modules/js/radioButton/bower.json create mode 100644 www/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/radioButton/radioButton.css create mode 100644 www/bower_components/angular-material/modules/js/radioButton/radioButton.js create mode 100644 www/bower_components/angular-material/modules/js/radioButton/radioButton.min.css create mode 100644 www/bower_components/angular-material/modules/js/radioButton/radioButton.min.js create mode 100644 www/bower_components/angular-material/modules/js/select/bower.json create mode 100644 www/bower_components/angular-material/modules/js/select/select-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/select/select-default-theme.min.css create mode 100755 www/bower_components/angular-material/modules/js/select/select.css create mode 100755 www/bower_components/angular-material/modules/js/select/select.js create mode 100755 www/bower_components/angular-material/modules/js/select/select.min.css create mode 100755 www/bower_components/angular-material/modules/js/select/select.min.js create mode 100644 www/bower_components/angular-material/modules/js/showHide/bower.json create mode 100644 www/bower_components/angular-material/modules/js/showHide/showHide.js create mode 100644 www/bower_components/angular-material/modules/js/showHide/showHide.min.js create mode 100644 www/bower_components/angular-material/modules/js/sidenav/bower.json create mode 100644 www/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/sidenav/sidenav.css create mode 100644 www/bower_components/angular-material/modules/js/sidenav/sidenav.js create mode 100644 www/bower_components/angular-material/modules/js/sidenav/sidenav.min.css create mode 100644 www/bower_components/angular-material/modules/js/sidenav/sidenav.min.js create mode 100644 www/bower_components/angular-material/modules/js/slider/bower.json create mode 100644 www/bower_components/angular-material/modules/js/slider/slider-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/slider/slider-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/slider/slider.css create mode 100644 www/bower_components/angular-material/modules/js/slider/slider.js create mode 100644 www/bower_components/angular-material/modules/js/slider/slider.min.css create mode 100644 www/bower_components/angular-material/modules/js/slider/slider.min.js create mode 100644 www/bower_components/angular-material/modules/js/sticky/bower.json create mode 100644 www/bower_components/angular-material/modules/js/sticky/sticky.css create mode 100644 www/bower_components/angular-material/modules/js/sticky/sticky.js create mode 100644 www/bower_components/angular-material/modules/js/sticky/sticky.min.css create mode 100644 www/bower_components/angular-material/modules/js/sticky/sticky.min.js create mode 100644 www/bower_components/angular-material/modules/js/subheader/bower.json create mode 100644 www/bower_components/angular-material/modules/js/subheader/subheader-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/subheader/subheader-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/subheader/subheader.css create mode 100644 www/bower_components/angular-material/modules/js/subheader/subheader.js create mode 100644 www/bower_components/angular-material/modules/js/subheader/subheader.min.css create mode 100644 www/bower_components/angular-material/modules/js/subheader/subheader.min.js create mode 100644 www/bower_components/angular-material/modules/js/swipe/bower.json create mode 100644 www/bower_components/angular-material/modules/js/swipe/swipe.js create mode 100644 www/bower_components/angular-material/modules/js/swipe/swipe.min.js create mode 100644 www/bower_components/angular-material/modules/js/switch/bower.json create mode 100644 www/bower_components/angular-material/modules/js/switch/switch-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/switch/switch-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/switch/switch.css create mode 100644 www/bower_components/angular-material/modules/js/switch/switch.js create mode 100644 www/bower_components/angular-material/modules/js/switch/switch.min.css create mode 100644 www/bower_components/angular-material/modules/js/switch/switch.min.js create mode 100644 www/bower_components/angular-material/modules/js/tabs/bower.json create mode 100644 www/bower_components/angular-material/modules/js/tabs/tabs-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/tabs/tabs-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/tabs/tabs.css create mode 100644 www/bower_components/angular-material/modules/js/tabs/tabs.js create mode 100644 www/bower_components/angular-material/modules/js/tabs/tabs.min.css create mode 100644 www/bower_components/angular-material/modules/js/tabs/tabs.min.js create mode 100644 www/bower_components/angular-material/modules/js/textField/bower.json create mode 100644 www/bower_components/angular-material/modules/js/textField/textField-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/textField/textField-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/textField/textField.css create mode 100644 www/bower_components/angular-material/modules/js/textField/textField.js create mode 100644 www/bower_components/angular-material/modules/js/textField/textField.min.css create mode 100644 www/bower_components/angular-material/modules/js/textField/textField.min.js create mode 100644 www/bower_components/angular-material/modules/js/toast/bower.json create mode 100644 www/bower_components/angular-material/modules/js/toast/toast-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/toast/toast-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/toast/toast.css create mode 100644 www/bower_components/angular-material/modules/js/toast/toast.js create mode 100644 www/bower_components/angular-material/modules/js/toast/toast.min.css create mode 100644 www/bower_components/angular-material/modules/js/toast/toast.min.js create mode 100644 www/bower_components/angular-material/modules/js/toolbar/bower.json create mode 100644 www/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/toolbar/toolbar.css create mode 100644 www/bower_components/angular-material/modules/js/toolbar/toolbar.js create mode 100644 www/bower_components/angular-material/modules/js/toolbar/toolbar.min.css create mode 100644 www/bower_components/angular-material/modules/js/toolbar/toolbar.min.js create mode 100644 www/bower_components/angular-material/modules/js/tooltip/bower.json create mode 100644 www/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.css create mode 100644 www/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.min.css create mode 100644 www/bower_components/angular-material/modules/js/tooltip/tooltip.css create mode 100644 www/bower_components/angular-material/modules/js/tooltip/tooltip.js create mode 100644 www/bower_components/angular-material/modules/js/tooltip/tooltip.min.css create mode 100644 www/bower_components/angular-material/modules/js/tooltip/tooltip.min.js create mode 100644 www/bower_components/angular-material/modules/js/truncate/bower.json create mode 100644 www/bower_components/angular-material/modules/js/truncate/truncate.css create mode 100644 www/bower_components/angular-material/modules/js/truncate/truncate.js create mode 100644 www/bower_components/angular-material/modules/js/truncate/truncate.min.css create mode 100644 www/bower_components/angular-material/modules/js/truncate/truncate.min.js create mode 100644 www/bower_components/angular-material/modules/js/virtualRepeat/bower.json create mode 100644 www/bower_components/angular-material/modules/js/virtualRepeat/virtualRepeat.css create mode 100644 www/bower_components/angular-material/modules/js/virtualRepeat/virtualRepeat.js create mode 100644 www/bower_components/angular-material/modules/js/virtualRepeat/virtualRepeat.min.css create mode 100644 www/bower_components/angular-material/modules/js/virtualRepeat/virtualRepeat.min.js create mode 100644 www/bower_components/angular-material/modules/js/whiteframe/bower.json create mode 100644 www/bower_components/angular-material/modules/js/whiteframe/whiteframe.css create mode 100644 www/bower_components/angular-material/modules/js/whiteframe/whiteframe.js create mode 100644 www/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.css create mode 100644 www/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.js create mode 100644 www/bower_components/angular-material/modules/layouts/angular-material.layout-attributes.css create mode 100644 www/bower_components/angular-material/modules/layouts/angular-material.layout-attributes.min.css create mode 100644 www/bower_components/angular-material/modules/layouts/angular-material.layouts.css create mode 100644 www/bower_components/angular-material/modules/layouts/angular-material.layouts.ie_fixes.css create mode 100644 www/bower_components/angular-material/modules/layouts/angular-material.layouts.min.css create mode 100644 www/bower_components/angular-material/modules/scss/angular-material.layout-attributes.scss create mode 100644 www/bower_components/angular-material/modules/scss/angular-material.layouts.scss create mode 100644 www/bower_components/angular-material/modules/scss/angular-material.scss create mode 100644 www/bower_components/angular-material/package.json create mode 100644 www/bower_components/angular-messages/.bower.json create mode 100644 www/bower_components/angular-messages/LICENSE.md create mode 100644 www/bower_components/angular-messages/README.md create mode 100644 www/bower_components/angular-messages/angular-messages.js create mode 100644 www/bower_components/angular-messages/angular-messages.min.js create mode 100644 www/bower_components/angular-messages/angular-messages.min.js.map create mode 100644 www/bower_components/angular-messages/bower.json create mode 100644 www/bower_components/angular-messages/index.js create mode 100644 www/bower_components/angular-messages/package.json create mode 100644 www/bower_components/angular-route/.bower.json create mode 100644 www/bower_components/angular-route/LICENSE.md create mode 100644 www/bower_components/angular-route/README.md create mode 100644 www/bower_components/angular-route/angular-route.js create mode 100644 www/bower_components/angular-route/angular-route.min.js create mode 100644 www/bower_components/angular-route/angular-route.min.js.map create mode 100644 www/bower_components/angular-route/bower.json create mode 100644 www/bower_components/angular-route/index.js create mode 100644 www/bower_components/angular-route/package.json create mode 100644 www/bower_components/angular-socket-io/.bower.json create mode 100644 www/bower_components/angular-socket-io/.gitignore create mode 100644 www/bower_components/angular-socket-io/.travis.yml create mode 100644 www/bower_components/angular-socket-io/README.md create mode 100644 www/bower_components/angular-socket-io/bower.json create mode 100644 www/bower_components/angular-socket-io/gulpfile.js create mode 100644 www/bower_components/angular-socket-io/karma.conf.js create mode 100644 www/bower_components/angular-socket-io/mock/socket-io.js create mode 100755 www/bower_components/angular-socket-io/npm-install.sh create mode 100644 www/bower_components/angular-socket-io/package.json create mode 100644 www/bower_components/angular-socket-io/socket.js create mode 100644 www/bower_components/angular-socket-io/socket.min.js create mode 100644 www/bower_components/angular-socket-io/socket.min.js.map create mode 100644 www/bower_components/angular-socket-io/socket.spec.js create mode 100644 www/bower_components/angular/.bower.json create mode 100644 www/bower_components/angular/LICENSE.md create mode 100644 www/bower_components/angular/README.md create mode 100644 www/bower_components/angular/angular-csp.css create mode 100644 www/bower_components/angular/angular.js create mode 100644 www/bower_components/angular/angular.min.js create mode 100644 www/bower_components/angular/angular.min.js.gzip create mode 100644 www/bower_components/angular/angular.min.js.map create mode 100644 www/bower_components/angular/bower.json create mode 100644 www/bower_components/angular/index.js create mode 100644 www/bower_components/angular/package.json create mode 100644 www/chat/chat.html create mode 100644 www/chat/chat.js create mode 100644 www/css/colors.css create mode 100644 www/css/main.css create mode 100644 www/index.html create mode 100644 www/index.js create mode 120000 www/node_modules/.bin/ecstatic create mode 120000 www/node_modules/.bin/he create mode 120000 www/node_modules/.bin/hs create mode 120000 www/node_modules/.bin/http-server create mode 120000 www/node_modules/.bin/mime create mode 120000 www/node_modules/.bin/mkdirp create mode 120000 www/node_modules/.bin/opener create mode 100644 www/node_modules/async/.travis.yml create mode 100644 www/node_modules/async/LICENSE create mode 100644 www/node_modules/async/README.md create mode 100644 www/node_modules/async/component.json create mode 100755 www/node_modules/async/lib/async.js create mode 100644 www/node_modules/async/package.json create mode 100644 www/node_modules/colors/.travis.yml create mode 100644 www/node_modules/colors/MIT-LICENSE.txt create mode 100644 www/node_modules/colors/ReadMe.md create mode 100644 www/node_modules/colors/examples/normal-usage.js create mode 100644 www/node_modules/colors/examples/safe-string.js create mode 100644 www/node_modules/colors/lib/colors.js create mode 100644 www/node_modules/colors/lib/custom/trap.js create mode 100644 www/node_modules/colors/lib/custom/zalgo.js create mode 100644 www/node_modules/colors/lib/extendStringPrototype.js create mode 100644 www/node_modules/colors/lib/index.js create mode 100644 www/node_modules/colors/lib/maps/america.js create mode 100644 www/node_modules/colors/lib/maps/rainbow.js create mode 100644 www/node_modules/colors/lib/maps/random.js create mode 100644 www/node_modules/colors/lib/maps/zebra.js create mode 100644 www/node_modules/colors/lib/styles.js create mode 100644 www/node_modules/colors/lib/system/supports-colors.js create mode 100644 www/node_modules/colors/package.json create mode 100644 www/node_modules/colors/safe.js create mode 100644 www/node_modules/colors/screenshots/colors.png create mode 100644 www/node_modules/colors/tests/basic-test.js create mode 100644 www/node_modules/colors/tests/safe-test.js create mode 100644 www/node_modules/colors/themes/generic-logging.js create mode 100644 www/node_modules/corser/.npmignore create mode 100644 www/node_modules/corser/.travis.yml create mode 100644 www/node_modules/corser/LICENSE create mode 100644 www/node_modules/corser/README.md create mode 100644 www/node_modules/corser/lib/corser.js create mode 100644 www/node_modules/corser/package.json create mode 100644 www/node_modules/ecstatic/.npmignore create mode 100644 www/node_modules/ecstatic/.travis.yml create mode 100644 www/node_modules/ecstatic/CHANGELOG.md create mode 100644 www/node_modules/ecstatic/CONTRIBUTING.md create mode 100644 www/node_modules/ecstatic/CONTRIBUTORS.md create mode 100644 www/node_modules/ecstatic/LICENSE.txt create mode 100644 www/node_modules/ecstatic/README.md create mode 100644 www/node_modules/ecstatic/example/core.js create mode 100644 www/node_modules/ecstatic/example/express.js create mode 100644 www/node_modules/ecstatic/example/public/beep/index.html create mode 100644 www/node_modules/ecstatic/example/public/hello.txt create mode 100644 www/node_modules/ecstatic/example/public/subdir/world.txt create mode 100644 www/node_modules/ecstatic/example/public/turtle.png create mode 100644 www/node_modules/ecstatic/example/union.js create mode 100755 www/node_modules/ecstatic/lib/ecstatic.js create mode 100644 www/node_modules/ecstatic/lib/ecstatic/aliases.json create mode 100644 www/node_modules/ecstatic/lib/ecstatic/defaults.json create mode 100644 www/node_modules/ecstatic/lib/ecstatic/etag.js create mode 100644 www/node_modules/ecstatic/lib/ecstatic/opts.js create mode 100644 www/node_modules/ecstatic/lib/ecstatic/showdir.js create mode 100644 www/node_modules/ecstatic/lib/ecstatic/status-handlers.js create mode 100644 www/node_modules/ecstatic/package.json create mode 100644 www/node_modules/ecstatic/test.js create mode 100644 www/node_modules/eventemitter3/LICENSE create mode 100644 www/node_modules/eventemitter3/README.md create mode 100644 www/node_modules/eventemitter3/index.js create mode 100644 www/node_modules/eventemitter3/package.json create mode 100644 www/node_modules/he/LICENSE-MIT.txt create mode 100644 www/node_modules/he/README.md create mode 100755 www/node_modules/he/bin/he create mode 100644 www/node_modules/he/he.js create mode 100644 www/node_modules/he/man/he.1 create mode 100644 www/node_modules/he/package.json create mode 100644 www/node_modules/http-proxy/.npmignore create mode 100644 www/node_modules/http-proxy/LICENSE create mode 100644 www/node_modules/http-proxy/README.md create mode 100644 www/node_modules/http-proxy/index.js create mode 100644 www/node_modules/http-proxy/lib/http-proxy.js create mode 100644 www/node_modules/http-proxy/lib/http-proxy/common.js create mode 100644 www/node_modules/http-proxy/lib/http-proxy/index.js create mode 100644 www/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js create mode 100644 www/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js create mode 100644 www/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js create mode 100644 www/node_modules/http-proxy/package.json create mode 100644 www/node_modules/http-server/.npmignore create mode 100644 www/node_modules/http-server/.travis.yml create mode 100644 www/node_modules/http-server/LICENSE create mode 100644 www/node_modules/http-server/README.md create mode 100755 www/node_modules/http-server/bin/http-server create mode 100644 www/node_modules/http-server/lib/http-server.js create mode 100644 www/node_modules/http-server/package.json create mode 100644 www/node_modules/http-server/public/404.html create mode 100644 www/node_modules/http-server/public/img/turtle.png create mode 100644 www/node_modules/http-server/public/index.html create mode 100644 www/node_modules/http-server/screenshots/directory.png create mode 100644 www/node_modules/http-server/screenshots/public.png create mode 100644 www/node_modules/http-server/screenshots/start.png create mode 100644 www/node_modules/http-server/test/fixtures/root/canYouSeeMe create mode 100644 www/node_modules/http-server/test/fixtures/root/file create mode 100644 www/node_modules/http-server/test/http-server-test.js create mode 100644 www/node_modules/mime/.npmignore create mode 100644 www/node_modules/mime/LICENSE create mode 100644 www/node_modules/mime/README.md create mode 100644 www/node_modules/mime/build/build.js create mode 100644 www/node_modules/mime/build/test.js create mode 100755 www/node_modules/mime/cli.js create mode 100644 www/node_modules/mime/mime.js create mode 100644 www/node_modules/mime/package.json create mode 100644 www/node_modules/mime/types.json create mode 100644 www/node_modules/minimist/.travis.yml create mode 100644 www/node_modules/minimist/LICENSE create mode 100644 www/node_modules/minimist/example/parse.js create mode 100644 www/node_modules/minimist/index.js create mode 100644 www/node_modules/minimist/package.json create mode 100644 www/node_modules/minimist/readme.markdown create mode 100644 www/node_modules/minimist/test/all_bool.js create mode 100644 www/node_modules/minimist/test/bool.js create mode 100644 www/node_modules/minimist/test/dash.js create mode 100644 www/node_modules/minimist/test/default_bool.js create mode 100644 www/node_modules/minimist/test/dotted.js create mode 100644 www/node_modules/minimist/test/kv_short.js create mode 100644 www/node_modules/minimist/test/long.js create mode 100644 www/node_modules/minimist/test/num.js create mode 100644 www/node_modules/minimist/test/parse.js create mode 100644 www/node_modules/minimist/test/parse_modified.js create mode 100644 www/node_modules/minimist/test/short.js create mode 100644 www/node_modules/minimist/test/stop_early.js create mode 100644 www/node_modules/minimist/test/unknown.js create mode 100644 www/node_modules/minimist/test/whitespace.js create mode 100644 www/node_modules/mkdirp/.travis.yml create mode 100644 www/node_modules/mkdirp/LICENSE create mode 100755 www/node_modules/mkdirp/bin/cmd.js create mode 100644 www/node_modules/mkdirp/bin/usage.txt create mode 100644 www/node_modules/mkdirp/examples/pow.js create mode 100644 www/node_modules/mkdirp/index.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/.travis.yml create mode 100644 www/node_modules/mkdirp/node_modules/minimist/LICENSE create mode 100644 www/node_modules/mkdirp/node_modules/minimist/example/parse.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/index.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/package.json create mode 100644 www/node_modules/mkdirp/node_modules/minimist/readme.markdown create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/dash.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/default_bool.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/dotted.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/long.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/parse.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/short.js create mode 100644 www/node_modules/mkdirp/node_modules/minimist/test/whitespace.js create mode 100644 www/node_modules/mkdirp/package.json create mode 100644 www/node_modules/mkdirp/readme.markdown create mode 100644 www/node_modules/mkdirp/test/chmod.js create mode 100644 www/node_modules/mkdirp/test/clobber.js create mode 100644 www/node_modules/mkdirp/test/mkdirp.js create mode 100644 www/node_modules/mkdirp/test/opts_fs.js create mode 100644 www/node_modules/mkdirp/test/opts_fs_sync.js create mode 100644 www/node_modules/mkdirp/test/perm.js create mode 100644 www/node_modules/mkdirp/test/perm_sync.js create mode 100644 www/node_modules/mkdirp/test/race.js create mode 100644 www/node_modules/mkdirp/test/rel.js create mode 100644 www/node_modules/mkdirp/test/return.js create mode 100644 www/node_modules/mkdirp/test/return_sync.js create mode 100644 www/node_modules/mkdirp/test/root.js create mode 100644 www/node_modules/mkdirp/test/sync.js create mode 100644 www/node_modules/mkdirp/test/umask.js create mode 100644 www/node_modules/mkdirp/test/umask_sync.js create mode 100644 www/node_modules/opener/LICENSE.txt create mode 100755 www/node_modules/opener/opener.js create mode 100644 www/node_modules/opener/package.json create mode 100644 www/node_modules/optimist/.travis.yml create mode 100644 www/node_modules/optimist/LICENSE create mode 100644 www/node_modules/optimist/example/bool.js create mode 100644 www/node_modules/optimist/example/boolean_double.js create mode 100644 www/node_modules/optimist/example/boolean_single.js create mode 100644 www/node_modules/optimist/example/default_hash.js create mode 100644 www/node_modules/optimist/example/default_singles.js create mode 100644 www/node_modules/optimist/example/divide.js create mode 100644 www/node_modules/optimist/example/line_count.js create mode 100644 www/node_modules/optimist/example/line_count_options.js create mode 100644 www/node_modules/optimist/example/line_count_wrap.js create mode 100644 www/node_modules/optimist/example/nonopt.js create mode 100644 www/node_modules/optimist/example/reflect.js create mode 100644 www/node_modules/optimist/example/short.js create mode 100644 www/node_modules/optimist/example/string.js create mode 100644 www/node_modules/optimist/example/usage-options.js create mode 100644 www/node_modules/optimist/example/xup.js create mode 100644 www/node_modules/optimist/index.js create mode 100644 www/node_modules/optimist/node_modules/minimist/.travis.yml create mode 100644 www/node_modules/optimist/node_modules/minimist/LICENSE create mode 100644 www/node_modules/optimist/node_modules/minimist/example/parse.js create mode 100644 www/node_modules/optimist/node_modules/minimist/index.js create mode 100644 www/node_modules/optimist/node_modules/minimist/package.json create mode 100644 www/node_modules/optimist/node_modules/minimist/readme.markdown create mode 100644 www/node_modules/optimist/node_modules/minimist/test/bool.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/dash.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/default_bool.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/dotted.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/long.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/num.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/parse.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/parse_modified.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/short.js create mode 100644 www/node_modules/optimist/node_modules/minimist/test/whitespace.js create mode 100644 www/node_modules/optimist/package.json create mode 100644 www/node_modules/optimist/readme.markdown create mode 100644 www/node_modules/optimist/test/_.js create mode 100644 www/node_modules/optimist/test/_/argv.js create mode 100755 www/node_modules/optimist/test/_/bin.js create mode 100644 www/node_modules/optimist/test/dash.js create mode 100644 www/node_modules/optimist/test/parse.js create mode 100644 www/node_modules/optimist/test/parse_modified.js create mode 100644 www/node_modules/optimist/test/short.js create mode 100644 www/node_modules/optimist/test/usage.js create mode 100644 www/node_modules/optimist/test/whitespace.js create mode 100644 www/node_modules/portfinder/.npmignore create mode 100644 www/node_modules/portfinder/.travis.yml create mode 100644 www/node_modules/portfinder/LICENSE create mode 100644 www/node_modules/portfinder/README.md create mode 100644 www/node_modules/portfinder/lib/portfinder.js create mode 100644 www/node_modules/portfinder/package.json create mode 100644 www/node_modules/portfinder/test/fixtures/.gitkeep create mode 100644 www/node_modules/portfinder/test/port-finder-multiple-test.js create mode 100644 www/node_modules/portfinder/test/port-finder-socket-test.js create mode 100644 www/node_modules/portfinder/test/port-finder-test.js create mode 100644 www/node_modules/qs/.jshintignore create mode 100644 www/node_modules/qs/.jshintrc create mode 100644 www/node_modules/qs/.npmignore create mode 100644 www/node_modules/qs/.travis.yml create mode 100644 www/node_modules/qs/CHANGELOG.md create mode 100644 www/node_modules/qs/CONTRIBUTING.md create mode 100755 www/node_modules/qs/LICENSE create mode 100644 www/node_modules/qs/Makefile create mode 100755 www/node_modules/qs/README.md create mode 100644 www/node_modules/qs/index.js create mode 100755 www/node_modules/qs/lib/index.js create mode 100755 www/node_modules/qs/lib/parse.js create mode 100755 www/node_modules/qs/lib/stringify.js create mode 100755 www/node_modules/qs/lib/utils.js create mode 100644 www/node_modules/qs/package.json create mode 100755 www/node_modules/qs/test/parse.js create mode 100755 www/node_modules/qs/test/stringify.js create mode 100644 www/node_modules/requires-port/.npmignore create mode 100644 www/node_modules/requires-port/.travis.yml create mode 100644 www/node_modules/requires-port/LICENSE create mode 100644 www/node_modules/requires-port/README.md create mode 100644 www/node_modules/requires-port/index.js create mode 100644 www/node_modules/requires-port/package.json create mode 100644 www/node_modules/requires-port/test.js create mode 100644 www/node_modules/union/.npmignore create mode 100644 www/node_modules/union/.travis.yml create mode 100644 www/node_modules/union/CHANGELOG.md create mode 100644 www/node_modules/union/LICENSE create mode 100644 www/node_modules/union/README.md create mode 100644 www/node_modules/union/examples/after/index.js create mode 100644 www/node_modules/union/examples/simple/favicon.png create mode 100644 www/node_modules/union/examples/simple/middleware/favicon.js create mode 100644 www/node_modules/union/examples/simple/middleware/gzip-decode.js create mode 100644 www/node_modules/union/examples/simple/middleware/gzip-encode.js create mode 100644 www/node_modules/union/examples/simple/simple.js create mode 100644 www/node_modules/union/examples/simple/spdy.js create mode 100644 www/node_modules/union/examples/socketio/README create mode 100644 www/node_modules/union/examples/socketio/index.html create mode 100644 www/node_modules/union/examples/socketio/server.js create mode 100644 www/node_modules/union/lib/buffered-stream.js create mode 100644 www/node_modules/union/lib/core.js create mode 100644 www/node_modules/union/lib/http-stream.js create mode 100644 www/node_modules/union/lib/index.js create mode 100644 www/node_modules/union/lib/request-stream.js create mode 100644 www/node_modules/union/lib/response-stream.js create mode 100644 www/node_modules/union/lib/routing-stream.js create mode 100644 www/node_modules/union/package.json create mode 100644 www/node_modules/union/test/after-test.js create mode 100644 www/node_modules/union/test/body-parser-test.js create mode 100644 www/node_modules/union/test/double-write-test.js create mode 100644 www/node_modules/union/test/ecstatic-test.js create mode 100644 www/node_modules/union/test/fixtures/index.js create mode 100644 www/node_modules/union/test/fixtures/static/some-file.txt create mode 100644 www/node_modules/union/test/header-test.js create mode 100644 www/node_modules/union/test/helpers/index.js create mode 100644 www/node_modules/union/test/helpers/macros.js create mode 100644 www/node_modules/union/test/prop-test.js create mode 100644 www/node_modules/union/test/simple-test.js create mode 100644 www/node_modules/union/test/status-code-test.js create mode 100644 www/node_modules/union/test/streaming-test.js create mode 100644 www/node_modules/union/union.png create mode 100644 www/node_modules/url-join/.npmignore create mode 100644 www/node_modules/url-join/.travis.yml create mode 100644 www/node_modules/url-join/README.md create mode 100644 www/node_modules/url-join/bower.json create mode 100644 www/node_modules/url-join/lib/url-join.js create mode 100644 www/node_modules/url-join/package.json create mode 100644 www/node_modules/url-join/test/tests.js create mode 100644 www/node_modules/wordwrap/LICENSE create mode 100644 www/node_modules/wordwrap/README.markdown create mode 100644 www/node_modules/wordwrap/example/center.js create mode 100644 www/node_modules/wordwrap/example/meat.js create mode 100644 www/node_modules/wordwrap/index.js create mode 100644 www/node_modules/wordwrap/package.json create mode 100644 www/node_modules/wordwrap/test/break.js create mode 100644 www/node_modules/wordwrap/test/idleness.txt create mode 100644 www/node_modules/wordwrap/test/wrap.js create mode 100644 www/package.json create mode 100644 www/views/chat/chat.html create mode 100644 www/views/chat/chat.js diff --git a/README.md b/README.md index f7b71fa..41d364e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # socketioMEANseed seed for a MEAN webapp with socketio, angular-material for the frontend + +## seed project with + * MongoDB + * Expressjs + * Angularjs (with angular-material) + * Nodejs + * Socketio (angular-socket-io) + +## To init +on /server directory: +``` +npm start +``` + +on /www directory: +``` +npm start +``` diff --git a/server/controllers/adminController.js b/server/controllers/adminController.js new file mode 100644 index 0000000..9e42df0 --- /dev/null +++ b/server/controllers/adminController.js @@ -0,0 +1,109 @@ +var express = require('express'); +var app = express(); +var jwt = require('jsonwebtoken'); +var config = require('../config/config'); +var crypto = require('crypto'); + +app.set('superSecret', config.secret); + +/*******MODELS*********/ +//var trainerModel = require('../models/trainerModel'); +var userModel = require('../models/userModel'); +var dietModel = require('../models/dietModel'); +var routineModel = require('../models/routineModel'); + +/** GET '/admin/users/' **/ +exports.getUsers = function (req, res) { + userModel.find() + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .exec(function (err, users) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(users); + }); +}; +/** GET '/admin/users/:userid' **/ +exports.getUserById = function (req, res) { + userModel.findOne({_id: req.params.userid}) + .lean() + .populate('followers', 'name avatar') + .populate('following', 'name avatar') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'User not found.'}); + } else if (user) { + var nodes=[]; + var edges=[]; + var node={ + title: user.name, + label: user.name, + image: user.avatar, + shape: "image", + id: user._id + }; + nodes.push(node); + for(var i=0; i -1) { + /* True to day done*/ + diet.days[indexDay].done = true; + /* end of done*/ + diet.save(function (err) { + if (err) + return res.send(500, err.message); + res.status(200).jsonp(diet); + });//diet.save + }//End if when day foung + else { + res.json({success: false, message: 'Day not found'}); + } + }//End else if found diet + });//En dietModel for done = true + }//End else if (user) + });//En UserModel findOne() +};//End function diff --git a/server/controllers/publicationController.js b/server/controllers/publicationController.js new file mode 100644 index 0000000..eb54a61 --- /dev/null +++ b/server/controllers/publicationController.js @@ -0,0 +1,269 @@ +var express = require('express'); +var app = express(); +var publicationModel = require('../models/publicationModel'); +var userModel = require('../models/userModel'); +//var trainerModel = require('../models/trainerModel'); +var crypto = require('crypto'); + +/**GET '/publications' **/ +exports.getAllPublications = function (req, res) { + publicationModel.find() + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize)*Number(req.query.page)) + .lean() + .populate('user', 'name avatar') + .exec(function (err, publications) { + if (err) return res.send(500, err.message); + if (!publications) { + // + } else if (publications) { + res.status(200).jsonp(publications); + } + }); +}; +/** GET '/publications/getById/:publicationid' **/ +exports.getPublicationById = function (req, res) { + publicationModel.findOne({_id: req.params.publicationid}) + .lean() + .populate('likes', 'name avatar') + .exec(function (err, publication) { + if (err) return res.send(500, err.message); + if (!publication) { + res.json({success: false, message: 'publication not found.'}); + } else if (publication) { + res.status(200).jsonp(publication); + } + }); +}; +/**POST '/publications' **/ +exports.postPublication = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + //aquí ja hem agafat el user a partir del seu token + var publication = new publicationModel({ + title: req.body.title, + content: req.body.content, + date: new Date(), + user: user._id, + photo: req.body.photo + }); + //fins aquí tenim la variable publication amb els continguts + //ara cal 1r guardar el model publication a la base de dades + publication.save(function (err, publication) { + if (err) return res.send(500, err.message); + + //i 2n, afegir la id de la publicació generada al user.publications + user.publications.push(publication._id); + /* gamification */ + var reward = { + concept: "added new publication to Timeline", + date: Date(), + value: +1 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 1; + /* end of gamification */ + user.save(function (err, user) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user); + }); + }); + }//end else if + }); +}; + +/**GET '/users/:userid/publications' **/ +exports.getUserPublicationsByUserId = function (req, res) { + userModel.findOne({_id: req.params.userid}, function (err, user) { + if (err) return res.send(500, err.message); + }).populate('publications') + .exec(function (error, user) { + if (error !== null) res.send(500, error.message); + console.log(JSON.stringify(user, null, "\t")); + res.status(200).jsonp(user.publications); + }); +}; + +/**DELETE '/publications/:publicationid' **/ +exports.deletePublicationById = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + for (var i = 0; i < user.publications.length; i++) { + if (user.publications[i].equals(req.params.publicationid)) {//només si el user és qui ha fet la publication la pot esborrar + user.publications.splice(i, 1); + user.save(function (err, user) {//guardem l'user + if (err) return res.send(500, err.message); + + publicationModel.findByIdAndRemove({_id: req.params.publicationid}, function (err) { + if (err !== null) return res.send(500, err.message); + res.status(200).jsonp('Deleted'); + }); + }); + } + } + } + }); +}; + +/** POST '/publications/:publicationid/like' **/ +exports.likePublication = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + console.log(user.name); + //ara busquem el userB + publicationModel.findOne({_id: req.params.publicationid}, function (err, publication) { + if (err) return res.send(500, err.message); + if (!publication) { + res.json({success: false, message: 'publication not found.'}); + } else if (publication) { + + // for(var i=0; i -1) { + /* True to day done*/ + routine.days[indexDay].done = true; + /* end of done*/ + routine.save(function (err) { + if (err) + return res.send(500, err.message); + routineModel.findOne({_id: routine._id}) + .lean() + .populate('trainer', 'name avatar') + .populate('client', 'name avatar points.total') + .exec(function (err, routine) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(routine); + }); + });//Routine.save + }//End if when day foung + else { + res.json({success: false, message: 'Day not found'}); + } + }//End else if found routine + });//En routineModel for done = true + }//End else if (user) + });//En UserModel findOne() +};//End function diff --git a/server/controllers/runController.js b/server/controllers/runController.js new file mode 100644 index 0000000..8e67c76 --- /dev/null +++ b/server/controllers/runController.js @@ -0,0 +1,107 @@ +var express = require('express'); +var app = express(); +var runModel = require('../models/runModel'); +var publicationModel = require('../models/publicationModel'); +var userModel = require('../models/userModel'); +//var trainerModel = require('../models/trainerModel'); +var crypto = require('crypto'); + + +/**POST '/publications' **/ +exports.postRun = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + //aquí ja hem agafat el user a partir del seu token + var run = new runModel(req.body.newRun); + run.user=user._id; + //fins aquí tenim la variable publication amb els continguts + //ara cal 1r guardar el model publication a la base de dades + run.save(function (err, run) { + if (err) return res.send(500, err.message); + + //i 2n, afegir la id de la publicació generada al user.publications + user.runs.push(run._id); + /* gamification */ + var reward = { + concept: "added new run to user", + date: Date(), + value: +1 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 1; + /* end of gamification */ + user.save(function (err, user) { + if (err) return res.send(500, err.message); + + //res.status(200).jsonp(user); + //ara farem una publicació ensenyant que ha fet aquest run + var publication = new publicationModel({ + title: "new run '" + run.title + "'!", + content: "distance of: " + run.distance + ". View my runs at my profile", + date: new Date(), + user: user._id, + photo: run.photo + }); + //fins aquí tenim la variable publication amb els continguts + //ara cal 1r guardar el model publication a la base de dades + publication.save(function (err, publication) { + if (err) return res.send(500, err.message); + + //i 2n, afegir la id de la publicació generada al user.publications + user.publications.push(publication._id); + /* gamification */ + var reward = { + concept: "added new publication to Timeline", + date: Date(), + value: +1 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 1; + /* end of gamification */ + + if(!user.totalkm) + { + user.totalkm=0; + } + user.totalkm=user.totalkm + run.distance; + + user.save(function (err, user) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user); + }); + }); + }); + }); + }//end else if + }); +}; + +/**GET '/users/:userid/publications' **/ +exports.getRunsByUserId = function (req, res) { + userModel.findOne({ + _id: req.params.userid + }) + .populate('runs') + .exec(function (error, user) { + if (error !== null) res.send(500, error.message); + + res.status(200).jsonp(user); + }); +}; +/** GET '/run/getById/:publicationid' **/ +exports.getRunByRunId = function (req, res) { + runModel.findOne({_id: req.params.runid}) + .lean() + .populate('user', 'name avatar') + .exec(function (err, run) { + if (err) return res.send(500, err.message); + if (!run) { + res.json({success: false, message: 'run not found.'}); + } else if (run) { + res.status(200).jsonp(run); + } + }); +}; diff --git a/server/controllers/trainerController.js b/server/controllers/trainerController.js new file mode 100644 index 0000000..dc7350d --- /dev/null +++ b/server/controllers/trainerController.js @@ -0,0 +1,433 @@ +var express = require('express'); +var app = express(); +var jwt = require('jsonwebtoken'); +var config = require('../config/config'); +var crypto = require('crypto'); + +app.set('superSecret', config.secret); + +/*******MODELS*********/ +//var trainerModel = require('../models/trainerModel'); +var userModel = require('../models/userModel'); +var dietModel = require('../models/dietModel'); +var routineModel = require('../models/routineModel'); + +/** GET '/trainers' **/ +exports.getTrainers = function (req, res) { + userModel.find({role: 'trainer'}) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize)*Number(req.query.page)) + .exec(function (err, trainers) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainers); + }); +}; +exports.getTrainersByDisciplinesArray = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'sending petition failed. user not found.'}); + } else if (user) { + if(user.disciplines[0]) + { + userModel.find({ + role: 'trainer', + $and: [ + {_id: { $nin: user._id}}, + {_id: { $nin: user.trainers}} + ], + 'disciplines.name': user.disciplines[0].name//per ara torna els trainers que tinguin la discipline[0] del user client + }) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize)*Number(req.query.page)) + .exec(function (err, trainers) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainers); + }); + }else{ + userModel.find({ + role: 'trainer', + $and: [ + {_id: { $nin: user._id}}, + {_id: { $nin: user.trainers}} + ] + }) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize)*Number(req.query.page)) + .exec(function (err, trainers) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainers); + }); + } + + } + }); +}; + +/** GET '/trainers/:trainerid' **/ +exports.getTrainerById = function (req, res) { + userModel.findOne({_id: req.params.trainerid, role: 'trainer'}) + .lean() + .populate('routines', 'title description') + .populate('clients.client', 'name avatar points') + .populate('clientsPetitions.clientid', 'name avatar') + .exec(function (err, trainer) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainer); + }); +}; + +/** GET '/trainers/searchByDiscipline' **/ +exports.searchByDiscipline = function (req, res) { + userModel.find({'disciplines.name': req.params.discipline, role: 'trainer'}) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize)*Number(req.query.page)) + .exec(function (err, trainers) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainers); + }); +}; + +/** POST '/trainers/register' **/ +exports.register = function (req, res) { + var trainer = new userModel({ + name: req.body.name, + password: crypto.createHash('sha256').update(req.body.password).digest('base64'), + email: req.body.email, + avatar: 'img/user.png', + background: 'img/background.png', + role: req.body.role, + discipline: req.body.discipline, + points: { + total: 0 + } + }); + /* gamification */ + var reward = { + concept: "account created", + date: Date(), + value: +1 + }; + trainer.points.history.push(reward); + trainer.points.total = trainer.points.total + 1; + /* end of gamification */ + trainer.save(function (err, trainer) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainer); + }); +}; + +/** POST '/trainers/login' **/ +exports.login = function (req, res) { + userModel.findOne({ + email: req.body.email, role: 'trainer' + }) + .select('+password') + .exec(function (err, trainer) { + if (err) throw err; + if (!trainer) { + res.json({success: false, message: 'Authentication failed. trainer not found.'}); + } else if (trainer) { + req.body.password = crypto.createHash('sha256').update(req.body.password).digest('base64'); + if (trainer.password != req.body.password) { + res.json({success: false, message: 'Authentication failed. Wrong password.'}); + } else { + var indexToken = -1; + for (var i = 0; i < trainer.tokens.length; i++) { + if (trainer.tokens[i].userAgent == req.body.userAgent) { + indexToken = JSON.parse(JSON.stringify(i)); + } + } + console.log(indexToken); + if (indexToken == -1) {//userAgent no exist + + var tokenGenerated = jwt.sign({foo: 'bar'}, app.get('superSecret'), { + // expiresIn: 86400 // expires in 24 hours + }); + var newToken = { + userAgent: req.body.userAgent, + token: tokenGenerated, + os: req.body.os, + browser: req.body.browser, + device: req.body.device, + os_version: req.body.os_version, + browser_version: req.body.browser_version, + ip: req.body.ip, + lastLogin: Date() + }; + trainer.tokens.push(newToken); + } else {//userAgent already exist + trainer.tokens[indexToken].token = ""; + + var tokenGenerated = jwt.sign({foo: 'bar'}, app.get('superSecret'), { + // expiresIn: 86400 // expires in 24 hours + }); + trainer.tokens[indexToken].token = tokenGenerated; + trainer.tokens[indexToken].ip = req.body.ip; + trainer.tokens[indexToken].lastLogin = Date(); + } + trainer.save(function (err, trainer) { + if (err) return res.send(500, err.message); + + // return the information including token as JSON + trainer.password = ""; + res.json({ + user: trainer, + success: true, + message: 'Enjoy your token!', + token: tokenGenerated + }); + }); + } + } + }); +}; + +/** POST '/trainers/acceptClientPetition' **/ +exports.acceptClientPetition = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token'], role: 'trainer'}, function (err, trainer) { + if (err) return res.send(500, err.message); + if (!trainer) { + res.json({success: false, message: 'adding client to trainer failed. trainer not found.'}); + } else if (trainer) { + console.log(trainer);//aquí potser caldria comprovar que la routine és la que han creat per l'trainer + //busquem la petition que estem processant + for (var i = 0; i < trainer.clientsPetitions.length; i++) //routine.days + { + if (trainer.clientsPetitions[i]._id.equals(req.body.petitionid)) { + var newClient = { + client: trainer.clientsPetitions[i].clientid, + petitionMessage: trainer.clientsPetitions[i].message, + date: Date() + }; + trainer.clients.push(newClient); + + //la petició la marco com a accepted + trainer.clientsPetitions[i].state = "accepted"; + trainer.save(function (err) { + if (err) return res.send(500, err.message); + + userModel.findOne({_id: trainer._id, role: 'trainer'}) + .lean() + .populate('routines', 'title description') + .populate('clients.client', 'name avatar points') + .populate('clientsPetitions.clientid', 'name avatar') + .exec(function (err, trainer) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainer); + }); + }); + //ara afegim el trainer al user.trainer + userModel.findOne({'_id': trainer.clientsPetitions[i].clientid}, function (err, user) { + if (err) console.log(err.message); + if (!user) { + console.log('adding client to trainer failed. user not found.'); + } else if (user) { + user.trainers.push(trainer._id); + + /* gamification */ + var reward = { + concept: "new trainer", + date: Date(), + value: +5 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 5; + /* end of gamification */ + + var notification = { + state: "pendent", + message: "trainer has accepted to train you", + link: "training", + icon: "newtrainer.png", + date: Date() + }; + user.notifications.push(notification); + user.save(function (err) { + if (err) console.log(err.message); + console.log("trainer added to user"); + }); + } + }); + } + } + + }//end else if + }); +}; + +/** PUT '/trainers/:trainerid' **/ +exports.updateTrainer = function (req, res) { + var trainer = req.body; + userModel.update({'tokens.token': req.headers['x-access-token']}, trainer, + function (err) { + if (err) return console.log(err); + console.log(trainer); + res.status(200).jsonp(trainer); + }); +}; + +/** POST '/trainers/valorateTrainer/:trainerid' **/ +exports.valorateTrainer = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'sending valoration failed. user not found.'}); + } else if (user) { + //ara busquem el trainer + userModel.findOne({_id: req.params.trainerid, role: 'trainer'}, function (err, trainer) { + if (err) return res.send(500, err.message); + if (!trainer) { + res.json({success: false, message: 'sending valoration failed. trainer not found.'}); + } else if (trainer) { + //comprovem que el client no hagi valorat ja el trainer + var javalorat = false; + var indexValoration=-1; + for (var i = 0; i < trainer.valorations.length; i++) { + + if (trainer.valorations[i].clientid.equals(user._id)) { + javalorat = true; + indexValoration=JSON.parse(JSON.stringify(i)); + } + } + + if (javalorat == false) { + var valoration = { + clientid: user._id, + date: Date(), + message: req.body.message, + value: req.body.value + }; + if(!trainer.valoration) + { + trainer.valoration=0; + } + var actual = (+trainer.valoration) * trainer.valorations.length; + var valor = ((+actual) + (+valoration.value)) / (trainer.valorations.length + 1); + trainer.valoration = valor; + trainer.valorations.push(valoration); + + var notification = { + state: "pendent", + message: "client has valorated you", + link: "dashboard", + icon: "newvaloration.png", + date: Date() + }; + trainer.notifications.push(notification); + + trainer.save(function (err) { + if (err) return res.send(500, err.message); + + //aquí la gamificació de l'user que fa la valoració per primer cop + /* gamification */ + var reward = { + concept: "valorating trainer", + date: Date(), + value: +1 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 1; + /* end of gamification */ + user.save(function (err) { + /*if (err) return res.send(500, err.message); + + res.status(200).jsonp(routine);*/ + console.log("points of gamification on trainer valorating added to user"); + }); + + userModel.findOne({_id: trainer._id}) + .lean() + .populate('diets', 'title description') + .populate('routines', 'title description') + .populate('trainers', 'name avatar description') + .populate('clients.client', 'name avatar') + .populate('publications') + .exec(function (err, trainer) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainer); + }); + }); + } else {//end if javalorat==false + console.log("user already has valorated trainer, updating valoration and recalculating total"); + var valoration = { + clientid: user._id, + date: Date(), + message: req.body.message, + value: req.body.value + }; + var actual = ((+trainer.valoration) * (+trainer.valorations.length)) - (+trainer.valorations[indexValoration].value);//suma total valoracions sense la que estic canviant + var valor = ((+actual) + (+valoration.value)) / (trainer.valorations.length); + console.log(actual + ", " + valor); + trainer.valoration = valor; + trainer.valorations[indexValoration]=valoration; + + var notification = { + state: "pendent", + message: "client has updated the valoration on you", + link: "dashboard", + icon: "newvaloration.png", + date: Date() + }; + trainer.notifications.push(notification); + + trainer.save(function (err) { + if (err) return res.send(500, err.message); + + userModel.findOne({_id: trainer._id}) + .lean() + .populate('diets', 'title description') + .populate('routines', 'title description') + .populate('trainers', 'name avatar description') + .populate('clients.client', 'name avatar') + .populate('publications') + .exec(function (err, trainer) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainer); + }); + }); + } + }//end else if + }); + }//end else if + }); +}; + +/** GET '/trainers/:trainerid/getNotifications' **/ +exports.getNotifications = function (req, res) { + userModel.findOne({_id: req.params.trainerid, role: 'trainer'}) + .exec(function (err, trainer) { + if (err) return res.send(500, err.message); + for (var i = 0; i < trainer.notifications.length; i++) { + if (trainer.notifications[i].state == "pendent") { + trainer.notifications[i].state = "viewed"; + trainer.notifications[i].dateviewed = Date(); + } + } + trainer.save(function (err) { + if (err) return res.send(500, err.message); + + res.status(200).jsonp(trainer.notifications); + }); + }); +}; + +/** GET '/trainers/searchByName/:trainername' **/ +exports.searchByName = function (req, res) { + console.log("searchByName"); + userModel.find({name: new RegExp(req.params.trainername, "i"), role: 'trainer'}) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize)*Number(req.query.page)) + .exec(function (err, trainers) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainers); + }); +}; + +/** DELETE '/trainers/:trainerid' **/ +exports.removeTrainer = function (req, res) {/* AQUESTA FUNCIÖ CREC QUE ESTÂ MAL PLANTEJADA, DIRIA QUE NO FUNCIONA, si jo també ho diria no es pot trobar despres d'eliminar */ + userModel.findByIdAndRemove({_id: req.params.trainerid}, function (err) {/**La he corregit, pero tenint en compte que tenim només un model ara potser es redundant no?**/ + if (err) return res.send(500, err.message); + res.status(200).send("Trainer Deleted"); + }); +}; diff --git a/server/controllers/userController.js b/server/controllers/userController.js new file mode 100644 index 0000000..88b275a --- /dev/null +++ b/server/controllers/userController.js @@ -0,0 +1,791 @@ +var express = require('express'); +var app = express(); +var router = express.Router(); +var jwt = require('jsonwebtoken'); +var config = require('../config/config'); +var crypto = require('crypto'); +var formidable = require('formidable'); +var fs = require('fs'); +var https = require('https'); +app.set('superSecret', config.secret); + +/*******MODELS*********/ +var publicationModel = require('../models/publicationModel'); +var userModel = require('../models/userModel'); +var dietModel = require('../models/dietModel'); +var routineModel = require('../models/routineModel'); + + +/** POST '/users/register' **/ +exports.register = function (req, res) { + console.log(req.body); + var user = new userModel({ + name: req.body.name, + role: req.body.role, + password: crypto.createHash('sha256').update(req.body.password).digest('base64'), + email: req.body.email, + description: "Hi, i'm here to train.", + avatar: 'img/user.png', + background: 'img/background.png', + attributes: { + height: req.body.height, + weight: req.body.weight, + gender: req.body.gender, + age: req.body.age + }, + points: { + total: 0 + } + }); + /* gamification */ + var reward = { + concept: "account created", + date: Date(), + value: +1 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 1; + /* end of gamification */ + /*notification*/ + var notification = { + state: "pendent", + message: "Wellcome! this is your profile, update the Profile picture to let other members recognize you", + link: "editUser/" + user._id, + icon: "newpetition.png", + date: Date() + }; + user.notifications.push(notification); + /* end of notification*/ + user.save(function (err, user) { + if (err) { + console.log(err.message); + return res.status(500).send(err.message); + } + //res.status(200).jsonp(user); en comptes de retoranr la data del signup, fem el login directament + console.log("signup fet correctament, redirigint al login internament automàtic"); + exports.login(req, res); + }); +}; + +var SECRET = "6LcyxhIUAAAAAPkCdz5HoBPN5--RhP7mpIE-V2CL"; + +function verifyRecaptcha(key, callback) { + https.get("https://www.google.com/recaptcha/api/siteverify?secret=" + SECRET + "&response=" + key, function(res) { + var data = ""; + res.on('data', function (chunk) { + data += chunk.toString(); + }); + res.on('end', function() { + try { + var parsedData = JSON.parse(data); + callback(parsedData.success); + } catch (e) { + callback(false); + } + }); + }); +} + +/** POST '/users/login' **/ +exports.login = function (req, res) { + verifyRecaptcha(req.body["g-recaptcha-response"], function() { + userModel.findOne({ + email: req.body.email + }) + .select('+password') + .exec(function (err, user) { + if (err) throw err; + if (!user) { + res.json({success: false, message: 'Authentication failed. User not found.'}); + } else if (user) { + req.body.password = crypto.createHash('sha256').update(req.body.password).digest('base64'); + if (user.password != req.body.password) { + res.json({success: false, message: 'Authentication failed. Wrong password.'}); + } else { + var indexToken = -1; + for (var i = 0; i < user.tokens.length; i++) { + if (user.tokens[i].userAgent == req.body.userAgent) { + indexToken = JSON.parse(JSON.stringify(i));//stringify i parse pq es faci una còpia de la variable i, enlloc de una referència + } + } + console.log(indexToken); + if (indexToken == -1) {//userAgent no exist + var tokenGenerated = jwt.sign({foo: 'bar'}, app.get('superSecret'), { + // expiresIn: 86400 // expires in 24 hours + }); + var newToken = { + userAgent: req.body.userAgent, + token: tokenGenerated, + os: req.body.os, + browser: req.body.browser, + device: req.body.device, + os_version: req.body.os_version, + browser_version: req.body.browser_version, + ip: req.body.ip, + lastLogin: Date() + }; + user.tokens.push(newToken); + } else {//userAgent already exist + user.tokens[indexToken].token = ""; + var tokenGenerated = jwt.sign({foo: 'bar'}, app.get('superSecret'), { + // expiresIn: 86400 // expires in 24 hours + }); + user.tokens[indexToken].token = tokenGenerated; + user.tokens[indexToken].ip = req.body.ip; + user.tokens[indexToken].lastLogin = Date(); + } + user.save(function (err, user) { + if (err) return res.send(500, err.message); + // return the information including token as JSON + user.password = ""; + res.json({ + user: user, + success: true, + message: 'Enjoy your token!', + token: tokenGenerated + }); + }); + } + } + }); +})}; + +/** POST '/logout' **/ +exports.logout = function (req, res, callback) { + var token = req.headers.authorization; + var decoded = verify(token); + if (decoded) { + db.get(decoded.auth, function (err, record) { + if (err) throw err; + var updated = JSON.parse(record); + updated.valid = false; + db.put(decoded.auth, updated, function (err) { + if (err) throw err; + res.writeHead(200, {'content-type': 'text/plain'}); + res.end('Logged Out!'); + return callback(res); + }); + }); + } else { + authFail(res, done); + return callback(res); + } +}; + +/*** Building a File Uploader with NodeJs + * https://coligo.io/building-ajax-file-uploader-with-node/ + */ +/** POST '/users/upload' **/ +exports.avatarUpload = function (req, res) {/* no sé si s'ha provat si funciona, per ara almenys no està linkat ni es fa servir */ + // create an incoming form object + var form = new formidable.IncomingForm(); + // specify that we want to allow the user to upload multiple files in a single request + form.multiples = true; + // store all uploads in the /uploads directory + form.uploadDir = path.join(__dirname, '/uploads'); + // every time a file has been uploaded successfully, + // rename it to it's orignal name + form.on('file', function (field, file) { + fs.rename(file.path, path.join(form.uploadDir, file.name)); + }); + // log any errors that occur + form.on('error', function (err) { + console.log('An error has occured: \n' + err); + }); + // once all the files have been uploaded, send a response to the client + form.on('end', function () { + res.end('success'); + }); + // parse the incoming request containing the form data + form.parse(req); +}; + +/** PUT '/users/:userid' **/ +exports.updateUser = function (req, res) {//funciona + var id = req.params.userid; + var user = req.body; + userModel.update({'tokens.token': req.headers['x-access-token']}, user, + function (err) { + if (err) return console.log(err); + console.log(user); + res.status(200).jsonp(user); + }); +}; + +/** DELETE '/users/:userid' **/ +exports.deleteUserById = function (req, res) { + userModel.findByIdAndRemove({_id: req.params.userid}, function (err) { + if (err) return res.send(500, err.message); + res.status(200).send("Deleted"); + }); +}; + +/** GET '/users/' **/ +exports.getUsers = function (req, res) { + userModel.find({role: 'user'}) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .exec(function (err, users) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(users); + }); +}; + +/** GET '/users/:userid' **/ +exports.getUserById = function (req, res) { + userModel.findOne({_id: req.params.userid}) + .lean() + .populate('diets', 'title description') + .populate('routines', 'title description') + .populate('trainers', 'name avatar description disciplines') + .populate('clients.client', 'name avatar') + .populate('publications') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'User not found.'}); + } else if (user) { + /* aquí va el carro de bucle per acabar retornant només les peticions pendents */ + var pendentNumber=0; + for (var i = 0; i < user.notifications.length; i++) { + if (user.notifications[i].state == "pendent") { + pendentNumber++; + } + } + user.pendentNotificationsNumber=pendentNumber; + /* fi del carro de bucle de peticions pendents */ + res.status(200).jsonp(user); + } + }); +}; +exports.getUserByToken = function (req, res) { + console.log(req.params.tok); + userModel.findOne({'tokens.token': req.params.tok}) + .lean() + .populate('diets', 'title description') + .populate('routines', 'title description') + .populate('trainers', 'name avatar description disciplines') + .populate('clients.client', 'name avatar') + .populate('publications') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'User not found.'}); + } else if (user) { + /* aquí va el carro de bucle per acabar retornant només les peticions pendents */ + var pendentNumber=0; + for (var i = 0; i < user.notifications.length; i++) { + if (user.notifications[i].state == "pendent") { + pendentNumber++; + } + } + user.pendentNotificationsNumber=pendentNumber; + /* fi del carro de bucle de peticions pendents */ + res.status(200).jsonp(user); + } + }); +}; + +/** GET '/users/:userid/network' **/ +exports.getUserNetworkById = function (req, res) { + userModel.findOne({_id: req.params.userid}) + .lean() + .populate('followers', 'name avatar description') + .populate('following', 'name avatar description') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user); + }); +}; + +/** GET '/users/:userid/suggestions' **/ +exports.getUserSuggestionsById = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}) + .exec(function (err, user) { + if (err) return res.send(500, err.message); + + userModel.find({ + $and: [ + {_id: { $nin: user._id}}, + {_id: { $nin: user.following}} + ], + city: user.city}) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .select('name role email description avatar') + .exec(function (err, users) { + if (err) return res.send(500, err.message); + console.log(users); + if (users.length>0) { + res.status(200).jsonp(users); + } else { + //si no té users a la ciutat, li tornem users igualment (tot i no ser de la mateixa ciutat) + userModel.find({ + $and: [ + {_id: { $nin: user._id}}, + {_id: { $nin: user.following}} + ]}) + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .select('name role email description avatar') + .exec(function (err, users) { + res.status(200).jsonp(users); + }); + } + }); + }); +}; + +/** GET '/users/:userid/diets' **/ +exports.getDietsFromUserId = function (req, res) { + userModel.findOne({_id: req.params.userid}) + .populate('diets') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user.diets); + }); +}; + +/** GET '/users/:userid/routines' **/ +exports.getRoutinesFromUserId = function (req, res) { + userModel.findOne({_id: req.params.userid}) + .populate('routines') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user.routines); + }); +}; + +/** POST '/users/sendPetitionToTrainer/:trainerid' **/ +exports.sendPetitionToTrainer = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'sending petition failed. user not found.'}); + } else if (user) { + console.log(user.name);//aquí potser caldria comprovar que la routine és la que han creat per l'user + //ara busquem el trainer + userModel.findOne({_id: req.params.trainerid}, function (err, trainer) { + if (err) return res.send(500, err.message); + if (!trainer) { + res.json({success: false, message: 'sending petition failed. trainer not found.'}); + } else if (trainer) { + var newPetition = { + clientid: user._id, + message: req.body.message, + state: "pendent" + }; + trainer.clientsPetitions.push(newPetition); + /*notification*/ + var notification = { + state: "pendent", + message: "client has sent a petition to you", + link: "dashboard", + icon: "newpetition.png", + date: Date() + }; + trainer.notifications.push(notification); + /* end of notification*/ + trainer.save(function (err) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(trainer); + }); + }//end else if + }); + }//end else if + }); +}; + +exports.getNumberOfNotifications = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}) + .exec(function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'User not found.'}); + } else if (user) { + /* aquí va el carro de bucle per acabar retornant només les peticions pendents */ + var pendentNumber=0; + for (var i = 0; i < user.notifications.length; i++) { + if (user.notifications[i].state == "pendent") { + pendentNumber++; + } + } + /* fi del carro de bucle de peticions pendents */ + res.status(200).jsonp(pendentNumber); + } + }); +}; + +/** GET '/users/:userid/getNotifications' **/ +exports.getNotifications = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}) + .exec(function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'User not found.'}); + } else if (user) { + var viewed=[]; + var pendent=[]; + for (var i = 0; i < user.notifications.length; i++) { + if (user.notifications[i].state == "pendent") { + pendent.push(user.notifications[i]); + user.notifications[i].state = "viewed"; + user.notifications[i].dateviewed = Date(); + }else{ + viewed.push(user.notifications[i]); + } + } + user.save(function (err) { + if (err) return res.send(500, err.message); + res.status(200).jsonp({ + pendent: pendent, + viewed: viewed + }); + }); + } + }); +}; + +/** POST '/users/:userid/deleteSelectedTokens' **/ +exports.deleteSelectedTokens = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + console.log(user); + for (var i = 0; i < req.body.devicesToDelete.length; i++) { + for (var j = 0; j < user.tokens.length; j++) { + if (user.tokens[j].userAgent == req.body.devicesToDelete[i].userAgent) { + user.tokens.splice(j, 1); + } + } + } + user.save(function (err) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user); + }); + }//end else if + }); +}; + +/** + userA: el que fa l'acció de seguir --> se li posa userB a following + userB: el que reb el seguiment --> se li posa el userA al followers + **/ +/** POST '/users/follow' **/ +exports.follow = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, userA) { + if (err) return res.send(500, err.message); + if (!userA) { + res.json({success: false, message: 'userA not found.'}); + } else if (userA) { + //ara busquem el userB + userModel.findOne({_id: req.body.userid}, function (err, userB) { + if (err) return res.send(500, err.message); + if (!userB) { + res.json({success: false, message: 'userB not found.'}); + } else if (userB) { + userB.followers.push(userA._id); + /*notification*/ + var notification = { + state: "pendent", + message: userA.name + " followed you", + link: "dashboard", + icon: "follower.png", + date: Date() + }; + userB.notifications.push(notification); + /* end of notification*/ + /* gamification */ + var reward = { + concept: userA.name + " followed you", + date: Date(), + value: +1 + }; + userB.points.history.push(reward); + userB.points.total = userB.points.total + 1; + /* end of gamification */ + userB.save(function (err) { + if (err) return res.send(500, err.message); + userA.following.push(userB._id); + /* gamification */ + var reward = { + concept: "followed " + userB.name, + date: Date(), + value: +1 + }; + userA.points.history.push(reward); + userA.points.total = userA.points.total + 1; + /* end of gamification */ + userA.save(function (err) { + if (err) return res.send(500, err.message); + userModel.findOne({_id: userA._id}).lean().populate('following', 'name avatar') + .exec(function (err, userA) { + if (err) return res.send(500, err.message); + console.log("user followed" + userB.name); + res.status(200).jsonp(userB); + }); + }); + }); + }//end else if + }); + }//end else if + }); +}; + +/** + userA: el que fa l'acció de deixar de seguir --> se li treu userB de following + userB: el que deixa de tenir el seguiment --> se li treu l'userA del followers + **/ +/** POST '/users/unfollow' **/ +exports.unfollow = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, userA) { + if (err) return res.send(500, err.message); + if (!userA) { + res.json({success: false, message: 'userA not found.'}); + } else if (userA) { + //ara busquem el userB + userModel.findOne({_id: req.body.userid}, function (err, userB) { + if (err) return res.send(500, err.message); + if (!userB) { + res.json({success: false, message: 'userB not found.'}); + } else if (userB) { + var indexFollower = -1; + for (var i = 0; i < userB.followers.length; i++) { + if (userB.followers[i].equals(userA._id)) { + indexFollower = JSON.parse(JSON.stringify(i)); + } + } + if (indexFollower > -1) { + userB.followers.splice(indexFollower, 1); + /*notification*/ + var notification = { + state: "pendent", + message: userA.name + " unfollowed you", + link: "dashboard", + icon: "unfollower.png", + date: Date() + }; + userB.notifications.push(notification); + /* end of notification*/ + /* gamification */ + var reward = { + concept: userA.name + " unfollowed you", + date: Date(), + value: -1 + }; + userB.points.history.push(reward); + userB.points.total = userB.points.total - 1; + /* end of gamification */ + userB.save(function (err) { + if (err) return res.send(500, err.message); + var indexFollower = -1; + for (var i = 0; i < userA.following.length; i++) { + if (userA.following[i].equals(userB._id)) { + indexFollower = JSON.parse(JSON.stringify(i)); + } + } + if (indexFollower > -1) { + userA.following.splice(indexFollower, 1); + /* gamification */ + var reward = { + concept: "unfollowed " + userB.name, + date: Date(), + value: -1 + }; + userA.points.history.push(reward); + userA.points.total = userA.points.total - 1; + /* end of gamification */ + userA.save(function (err) { + if (err) return res.send(500, err.message); + userModel.findOne(userA).lean().populate('following', 'name avatar') + .exec(function (err, userA) { + if (err) return res.send(500, err.message); + console.log("user followed" + userB.name); + res.status(200).jsonp(userB); + }); + }); + } else {//else de indexFollower>-1 + res.status(200).jsonp({message: 'not found'}); + } + }); + } else {//else de indexFollower>-1 + res.status(200).jsonp({message: 'not found'}); + } + }//end else if + }); + }//end else if + }); +}; + +/**GET '/search/:searchstring' **/ +exports.search = function (req, res) { + userModel.find({ + name: new RegExp(req.params.searchstring, "i"), + role: 'user' + })//perquè retorni tots els objectes que continguin l'string sense necessitat de que sigui exactament la mateixa string + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .exec(function (err, users) { + if (err) return res.send(500, err.message); + userModel.find({ + name: new RegExp(req.params.searchstring, "i"), + role: 'trainer' + })//perquè retorni tots els objectes que continguin l'string sense necessitat de que sigui exactament la mateixa string + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .exec(function (err, trainers) { + if (err) return res.send(500, err.message); + routineModel.find({title: new RegExp(req.params.searchstring, "i")})//perquè retorni tots els objectes que continguin l'string sense necessitat de que sigui exactament la mateixa string + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .exec(function (err, routines) { + if (err) return res.send(500, err.message); + dietModel.find({title: new RegExp(req.params.searchstring, "i")})//perquè retorni tots els objectes que continguin l'string sense necessitat de que sigui exactament la mateixa string + .limit(Number(req.query.pageSize)) + .skip(Number(req.query.pageSize) * Number(req.query.page)) + .exec(function (err, diets) { + if (err) return res.send(500, err.message); + res.json({ + users: users, + trainers: trainers, + routines: routines, + diets: diets + }); + });//diets + });//routines + });//trainers + });//users +}; + +/** POST '/users/newMark' **/ +exports.newMark = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + var newmark = { + title: req.body.title, + unit: req.body.unit + }; + user.marks.push(newmark); + /* gamification */ + var reward = { + concept: "new mark created: " + newmark.title, + date: Date(), + value: +3 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 3; + /* end of gamification */ + user.save(function (err) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user.marks); + }); + }//end else if user + }); +}; + +/** DELETE /users/markid'**/ +exports.deleteUserMark = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + var indexMark=-1; + for (var i = 0; i < user.marks.length; i++) { + if (user.marks[i]._id == req.params.markid) { + indexMark = JSON.parse(JSON.stringify(i)); + } + } + if(indexMark>-1) + { + user.marks.splice(indexMark, 1); + /* gamification */ + var reward = { + concept: "mark deleted", + date: Date(), + value: -3 + }; + user.points.history.push(reward); + user.points.total = user.points.total - 3; + /* end of gamification */ + user.save(function (err, user) {//guardem el trainer amb la rutina treta + if (err) return res.send(500, err.message); + userModel.findOne({_id: user._id}) + .lean() + .populate('diets', 'title description') + .populate('routines', 'title description') + .populate('trainers', 'name avatar description disciplines') + .populate('clients.client', 'name avatar') + .populate('publications') + .exec(function (err, user) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user); + }); + }); + }else{ + res.status(200).jsonp({message: 'mark not found'}); + } + } + }); +} + +/** + cal rebre: + _id + value: 10 + **/ +/** POST '/users/:markid/addDayToMark' **/ +exports.addDayToMark = function (req, res) { + userModel.findOne({'tokens.token': req.headers['x-access-token']}, function (err, user) { + if (err) return res.send(500, err.message); + if (!user) { + res.json({success: false, message: 'user not found.'}); + } else if (user) { + var indexMark = -1; + var indexDay = -1; + for (var i = 0; i < user.marks.length; i++) { + if (user.marks[i]._id == req.params.markid) { + indexMark = JSON.parse(JSON.stringify(i)); + for (var j = 0; j < user.marks[i].days.length; j++) { + if (user.marks[i].days[j].date == Date()) { + indexDay = JSON.parse(JSON.stringify(j)); + } + } + } + } + if (indexMark > -1)//si la mark existeix + { + if (indexDay == -1)//però el dia no existeix encara + { + var newday = { + date: Date(), + value: req.body.value + }; + user.marks[indexMark].days.push(newday); + /* gamification */ + var reward = { + concept: "day value added to mark: " + user.marks[indexMark].title, + date: Date(), + value: +1 + }; + user.points.history.push(reward); + user.points.total = user.points.total + 1; + /* end of gamification */ + user.save(function (err) { + if (err) return res.send(500, err.message); + res.status(200).jsonp(user.marks); + }); + } else { + res.status(200).jsonp({message: 'mark of day already registered'}); + } + } else { + res.status(200).jsonp({message: 'mark not registered'}); + } + }//end else if user + }); +}; diff --git a/server/models/contactModel.js b/server/models/contactModel.js new file mode 100644 index 0000000..a151a88 --- /dev/null +++ b/server/models/contactModel.js @@ -0,0 +1,12 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; + +var contactSchema = new Schema({ + name: {type: String, required: true,}, + subject: {type: String, required: true, select: false}, + email: {type: String, required: true, unique: true}, + description: {type: String} +}); +contactSchema.plugin(mongooseUniqueValidator); +module.exports = mongoose.model('contactModel', contactSchema); diff --git a/server/models/conversationModel.js b/server/models/conversationModel.js new file mode 100644 index 0000000..b1508e6 --- /dev/null +++ b/server/models/conversationModel.js @@ -0,0 +1,27 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; + +var conversationSchema = new Schema({ + userA: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + userB: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + messages: [{ + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + content: {type: String}, + date: {type: Date} + }], + modifiedDate: {type: Date} +}); + +conversationSchema.plugin(mongooseUniqueValidator); + +module.exports = mongoose.model('conversationModel', conversationSchema); diff --git a/server/models/dietModel.js b/server/models/dietModel.js new file mode 100644 index 0000000..a345c19 --- /dev/null +++ b/server/models/dietModel.js @@ -0,0 +1,46 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; + +var dietSchema = new Schema({ + title: {type: String}, + description: {type: String}, + startingDay: {type: Date}, + price: { type: Number }, + image: { type: String }, + clients: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }], + chef: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + days: [{ + date: {type: Date}, //Ha de ser realmente un día que empiezas por ejemplo 12/12/2016 para poder ir completando según la fecha, comer comes cada día + title: {type: String}, + description: {type: String}, + meals: [{ + title: {type: String}, + img: {type: String}, + submeals: [{ + title: {type: String}, + description: {type: String}, + amount: { + unit: {type: String}, + quantity: {type: Number} + }, + nutritional: { + kcal: {type: Number}, + proteins: {type: Number}, + carbohidrates: {type: Number}, + fats: {type: Number}, + vitamins: {type: Number} + } + }] + }], + done: {type: Boolean, default: false} + }] +}); +dietSchema.plugin(mongooseUniqueValidator); +module.exports = mongoose.model('dietModel', dietSchema); diff --git a/server/models/publicationModel.js b/server/models/publicationModel.js new file mode 100644 index 0000000..0e53e94 --- /dev/null +++ b/server/models/publicationModel.js @@ -0,0 +1,22 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; + +var publicationSchema = new Schema({ + title: {type: String, required: true}, + content: {type: String, required: true}, + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + photo: {type: String},//link a la imatge, en plan, l'user corrent pel carrer tot feliç + date: {type: Date}, + likes: [{ + type:mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }] +}); + +publicationSchema.plugin(mongooseUniqueValidator); + +module.exports = mongoose.model('publicationModel', publicationSchema); diff --git a/server/models/routineModel.js b/server/models/routineModel.js new file mode 100644 index 0000000..428f05d --- /dev/null +++ b/server/models/routineModel.js @@ -0,0 +1,37 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; + +var routineSchema = new Schema({ + title: {type: String}, + description: {type: String}, + startingDay: {type: Date}, + discipline: {type: String}, + price: { type: Number },//si és gratis, es posa q val 0, així els users ho veuen amb bons ulls + image: { type: String }, + client: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + trainer: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + days: [{ + title: {type: String}, + description: {type: String}, + exercises: [{ + title: {type: String}, + description: {type: String}, + img: {type: String}, + weight: {type: String}, + distance: {type: String}, + reps: {type: String}, + series: {type: String} + }], + done: {type: String, default: false}//si ha complert el dia + }] +}) +; +routineSchema.plugin(mongooseUniqueValidator); +module.exports = mongoose.model('routineModel', routineSchema); diff --git a/server/models/runModel.js b/server/models/runModel.js new file mode 100644 index 0000000..77d0ff6 --- /dev/null +++ b/server/models/runModel.js @@ -0,0 +1,25 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; + +var runSchema = new Schema({ + title: {type: String}, + photo: {type: String}, + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + datestart: {type: Date}, + datefinish: {type: Date}, + distance: {type: Number}, + positions: [{ + date: {type: Date}, + lat: {type: Number}, + long: {type: Number}, + distance: {type: Number} + }] +}); + +runSchema.plugin(mongooseUniqueValidator); + +module.exports = mongoose.model('runModel', runSchema); diff --git a/server/models/userModel.js b/server/models/userModel.js new file mode 100644 index 0000000..9e5820e --- /dev/null +++ b/server/models/userModel.js @@ -0,0 +1,140 @@ +var mongoose = require('mongoose'); +var mongooseUniqueValidator = require('mongoose-unique-validator'); +var Schema = mongoose.Schema; +var userSchema = new Schema({ + name: {type: String, required: true, unique: true}, + role: {type: String, required: true}, + password: {type: String, select: false}, + tokens: [{ + userAgent: {type: String}, + token: {type: String}, + os: {type: String}, + browser: {type: String}, + device: {type: String}, + os_version: {type: String}, + browser_version: {type: String}, + ip: {type: String}, + lastLogin: {type: Date}, + birthdate: {type: Date}, + }], + testimonial: {type :String},//Para la landing page, sera como una review del sitio + email: {type: String, required: true, unique: true}, + description: {type: String}, + direction: {type: String}, + city: {type: String}, + avatar: {type: String}, + background: {type: String}, + attributes: { + height: {type: Number}, + weight: {type: Number}, + gender: {type: String},//Home, Dona, Altres -->com a mínim aquestes 3 opcions, més endavant tenim el debat de com s'enfoca + age: {type: Number} + }, + publications: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'publicationModel' + }], + runs: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'runModel' + }], + totalkm: {type: Number}, + conversations: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'conversationModel' + }], + diets: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'dietModel' + }], + trainers: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }], + routines: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'routineModel' + }],// trainermodel + disciplines : [{ + name: {type: String} + }], + specialties : [{ + name: {type: String} + }], + clients: [{ + client: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + petitionMessage: {type: String}, + date: {type: Date} + }], + clientsPetitions: [{ + clientid: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + message: {type: String}, + state: {type: String}//pendent, accepted, declined + }], + valoration: {type:String}, //La media de todas las valoraciones + valorations: [{ + clientid: { + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }, + date: {type: Date}, + message: {type: String},//missatge de valoració + value: {type: Number}//per exemple sistema d'estrelles sobre 5 + }],//end of trainermodel + points: { + total: {type: Number}, + history: [{ + concept: {type: String}, + date: {type: Date}, + value: {type: Number} + }] + }, + marks: [{ + title: {type: String}, + unit: {type: String},//si són kg, km + best: { + date: {type: Date}, + value: {type: String} + }, + days:[{ + date: {type: Date}, + value: {type: String} + }] + }], + notifications: [{ + state: {type: String},//viewed, pendent + message: {type: String}, + link: {type: String},//aquí oju, a la app i a la web calen links diferents, però ho podem fer posant sempre a la app i a la web el prefix del link (#!/app) o (#/app/), i després afegint-hi la pàgina on volem enviar el routing, per exemple (dashboard) + icon: {type: String}, + date: {type: Date}, + dateviewed: {type: Date} + }], + followers: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }], + following: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'userModel' + }], + google: { + id: {type: String}, + token: {type: String}, + email: {type: String}, + name: {type: String}, + }, + twitter: { + id: {type: String}, + token: {type: String}, + email: {type: String}, + name: {type: String}, + } +}); +userSchema.plugin(mongooseUniqueValidator); +module.exports = mongoose.model('userModel', userSchema); diff --git a/server/node_modules/accepts/HISTORY.md b/server/node_modules/accepts/HISTORY.md new file mode 100644 index 0000000..0508481 --- /dev/null +++ b/server/node_modules/accepts/HISTORY.md @@ -0,0 +1,74 @@ +1.1.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - deps: mime-db@~1.3.0 + +1.1.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - deps: mime-db@~1.2.0 + +1.1.2 / 2014-10-14 +================== + + * deps: negotiator@0.4.9 + - Fix error when media type has invalid parameter + +1.1.1 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - deps: mime-db@~1.1.0 + * deps: negotiator@0.4.8 + - Fix all negotiations to be case-insensitive + - Stable sort preferences of same quality according to client order + +1.1.0 / 2014-09-02 +================== + + * update `mime-types` + +1.0.7 / 2014-07-04 +================== + + * Fix wrong type returned from `type` when match after unknown extension + +1.0.6 / 2014-06-24 +================== + + * deps: negotiator@0.4.7 + +1.0.5 / 2014-06-20 +================== + + * fix crash when unknown extension given + +1.0.4 / 2014-06-19 +================== + + * use `mime-types` + +1.0.3 / 2014-06-11 +================== + + * deps: negotiator@0.4.6 + - Order by specificity when quality is the same + +1.0.2 / 2014-05-29 +================== + + * Fix interpretation when header not in request + * deps: pin negotiator@0.4.5 + +1.0.1 / 2014-01-18 +================== + + * Identity encoding isn't always acceptable + * deps: negotiator@~0.4.0 + +1.0.0 / 2013-12-27 +================== + + * Genesis diff --git a/server/node_modules/accepts/LICENSE b/server/node_modules/accepts/LICENSE new file mode 100644 index 0000000..f23dca8 --- /dev/null +++ b/server/node_modules/accepts/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong + +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/server/node_modules/accepts/README.md b/server/node_modules/accepts/README.md new file mode 100644 index 0000000..a9bc28a --- /dev/null +++ b/server/node_modules/accepts/README.md @@ -0,0 +1,94 @@ +# accepts + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Higher level content negotation based on [negotiator](https://github.com/federomero/negotiator). Extracted from [koa](https://github.com/koajs/koa) for general use. + +In addition to negotatior, it allows: + +- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`. +- Allows type shorthands such as `json`. +- Returns `false` when no types match +- Treats non-existent headers as `*` + +## API + +### var accept = new Accepts(req) + +```js +var accepts = require('accepts') + +http.createServer(function (req, res) { + var accept = accepts(req) +}) +``` + +### accept\[property\]\(\) + +Returns all the explicitly accepted content property as an array in descending priority. + +- `accept.types()` +- `accept.encodings()` +- `accept.charsets()` +- `accept.languages()` + +They are also aliased in singular form such as `accept.type()`. `accept.languages()` is also aliased as `accept.langs()`, etc. + +Note: you should almost never do this in a real app as it defeats the purpose of content negotiation. + +Example: + +```js +// in Google Chrome +var encodings = accept.encodings() // -> ['sdch', 'gzip', 'deflate'] +``` + +Since you probably don't support `sdch`, you should just supply the encodings you support: + +```js +var encoding = accept.encodings('gzip', 'deflate') // -> 'gzip', probably +``` + +### accept\[property\]\(values, ...\) + +You can either have `values` be an array or have an argument list of values. + +If the client does not accept any `values`, `false` will be returned. +If the client accepts any `values`, the preferred `value` will be return. + +For `accept.types()`, shorthand mime types are allowed. + +Example: + +```js +// req.headers.accept = 'application/json' + +accept.types('json') // -> 'json' +accept.types('html', 'json') // -> 'json' +accept.types('html') // -> false + +// req.headers.accept = '' +// which is equivalent to `*` + +accept.types() // -> [], no explicit types +accept.types('text/html', 'text/json') // -> 'text/html', since it was first +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/accepts.svg?style=flat +[npm-url]: https://npmjs.org/package/accepts +[node-version-image]: https://img.shields.io/node/v/accepts.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/accepts.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/accepts +[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/accepts +[downloads-image]: https://img.shields.io/npm/dm/accepts.svg?style=flat +[downloads-url]: https://npmjs.org/package/accepts diff --git a/server/node_modules/accepts/index.js b/server/node_modules/accepts/index.js new file mode 100644 index 0000000..805e33a --- /dev/null +++ b/server/node_modules/accepts/index.js @@ -0,0 +1,160 @@ +var Negotiator = require('negotiator') +var mime = require('mime-types') + +var slice = [].slice + +module.exports = Accepts + +function Accepts(req) { + if (!(this instanceof Accepts)) + return new Accepts(req) + + this.headers = req.headers + this.negotiator = Negotiator(req) +} + +/** + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single mime type string + * such as "application/json", the extension name + * such as "json" or an array `["json", "html", "text/plain"]`. When a list + * or array is given the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * this.types('html'); + * // => "html" + * + * // Accept: text/*, application/json + * this.types('html'); + * // => "html" + * this.types('text/html'); + * // => "text/html" + * this.types('json', 'text'); + * // => "json" + * this.types('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * this.types('image/png'); + * this.types('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * this.types(['html', 'json']); + * this.types('html', 'json'); + * // => "json" + * + * @param {String|Array} type(s)... + * @return {String|Array|Boolean} + * @api public + */ + +Accepts.prototype.type = +Accepts.prototype.types = function (types) { + if (!Array.isArray(types)) types = slice.call(arguments); + var n = this.negotiator; + if (!types.length) return n.mediaTypes(); + if (!this.headers.accept) return types[0]; + var mimes = types.map(extToMime); + var accepts = n.mediaTypes(mimes.filter(validMime)); + var first = accepts[0]; + if (!first) return false; + return types[mimes.indexOf(first)]; +} + +/** + * Return accepted encodings or best fit based on `encodings`. + * + * Given `Accept-Encoding: gzip, deflate` + * an array sorted by quality is returned: + * + * ['gzip', 'deflate'] + * + * @param {String|Array} encoding(s)... + * @return {String|Array} + * @api public + */ + +Accepts.prototype.encoding = +Accepts.prototype.encodings = function (encodings) { + if (!Array.isArray(encodings)) encodings = slice.call(arguments); + var n = this.negotiator; + if (!encodings.length) return n.encodings(); + return n.encodings(encodings)[0] || false; +} + +/** + * Return accepted charsets or best fit based on `charsets`. + * + * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` + * an array sorted by quality is returned: + * + * ['utf-8', 'utf-7', 'iso-8859-1'] + * + * @param {String|Array} charset(s)... + * @return {String|Array} + * @api public + */ + +Accepts.prototype.charset = +Accepts.prototype.charsets = function (charsets) { + if (!Array.isArray(charsets)) charsets = [].slice.call(arguments); + var n = this.negotiator; + if (!charsets.length) return n.charsets(); + if (!this.headers['accept-charset']) return charsets[0]; + return n.charsets(charsets)[0] || false; +} + +/** + * Return accepted languages or best fit based on `langs`. + * + * Given `Accept-Language: en;q=0.8, es, pt` + * an array sorted by quality is returned: + * + * ['es', 'pt', 'en'] + * + * @param {String|Array} lang(s)... + * @return {Array|String} + * @api public + */ + +Accepts.prototype.lang = +Accepts.prototype.langs = +Accepts.prototype.language = +Accepts.prototype.languages = function (langs) { + if (!Array.isArray(langs)) langs = slice.call(arguments); + var n = this.negotiator; + if (!langs.length) return n.languages(); + if (!this.headers['accept-language']) return langs[0]; + return n.languages(langs)[0] || false; +} + +/** + * Convert extnames to mime. + * + * @param {String} type + * @return {String} + * @api private + */ + +function extToMime(type) { + if (~type.indexOf('/')) return type; + return mime.lookup(type); +} + +/** + * Check if mime is valid. + * + * @param {String} type + * @return {String} + * @api private + */ + +function validMime(type) { + return typeof type === 'string'; +} diff --git a/server/node_modules/accepts/package.json b/server/node_modules/accepts/package.json new file mode 100644 index 0000000..3a5a6e8 --- /dev/null +++ b/server/node_modules/accepts/package.json @@ -0,0 +1,125 @@ +{ + "_args": [ + [ + { + "raw": "accepts@~1.1.3", + "scope": null, + "escapedName": "accepts", + "name": "accepts", + "rawSpec": "~1.1.3", + "spec": ">=1.1.3 <1.2.0", + "type": "range" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express" + ] + ], + "_from": "accepts@>=1.1.3 <1.2.0", + "_id": "accepts@1.1.4", + "_inCache": true, + "_location": "/accepts", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "raw": "accepts@~1.1.3", + "scope": null, + "escapedName": "accepts", + "name": "accepts", + "rawSpec": "~1.1.3", + "spec": ">=1.1.3 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.1.4.tgz", + "_shasum": "d71c96f7d41d0feda2c38cd14e8a27c04158df4a", + "_shrinkwrap": null, + "_spec": "accepts@~1.1.3", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/jshttp/accepts/issues" + }, + "dependencies": { + "mime-types": "~2.0.4", + "negotiator": "0.4.9" + }, + "description": "Higher-level content negotiation", + "devDependencies": { + "istanbul": "~0.3.4", + "mocha": "~2.0.1" + }, + "directories": {}, + "dist": { + "shasum": "d71c96f7d41d0feda2c38cd14e8a27c04158df4a", + "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.1.4.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "gitHead": "df66414d80f096627b28f137127fce0a851d7900", + "homepage": "https://github.com/jshttp/accepts", + "keywords": [ + "content", + "negotiation", + "accept", + "accepts" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "federomero", + "email": "federomero@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "shtylman", + "email": "shtylman@gmail.com" + }, + { + "name": "mscdex", + "email": "mscdex@mscdex.net" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + } + ], + "name": "accepts", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/accepts.git" + }, + "scripts": { + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.1.4" +} diff --git a/server/node_modules/after/.npmignore b/server/node_modules/after/.npmignore new file mode 100644 index 0000000..6c78602 --- /dev/null +++ b/server/node_modules/after/.npmignore @@ -0,0 +1,2 @@ +node_modules +.monitor diff --git a/server/node_modules/after/.travis.yml b/server/node_modules/after/.travis.yml new file mode 100644 index 0000000..afd72d0 --- /dev/null +++ b/server/node_modules/after/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - 0.6 + - 0.8 + - 0.9 + - 0.10 + - 0.12 + - 4.2.4 + - 5.4.1 + - iojs-1 + - iojs-2 + - iojs-3 diff --git a/server/node_modules/after/LICENCE b/server/node_modules/after/LICENCE new file mode 100644 index 0000000..7c35130 --- /dev/null +++ b/server/node_modules/after/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Raynos. + +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/server/node_modules/after/README.md b/server/node_modules/after/README.md new file mode 100644 index 0000000..fc69096 --- /dev/null +++ b/server/node_modules/after/README.md @@ -0,0 +1,115 @@ +# After [![Build Status][1]][2] + +Invoke callback after n calls + +## Status: production ready + +## Example + +```js +var after = require("after") +var db = require("./db") // some db. + +var updateUser = function (req, res) { + // use after to run two tasks in parallel, + // namely get request body and get session + // then run updateUser with the results + var next = after(2, updateUser) + var results = {} + + getJSONBody(req, res, function (err, body) { + if (err) return next(err) + + results.body = body + next(null, results) + }) + + getSessionUser(req, res, function (err, user) { + if (err) return next(err) + + results.user = user + next(null, results) + }) + + // now do the thing! + function updateUser(err, result) { + if (err) { + res.statusCode = 500 + return res.end("Unexpected Error") + } + + if (!result.user || result.user.role !== "admin") { + res.statusCode = 403 + return res.end("Permission Denied") + } + + db.put("users:" + req.params.userId, result.body, function (err) { + if (err) { + res.statusCode = 500 + return res.end("Unexpected Error") + } + + res.statusCode = 200 + res.end("Ok") + }) + } +} +``` + +## Naive Example + +```js +var after = require("after") + , next = after(3, logItWorks) + +next() +next() +next() // it works + +function logItWorks() { + console.log("it works!") +} +``` + +## Example with error handling + +```js +var after = require("after") + , next = after(3, logError) + +next() +next(new Error("oops")) // logs oops +next() // does nothing + +// This callback is only called once. +// If there is an error the callback gets called immediately +// this avoids the situation where errors get lost. +function logError(err) { + console.log(err) +} +``` + +## Installation + +`npm install after` + +## Tests + +`npm test` + +## Contributors + + - Raynos + - defunctzombie + +## MIT Licenced + + [1]: https://secure.travis-ci.org/Raynos/after.png + [2]: http://travis-ci.org/Raynos/after + [3]: http://raynos.org/blog/2/Flow-control-in-node.js + [4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307 + [5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031 + [6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419 + [7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091 + [8]: http://github.com/Raynos/iterators + [9]: http://github.com/Raynos/composite diff --git a/server/node_modules/after/index.js b/server/node_modules/after/index.js new file mode 100644 index 0000000..ec24879 --- /dev/null +++ b/server/node_modules/after/index.js @@ -0,0 +1,28 @@ +module.exports = after + +function after(count, callback, err_cb) { + var bail = false + err_cb = err_cb || noop + proxy.count = count + + return (count === 0) ? callback() : proxy + + function proxy(err, result) { + if (proxy.count <= 0) { + throw new Error('after called too many times') + } + --proxy.count + + // after first error, rest are passed to err_cb + if (err) { + bail = true + callback(err) + // future error callbacks will go to error handler + callback = err_cb + } else if (proxy.count === 0 && !bail) { + callback(null, result) + } + } +} + +function noop() {} diff --git a/server/node_modules/after/package.json b/server/node_modules/after/package.json new file mode 100644 index 0000000..e949a61 --- /dev/null +++ b/server/node_modules/after/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "after@0.8.2", + "scope": null, + "escapedName": "after", + "name": "after", + "rawSpec": "0.8.2", + "spec": "0.8.2", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser" + ] + ], + "_from": "after@0.8.2", + "_id": "after@0.8.2", + "_inCache": true, + "_location": "/after", + "_nodeVersion": "0.10.32", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/after-0.8.2.tgz_1471308639186_0.9132961586583406" + }, + "_npmUser": { + "name": "raynos", + "email": "raynos2@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "after@0.8.2", + "scope": null, + "escapedName": "after", + "name": "after", + "rawSpec": "0.8.2", + "spec": "0.8.2", + "type": "version" + }, + "_requiredBy": [ + "/engine.io-parser" + ], + "_resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "_shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f", + "_shrinkwrap": null, + "_spec": "after@0.8.2", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/after/issues" + }, + "contributors": [ + { + "name": "Raynos", + "email": "raynos2@gmail.com", + "url": "http://raynos.org" + } + ], + "dependencies": {}, + "description": "after - tiny flow control", + "devDependencies": { + "mocha": "~1.8.1" + }, + "directories": {}, + "dist": { + "shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f", + "tarball": "https://registry.npmjs.org/after/-/after-0.8.2.tgz" + }, + "gitHead": "e8c26046f36962b90e68dc5df33a9672a54b25f5", + "homepage": "https://github.com/Raynos/after#readme", + "keywords": [ + "flowcontrol", + "after", + "flow", + "control", + "arch" + ], + "license": "MIT", + "maintainers": [ + { + "name": "raynos", + "email": "raynos2@gmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + } + ], + "name": "after", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/after.git" + }, + "scripts": { + "test": "mocha --ui tdd --reporter spec test/*.js" + }, + "version": "0.8.2" +} diff --git a/server/node_modules/after/test/after-test.js b/server/node_modules/after/test/after-test.js new file mode 100644 index 0000000..0d63f4c --- /dev/null +++ b/server/node_modules/after/test/after-test.js @@ -0,0 +1,120 @@ +/*global suite, test*/ + +var assert = require("assert") + , after = require("../") + +test("exists", function () { + assert(typeof after === "function", "after is not a function") +}) + +test("after when called with 0 invokes", function (done) { + after(0, done) +}); + +test("after 1", function (done) { + var next = after(1, done) + next() +}) + +test("after 5", function (done) { + var next = after(5, done) + , i = 5 + + while (i--) { + next() + } +}) + +test("manipulate count", function (done) { + var next = after(1, done) + , i = 5 + + next.count = i + while (i--) { + next() + } +}) + +test("after terminates on error", function (done) { + var next = after(2, function(err) { + assert.equal(err.message, 'test'); + done(); + }) + next(new Error('test')) + next(new Error('test2')) +}) + +test('gee', function(done) { + done = after(2, done) + + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + assert.equal(err.message, 2) + done() + }); + + next() + next(new Error(1)) + next(new Error(2)) +}) + +test('eee', function(done) { + done = after(3, done) + + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + assert.equal(err.message, 2) + done() + }); + + next(new Error(1)) + next(new Error(2)) + next(new Error(2)) +}) + +test('gge', function(done) { + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + // should not happen + assert.ok(false); + }); + + next() + next() + next(new Error(1)) +}) + +test('egg', function(done) { + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + // should not happen + assert.ok(false); + }); + + next(new Error(1)) + next() + next() +}) + +test('throws on too many calls', function(done) { + var next = after(1, done); + next() + assert.throws(next, /after called too many times/); +}); + diff --git a/server/node_modules/arraybuffer.slice/.npmignore b/server/node_modules/arraybuffer.slice/.npmignore new file mode 100644 index 0000000..cfbee8d --- /dev/null +++ b/server/node_modules/arraybuffer.slice/.npmignore @@ -0,0 +1,17 @@ +lib-cov +lcov.info +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results +build +.grunt + +node_modules diff --git a/server/node_modules/arraybuffer.slice/Makefile b/server/node_modules/arraybuffer.slice/Makefile new file mode 100644 index 0000000..849887f --- /dev/null +++ b/server/node_modules/arraybuffer.slice/Makefile @@ -0,0 +1,8 @@ + +REPORTER = dot + +test: + @./node_modules/.bin/mocha \ + --reporter $(REPORTER) + +.PHONY: test diff --git a/server/node_modules/arraybuffer.slice/README.md b/server/node_modules/arraybuffer.slice/README.md new file mode 100644 index 0000000..15e465e --- /dev/null +++ b/server/node_modules/arraybuffer.slice/README.md @@ -0,0 +1,17 @@ +# How to +```javascript +var sliceBuffer = require('arraybuffer.slice'); +var ab = (new Int8Array(5)).buffer; +var sliced = sliceBuffer(ab, 1, 3); +sliced = sliceBuffer(ab, 1); +``` + +# Licence (MIT) +Copyright (C) 2013 Rase- + + +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/server/node_modules/arraybuffer.slice/index.js b/server/node_modules/arraybuffer.slice/index.js new file mode 100644 index 0000000..11ac556 --- /dev/null +++ b/server/node_modules/arraybuffer.slice/index.js @@ -0,0 +1,29 @@ +/** + * An abstraction for slicing an arraybuffer even when + * ArrayBuffer.prototype.slice is not supported + * + * @api public + */ + +module.exports = function(arraybuffer, start, end) { + var bytes = arraybuffer.byteLength; + start = start || 0; + end = end || bytes; + + if (arraybuffer.slice) { return arraybuffer.slice(start, end); } + + if (start < 0) { start += bytes; } + if (end < 0) { end += bytes; } + if (end > bytes) { end = bytes; } + + if (start >= bytes || start >= end || bytes === 0) { + return new ArrayBuffer(0); + } + + var abv = new Uint8Array(arraybuffer); + var result = new Uint8Array(end - start); + for (var i = start, ii = 0; i < end; i++, ii++) { + result[ii] = abv[i]; + } + return result.buffer; +}; diff --git a/server/node_modules/arraybuffer.slice/package.json b/server/node_modules/arraybuffer.slice/package.json new file mode 100644 index 0000000..61b853c --- /dev/null +++ b/server/node_modules/arraybuffer.slice/package.json @@ -0,0 +1,72 @@ +{ + "_args": [ + [ + { + "raw": "arraybuffer.slice@0.0.6", + "scope": null, + "escapedName": "arraybuffer.slice", + "name": "arraybuffer.slice", + "rawSpec": "0.0.6", + "spec": "0.0.6", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser" + ] + ], + "_from": "arraybuffer.slice@0.0.6", + "_id": "arraybuffer.slice@0.0.6", + "_inCache": true, + "_location": "/arraybuffer.slice", + "_npmUser": { + "name": "rase-", + "email": "tonykovanen@hotmail.com" + }, + "_npmVersion": "1.3.5", + "_phantomChildren": {}, + "_requested": { + "raw": "arraybuffer.slice@0.0.6", + "scope": null, + "escapedName": "arraybuffer.slice", + "name": "arraybuffer.slice", + "rawSpec": "0.0.6", + "spec": "0.0.6", + "type": "version" + }, + "_requiredBy": [ + "/engine.io-parser" + ], + "_resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "_shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca", + "_shrinkwrap": null, + "_spec": "arraybuffer.slice@0.0.6", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser", + "bugs": { + "url": "https://github.com/rase-/arraybuffer.slice/issues" + }, + "dependencies": {}, + "description": "Exports a function for slicing ArrayBuffers (no polyfilling)", + "devDependencies": { + "expect.js": "0.2.0", + "mocha": "1.17.1" + }, + "directories": {}, + "dist": { + "shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca", + "tarball": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz" + }, + "homepage": "https://github.com/rase-/arraybuffer.slice", + "maintainers": [ + { + "name": "rase-", + "email": "tonykovanen@hotmail.com" + } + ], + "name": "arraybuffer.slice", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rase-/arraybuffer.slice.git" + }, + "version": "0.0.6" +} diff --git a/server/node_modules/arraybuffer.slice/test/slice-buffer.js b/server/node_modules/arraybuffer.slice/test/slice-buffer.js new file mode 100644 index 0000000..4778da6 --- /dev/null +++ b/server/node_modules/arraybuffer.slice/test/slice-buffer.js @@ -0,0 +1,227 @@ +/* + * Test dependencies + */ + +var sliceBuffer = require('../index.js'); +var expect = require('expect.js'); + +/** + * Tests + */ + +describe('sliceBuffer', function() { + describe('using standard slice', function() { + it('should slice correctly with only start provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 3); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with start and end provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 3, 8); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < 8; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 0, -3); + var sabv = new Uint8Array(sliced); + for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, -6, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with equal start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 1, 1); + expect(sliced.byteLength).to.equal(0); + }); + + it('should slice correctly when end larger than buffer', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 0, 100); + expect(new Uint8Array(sliced)).to.eql(abv); + }); + + it('shoud slice correctly when start larger than end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 6, 5); + expect(sliced.byteLength).to.equal(0); + }); + }); + + describe('using fallback', function() { + it('should slice correctly with only start provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 3); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with start and end provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + + var sliced = sliceBuffer(ab, 3, 8); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < 8; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + + var sliced = sliceBuffer(ab, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 0, -3); + var sabv = new Uint8Array(sliced); + for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, -6, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with equal start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 1, 1); + expect(sliced.byteLength).to.equal(0); + }); + + it('should slice correctly when end larger than buffer', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 0, 100); + var sabv = new Uint8Array(sliced); + for (var i = 0; i < abv.length; i++) { + expect(abv[i]).to.equal(sabv[i]); + } + }); + + it('shoud slice correctly when start larger than end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 6, 5); + expect(sliced.byteLength).to.equal(0); + }); + }); +}); diff --git a/server/node_modules/backo2/.npmignore b/server/node_modules/backo2/.npmignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/server/node_modules/backo2/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/server/node_modules/backo2/History.md b/server/node_modules/backo2/History.md new file mode 100644 index 0000000..8eb28b8 --- /dev/null +++ b/server/node_modules/backo2/History.md @@ -0,0 +1,12 @@ + +1.0.1 / 2014-02-17 +================== + + * go away decimal point + * history + +1.0.0 / 2014-02-17 +================== + + * add jitter option + * Initial commit diff --git a/server/node_modules/backo2/Makefile b/server/node_modules/backo2/Makefile new file mode 100644 index 0000000..9987df8 --- /dev/null +++ b/server/node_modules/backo2/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter dot \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/server/node_modules/backo2/Readme.md b/server/node_modules/backo2/Readme.md new file mode 100644 index 0000000..0df2a39 --- /dev/null +++ b/server/node_modules/backo2/Readme.md @@ -0,0 +1,34 @@ +# backo + + Simple exponential backoff because the others seem to have weird abstractions. + +## Installation + +``` +$ npm install backo +``` + +## Options + + - `min` initial timeout in milliseconds [100] + - `max` max timeout [10000] + - `jitter` [0] + - `factor` [2] + +## Example + +```js +var Backoff = require('backo'); +var backoff = new Backoff({ min: 100, max: 20000 }); + +setTimeout(function(){ + something.reconnect(); +}, backoff.duration()); + +// later when something works +backoff.reset() +``` + +# License + + MIT diff --git a/server/node_modules/backo2/component.json b/server/node_modules/backo2/component.json new file mode 100644 index 0000000..994845a --- /dev/null +++ b/server/node_modules/backo2/component.json @@ -0,0 +1,11 @@ +{ + "name": "backo", + "repo": "segmentio/backo", + "dependencies": {}, + "version": "1.0.1", + "description": "simple backoff without the weird abstractions", + "keywords": ["backoff"], + "license": "MIT", + "scripts": ["index.js"], + "main": "index.js" +} diff --git a/server/node_modules/backo2/index.js b/server/node_modules/backo2/index.js new file mode 100644 index 0000000..fac4429 --- /dev/null +++ b/server/node_modules/backo2/index.js @@ -0,0 +1,85 @@ + +/** + * Expose `Backoff`. + */ + +module.exports = Backoff; + +/** + * Initialize backoff timer with `opts`. + * + * - `min` initial timeout in milliseconds [100] + * - `max` max timeout [10000] + * - `jitter` [0] + * - `factor` [2] + * + * @param {Object} opts + * @api public + */ + +function Backoff(opts) { + opts = opts || {}; + this.ms = opts.min || 100; + this.max = opts.max || 10000; + this.factor = opts.factor || 2; + this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0; + this.attempts = 0; +} + +/** + * Return the backoff duration. + * + * @return {Number} + * @api public + */ + +Backoff.prototype.duration = function(){ + var ms = this.ms * Math.pow(this.factor, this.attempts++); + if (this.jitter) { + var rand = Math.random(); + var deviation = Math.floor(rand * this.jitter * ms); + ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation; + } + return Math.min(ms, this.max) | 0; +}; + +/** + * Reset the number of attempts. + * + * @api public + */ + +Backoff.prototype.reset = function(){ + this.attempts = 0; +}; + +/** + * Set the minimum duration + * + * @api public + */ + +Backoff.prototype.setMin = function(min){ + this.ms = min; +}; + +/** + * Set the maximum duration + * + * @api public + */ + +Backoff.prototype.setMax = function(max){ + this.max = max; +}; + +/** + * Set the jitter + * + * @api public + */ + +Backoff.prototype.setJitter = function(jitter){ + this.jitter = jitter; +}; + diff --git a/server/node_modules/backo2/package.json b/server/node_modules/backo2/package.json new file mode 100644 index 0000000..879eb52 --- /dev/null +++ b/server/node_modules/backo2/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + { + "raw": "backo2@1.0.2", + "scope": null, + "escapedName": "backo2", + "name": "backo2", + "rawSpec": "1.0.2", + "spec": "1.0.2", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/socket.io-client" + ] + ], + "_from": "backo2@1.0.2", + "_id": "backo2@1.0.2", + "_inCache": true, + "_location": "/backo2", + "_npmUser": { + "name": "mokesmokes", + "email": "mokesmokes@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "backo2@1.0.2", + "scope": null, + "escapedName": "backo2", + "name": "backo2", + "rawSpec": "1.0.2", + "spec": "1.0.2", + "type": "version" + }, + "_requiredBy": [ + "/socket.io-client" + ], + "_resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "_shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947", + "_shrinkwrap": null, + "_spec": "backo2@1.0.2", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/socket.io-client", + "bugs": { + "url": "https://github.com/mokesmokes/backo/issues" + }, + "dependencies": {}, + "description": "simple backoff based on segmentio/backo", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947", + "tarball": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz" + }, + "gitHead": "3e695bade7756fef2295e8883bf3570a06e5d9ec", + "homepage": "https://github.com/mokesmokes/backo", + "keywords": [ + "backoff" + ], + "license": "MIT", + "maintainers": [ + { + "name": "mokesmokes", + "email": "mokesmokes@gmail.com" + } + ], + "name": "backo2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mokesmokes/backo.git" + }, + "scripts": {}, + "version": "1.0.2" +} diff --git a/server/node_modules/backo2/test/index.js b/server/node_modules/backo2/test/index.js new file mode 100644 index 0000000..ea1f6de --- /dev/null +++ b/server/node_modules/backo2/test/index.js @@ -0,0 +1,18 @@ + +var Backoff = require('..'); +var assert = require('assert'); + +describe('.duration()', function(){ + it('should increase the backoff', function(){ + var b = new Backoff; + + assert(100 == b.duration()); + assert(200 == b.duration()); + assert(400 == b.duration()); + assert(800 == b.duration()); + + b.reset(); + assert(100 == b.duration()); + assert(200 == b.duration()); + }) +}) \ No newline at end of file diff --git a/server/node_modules/base64-arraybuffer/.npmignore b/server/node_modules/base64-arraybuffer/.npmignore new file mode 100644 index 0000000..332ee5a --- /dev/null +++ b/server/node_modules/base64-arraybuffer/.npmignore @@ -0,0 +1,3 @@ +/node_modules/ +Gruntfile.js +/test/ diff --git a/server/node_modules/base64-arraybuffer/.travis.yml b/server/node_modules/base64-arraybuffer/.travis.yml new file mode 100644 index 0000000..19259a5 --- /dev/null +++ b/server/node_modules/base64-arraybuffer/.travis.yml @@ -0,0 +1,19 @@ +language: node_js +node_js: +- '0.12' +- iojs-1 +- iojs-2 +- iojs-3 +- '4.1' +before_script: +- npm install +before_install: npm install -g npm@'>=2.13.5' +deploy: + provider: npm + email: niklasvh@gmail.com + api_key: + secure: oHV9ArprTj5WOk7MP1UF7QMJ70huXw+y7xXb5wF4+V2H8Hyfa5TfE0DiOmqrube1WXTeH1FLgq54shp/sJWi47Hkg/GyeoB5NnsPhYEaJkaON9UG5blML+ODiNVsEnq/1kNBQ8e0+0JItMPLGySKyFmuZ3yflulXKS8O88mfINo= + on: + tags: true + branch: master + repo: niklasvh/base64-arraybuffer diff --git a/server/node_modules/base64-arraybuffer/LICENSE-MIT b/server/node_modules/base64-arraybuffer/LICENSE-MIT new file mode 100644 index 0000000..ed27b41 --- /dev/null +++ b/server/node_modules/base64-arraybuffer/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2012 Niklas von Hertzen + +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/server/node_modules/base64-arraybuffer/README.md b/server/node_modules/base64-arraybuffer/README.md new file mode 100644 index 0000000..50009e4 --- /dev/null +++ b/server/node_modules/base64-arraybuffer/README.md @@ -0,0 +1,20 @@ +# base64-arraybuffer + +[![Build Status](https://travis-ci.org/niklasvh/base64-arraybuffer.png)](https://travis-ci.org/niklasvh/base64-arraybuffer) +[![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) +[![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) + +Encode/decode base64 data into ArrayBuffers + +## Getting Started +Install the module with: `npm install base64-arraybuffer` + +## API +The library encodes and decodes base64 to and from ArrayBuffers + + - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string + - __decode(str)__ - Decodes base64 string to `ArrayBuffer` + +## License +Copyright (c) 2012 Niklas von Hertzen +Licensed under the MIT license. diff --git a/server/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js b/server/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js new file mode 100644 index 0000000..e6b6306 --- /dev/null +++ b/server/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js @@ -0,0 +1,67 @@ +/* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ +(function(){ + "use strict"; + + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + // Use a lookup table to find the index. + var lookup = new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + + exports.encode = function(arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, len = bytes.length, base64 = ""; + + for (i = 0; i < len; i+=3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, i, p = 0, + encoded1, encoded2, encoded3, encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i+=4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i+1)]; + encoded3 = lookup[base64.charCodeAt(i+2)]; + encoded4 = lookup[base64.charCodeAt(i+3)]; + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arraybuffer; + }; +})(); diff --git a/server/node_modules/base64-arraybuffer/package.json b/server/node_modules/base64-arraybuffer/package.json new file mode 100644 index 0000000..d085c24 --- /dev/null +++ b/server/node_modules/base64-arraybuffer/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + { + "raw": "base64-arraybuffer@0.1.5", + "scope": null, + "escapedName": "base64-arraybuffer", + "name": "base64-arraybuffer", + "rawSpec": "0.1.5", + "spec": "0.1.5", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser" + ] + ], + "_from": "base64-arraybuffer@0.1.5", + "_id": "base64-arraybuffer@0.1.5", + "_inCache": true, + "_location": "/base64-arraybuffer", + "_nodeVersion": "2.5.0", + "_npmUser": { + "name": "niklasvh", + "email": "niklasvh@gmail.com" + }, + "_npmVersion": "3.4.0", + "_phantomChildren": {}, + "_requested": { + "raw": "base64-arraybuffer@0.1.5", + "scope": null, + "escapedName": "base64-arraybuffer", + "name": "base64-arraybuffer", + "rawSpec": "0.1.5", + "spec": "0.1.5", + "type": "version" + }, + "_requiredBy": [ + "/engine.io-parser" + ], + "_resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "_shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8", + "_shrinkwrap": null, + "_spec": "base64-arraybuffer@0.1.5", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser", + "author": { + "name": "Niklas von Hertzen", + "email": "niklasvh@gmail.com", + "url": "http://hertzen.com" + }, + "bugs": { + "url": "https://github.com/niklasvh/base64-arraybuffer/issues" + }, + "dependencies": {}, + "description": "Encode/decode base64 data into ArrayBuffers", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-cli": "^0.1.13", + "grunt-contrib-jshint": "^0.11.2", + "grunt-contrib-nodeunit": "^0.4.1", + "grunt-contrib-watch": "^0.6.1" + }, + "directories": {}, + "dist": { + "shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8", + "tarball": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz" + }, + "engines": { + "node": ">= 0.6.0" + }, + "gitHead": "e9457ccb7b140f5ae54a2880c8e9b967ffb03a7d", + "homepage": "https://github.com/niklasvh/base64-arraybuffer", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT" + } + ], + "main": "lib/base64-arraybuffer", + "maintainers": [ + { + "name": "niklasvh", + "email": "niklasvh@gmail.com" + } + ], + "name": "base64-arraybuffer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/niklasvh/base64-arraybuffer.git" + }, + "scripts": { + "test": "grunt nodeunit" + }, + "version": "0.1.5" +} diff --git a/server/node_modules/base64id/.npmignore b/server/node_modules/base64id/.npmignore new file mode 100644 index 0000000..39e9864 --- /dev/null +++ b/server/node_modules/base64id/.npmignore @@ -0,0 +1,3 @@ +support +test +examples diff --git a/server/node_modules/base64id/LICENSE b/server/node_modules/base64id/LICENSE new file mode 100644 index 0000000..0d03c83 --- /dev/null +++ b/server/node_modules/base64id/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012-2016 Kristian Faeldt + +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/server/node_modules/base64id/README.md b/server/node_modules/base64id/README.md new file mode 100644 index 0000000..17689e6 --- /dev/null +++ b/server/node_modules/base64id/README.md @@ -0,0 +1,18 @@ +base64id +======== + +Node.js module that generates a base64 id. + +Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4. + +To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes. + +## Installation + + $ npm install base64id + +## Usage + + var base64id = require('base64id'); + + var id = base64id.generateId(); diff --git a/server/node_modules/base64id/lib/base64id.js b/server/node_modules/base64id/lib/base64id.js new file mode 100644 index 0000000..f688159 --- /dev/null +++ b/server/node_modules/base64id/lib/base64id.js @@ -0,0 +1,103 @@ +/*! + * base64id v0.1.0 + */ + +/** + * Module dependencies + */ + +var crypto = require('crypto'); + +/** + * Constructor + */ + +var Base64Id = function() { }; + +/** + * Get random bytes + * + * Uses a buffer if available, falls back to crypto.randomBytes + */ + +Base64Id.prototype.getRandomBytes = function(bytes) { + + var BUFFER_SIZE = 4096 + var self = this; + + bytes = bytes || 12; + + if (bytes > BUFFER_SIZE) { + return crypto.randomBytes(bytes); + } + + var bytesInBuffer = parseInt(BUFFER_SIZE/bytes); + var threshold = parseInt(bytesInBuffer*0.85); + + if (!threshold) { + return crypto.randomBytes(bytes); + } + + if (this.bytesBufferIndex == null) { + this.bytesBufferIndex = -1; + } + + if (this.bytesBufferIndex == bytesInBuffer) { + this.bytesBuffer = null; + this.bytesBufferIndex = -1; + } + + // No buffered bytes available or index above threshold + if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) { + + if (!this.isGeneratingBytes) { + this.isGeneratingBytes = true; + crypto.randomBytes(BUFFER_SIZE, function(err, bytes) { + self.bytesBuffer = bytes; + self.bytesBufferIndex = 0; + self.isGeneratingBytes = false; + }); + } + + // Fall back to sync call when no buffered bytes are available + if (this.bytesBufferIndex == -1) { + return crypto.randomBytes(bytes); + } + } + + var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1)); + this.bytesBufferIndex++; + + return result; +} + +/** + * Generates a base64 id + * + * (Original version from socket.io ) + */ + +Base64Id.prototype.generateId = function () { + var rand = new Buffer(15); // multiple of 3 for base64 + if (!rand.writeInt32BE) { + return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString() + + Math.abs(Math.random() * Math.random() * Date.now() | 0).toString(); + } + this.sequenceNumber = (this.sequenceNumber + 1) | 0; + rand.writeInt32BE(this.sequenceNumber, 11); + if (crypto.randomBytes) { + this.getRandomBytes(12).copy(rand); + } else { + // not secure for node 0.4 + [0, 4, 8].forEach(function(i) { + rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i); + }); + } + return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-'); +}; + +/** + * Export + */ + +exports = module.exports = new Base64Id(); diff --git a/server/node_modules/base64id/package.json b/server/node_modules/base64id/package.json new file mode 100644 index 0000000..c52b152 --- /dev/null +++ b/server/node_modules/base64id/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + { + "raw": "base64id@1.0.0", + "scope": null, + "escapedName": "base64id", + "name": "base64id", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io" + ] + ], + "_from": "base64id@1.0.0", + "_id": "base64id@1.0.0", + "_inCache": true, + "_location": "/base64id", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/base64id-1.0.0.tgz_1480551701495_0.042360062478110194" + }, + "_npmUser": { + "name": "darrachequesne", + "email": "damien.arrachequesne@gmail.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "base64id@1.0.0", + "scope": null, + "escapedName": "base64id", + "name": "base64id", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "_requiredBy": [ + "/engine.io" + ], + "_resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", + "_shasum": "47688cb99bb6804f0e06d3e763b1c32e57d8e6b6", + "_shrinkwrap": null, + "_spec": "base64id@1.0.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io", + "author": { + "name": "Kristian Faeldt", + "email": "faeldt_kristian@cyberagent.co.jp" + }, + "bugs": { + "url": "https://github.com/faeldt/base64id/issues" + }, + "dependencies": {}, + "description": "Generates a base64 id", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "47688cb99bb6804f0e06d3e763b1c32e57d8e6b6", + "tarball": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz" + }, + "engines": { + "node": ">= 0.4.0" + }, + "gitHead": "3c846f0818ff88b683ad39fde2f8e015ce0f9807", + "homepage": "https://github.com/faeldt/base64id#readme", + "license": "MIT", + "main": "./lib/base64id.js", + "maintainers": [ + { + "name": "darrachequesne", + "email": "damien.arrachequesne@gmail.com" + }, + { + "name": "faeldt_kristian", + "email": "kristian.faeldt@gmail.com" + } + ], + "name": "base64id", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/faeldt/base64id.git" + }, + "scripts": {}, + "version": "1.0.0" +} diff --git a/server/node_modules/better-assert/.npmignore b/server/node_modules/better-assert/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/server/node_modules/better-assert/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/server/node_modules/better-assert/History.md b/server/node_modules/better-assert/History.md new file mode 100644 index 0000000..cbb579b --- /dev/null +++ b/server/node_modules/better-assert/History.md @@ -0,0 +1,15 @@ + +1.0.0 / 2013-02-03 +================== + + * Stop using the removed magic __stack global getter + +0.1.0 / 2012-10-04 +================== + + * add throwing of AssertionError for test frameworks etc + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/server/node_modules/better-assert/Makefile b/server/node_modules/better-assert/Makefile new file mode 100644 index 0000000..36a3ed7 --- /dev/null +++ b/server/node_modules/better-assert/Makefile @@ -0,0 +1,5 @@ + +test: + @echo "populate me" + +.PHONY: test \ No newline at end of file diff --git a/server/node_modules/better-assert/Readme.md b/server/node_modules/better-assert/Readme.md new file mode 100644 index 0000000..d8d3a63 --- /dev/null +++ b/server/node_modules/better-assert/Readme.md @@ -0,0 +1,61 @@ + +# better-assert + + Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for + self-documenting failure messages. + +## Installation + + $ npm install better-assert + +## Example + + By default assertions are enabled, however the __NO_ASSERT__ environment variable + will deactivate them when truthy. + +```js +var assert = require('better-assert'); + +test(); + +function test() { + var user = { name: 'tobi' }; + assert('tobi' == user.name); + assert('number' == typeof user.age); +} + +AssertionError: 'number' == typeof user.age + at test (/Users/tj/projects/better-assert/example.js:9:3) + at Object. (/Users/tj/projects/better-assert/example.js:4:1) + at Module._compile (module.js:449:26) + at Object.Module._extensions..js (module.js:467:10) + at Module.load (module.js:356:32) + at Function.Module._load (module.js:312:12) + at Module.runMain (module.js:492:10) + at process.startup.processNextTick.process._tickCallback (node.js:244:9) +``` + +## License + +(The MIT License) + +Copyright (c) 2012 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/server/node_modules/better-assert/example.js b/server/node_modules/better-assert/example.js new file mode 100644 index 0000000..688c29e --- /dev/null +++ b/server/node_modules/better-assert/example.js @@ -0,0 +1,10 @@ + +var assert = require('./'); + +test(); + +function test() { + var user = { name: 'tobi' }; + assert('tobi' == user.name); + assert('number' == typeof user.age); +} \ No newline at end of file diff --git a/server/node_modules/better-assert/index.js b/server/node_modules/better-assert/index.js new file mode 100644 index 0000000..fd1c9b7 --- /dev/null +++ b/server/node_modules/better-assert/index.js @@ -0,0 +1,38 @@ +/** + * Module dependencies. + */ + +var AssertionError = require('assert').AssertionError + , callsite = require('callsite') + , fs = require('fs') + +/** + * Expose `assert`. + */ + +module.exports = process.env.NO_ASSERT + ? function(){} + : assert; + +/** + * Assert the given `expr`. + */ + +function assert(expr) { + if (expr) return; + + var stack = callsite(); + var call = stack[1]; + var file = call.getFileName(); + var lineno = call.getLineNumber(); + var src = fs.readFileSync(file, 'utf8'); + var line = src.split('\n')[lineno-1]; + var src = line.match(/assert\((.*)\)/)[1]; + + var err = new AssertionError({ + message: src, + stackStartFunction: stack[0].getFunction() + }); + + throw err; +} diff --git a/server/node_modules/better-assert/package.json b/server/node_modules/better-assert/package.json new file mode 100644 index 0000000..08ecc09 --- /dev/null +++ b/server/node_modules/better-assert/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "better-assert@~1.0.0", + "scope": null, + "escapedName": "better-assert", + "name": "better-assert", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/parsejson" + ] + ], + "_from": "better-assert@>=1.0.0 <1.1.0", + "_id": "better-assert@1.0.2", + "_inCache": true, + "_location": "/better-assert", + "_npmUser": { + "name": "tony_ado", + "email": "coolhzb@163.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "better-assert@~1.0.0", + "scope": null, + "escapedName": "better-assert", + "name": "better-assert", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/parsejson", + "/parseqs", + "/parseuri" + ], + "_resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "_shasum": "40866b9e1b9e0b55b481894311e68faffaebc522", + "_shrinkwrap": null, + "_spec": "better-assert@~1.0.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/parsejson", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bugs": { + "url": "https://github.com/visionmedia/better-assert/issues" + }, + "contributors": [ + { + "name": "TonyHe", + "email": "coolhzb@163.com" + }, + { + "name": "ForbesLindesay" + } + ], + "dependencies": { + "callsite": "1.0.0" + }, + "description": "Better assertions for node, reporting the expr, filename, lineno etc", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "40866b9e1b9e0b55b481894311e68faffaebc522", + "tarball": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/visionmedia/better-assert", + "keywords": [ + "assert", + "stack", + "trace", + "debug" + ], + "main": "index", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tony_ado", + "email": "coolhzb@163.com" + } + ], + "name": "better-assert", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/better-assert.git" + }, + "version": "1.0.2" +} diff --git a/server/node_modules/blob/.npmignore b/server/node_modules/blob/.npmignore new file mode 100644 index 0000000..548a368 --- /dev/null +++ b/server/node_modules/blob/.npmignore @@ -0,0 +1,2 @@ +node_modules +blob.js diff --git a/server/node_modules/blob/.zuul.yml b/server/node_modules/blob/.zuul.yml new file mode 100644 index 0000000..380c395 --- /dev/null +++ b/server/node_modules/blob/.zuul.yml @@ -0,0 +1,14 @@ +ui: mocha-bdd +browsers: + - name: chrome + version: 8..latest + - name: firefox + version: 7..latest + - name: safari + version: 6..latest + - name: opera + version: 12.1..latest + - name: ie + version: 10..latest + - name: android + version: latest diff --git a/server/node_modules/blob/Makefile b/server/node_modules/blob/Makefile new file mode 100644 index 0000000..7d9601a --- /dev/null +++ b/server/node_modules/blob/Makefile @@ -0,0 +1,14 @@ +REPORTER = dot + +build: blob.js + +blob.js: + @./node_modules/.bin/browserify --standalone blob index.js > blob.js + +test: + @./node_modules/.bin/zuul -- test/index.js + +clean: + rm blob.js + +.PHONY: test blob.js diff --git a/server/node_modules/blob/README.md b/server/node_modules/blob/README.md new file mode 100644 index 0000000..6915955 --- /dev/null +++ b/server/node_modules/blob/README.md @@ -0,0 +1,14 @@ +Blob +==== + +A module that exports a constructor that uses window.Blob when available, and a BlobBuilder with any vendor prefix in other cases. If neither is available, it exports undefined. + +Usage: + +```javascript +var Blob = require('blob'); +var b = new Blob(['hi', 'constructing', 'a', 'blob']); +``` + +## Licence +MIT diff --git a/server/node_modules/blob/index.js b/server/node_modules/blob/index.js new file mode 100644 index 0000000..cad3f84 --- /dev/null +++ b/server/node_modules/blob/index.js @@ -0,0 +1,96 @@ +/** + * Create a blob builder even when vendor prefixes exist + */ + +var BlobBuilder = global.BlobBuilder + || global.WebKitBlobBuilder + || global.MSBlobBuilder + || global.MozBlobBuilder; + +/** + * Check if Blob constructor is supported + */ + +var blobSupported = (function() { + try { + var a = new Blob(['hi']); + return a.size === 2; + } catch(e) { + return false; + } +})(); + +/** + * Check if Blob constructor supports ArrayBufferViews + * Fails in Safari 6, so we need to map to ArrayBuffers there. + */ + +var blobSupportsArrayBufferView = blobSupported && (function() { + try { + var b = new Blob([new Uint8Array([1,2])]); + return b.size === 2; + } catch(e) { + return false; + } +})(); + +/** + * Check if BlobBuilder is supported + */ + +var blobBuilderSupported = BlobBuilder + && BlobBuilder.prototype.append + && BlobBuilder.prototype.getBlob; + +/** + * Helper function that maps ArrayBufferViews to ArrayBuffers + * Used by BlobBuilder constructor and old browsers that didn't + * support it in the Blob constructor. + */ + +function mapArrayBufferViews(ary) { + for (var i = 0; i < ary.length; i++) { + var chunk = ary[i]; + if (chunk.buffer instanceof ArrayBuffer) { + var buf = chunk.buffer; + + // if this is a subarray, make a copy so we only + // include the subarray region from the underlying buffer + if (chunk.byteLength !== buf.byteLength) { + var copy = new Uint8Array(chunk.byteLength); + copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); + buf = copy.buffer; + } + + ary[i] = buf; + } + } +} + +function BlobBuilderConstructor(ary, options) { + options = options || {}; + + var bb = new BlobBuilder(); + mapArrayBufferViews(ary); + + for (var i = 0; i < ary.length; i++) { + bb.append(ary[i]); + } + + return (options.type) ? bb.getBlob(options.type) : bb.getBlob(); +}; + +function BlobConstructor(ary, options) { + mapArrayBufferViews(ary); + return new Blob(ary, options || {}); +}; + +module.exports = (function() { + if (blobSupported) { + return blobSupportsArrayBufferView ? global.Blob : BlobConstructor; + } else if (blobBuilderSupported) { + return BlobBuilderConstructor; + } else { + return undefined; + } +})(); diff --git a/server/node_modules/blob/package.json b/server/node_modules/blob/package.json new file mode 100644 index 0000000..516d865 --- /dev/null +++ b/server/node_modules/blob/package.json @@ -0,0 +1,77 @@ +{ + "_args": [ + [ + { + "raw": "blob@0.0.4", + "scope": null, + "escapedName": "blob", + "name": "blob", + "rawSpec": "0.0.4", + "spec": "0.0.4", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser" + ] + ], + "_from": "blob@0.0.4", + "_id": "blob@0.0.4", + "_inCache": true, + "_location": "/blob", + "_npmUser": { + "name": "rase-", + "email": "tonykovanen@hotmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "blob@0.0.4", + "scope": null, + "escapedName": "blob", + "name": "blob", + "rawSpec": "0.0.4", + "spec": "0.0.4", + "type": "version" + }, + "_requiredBy": [ + "/engine.io-parser" + ], + "_resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "_shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921", + "_shrinkwrap": null, + "_spec": "blob@0.0.4", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-parser", + "bugs": { + "url": "https://github.com/rase-/blob/issues" + }, + "dependencies": {}, + "description": "Abstracts out Blob and uses BlobBulder in cases where it is supported with any vendor prefix.", + "devDependencies": { + "browserify": "3.30.1", + "expect.js": "0.2.0", + "mocha": "1.17.1", + "zuul": "1.5.4" + }, + "directories": {}, + "dist": { + "shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921", + "tarball": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz" + }, + "homepage": "https://github.com/rase-/blob", + "maintainers": [ + { + "name": "rase-", + "email": "tonykovanen@hotmail.com" + } + ], + "name": "blob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rase-/blob.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.0.4" +} diff --git a/server/node_modules/blob/test/index.js b/server/node_modules/blob/test/index.js new file mode 100644 index 0000000..df9303f --- /dev/null +++ b/server/node_modules/blob/test/index.js @@ -0,0 +1,94 @@ +var Blob = require('../'); +var expect = require('expect.js'); + +describe('blob', function() { + if (!Blob) { + it('should not have a blob or a blob builder in the global namespace, or blob should not be a constructor function if the module exports false', function() { + try { + var ab = (new Uint8Array(5)).buffer; + global.Blob([ab]); + expect().fail('Blob shouldn\'t be constructable'); + } catch (e) {} + + var BlobBuilder = global.BlobBuilder + || global.WebKitBlobBuilder + || global.MSBlobBuilder + || global.MozBlobBuilder; + expect(BlobBuilder).to.be(undefined); + }); + } else { + it('should encode a proper sized blob when given a string argument', function() { + var b = new Blob(['hi']); + expect(b.size).to.be(2); + }); + + it('should encode a blob with proper size when given two strings as arguments', function() { + var b = new Blob(['hi', 'hello']); + expect(b.size).to.be(7); + }); + + it('should encode arraybuffers with right content', function(done) { + var ary = new Uint8Array(5); + for (var i = 0; i < 5; i++) ary[i] = i; + var b = new Blob([ary.buffer]); + var fr = new FileReader(); + fr.onload = function() { + var newAry = new Uint8Array(this.result); + for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i); + done(); + }; + fr.readAsArrayBuffer(b); + }); + + it('should encode typed arrays with right content', function(done) { + var ary = new Uint8Array(5); + for (var i = 0; i < 5; i++) ary[i] = i; + var b = new Blob([ary]); + var fr = new FileReader(); + fr.onload = function() { + var newAry = new Uint8Array(this.result); + for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i); + done(); + }; + fr.readAsArrayBuffer(b); + }); + + it('should encode sliced typed arrays with right content', function(done) { + var ary = new Uint8Array(5); + for (var i = 0; i < 5; i++) ary[i] = i; + var b = new Blob([ary.subarray(2)]); + var fr = new FileReader(); + fr.onload = function() { + var newAry = new Uint8Array(this.result); + for (var i = 0; i < 3; i++) expect(newAry[i]).to.be(i + 2); + done(); + }; + fr.readAsArrayBuffer(b); + }); + + it('should encode with blobs', function(done) { + var ary = new Uint8Array(5); + for (var i = 0; i < 5; i++) ary[i] = i; + var b = new Blob([new Blob([ary.buffer])]); + var fr = new FileReader(); + fr.onload = function() { + var newAry = new Uint8Array(this.result); + for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i); + done(); + }; + fr.readAsArrayBuffer(b); + }); + + it('should enode mixed contents to right size', function() { + var ary = new Uint8Array(5); + for (var i = 0; i < 5; i++) ary[i] = i; + var b = new Blob([ary.buffer, 'hello']); + expect(b.size).to.be(10); + }); + + it('should accept mime type', function() { + var b = new Blob(['hi', 'hello'], { type: 'text/html' }); + expect(b.type).to.be('text/html'); + }); + } +}); diff --git a/server/node_modules/callsite/.npmignore b/server/node_modules/callsite/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/server/node_modules/callsite/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/server/node_modules/callsite/History.md b/server/node_modules/callsite/History.md new file mode 100644 index 0000000..4994198 --- /dev/null +++ b/server/node_modules/callsite/History.md @@ -0,0 +1,10 @@ + +1.0.0 / 2013-01-24 +================== + + * remove lame magical getters + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/server/node_modules/callsite/Makefile b/server/node_modules/callsite/Makefile new file mode 100644 index 0000000..634e372 --- /dev/null +++ b/server/node_modules/callsite/Makefile @@ -0,0 +1,6 @@ + +test: + @./node_modules/.bin/mocha \ + --require should + +.PHONY: test \ No newline at end of file diff --git a/server/node_modules/callsite/Readme.md b/server/node_modules/callsite/Readme.md new file mode 100644 index 0000000..0dbd16a --- /dev/null +++ b/server/node_modules/callsite/Readme.md @@ -0,0 +1,44 @@ +# callstack + + Access to v8's "raw" `CallSite`s. + +## Installation + + $ npm install callsite + +## Example + +```js +var stack = require('callsite'); + +foo(); + +function foo() { + bar(); +} + +function bar() { + baz(); +} + +function baz() { + console.log(); + stack().forEach(function(site){ + console.log(' \033[36m%s\033[90m in %s:%d\033[0m' + , site.getFunctionName() || 'anonymous' + , site.getFileName() + , site.getLineNumber()); + }); + console.log(); +} +``` + +## Why? + + Because you can do weird, stupid, clever, wacky things such as: + + - [better-assert](https://github.com/visionmedia/better-assert) + +## License + + MIT diff --git a/server/node_modules/callsite/index.js b/server/node_modules/callsite/index.js new file mode 100644 index 0000000..d3ee6f8 --- /dev/null +++ b/server/node_modules/callsite/index.js @@ -0,0 +1,10 @@ + +module.exports = function(){ + var orig = Error.prepareStackTrace; + Error.prepareStackTrace = function(_, stack){ return stack; }; + var err = new Error; + Error.captureStackTrace(err, arguments.callee); + var stack = err.stack; + Error.prepareStackTrace = orig; + return stack; +}; diff --git a/server/node_modules/callsite/package.json b/server/node_modules/callsite/package.json new file mode 100644 index 0000000..9f90631 --- /dev/null +++ b/server/node_modules/callsite/package.json @@ -0,0 +1,77 @@ +{ + "_args": [ + [ + { + "raw": "callsite@1.0.0", + "scope": null, + "escapedName": "callsite", + "name": "callsite", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/better-assert" + ] + ], + "_from": "callsite@1.0.0", + "_id": "callsite@1.0.0", + "_inCache": true, + "_location": "/callsite", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "_npmVersion": "1.2.2", + "_phantomChildren": {}, + "_requested": { + "raw": "callsite@1.0.0", + "scope": null, + "escapedName": "callsite", + "name": "callsite", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "_requiredBy": [ + "/better-assert" + ], + "_resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "_shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20", + "_shrinkwrap": null, + "_spec": "callsite@1.0.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/better-assert", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "dependencies": {}, + "description": "access to v8's CallSites", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20", + "tarball": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "keywords": [ + "stack", + "trace", + "line" + ], + "main": "index", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "name": "callsite", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "version": "1.0.0" +} diff --git a/server/node_modules/component-bind/.npmignore b/server/node_modules/component-bind/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/server/node_modules/component-bind/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/server/node_modules/component-bind/History.md b/server/node_modules/component-bind/History.md new file mode 100644 index 0000000..2795fdb --- /dev/null +++ b/server/node_modules/component-bind/History.md @@ -0,0 +1,13 @@ + +1.0.0 / 2014-05-27 +================== + + * index: use slice ref (#7, @viatropos) + * package: rename package to "component-bind" + * package: add "repository" field (#6, @repoify) + * package: add "component" section + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/server/node_modules/component-bind/Makefile b/server/node_modules/component-bind/Makefile new file mode 100644 index 0000000..4e9c8d3 --- /dev/null +++ b/server/node_modules/component-bind/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec + +.PHONY: test \ No newline at end of file diff --git a/server/node_modules/component-bind/Readme.md b/server/node_modules/component-bind/Readme.md new file mode 100644 index 0000000..6a8febc --- /dev/null +++ b/server/node_modules/component-bind/Readme.md @@ -0,0 +1,64 @@ +# bind + + Function binding utility. + +## Installation + +``` +$ component install component/bind +``` + +## API + + - [bind(obj, fn)](#bindobj-fn) + - [bind(obj, fn, ...)](#bindobj-fn-) + - [bind(obj, name)](#bindobj-name) + + + +### bind(obj, fn) +should bind the function to the given object. + +```js +var tobi = { name: 'tobi' }; + +function name() { + return this.name; +} + +var fn = bind(tobi, name); +fn().should.equal('tobi'); +``` + + +### bind(obj, fn, ...) +should curry the remaining arguments. + +```js +function add(a, b) { + return a + b; +} + +bind(null, add)(1, 2).should.equal(3); +bind(null, add, 1)(2).should.equal(3); +bind(null, add, 1, 2)().should.equal(3); +``` + + +### bind(obj, name) +should bind the method of the given name. + +```js +var tobi = { name: 'tobi' }; + +tobi.getName = function() { + return this.name; +}; + +var fn = bind(tobi, 'getName'); +fn().should.equal('tobi'); +``` + +## License + + MIT \ No newline at end of file diff --git a/server/node_modules/component-bind/component.json b/server/node_modules/component-bind/component.json new file mode 100644 index 0000000..4e1e93f --- /dev/null +++ b/server/node_modules/component-bind/component.json @@ -0,0 +1,13 @@ +{ + "name": "bind", + "version": "1.0.0", + "description": "function binding utility", + "keywords": [ + "bind", + "utility" + ], + "dependencies": {}, + "scripts": [ + "index.js" + ] +} diff --git a/server/node_modules/component-bind/index.js b/server/node_modules/component-bind/index.js new file mode 100644 index 0000000..4eeb2c0 --- /dev/null +++ b/server/node_modules/component-bind/index.js @@ -0,0 +1,23 @@ +/** + * Slice reference. + */ + +var slice = [].slice; + +/** + * Bind `obj` to `fn`. + * + * @param {Object} obj + * @param {Function|String} fn or string + * @return {Function} + * @api public + */ + +module.exports = function(obj, fn){ + if ('string' == typeof fn) fn = obj[fn]; + if ('function' != typeof fn) throw new Error('bind() requires a function'); + var args = slice.call(arguments, 2); + return function(){ + return fn.apply(obj, args.concat(slice.call(arguments))); + } +}; diff --git a/server/node_modules/component-bind/package.json b/server/node_modules/component-bind/package.json new file mode 100644 index 0000000..e4e706e --- /dev/null +++ b/server/node_modules/component-bind/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + { + "raw": "component-bind@1.0.0", + "scope": null, + "escapedName": "component-bind", + "name": "component-bind", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/socket.io-client" + ] + ], + "_from": "component-bind@1.0.0", + "_id": "component-bind@1.0.0", + "_inCache": true, + "_location": "/component-bind", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "component-bind@1.0.0", + "scope": null, + "escapedName": "component-bind", + "name": "component-bind", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "_requiredBy": [ + "/socket.io-client" + ], + "_resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "_shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1", + "_shrinkwrap": null, + "_spec": "component-bind@1.0.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/socket.io-client", + "bugs": { + "url": "https://github.com/component/bind/issues" + }, + "component": { + "scripts": { + "bind/index.js": "index.js" + } + }, + "dependencies": {}, + "description": "function binding utility", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1", + "tarball": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz" + }, + "homepage": "https://github.com/component/bind", + "keywords": [ + "bind", + "utility" + ], + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "component-bind", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/component/bind.git" + }, + "version": "1.0.0" +} diff --git a/server/node_modules/component-emitter/.npmignore b/server/node_modules/component-emitter/.npmignore new file mode 100644 index 0000000..f05b1f2 --- /dev/null +++ b/server/node_modules/component-emitter/.npmignore @@ -0,0 +1,2 @@ +node_modules +test diff --git a/server/node_modules/component-emitter/.travis.yml b/server/node_modules/component-emitter/.travis.yml new file mode 100644 index 0000000..8750e3b --- /dev/null +++ b/server/node_modules/component-emitter/.travis.yml @@ -0,0 +1,4 @@ +node_js: +- "0.8" +- "0.10" +language: node_js \ No newline at end of file diff --git a/server/node_modules/component-emitter/History.md b/server/node_modules/component-emitter/History.md new file mode 100644 index 0000000..b898ca6 --- /dev/null +++ b/server/node_modules/component-emitter/History.md @@ -0,0 +1,52 @@ + +1.1.2 / 2014-02-10 +================== + + * package: rename to "component-emitter" + * package: update "main" and "component" fields + * Add license to Readme (same format as the other components) + * created .npmignore + * travis stuff + +1.1.1 / 2013-12-01 +================== + + * fix .once adding .on to the listener + * docs: Emitter#off() + * component: add `.repo` prop + +1.1.0 / 2013-10-20 +================== + + * add `.addEventListener()` and `.removeEventListener()` aliases + +1.0.1 / 2013-06-27 +================== + + * add support for legacy ie + +1.0.0 / 2013-02-26 +================== + + * add `.off()` support for removing all listeners + +0.0.6 / 2012-10-08 +================== + + * add `this._callbacks` initialization to prevent funky gotcha + +0.0.5 / 2012-09-07 +================== + + * fix `Emitter.call(this)` usage + +0.0.3 / 2012-07-11 +================== + + * add `.listeners()` + * rename `.has()` to `.hasListeners()` + +0.0.2 / 2012-06-28 +================== + + * fix `.off()` with `.once()`-registered callbacks diff --git a/server/node_modules/component-emitter/Makefile b/server/node_modules/component-emitter/Makefile new file mode 100644 index 0000000..4e9c8d3 --- /dev/null +++ b/server/node_modules/component-emitter/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec + +.PHONY: test \ No newline at end of file diff --git a/server/node_modules/component-emitter/Readme.md b/server/node_modules/component-emitter/Readme.md new file mode 100644 index 0000000..0f3f9b9 --- /dev/null +++ b/server/node_modules/component-emitter/Readme.md @@ -0,0 +1,74 @@ +# Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter) + + Event emitter component. + +## Installation + +``` +$ component install component/emitter +``` + +## API + +### Emitter(obj) + + The `Emitter` may also be used as a mixin. For example + a "plain" object may become an emitter, or you may + extend an existing prototype. + + As an `Emitter` instance: + +```js +var Emitter = require('emitter'); +var emitter = new Emitter; +emitter.emit('something'); +``` + + As a mixin: + +```js +var Emitter = require('emitter'); +var user = { name: 'tobi' }; +Emitter(user); + +user.emit('im a user'); +``` + + As a prototype mixin: + +```js +var Emitter = require('emitter'); +Emitter(User.prototype); +``` + +### Emitter#on(event, fn) + + Register an `event` handler `fn`. + +### Emitter#once(event, fn) + + Register a single-shot `event` handler `fn`, + removed immediately after it is invoked the + first time. + +### Emitter#off(event, fn) + + * Pass `event` and `fn` to remove a listener. + * Pass `event` to remove all listeners on that event. + * Pass nothing to remove all listeners on all events. + +### Emitter#emit(event, ...) + + Emit an `event` with variable option args. + +### Emitter#listeners(event) + + Return an array of callbacks, or an empty array. + +### Emitter#hasListeners(event) + + Check if this emitter has `event` handlers. + +## License + +MIT diff --git a/server/node_modules/component-emitter/bower.json b/server/node_modules/component-emitter/bower.json new file mode 100644 index 0000000..c618d41 --- /dev/null +++ b/server/node_modules/component-emitter/bower.json @@ -0,0 +1,21 @@ +{ + "name": "emitter", + "description": "Event emitter", + "keywords": [ + "emitter", + "events" + ], + "version": "1.1.2", + "license": "MIT", + "main": "index.js", + "homepage": "https://github.com/component/emitter", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "Makefile", + "package.json", + "component.json" + ] +} diff --git a/server/node_modules/component-emitter/component.json b/server/node_modules/component-emitter/component.json new file mode 100644 index 0000000..68ba0b1 --- /dev/null +++ b/server/node_modules/component-emitter/component.json @@ -0,0 +1,14 @@ +{ + "name": "emitter", + "repo": "component/emitter", + "description": "Event emitter", + "keywords": [ + "emitter", + "events" + ], + "version": "1.1.2", + "scripts": [ + "index.js" + ], + "license": "MIT" +} diff --git a/server/node_modules/component-emitter/index.js b/server/node_modules/component-emitter/index.js new file mode 100644 index 0000000..ad71163 --- /dev/null +++ b/server/node_modules/component-emitter/index.js @@ -0,0 +1,164 @@ + +/** + * Expose `Emitter`. + */ + +module.exports = Emitter; + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = +Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks[event] = this._callbacks[event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + var self = this; + this._callbacks = this._callbacks || {}; + + function on() { + self.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = +Emitter.prototype.removeListener = +Emitter.prototype.removeAllListeners = +Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks[event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks[event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks[event]; + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks[event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; diff --git a/server/node_modules/component-emitter/package.json b/server/node_modules/component-emitter/package.json new file mode 100644 index 0000000..fabeaec --- /dev/null +++ b/server/node_modules/component-emitter/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + { + "raw": "component-emitter@1.1.2", + "scope": null, + "escapedName": "component-emitter", + "name": "component-emitter", + "rawSpec": "1.1.2", + "spec": "1.1.2", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/socket.io-parser" + ] + ], + "_from": "component-emitter@1.1.2", + "_id": "component-emitter@1.1.2", + "_inCache": true, + "_location": "/component-emitter", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "_npmVersion": "1.3.24", + "_phantomChildren": {}, + "_requested": { + "raw": "component-emitter@1.1.2", + "scope": null, + "escapedName": "component-emitter", + "name": "component-emitter", + "rawSpec": "1.1.2", + "spec": "1.1.2", + "type": "version" + }, + "_requiredBy": [ + "/socket.io-parser" + ], + "_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "_shasum": "296594f2753daa63996d2af08d15a95116c9aec3", + "_shrinkwrap": null, + "_spec": "component-emitter@1.1.2", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/socket.io-parser", + "bugs": { + "url": "https://github.com/component/emitter/issues" + }, + "component": { + "scripts": { + "emitter/index.js": "index.js" + } + }, + "dependencies": {}, + "description": "Event emitter", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "296594f2753daa63996d2af08d15a95116c9aec3", + "tarball": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz" + }, + "homepage": "https://github.com/component/emitter", + "main": "index.js", + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "component-emitter", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/component/emitter.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.1.2" +} diff --git a/server/node_modules/component-inherit/.npmignore b/server/node_modules/component-inherit/.npmignore new file mode 100644 index 0000000..665aa21 --- /dev/null +++ b/server/node_modules/component-inherit/.npmignore @@ -0,0 +1,3 @@ +components +build +node_modules diff --git a/server/node_modules/component-inherit/History.md b/server/node_modules/component-inherit/History.md new file mode 100644 index 0000000..22d87e1 --- /dev/null +++ b/server/node_modules/component-inherit/History.md @@ -0,0 +1,5 @@ + +0.0.2 / 2012-09-03 +================== + + * fix typo in package.json diff --git a/server/node_modules/component-inherit/Makefile b/server/node_modules/component-inherit/Makefile new file mode 100644 index 0000000..ebbc52a --- /dev/null +++ b/server/node_modules/component-inherit/Makefile @@ -0,0 +1,16 @@ + +build: components index.js + @component build + +components: + @Component install + +clean: + rm -fr build components template.js + +test: + @node_modules/.bin/mocha \ + --require should \ + --reporter spec + +.PHONY: clean test diff --git a/server/node_modules/component-inherit/Readme.md b/server/node_modules/component-inherit/Readme.md new file mode 100644 index 0000000..f03ab27 --- /dev/null +++ b/server/node_modules/component-inherit/Readme.md @@ -0,0 +1,24 @@ +# inherit + + Prototype inheritance utility. + +## Installation + +``` +$ component install component/inherit +``` + +## Example + +```js +var inherit = require('inherit'); + +function Human() {} +function Woman() {} + +inherit(Woman, Human); +``` + +## License + + MIT diff --git a/server/node_modules/component-inherit/component.json b/server/node_modules/component-inherit/component.json new file mode 100644 index 0000000..ae57747 --- /dev/null +++ b/server/node_modules/component-inherit/component.json @@ -0,0 +1,10 @@ +{ + "name": "inherit", + "description": "Prototype inheritance utility", + "version": "0.0.3", + "keywords": ["inherit", "utility"], + "dependencies": {}, + "scripts": [ + "index.js" + ] +} diff --git a/server/node_modules/component-inherit/index.js b/server/node_modules/component-inherit/index.js new file mode 100644 index 0000000..aaebc03 --- /dev/null +++ b/server/node_modules/component-inherit/index.js @@ -0,0 +1,7 @@ + +module.exports = function(a, b){ + var fn = function(){}; + fn.prototype = b.prototype; + a.prototype = new fn; + a.prototype.constructor = a; +}; \ No newline at end of file diff --git a/server/node_modules/component-inherit/package.json b/server/node_modules/component-inherit/package.json new file mode 100644 index 0000000..9cf33d8 --- /dev/null +++ b/server/node_modules/component-inherit/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + { + "raw": "component-inherit@0.0.3", + "scope": null, + "escapedName": "component-inherit", + "name": "component-inherit", + "rawSpec": "0.0.3", + "spec": "0.0.3", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-client" + ] + ], + "_from": "component-inherit@0.0.3", + "_id": "component-inherit@0.0.3", + "_inCache": true, + "_location": "/component-inherit", + "_npmUser": { + "name": "coreh", + "email": "thecoreh@gmail.com" + }, + "_npmVersion": "1.3.24", + "_phantomChildren": {}, + "_requested": { + "raw": "component-inherit@0.0.3", + "scope": null, + "escapedName": "component-inherit", + "name": "component-inherit", + "rawSpec": "0.0.3", + "spec": "0.0.3", + "type": "version" + }, + "_requiredBy": [ + "/engine.io-client" + ], + "_resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "_shasum": "645fc4adf58b72b649d5cae65135619db26ff143", + "_shrinkwrap": null, + "_spec": "component-inherit@0.0.3", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/engine.io-client", + "bugs": { + "url": "https://github.com/component/inherit/issues" + }, + "component": { + "scripts": { + "inherit/index.js": "index.js" + } + }, + "dependencies": {}, + "description": "Prototype inheritance utility", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "645fc4adf58b72b649d5cae65135619db26ff143", + "tarball": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz" + }, + "homepage": "https://github.com/component/inherit", + "keywords": [ + "inherit", + "utility" + ], + "maintainers": [ + { + "name": "coreh", + "email": "thecoreh@gmail.com" + } + ], + "name": "component-inherit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/component/inherit.git" + }, + "version": "0.0.3" +} diff --git a/server/node_modules/component-inherit/test/inherit.js b/server/node_modules/component-inherit/test/inherit.js new file mode 100644 index 0000000..14852f2 --- /dev/null +++ b/server/node_modules/component-inherit/test/inherit.js @@ -0,0 +1,21 @@ + +/** + * Module dependencies. + */ + +var inherit = require('..'); + +describe('inherit(a, b)', function(){ + it('should inherit b\'s prototype', function(){ + function Loki(){} + function Animal(){} + + Animal.prototype.species = 'unknown'; + + inherit(Loki, Animal); + + var loki = new Loki; + loki.species.should.equal('unknown'); + loki.constructor.should.equal(Loki); + }) +}) \ No newline at end of file diff --git a/server/node_modules/content-disposition/HISTORY.md b/server/node_modules/content-disposition/HISTORY.md new file mode 100644 index 0000000..1192551 --- /dev/null +++ b/server/node_modules/content-disposition/HISTORY.md @@ -0,0 +1,40 @@ +0.5.0 / 2014-10-11 +================== + + * Add `parse` function + +0.4.0 / 2014-09-21 +================== + + * Expand non-Unicode `filename` to the full ISO-8859-1 charset + +0.3.0 / 2014-09-20 +================== + + * Add `fallback` option + * Add `type` option + +0.2.0 / 2014-09-19 +================== + + * Reduce ambiguity of file names with hex escape in buggy browsers + +0.1.2 / 2014-09-19 +================== + + * Fix periodic invalid Unicode filename header + +0.1.1 / 2014-09-19 +================== + + * Fix invalid characters appearing in `filename*` parameter + +0.1.0 / 2014-09-18 +================== + + * Make the `filename` argument optional + +0.0.0 / 2014-09-18 +================== + + * Initial release diff --git a/server/node_modules/content-disposition/LICENSE b/server/node_modules/content-disposition/LICENSE new file mode 100644 index 0000000..b7dce6c --- /dev/null +++ b/server/node_modules/content-disposition/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +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/server/node_modules/content-disposition/README.md b/server/node_modules/content-disposition/README.md new file mode 100644 index 0000000..d265431 --- /dev/null +++ b/server/node_modules/content-disposition/README.md @@ -0,0 +1,141 @@ +# content-disposition + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create and parse HTTP `Content-Disposition` header + +## Installation + +```sh +$ npm install content-disposition +``` + +## API + +```js +var contentDisposition = require('content-disposition') +``` + +### contentDisposition(filename, options) + +Create an attachment `Content-Disposition` header value using the given file name, +if supplied. The `filename` is optional and if no file name is desired, but you +want to specify `options`, set `filename` to `undefined`. + +```js +res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf')) +``` + +**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this +header through a means different from `setHeader` in Node.js, you'll want to specify +the `'binary'` encoding in Node.js. + +#### Options + +`contentDisposition` accepts these properties in the options object. + +##### fallback + +If the `filename` option is outside ISO-8859-1, then the file name is actually +stored in a supplemental field for clients that support Unicode file names and +a ISO-8859-1 version of the file name is automatically generated. + +This specifies the ISO-8859-1 file name to override the automatic generation or +disables the generation all together, defaults to `true`. + + - A string will specify the ISO-8859-1 file name to use in place of automatic + generation. + - `false` will disable including a ISO-8859-1 file name and only include the + Unicode version (unless the file name is already ISO-8859-1). + - `true` will enable automatic generation if the file name is outside ISO-8859-1. + +If the `filename` option is ISO-8859-1 and this option is specified and has a +different value, then the `filename` option is encoded in the extended field +and this set as the fallback field, even though they are both ISO-8859-1. + +##### type + +Specifies the disposition type, defaults to `"attachment"`. This can also be +`"inline"`, or any other value (all values except inline are treated like +`attachment`, but can convey additional information if both parties agree to +it). The type is normalized to lower-case. + +### contentDisposition.parse(string) + +```js +var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt"'); +``` + +Parse a `Content-Disposition` header string. This automatically handles extended +("Unicode") parameters by decoding them and providing them under the standard +parameter name. This will return an object with the following properties (examples +are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`): + + - `type`: The disposition type (always lower case). Example: `'attachment'` + + - `parameters`: An object of the parameters in the disposition (name of parameter + always lower case and extended versions replace non-extended versions). Example: + `{filename: "€ rates.txt"}` + +## Examples + +### Send a file for download + +```js +var contentDisposition = require('content-disposition') +var destroy = require('destroy') +var http = require('http') +var onFinished = require('on-finished') + +var filePath = '/path/to/public/plans.pdf' + +http.createServer(function onRequest(req, res) { + // set headers + res.setHeader('Content-Type', 'application/pdf') + res.setHeader('Content-Disposition', contentDisposition(filePath)) + + // send file + var stream = fs.createReadStream(filePath) + stream.pipe(res) + onFinished(res, function (err) { + destroy(stream) + }) +}) +``` + +## Testing + +```sh +$ npm test +``` + +## References + +- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616] +- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987] +- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266] +- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231] + +[rfc-2616]: https://tools.ietf.org/html/rfc2616 +[rfc-5987]: https://tools.ietf.org/html/rfc5987 +[rfc-6266]: https://tools.ietf.org/html/rfc6266 +[tc-2231]: http://greenbytes.de/tech/tc2231/ + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-disposition.svg?style=flat +[npm-url]: https://npmjs.org/package/content-disposition +[node-version-image]: https://img.shields.io/node/v/content-disposition.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/content-disposition +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master +[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg?style=flat +[downloads-url]: https://npmjs.org/package/content-disposition diff --git a/server/node_modules/content-disposition/index.js b/server/node_modules/content-disposition/index.js new file mode 100644 index 0000000..fa3bc74 --- /dev/null +++ b/server/node_modules/content-disposition/index.js @@ -0,0 +1,443 @@ +/*! + * content-disposition + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = contentDisposition +module.exports.parse = parse + +/** + * Module dependencies. + */ + +var basename = require('path').basename + +/** + * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") + */ + +var encodeUriAttrCharRegExp = /[\x00-\x20"'\(\)*,\/:;<=>?@\[\\\]\{\}\x7f]/g + +/** + * RegExp to match percent encoding escape. + */ + +var hexEscapeRegExp = /%[0-9A-Fa-f]{2}/ +var hexEscapeReplaceRegExp = /%([0-9A-Fa-f]{2})/g + +/** + * RegExp to match non-latin1 characters. + */ + +var nonLatin1RegExp = /[^\x20-\x7e\xa0-\xff]/g + +/** + * RegExp to match quoted-pair in RFC 2616 + * + * quoted-pair = "\" CHAR + * CHAR = + */ + +var qescRegExp = /\\([\u0000-\u007f])/g; + +/** + * RegExp to match chars that must be quoted-pair in RFC 2616 + */ + +var quoteRegExp = /([\\"])/g + +/** + * RegExp for various RFC 2616 grammar + * + * parameter = token "=" ( token | quoted-string ) + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) + * qdtext = > + * quoted-pair = "\" CHAR + * CHAR = + * TEXT = + * LWS = [CRLF] 1*( SP | HT ) + * CRLF = CR LF + * CR = + * LF = + * SP = + * HT = + * CTL = + * OCTET = + */ + +var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g +var textRegExp = /^[\x20-\x7e\x80-\xff]+$/ +var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/ + +/** + * RegExp for various RFC 5987 grammar + * + * ext-value = charset "'" [ language ] "'" value-chars + * charset = "UTF-8" / "ISO-8859-1" / mime-charset + * mime-charset = 1*mime-charsetc + * mime-charsetc = ALPHA / DIGIT + * / "!" / "#" / "$" / "%" / "&" + * / "+" / "-" / "^" / "_" / "`" + * / "{" / "}" / "~" + * language = ( 2*3ALPHA [ extlang ] ) + * / 4ALPHA + * / 5*8ALPHA + * extlang = *3( "-" 3ALPHA ) + * value-chars = *( pct-encoded / attr-char ) + * pct-encoded = "%" HEXDIG HEXDIG + * attr-char = ALPHA / DIGIT + * / "!" / "#" / "$" / "&" / "+" / "-" / "." + * / "^" / "_" / "`" / "|" / "~" + */ + +var extValueRegExp = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+\-\.^_`|~])+)$/ + +/** + * RegExp for various RFC 6266 grammar + * + * disposition-type = "inline" | "attachment" | disp-ext-type + * disp-ext-type = token + * disposition-parm = filename-parm | disp-ext-parm + * filename-parm = "filename" "=" value + * | "filename*" "=" ext-value + * disp-ext-parm = token "=" value + * | ext-token "=" ext-value + * ext-token = + */ + +var dispositionTypeRegExp = /^([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *(?:$|;)/ + +/** + * Create an attachment Content-Disposition header. + * + * @param {string} [filename] + * @param {object} [options] + * @param {string} [options.type=attachment] + * @param {string|boolean} [options.fallback=true] + * @return {string} + * @api public + */ + +function contentDisposition(filename, options) { + var opts = options || {} + + // get type + var type = opts.type || 'attachment' + + // get parameters + var params = createparams(filename, opts.fallback) + + // format into string + return format(new ContentDisposition(type, params)) +} + +/** + * Create parameters object from filename and fallback. + * + * @param {string} [filename] + * @param {string|boolean} [fallback=true] + * @return {object} + * @api private + */ + +function createparams(filename, fallback) { + if (filename === undefined) { + return + } + + var params = {} + + if (typeof filename !== 'string') { + throw new TypeError('filename must be a string') + } + + // fallback defaults to true + if (fallback === undefined) { + fallback = true + } + + if (typeof fallback !== 'string' && typeof fallback !== 'boolean') { + throw new TypeError('fallback must be a string or boolean') + } + + if (typeof fallback === 'string' && nonLatin1RegExp.test(fallback)) { + throw new TypeError('fallback must be ISO-8859-1 string') + } + + // restrict to file base name + var name = basename(filename) + + // determine if name is suitable for quoted string + var isQuotedString = textRegExp.test(name) + + // generate fallback name + var fallbackName = typeof fallback !== 'string' + ? fallback && getlatin1(name) + : basename(fallback) + var hasFallback = typeof fallbackName === 'string' && fallbackName !== name + + // set extended filename parameter + if (hasFallback || !isQuotedString || hexEscapeRegExp.test(name)) { + params['filename*'] = name + } + + // set filename parameter + if (isQuotedString || hasFallback) { + params.filename = hasFallback + ? fallbackName + : name + } + + return params +} + +/** + * Format object to Content-Disposition header. + * + * @param {object} obj + * @param {string} obj.type + * @param {object} [obj.parameters] + * @return {string} + * @api private + */ + +function format(obj) { + var parameters = obj.parameters + var type = obj.type + + if (!type || typeof type !== 'string' || !tokenRegExp.test(type)) { + throw new TypeError('invalid type') + } + + // start with normalized type + var string = String(type).toLowerCase() + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + var val = param.substr(-1) === '*' + ? ustring(parameters[param]) + : qstring(parameters[param]) + + string += '; ' + param + '=' + val + } + } + + return string +} + +/** + * Decode a RFC 6987 field value (gracefully). + * + * @param {string} str + * @return {string} + * @api private + */ + +function decodefield(str) { + var match = extValueRegExp.exec(str) + + if (!match) { + throw new TypeError('invalid extended field value') + } + + var charset = match[1].toLowerCase() + var encoded = match[2] + var value + + // to binary string + var binary = encoded.replace(hexEscapeReplaceRegExp, pdecode) + + switch (charset) { + case 'iso-8859-1': + value = getlatin1(binary) + break + case 'utf-8': + value = new Buffer(binary, 'binary').toString('utf8') + break + default: + throw new TypeError('unsupported charset in extended field') + } + + return value +} + +/** + * Get ISO-8859-1 version of string. + * + * @param {string} val + * @return {string} + * @api private + */ + +function getlatin1(val) { + // simple Unicode -> ISO-8859-1 transformation + return String(val).replace(nonLatin1RegExp, '?') +} + +/** + * Parse Content-Disposition header string. + * + * @param {string} string + * @return {object} + * @api private + */ + +function parse(string) { + if (!string || typeof string !== 'string') { + throw new TypeError('argument string is required') + } + + var match = dispositionTypeRegExp.exec(string) + + if (!match) { + throw new TypeError('invalid type format') + } + + // normalize type + var index = match[0].length + var type = match[1].toLowerCase() + + var key + var names = [] + var params = {} + var value + + // calculate index to start at + index = paramRegExp.lastIndex = match[0].substr(-1) === ';' + ? index - 1 + : index + + // match parameters + while (match = paramRegExp.exec(string)) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (names.indexOf(key) !== -1) { + throw new TypeError('invalid duplicate parameter') + } + + names.push(key) + + if (key.indexOf('*') + 1 === key.length) { + // decode extended value + key = key.slice(0, -1) + value = decodefield(value) + + // overwrite existing value + params[key] = value + continue + } + + if (typeof params[key] === 'string') { + continue + } + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .substr(1, value.length - 2) + .replace(qescRegExp, '$1') + } + + params[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + return new ContentDisposition(type, params) +} + +/** + * Percent decode a single character. + * + * @param {string} str + * @param {string} hex + * @return {string} + * @api private + */ + +function pdecode(str, hex) { + return String.fromCharCode(parseInt(hex, 16)) +} + +/** + * Percent encode a single character. + * + * @param {string} char + * @return {string} + * @api private + */ + +function pencode(char) { + var hex = String(char) + .charCodeAt(0) + .toString(16) + .toUpperCase() + return hex.length === 1 + ? '%0' + hex + : '%' + hex +} + +/** + * Quote a string for HTTP. + * + * @param {string} val + * @return {string} + * @api private + */ + +function qstring(val) { + var str = String(val) + + return '"' + str.replace(quoteRegExp, '\\$1') + '"' +} + +/** + * Encode a Unicode string for HTTP (RFC 5987). + * + * @param {string} val + * @return {string} + * @api private + */ + +function ustring(val) { + var str = String(val) + + // percent encode as UTF-8 + var encoded = encodeURIComponent(str) + .replace(encodeUriAttrCharRegExp, pencode) + + return 'UTF-8\'\'' + encoded +} + +/** + * Class for parsed Content-Disposition header for v8 optimization + */ + +function ContentDisposition(type, parameters) { + this.type = type + this.parameters = parameters +} diff --git a/server/node_modules/content-disposition/package.json b/server/node_modules/content-disposition/package.json new file mode 100644 index 0000000..861451f --- /dev/null +++ b/server/node_modules/content-disposition/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "content-disposition@0.5.0", + "scope": null, + "escapedName": "content-disposition", + "name": "content-disposition", + "rawSpec": "0.5.0", + "spec": "0.5.0", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express" + ] + ], + "_from": "content-disposition@0.5.0", + "_id": "content-disposition@0.5.0", + "_inCache": true, + "_location": "/content-disposition", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "raw": "content-disposition@0.5.0", + "scope": null, + "escapedName": "content-disposition", + "name": "content-disposition", + "rawSpec": "0.5.0", + "spec": "0.5.0", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz", + "_shasum": "4284fe6ae0630874639e44e80a418c2934135e9e", + "_shrinkwrap": null, + "_spec": "content-disposition@0.5.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express", + "bugs": { + "url": "https://github.com/jshttp/content-disposition/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "Create and parse Content-Disposition header", + "devDependencies": { + "istanbul": "0.3.2", + "mocha": "~1.21.4" + }, + "directories": {}, + "dist": { + "shasum": "4284fe6ae0630874639e44e80a418c2934135e9e", + "tarball": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "f3c915f0c9d9f5ec79713dba24c8c6181b73305d", + "homepage": "https://github.com/jshttp/content-disposition", + "keywords": [ + "content-disposition", + "http", + "rfc6266", + "res" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "content-disposition", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/content-disposition.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "0.5.0" +} diff --git a/server/node_modules/cookie-signature/.npmignore b/server/node_modules/cookie-signature/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/server/node_modules/cookie-signature/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/server/node_modules/cookie-signature/History.md b/server/node_modules/cookie-signature/History.md new file mode 100644 index 0000000..2bbc4b3 --- /dev/null +++ b/server/node_modules/cookie-signature/History.md @@ -0,0 +1,27 @@ +1.0.4 / 2014-06-25 +================== + + * corrected avoidance of timing attacks (thanks @tenbits!) + + +1.0.3 / 2014-01-28 +================== + + * [incorrect] fix for timing attacks + +1.0.2 / 2014-01-28 +================== + + * fix missing repository warning + * fix typo in test + +1.0.1 / 2013-04-15 +================== + + * Revert "Changed underlying HMAC algo. to sha512." + * Revert "Fix for timing attacks on MAC verification." + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/server/node_modules/cookie-signature/Makefile b/server/node_modules/cookie-signature/Makefile new file mode 100644 index 0000000..4e9c8d3 --- /dev/null +++ b/server/node_modules/cookie-signature/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec + +.PHONY: test \ No newline at end of file diff --git a/server/node_modules/cookie-signature/Readme.md b/server/node_modules/cookie-signature/Readme.md new file mode 100644 index 0000000..2559e84 --- /dev/null +++ b/server/node_modules/cookie-signature/Readme.md @@ -0,0 +1,42 @@ + +# cookie-signature + + Sign and unsign cookies. + +## Example + +```js +var cookie = require('cookie-signature'); + +var val = cookie.sign('hello', 'tobiiscool'); +val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI'); + +var val = cookie.sign('hello', 'tobiiscool'); +cookie.unsign(val, 'tobiiscool').should.equal('hello'); +cookie.unsign(val, 'luna').should.be.false; +``` + +## License + +(The MIT License) + +Copyright (c) 2012 LearnBoost <tj@learnboost.com> + +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/server/node_modules/cookie-signature/index.js b/server/node_modules/cookie-signature/index.js new file mode 100644 index 0000000..b63bf84 --- /dev/null +++ b/server/node_modules/cookie-signature/index.js @@ -0,0 +1,51 @@ +/** + * Module dependencies. + */ + +var crypto = require('crypto'); + +/** + * Sign the given `val` with `secret`. + * + * @param {String} val + * @param {String} secret + * @return {String} + * @api private + */ + +exports.sign = function(val, secret){ + if ('string' != typeof val) throw new TypeError('cookie required'); + if ('string' != typeof secret) throw new TypeError('secret required'); + return val + '.' + crypto + .createHmac('sha256', secret) + .update(val) + .digest('base64') + .replace(/\=+$/, ''); +}; + +/** + * Unsign and decode the given `val` with `secret`, + * returning `false` if the signature is invalid. + * + * @param {String} val + * @param {String} secret + * @return {String|Boolean} + * @api private + */ + +exports.unsign = function(val, secret){ + if ('string' != typeof val) throw new TypeError('cookie required'); + if ('string' != typeof secret) throw new TypeError('secret required'); + var str = val.slice(0, val.lastIndexOf('.')) + , mac = exports.sign(str, secret); + + return sha1(mac) == sha1(val) ? str : false; +}; + +/** + * Private + */ + +function sha1(str){ + return crypto.createHash('sha1').update(str).digest('hex'); +} diff --git a/server/node_modules/cookie-signature/package.json b/server/node_modules/cookie-signature/package.json new file mode 100644 index 0000000..a472106 --- /dev/null +++ b/server/node_modules/cookie-signature/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + { + "raw": "cookie-signature@1.0.5", + "scope": null, + "escapedName": "cookie-signature", + "name": "cookie-signature", + "rawSpec": "1.0.5", + "spec": "1.0.5", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express" + ] + ], + "_from": "cookie-signature@1.0.5", + "_id": "cookie-signature@1.0.5", + "_inCache": true, + "_location": "/cookie-signature", + "_npmUser": { + "name": "natevw", + "email": "natevw@yahoo.com" + }, + "_npmVersion": "1.4.20", + "_phantomChildren": {}, + "_requested": { + "raw": "cookie-signature@1.0.5", + "scope": null, + "escapedName": "cookie-signature", + "name": "cookie-signature", + "rawSpec": "1.0.5", + "spec": "1.0.5", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz", + "_shasum": "a122e3f1503eca0f5355795b0711bb2368d450f9", + "_shrinkwrap": null, + "_spec": "cookie-signature@1.0.5", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@learnboost.com" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-cookie-signature/issues" + }, + "dependencies": {}, + "description": "Sign and unsign cookies", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "a122e3f1503eca0f5355795b0711bb2368d450f9", + "tarball": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz" + }, + "gitHead": "73ed69b511b3ef47555d71b4ed1deea9e5ed6e1f", + "homepage": "https://github.com/visionmedia/node-cookie-signature", + "keywords": [ + "cookie", + "sign", + "unsign" + ], + "license": "MIT", + "main": "index", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "natevw", + "email": "natevw@yahoo.com" + } + ], + "name": "cookie-signature", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-cookie-signature.git" + }, + "scripts": {}, + "version": "1.0.5" +} diff --git a/server/node_modules/cookie/.npmignore b/server/node_modules/cookie/.npmignore new file mode 100644 index 0000000..efab07f --- /dev/null +++ b/server/node_modules/cookie/.npmignore @@ -0,0 +1,2 @@ +test +.travis.yml diff --git a/server/node_modules/cookie/LICENSE b/server/node_modules/cookie/LICENSE new file mode 100644 index 0000000..249d9de --- /dev/null +++ b/server/node_modules/cookie/LICENSE @@ -0,0 +1,9 @@ +// MIT License + +Copyright (C) Roman Shtylman + +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/server/node_modules/cookie/README.md b/server/node_modules/cookie/README.md new file mode 100644 index 0000000..3170b4b --- /dev/null +++ b/server/node_modules/cookie/README.md @@ -0,0 +1,44 @@ +# cookie [![Build Status](https://secure.travis-ci.org/defunctzombie/node-cookie.png?branch=master)](http://travis-ci.org/defunctzombie/node-cookie) # + +cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers. + +See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies. + +## how? + +``` +npm install cookie +``` + +```javascript +var cookie = require('cookie'); + +var hdr = cookie.serialize('foo', 'bar'); +// hdr = 'foo=bar'; + +var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff'); +// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' }; +``` + +## more + +The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values. + +### path +> cookie path + +### expires +> absolute expiration date for the cookie (Date object) + +### maxAge +> relative max age of the cookie from when the client receives it (seconds) + +### domain +> domain for the cookie + +### secure +> true or false + +### httpOnly +> true or false + diff --git a/server/node_modules/cookie/index.js b/server/node_modules/cookie/index.js new file mode 100644 index 0000000..00d54a7 --- /dev/null +++ b/server/node_modules/cookie/index.js @@ -0,0 +1,75 @@ + +/// Serialize the a name value pair into a cookie string suitable for +/// http headers. An optional options object specified cookie parameters +/// +/// serialize('foo', 'bar', { httpOnly: true }) +/// => "foo=bar; httpOnly" +/// +/// @param {String} name +/// @param {String} val +/// @param {Object} options +/// @return {String} +var serialize = function(name, val, opt){ + opt = opt || {}; + var enc = opt.encode || encode; + var pairs = [name + '=' + enc(val)]; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); + pairs.push('Max-Age=' + maxAge); + } + + if (opt.domain) pairs.push('Domain=' + opt.domain); + if (opt.path) pairs.push('Path=' + opt.path); + if (opt.expires) pairs.push('Expires=' + opt.expires.toUTCString()); + if (opt.httpOnly) pairs.push('HttpOnly'); + if (opt.secure) pairs.push('Secure'); + + return pairs.join('; '); +}; + +/// Parse the given cookie header string into an object +/// The object has the various cookies as keys(names) => values +/// @param {String} str +/// @return {Object} +var parse = function(str, opt) { + opt = opt || {}; + var obj = {} + var pairs = str.split(/; */); + var dec = opt.decode || decode; + + pairs.forEach(function(pair) { + var eq_idx = pair.indexOf('=') + + // skip things that don't look like key=value + if (eq_idx < 0) { + return; + } + + var key = pair.substr(0, eq_idx).trim() + var val = pair.substr(++eq_idx, pair.length).trim(); + + // quoted values + if ('"' == val[0]) { + val = val.slice(1, -1); + } + + // only assign once + if (undefined == obj[key]) { + try { + obj[key] = dec(val); + } catch (e) { + obj[key] = val; + } + } + }); + + return obj; +}; + +var encode = encodeURIComponent; +var decode = decodeURIComponent; + +module.exports.serialize = serialize; +module.exports.parse = parse; diff --git a/server/node_modules/cookie/package.json b/server/node_modules/cookie/package.json new file mode 100644 index 0000000..66292d0 --- /dev/null +++ b/server/node_modules/cookie/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + { + "raw": "cookie@0.1.2", + "scope": null, + "escapedName": "cookie", + "name": "cookie", + "rawSpec": "0.1.2", + "spec": "0.1.2", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express" + ] + ], + "_from": "cookie@0.1.2", + "_id": "cookie@0.1.2", + "_inCache": true, + "_location": "/cookie", + "_npmUser": { + "name": "shtylman", + "email": "shtylman@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "cookie@0.1.2", + "scope": null, + "escapedName": "cookie", + "name": "cookie", + "rawSpec": "0.1.2", + "spec": "0.1.2", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz", + "_shasum": "72fec3d24e48a3432073d90c12642005061004b1", + "_shrinkwrap": null, + "_spec": "cookie@0.1.2", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express", + "author": { + "name": "Roman Shtylman", + "email": "shtylman@gmail.com" + }, + "bugs": { + "url": "https://github.com/shtylman/node-cookie/issues" + }, + "dependencies": {}, + "description": "cookie parsing and serialization", + "devDependencies": { + "mocha": "1.x.x" + }, + "directories": {}, + "dist": { + "shasum": "72fec3d24e48a3432073d90c12642005061004b1", + "tarball": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/shtylman/node-cookie", + "keywords": [ + "cookie", + "cookies" + ], + "main": "index.js", + "maintainers": [ + { + "name": "shtylman", + "email": "shtylman@gmail.com" + } + ], + "name": "cookie", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/shtylman/node-cookie.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.2" +} diff --git a/server/node_modules/crc/.npmignore b/server/node_modules/crc/.npmignore new file mode 100644 index 0000000..57d4cb8 --- /dev/null +++ b/server/node_modules/crc/.npmignore @@ -0,0 +1,5 @@ +benchmark +src +test +.travis.yml +bitcoin.png diff --git a/server/node_modules/crc/LICENSE b/server/node_modules/crc/LICENSE new file mode 100644 index 0000000..c49097c --- /dev/null +++ b/server/node_modules/crc/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright 2014 Alex Gorbatchev + +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/server/node_modules/crc/README.md b/server/node_modules/crc/README.md new file mode 100644 index 0000000..6473cbd --- /dev/null +++ b/server/node_modules/crc/README.md @@ -0,0 +1,98 @@ +# crc + +[![GitTip](http://img.shields.io/gittip/alexgorbatchev.svg?style=flat)](https://www.gittip.com/alexgorbatchev/) +[![Dependency status](http://img.shields.io/david/alexgorbatchev/node-crc.svg?style=flat)](https://david-dm.org/alexgorbatchev/node-crc) +[![devDependency Status](http://img.shields.io/david/dev/alexgorbatchev/node-crc.svg?style=flat)](https://david-dm.org/alexgorbatchev/node-crc#info=devDependencies) +[![Build Status](http://img.shields.io/travis/alexgorbatchev/node-crc.svg?style=flat&branch=master)](https://travis-ci.org/alexgorbatchev/node-crc) + +[![NPM](https://nodei.co/npm/crc.svg?style=flat)](https://npmjs.org/package/node-crc) + +Module for calculating Cyclic Redundancy Check (CRC). + +## Features + +* Full test suite comparing values against reference `pycrc` implementation. +* Version 3.x is 3x to 4x faster than version 2.x. +* Pure JavaScript implementation, no dependencies. +* Provides CRC Tables for optimized calculations. +* Provides support for the following CRC algorithms: + * CRC1 `crc.crc1(…)` + * CRC8 `crc.crc8(…)` + * CRC8 1-Wire `crc.crc81wire(…)` + * CRC16 `crc.crc16(…)` + * CRC16 CCITT `crc.crc16ccitt(…)` + * CRC16 Modbus `crc.crc16modbus(…)` + * CRC24 `crc.crc24(…)` + * CRC32 `crc.crc32(…)` + +## IMPORTANT + +If you've used `crc` module prior to version 2.x, you might have some inconsistentcies with the current implementation because it relied on very old code and wasn't checked against reference implementation. If you upgrading from 1.x, please take special care. + +## Support + + Please support me on [GitTip](https://www.gittip.com/alexgorbatchev/). I've spend days developing and grooming this module and hope to spend more time. If you have bitcoin, please use the QR code or this wallet address [`1CZyBREeHTmy8C5zVGHZHPwqBuWFmEuUCQ`](https://blockchain.info/address/1CZyBREeHTmy8C5zVGHZHPwqBuWFmEuUCQ): + +## Installation + + npm install crc + +## Running tests + + $ npm install + $ npm test + +## Usage Example + +Calculate a CRC32: + + var crc = require('crc'); + + crc.crc32('hello').toString(16); + # => "3610a686" + +Calculate a CRC32 of a file: + + crc.crc32(fs.readFileSync('README.md', 'utf8')).toString(16); + # => "127ad531" + +Or using a `Buffer`: + + crc.crc32(fs.readFileSync('README.md')).toString(16); + # => "127ad531" + +Incrementally calculate a CRC32: + + value = crc32('one'); + value = crc32('two', value); + value = crc32('three', value); + value.toString(16); + # => "09e1c092" + +## Thanks! + +[pycrc](http://www.tty1.net/pycrc/) library is which the source of all of the CRC tables. + +# License + +The MIT License (MIT) + +Copyright (c) 2014 Alex Gorbatchev + +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/server/node_modules/crc/lib/crc.js b/server/node_modules/crc/lib/crc.js new file mode 100644 index 0000000..1c342b7 --- /dev/null +++ b/server/node_modules/crc/lib/crc.js @@ -0,0 +1,71 @@ +// Generated by CoffeeScript 1.7.1 +var CRC, hex; + +hex = require('./hex'); + +module.exports = CRC = (function() { + CRC.prototype.INIT_CRC = 0x00; + + CRC.prototype.XOR_MASK = 0x00; + + CRC.prototype.WIDTH = 0; + + CRC.prototype.pack = function(crc) { + return ''; + }; + + CRC.prototype.each_byte = function(buf, cb) { + var i, _i, _ref, _results; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + _results = []; + for (i = _i = 0, _ref = buf.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { + _results.push(cb(buf[i])); + } + return _results; + }; + + function CRC() { + this.crc = this.INIT_CRC; + } + + CRC.prototype.digest_length = function() { + return Math.ceil(this.WIDTH / 8.0); + }; + + CRC.prototype.update = function(data) {}; + + CRC.prototype.reset = function() { + return this.crc = this.INIT_CRC; + }; + + CRC.prototype.checksum = function(signed) { + var sum; + if (signed == null) { + signed = true; + } + sum = this.crc ^ this.XOR_MASK; + if (signed) { + sum = sum >>> 0; + } + return sum; + }; + + CRC.prototype.finish = function() { + return this.pack(this.checksum()); + }; + + CRC.prototype.hexdigest = function(value) { + var result; + if (value != null) { + this.update(value); + } + result = this.finish(); + this.reset(); + return result; + }; + + return CRC; + +})(); diff --git a/server/node_modules/crc/lib/crc1.js b/server/node_modules/crc/lib/crc1.js new file mode 100644 index 0000000..f094567 --- /dev/null +++ b/server/node_modules/crc/lib/crc1.js @@ -0,0 +1,21 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +module.exports = create('crc1', function(buf, previous) { + var accum, byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = ~~previous; + accum = 0; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + accum += byte; + } + crc += accum % 256; + return crc % 256; +}); diff --git a/server/node_modules/crc/lib/crc16.js b/server/node_modules/crc/lib/crc16.js new file mode 100644 index 0000000..a09cd1e --- /dev/null +++ b/server/node_modules/crc/lib/crc16.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('crc-16', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = ~~previous; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = (TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8)) & 0xffff; + } + return crc; +}); diff --git a/server/node_modules/crc/lib/crc16_ccitt.js b/server/node_modules/crc/lib/crc16_ccitt.js new file mode 100644 index 0000000..0bdb0bf --- /dev/null +++ b/server/node_modules/crc/lib/crc16_ccitt.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('ccitt', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = previous != null ? ~~previous : 0xffff; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = (TABLE[((crc >> 8) ^ byte) & 0xff] ^ (crc << 8)) & 0xffff; + } + return crc; +}); diff --git a/server/node_modules/crc/lib/crc16_modbus.js b/server/node_modules/crc/lib/crc16_modbus.js new file mode 100644 index 0000000..52a536a --- /dev/null +++ b/server/node_modules/crc/lib/crc16_modbus.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('crc-16-modbus', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = previous != null ? ~~previous : 0xffff; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = (TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8)) & 0xffff; + } + return crc; +}); diff --git a/server/node_modules/crc/lib/crc24.js b/server/node_modules/crc/lib/crc24.js new file mode 100644 index 0000000..ff67bc1 --- /dev/null +++ b/server/node_modules/crc/lib/crc24.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139, 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272, 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd, 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f, 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631, 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a, 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5, 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5, 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b, 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099, 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736, 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4, 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53, 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791, 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448, 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a, 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814, 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6, 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279, 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132, 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c, 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c, 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3, 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8, 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f, 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('crc-24', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = previous != null ? ~~previous : 0xb704ce; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = (TABLE[((crc >> 16) ^ byte) & 0xff] ^ (crc << 8)) & 0xffffff; + } + return crc; +}); diff --git a/server/node_modules/crc/lib/crc32.js b/server/node_modules/crc/lib/crc32.js new file mode 100644 index 0000000..20bc024 --- /dev/null +++ b/server/node_modules/crc/lib/crc32.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('crc-32', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = previous === 0 ? 0 : ~~previous ^ -1; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = TABLE[(crc ^ byte) & 0xff] ^ (crc >>> 8); + } + return crc ^ -1; +}); diff --git a/server/node_modules/crc/lib/crc8.js b/server/node_modules/crc/lib/crc8.js new file mode 100644 index 0000000..6ebe77c --- /dev/null +++ b/server/node_modules/crc/lib/crc8.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('crc-8', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = ~~previous; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = TABLE[(crc ^ byte) & 0xff] & 0xff; + } + return crc; +}); diff --git a/server/node_modules/crc/lib/crc8_1wire.js b/server/node_modules/crc/lib/crc8_1wire.js new file mode 100644 index 0000000..b561246 --- /dev/null +++ b/server/node_modules/crc/lib/crc8_1wire.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 1.7.1 +var Buffer, TABLE, create; + +Buffer = require('buffer').Buffer; + +create = require('./create'); + +TABLE = [0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41, 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc, 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62, 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff, 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07, 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a, 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24, 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9, 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd, 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50, 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee, 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73, 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b, 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16, 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8, 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35]; + +if (typeof Int32Array !== 'undefined') { + TABLE = new Int32Array(TABLE); +} + +module.exports = create('dallas-1-wire', function(buf, previous) { + var byte, crc, _i, _len; + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + crc = ~~previous; + for (_i = 0, _len = buf.length; _i < _len; _i++) { + byte = buf[_i]; + crc = TABLE[(crc ^ byte) & 0xff] & 0xff; + } + return crc; +}); diff --git a/server/node_modules/crc/lib/create.js b/server/node_modules/crc/lib/create.js new file mode 100644 index 0000000..2d856bd --- /dev/null +++ b/server/node_modules/crc/lib/create.js @@ -0,0 +1,11 @@ +// Generated by CoffeeScript 1.7.1 +module.exports = function(model, calc) { + var fn; + fn = function(buf, previous) { + return calc(buf, previous) >>> 0; + }; + fn.signed = calc; + fn.unsigned = fn; + fn.model = model; + return fn; +}; diff --git a/server/node_modules/crc/lib/hex.js b/server/node_modules/crc/lib/hex.js new file mode 100644 index 0000000..0a6aa4c --- /dev/null +++ b/server/node_modules/crc/lib/hex.js @@ -0,0 +1,9 @@ +// Generated by CoffeeScript 1.7.1 +module.exports = function(number) { + var result; + result = number.toString(16); + while (result.length % 2) { + result = "0" + result; + } + return result; +}; diff --git a/server/node_modules/crc/lib/index.js b/server/node_modules/crc/lib/index.js new file mode 100644 index 0000000..15ac34c --- /dev/null +++ b/server/node_modules/crc/lib/index.js @@ -0,0 +1,11 @@ +// Generated by CoffeeScript 1.7.1 +module.exports = { + crc1: require('./crc1'), + crc8: require('./crc8'), + crc81wire: require('./crc8_1wire'), + crc16: require('./crc16'), + crc16ccitt: require('./crc16_ccitt'), + crc16modbus: require('./crc16_modbus'), + crc24: require('./crc24'), + crc32: require('./crc32') +}; diff --git a/server/node_modules/crc/package.json b/server/node_modules/crc/package.json new file mode 100644 index 0000000..3eb1a29 --- /dev/null +++ b/server/node_modules/crc/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + { + "raw": "crc@3.2.1", + "scope": null, + "escapedName": "crc", + "name": "crc", + "rawSpec": "3.2.1", + "spec": "3.2.1", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/etag" + ] + ], + "_from": "crc@3.2.1", + "_id": "crc@3.2.1", + "_inCache": true, + "_location": "/crc", + "_npmUser": { + "name": "alexgorbatchev", + "email": "alex.gorbatchev@gmail.com" + }, + "_npmVersion": "1.4.13", + "_phantomChildren": {}, + "_requested": { + "raw": "crc@3.2.1", + "scope": null, + "escapedName": "crc", + "name": "crc", + "rawSpec": "3.2.1", + "spec": "3.2.1", + "type": "version" + }, + "_requiredBy": [ + "/etag" + ], + "_resolved": "https://registry.npmjs.org/crc/-/crc-3.2.1.tgz", + "_shasum": "5d9c8fb77a245cd5eca291e5d2d005334bab0082", + "_shrinkwrap": null, + "_spec": "crc@3.2.1", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/etag", + "author": { + "name": "Alex Gorbatchev", + "url": "https://github.com/alexgorbatchev" + }, + "bugs": { + "url": "https://github.com/alexgorbatchev/node-crc/issues" + }, + "dependencies": {}, + "description": "Various CRC JavaScript implementations", + "devDependencies": { + "beautify-benchmark": "^0.2.4", + "benchmark": "^1.0.0", + "buffer-crc32": "^0.2.3", + "chai": "~1.9.1", + "coffee-errors": "~0.8.6", + "coffee-script": "~1.7.1", + "mocha": "*", + "seedrandom": "^2.3.6" + }, + "directories": {}, + "dist": { + "shasum": "5d9c8fb77a245cd5eca291e5d2d005334bab0082", + "tarball": "https://registry.npmjs.org/crc/-/crc-3.2.1.tgz" + }, + "gitHead": "71caf362b061992bfe4ca8706ee264e764d2e88e", + "homepage": "https://github.com/alexgorbatchev/node-crc", + "keywords": [ + "crc" + ], + "license": "MIT", + "main": "./lib/index.js", + "maintainers": [ + { + "name": "alexgorbatchev", + "email": "alex.gorbatchev@gmail.com" + } + ], + "name": "crc", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/alexgorbatchev/node-crc.git" + }, + "scripts": { + "pretest": "coffee --bare --output ./lib --compile ./src/*.coffee", + "test": "mocha test/*.spec.coffee" + }, + "version": "3.2.1" +} diff --git a/server/node_modules/debug/.jshintrc b/server/node_modules/debug/.jshintrc new file mode 100644 index 0000000..299877f --- /dev/null +++ b/server/node_modules/debug/.jshintrc @@ -0,0 +1,3 @@ +{ + "laxbreak": true +} diff --git a/server/node_modules/debug/.npmignore b/server/node_modules/debug/.npmignore new file mode 100644 index 0000000..7e6163d --- /dev/null +++ b/server/node_modules/debug/.npmignore @@ -0,0 +1,6 @@ +support +test +examples +example +*.sock +dist diff --git a/server/node_modules/debug/History.md b/server/node_modules/debug/History.md new file mode 100644 index 0000000..770e483 --- /dev/null +++ b/server/node_modules/debug/History.md @@ -0,0 +1,186 @@ + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/server/node_modules/debug/Makefile b/server/node_modules/debug/Makefile new file mode 100644 index 0000000..b0bde6e --- /dev/null +++ b/server/node_modules/debug/Makefile @@ -0,0 +1,33 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= $(shell which node) +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +all: dist/debug.js + +install: node_modules + +clean: + @rm -rf node_modules dist + +dist: + @mkdir -p $@ + +dist/debug.js: node_modules browser.js debug.js dist + @$(BROWSERIFY) \ + --standalone debug \ + . > $@ + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +.PHONY: all install clean diff --git a/server/node_modules/debug/Readme.md b/server/node_modules/debug/Readme.md new file mode 100644 index 0000000..14222e0 --- /dev/null +++ b/server/node_modules/debug/Readme.md @@ -0,0 +1,178 @@ +# debug + + tiny node.js debugging utility modelled after node core's debugging technique. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + + With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Browser support + + Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: + +```js +window.myDebug = require("debug"); +``` + + ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: + +```js +myDebug.enable("worker:*") +``` + + Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + +### stderr vs stdout + +You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + +## License + +(The MIT License) + +Copyright (c) 2014 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/server/node_modules/debug/bower.json b/server/node_modules/debug/bower.json new file mode 100644 index 0000000..f7d3f6d --- /dev/null +++ b/server/node_modules/debug/bower.json @@ -0,0 +1,28 @@ +{ + "name": "visionmedia-debug", + "main": "dist/debug.js", + "version": "2.1.3", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/server/node_modules/debug/browser.js b/server/node_modules/debug/browser.js new file mode 100644 index 0000000..55f4cf9 --- /dev/null +++ b/server/node_modules/debug/browser.js @@ -0,0 +1,175 @@ + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Use chrome.storage.local if we are in an app + */ + +var storage; + +if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined') + storage = chrome.storage.local; +else + storage = localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + storage.removeItem('debug'); + } else { + storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = storage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} diff --git a/server/node_modules/debug/component.json b/server/node_modules/debug/component.json new file mode 100644 index 0000000..52ffd42 --- /dev/null +++ b/server/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.1.3", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "browser.js", + "scripts": [ + "browser.js", + "debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.0" + } +} diff --git a/server/node_modules/debug/debug.js b/server/node_modules/debug/debug.js new file mode 100644 index 0000000..7571a86 --- /dev/null +++ b/server/node_modules/debug/debug.js @@ -0,0 +1,197 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/server/node_modules/debug/node.js b/server/node_modules/debug/node.js new file mode 100644 index 0000000..1d392a8 --- /dev/null +++ b/server/node_modules/debug/node.js @@ -0,0 +1,209 @@ + +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); + if (0 === debugColors.length) { + return tty.isatty(fd); + } else { + return '0' !== debugColors + && 'no' !== debugColors + && 'false' !== debugColors + && 'disabled' !== debugColors; + } +} + +/** + * Map %o to `util.inspect()`, since Node doesn't do that out of the box. + */ + +var inspect = (4 === util.inspect.length ? + // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } : + // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + } +); + +exports.formatters.o = function(v) { + return inspect(v, this.useColors) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + var name = this.namespace; + + if (useColors) { + var c = this.color; + + args[0] = ' \u001b[3' + c + ';1m' + name + ' ' + + '\u001b[0m' + + args[0] + '\u001b[3' + c + 'm' + + ' +' + exports.humanize(this.diff) + '\u001b[0m'; + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } + return args; +} + +/** + * Invokes `console.error()` with the specified arguments. + */ + +function log() { + return stream.write(util.format.apply(this, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/server/node_modules/debug/package.json b/server/node_modules/debug/package.json new file mode 100644 index 0000000..c060c87 --- /dev/null +++ b/server/node_modules/debug/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "debug@~2.1.0", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "~2.1.0", + "spec": ">=2.1.0 <2.2.0", + "type": "range" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express" + ] + ], + "_from": "debug@>=2.1.0 <2.2.0", + "_id": "debug@2.1.3", + "_inCache": true, + "_location": "/debug", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "debug@~2.1.0", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "~2.1.0", + "spec": ">=2.1.0 <2.2.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/finalhandler", + "/send" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.3.tgz", + "_shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e", + "_shrinkwrap": null, + "_spec": "debug@~2.1.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + } + ], + "dependencies": { + "ms": "0.7.0" + }, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e", + "tarball": "https://registry.npmjs.org/debug/-/debug-2.1.3.tgz" + }, + "gitHead": "0a8e4b7e0d2d1b55ef4e7422498ca24c677ae63a", + "homepage": "https://github.com/visionmedia/debug", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./node.js", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "scripts": {}, + "version": "2.1.3" +} diff --git a/server/node_modules/depd/History.md b/server/node_modules/depd/History.md new file mode 100644 index 0000000..4a36a6c --- /dev/null +++ b/server/node_modules/depd/History.md @@ -0,0 +1,75 @@ +1.0.1 / 2015-04-07 +================== + + * Fix `TypeError`s when under `'use strict'` code + * Fix useless type name on auto-generated messages + * Support io.js 1.x + * Support Node.js 0.12 + +1.0.0 / 2014-09-17 +================== + + * No changes + +0.4.5 / 2014-09-09 +================== + + * Improve call speed to functions using the function wrapper + * Support Node.js 0.6 + +0.4.4 / 2014-07-27 +================== + + * Work-around v8 generating empty stack traces + +0.4.3 / 2014-07-26 +================== + + * Fix exception when global `Error.stackTraceLimit` is too low + +0.4.2 / 2014-07-19 +================== + + * Correct call site for wrapped functions and properties + +0.4.1 / 2014-07-19 +================== + + * Improve automatic message generation for function properties + +0.4.0 / 2014-07-19 +================== + + * Add `TRACE_DEPRECATION` environment variable + * Remove non-standard grey color from color output + * Support `--no-deprecation` argument + * Support `--trace-deprecation` argument + * Support `deprecate.property(fn, prop, message)` + +0.3.0 / 2014-06-16 +================== + + * Add `NO_DEPRECATION` environment variable + +0.2.0 / 2014-06-15 +================== + + * Add `deprecate.property(obj, prop, message)` + * Remove `supports-color` dependency for node.js 0.8 + +0.1.0 / 2014-06-15 +================== + + * Add `deprecate.function(fn, message)` + * Add `process.on('deprecation', fn)` emitter + * Automatically generate message when omitted from `deprecate()` + +0.0.1 / 2014-06-15 +================== + + * Fix warning for dynamic calls at singe call site + +0.0.0 / 2014-06-15 +================== + + * Initial implementation diff --git a/server/node_modules/depd/LICENSE b/server/node_modules/depd/LICENSE new file mode 100644 index 0000000..b7dce6c --- /dev/null +++ b/server/node_modules/depd/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +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/server/node_modules/depd/Readme.md b/server/node_modules/depd/Readme.md new file mode 100644 index 0000000..5ead5da --- /dev/null +++ b/server/node_modules/depd/Readme.md @@ -0,0 +1,274 @@ +# depd + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Linux Build][travis-image]][travis-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Coverage Status][coveralls-image]][coveralls-url] +[![Gratipay][gratipay-image]][gratipay-url] + +Deprecate all the things + +> With great modules comes great responsibility; mark things deprecated! + +## Install + +```sh +$ npm install depd +``` + +## API + +```js +var deprecate = require('depd')('my-module') +``` + +This library allows you to display deprecation messages to your users. +This library goes above and beyond with deprecation warnings by +introspection of the call stack (but only the bits that it is interested +in). + +Instead of just warning on the first invocation of a deprecated +function and never again, this module will warn on the first invocation +of a deprecated function per unique call site, making it ideal to alert +users of all deprecated uses across the code base, rather than just +whatever happens to execute first. + +The deprecation warnings from this module also include the file and line +information for the call into the module that the deprecated function was +in. + +**NOTE** this library has a similar interface to the `debug` module, and +this module uses the calling file to get the boundary for the call stacks, +so you should always create a new `deprecate` object in each file and not +within some central file. + +### depd(namespace) + +Create a new deprecate function that uses the given namespace name in the +messages and will display the call site prior to the stack entering the +file this function was called from. It is highly suggested you use the +name of your module as the namespace. + +### deprecate(message) + +Call this function from deprecated code to display a deprecation message. +This message will appear once per unique caller site. Caller site is the +first call site in the stack in a different file from the caller of this +function. + +If the message is omitted, a message is generated for you based on the site +of the `deprecate()` call and will display the name of the function called, +similar to the name displayed in a stack trace. + +### deprecate.function(fn, message) + +Call this function to wrap a given function in a deprecation message on any +call to the function. An optional message can be supplied to provide a custom +message. + +### deprecate.property(obj, prop, message) + +Call this function to wrap a given property on object in a deprecation message +on any accessing or setting of the property. An optional message can be supplied +to provide a custom message. + +The method must be called on the object where the property belongs (not +inherited from the prototype). + +If the property is a data descriptor, it will be converted to an accessor +descriptor in order to display the deprecation message. + +### process.on('deprecation', fn) + +This module will allow easy capturing of deprecation errors by emitting the +errors as the type "deprecation" on the global `process`. If there are no +listeners for this type, the errors are written to STDERR as normal, but if +there are any listeners, nothing will be written to STDERR and instead only +emitted. From there, you can write the errors in a different format or to a +logging source. + +The error represents the deprecation and is emitted only once with the same +rules as writing to STDERR. The error has the following properties: + + - `message` - This is the message given by the library + - `name` - This is always `'DeprecationError'` + - `namespace` - This is the namespace the deprecation came from + - `stack` - This is the stack of the call to the deprecated thing + +Example `error.stack` output: + +``` +DeprecationError: my-cool-module deprecated oldfunction + at Object. ([eval]-wrapper:6:22) + at Module._compile (module.js:456:26) + at evalScript (node.js:532:25) + at startup (node.js:80:7) + at node.js:902:3 +``` + +### process.env.NO_DEPRECATION + +As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` +is provided as a quick solution to silencing deprecation warnings from being +output. The format of this is similar to that of `DEBUG`: + +```sh +$ NO_DEPRECATION=my-module,othermod node app.js +``` + +This will suppress deprecations from being output for "my-module" and "othermod". +The value is a list of comma-separated namespaces. To suppress every warning +across all namespaces, use the value `*` for a namespace. + +Providing the argument `--no-deprecation` to the `node` executable will suppress +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not suppress the deperecations given to any "deprecation" +event listeners, just the output to STDERR. + +### process.env.TRACE_DEPRECATION + +As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` +is provided as a solution to getting more detailed location information in deprecation +warnings by including the entire stack trace. The format of this is the same as +`NO_DEPRECATION`: + +```sh +$ TRACE_DEPRECATION=my-module,othermod node app.js +``` + +This will include stack traces for deprecations being output for "my-module" and +"othermod". The value is a list of comma-separated namespaces. To trace every +warning across all namespaces, use the value `*` for a namespace. + +Providing the argument `--trace-deprecation` to the `node` executable will trace +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. + +## Display + +![message](files/message.png) + +When a user calls a function in your library that you mark deprecated, they +will see the following written to STDERR (in the given colors, similar colors +and layout to the `debug` module): + +``` +bright cyan bright yellow +| | reset cyan +| | | | +▼ ▼ ▼ ▼ +my-cool-module deprecated oldfunction [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ +| | | | +namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +If the user redirects their STDERR to a file or somewhere that does not support +colors, they see (similar layout to the `debug` module): + +``` +Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ ▲ +| | | | | +timestamp of message namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +## Examples + +### Deprecating all calls to a function + +This will display a deprecated message about "oldfunction" being deprecated +from "my-module" on STDERR. + +```js +var deprecate = require('depd')('my-cool-module') + +// message automatically derived from function name +// Object.oldfunction +exports.oldfunction = deprecate.function(function oldfunction() { + // all calls to function are deprecated +}) + +// specific message +exports.oldfunction = deprecate.function(function () { + // all calls to function are deprecated +}, 'oldfunction') +``` + +### Conditionally deprecating a function call + +This will display a deprecated message about "weirdfunction" being deprecated +from "my-module" on STDERR when called with less than 2 arguments. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } +} +``` + +When calling `deprecate` as a function, the warning is counted per call site +within your own module, so you can display different deprecations depending +on different situations and the users will still get all the warnings: + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } else if (typeof arguments[0] !== 'string') { + // calls with non-string first argument are deprecated + deprecate('weirdfunction non-string first arg') + } +} +``` + +### Deprecating property access + +This will display a deprecated message about "oldprop" being deprecated +from "my-module" on STDERR when accessed. A deprecation will be displayed +when setting the value and when getting the value. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.oldprop = 'something' + +// message automatically derives from property name +deprecate.property(exports, 'oldprop') + +// explicit message +deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') +``` + +## License + +[MIT](LICENSE) + +[npm-version-image]: https://img.shields.io/npm/v/depd.svg +[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg +[npm-url]: https://npmjs.org/package/depd +[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux +[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd +[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd +[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg +[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master +[node-image]: https://img.shields.io/node/v/depd.svg +[node-url]: http://nodejs.org/download/ +[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg +[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/server/node_modules/depd/index.js b/server/node_modules/depd/index.js new file mode 100644 index 0000000..d183b0a --- /dev/null +++ b/server/node_modules/depd/index.js @@ -0,0 +1,529 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var callSiteToString = require('./lib/compat').callSiteToString +var EventEmitter = require('events').EventEmitter +var relative = require('path').relative + +/** + * Module exports. + */ + +module.exports = depd + +/** + * Get the path to base files on. + */ + +var basePath = process.cwd() + +/** + * Get listener count on event emitter. + */ + +/*istanbul ignore next*/ +var eventListenerCount = EventEmitter.listenerCount + || function (emitter, type) { return emitter.listeners(type).length } + +/** + * Determine if namespace is contained in the string. + */ + +function containsNamespace(str, namespace) { + var val = str.split(/[ ,]+/) + + namespace = String(namespace).toLowerCase() + + for (var i = 0 ; i < val.length; i++) { + if (!(str = val[i])) continue; + + // namespace contained + if (str === '*' || str.toLowerCase() === namespace) { + return true + } + } + + return false +} + +/** + * Convert a data descriptor to accessor descriptor. + */ + +function convertDataDescriptorToAccessor(obj, prop, message) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + var value = descriptor.value + + descriptor.get = function getter() { return value } + + if (descriptor.writable) { + descriptor.set = function setter(val) { return value = val } + } + + delete descriptor.value + delete descriptor.writable + + Object.defineProperty(obj, prop, descriptor) + + return descriptor +} + +/** + * Create arguments string to keep arity. + */ + +function createArgumentsString(arity) { + var str = '' + + for (var i = 0; i < arity; i++) { + str += ', arg' + i + } + + return str.substr(2) +} + +/** + * Create stack string from stack. + */ + +function createStackString(stack) { + var str = this.name + ': ' + this.namespace + + if (this.message) { + str += ' deprecated ' + this.message + } + + for (var i = 0; i < stack.length; i++) { + str += '\n at ' + callSiteToString(stack[i]) + } + + return str +} + +/** + * Create deprecate for namespace in caller. + */ + +function depd(namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + var stack = getStack() + var site = callSiteLocation(stack[1]) + var file = site[0] + + function deprecate(message) { + // call to self as log + log.call(deprecate, message) + } + + deprecate._file = file + deprecate._ignored = isignored(namespace) + deprecate._namespace = namespace + deprecate._traced = istraced(namespace) + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Determine if namespace is ignored. + */ + +function isignored(namespace) { + /* istanbul ignore next: tested in a child processs */ + if (process.noDeprecation) { + // --no-deprecation support + return true + } + + var str = process.env.NO_DEPRECATION || '' + + // namespace ignored + return containsNamespace(str, namespace) +} + +/** + * Determine if namespace is traced. + */ + +function istraced(namespace) { + /* istanbul ignore next: tested in a child processs */ + if (process.traceDeprecation) { + // --trace-deprecation support + return true + } + + var str = process.env.TRACE_DEPRECATION || '' + + // namespace traced + return containsNamespace(str, namespace) +} + +/** + * Display deprecation message. + */ + +function log(message, site) { + var haslisteners = eventListenerCount(process, 'deprecation') !== 0 + + // abort early if no destination + if (!haslisteners && this._ignored) { + return + } + + var caller + var callFile + var callSite + var i = 0 + var seen = false + var stack = getStack() + var file = this._file + + if (site) { + // provided site + callSite = callSiteLocation(stack[1]) + callSite.name = site.name + file = callSite[0] + } else { + // get call site + i = 2 + site = callSiteLocation(stack[i]) + callSite = site + } + + // get caller of deprecated thing in relation to file + for (; i < stack.length; i++) { + caller = callSiteLocation(stack[i]) + callFile = caller[0] + + if (callFile === file) { + seen = true + } else if (callFile === this._file) { + file = this._file + } else if (seen) { + break + } + } + + var key = caller + ? site.join(':') + '__' + caller.join(':') + : undefined + + if (key !== undefined && key in this._warned) { + // already warned + return + } + + this._warned[key] = true + + // generate automatic message from call site + if (!message) { + message = callSite === site || !callSite.name + ? defaultMessage(site) + : defaultMessage(callSite) + } + + // emit deprecation if listeners exist + if (haslisteners) { + var err = DeprecationError(this._namespace, message, stack.slice(i)) + process.emit('deprecation', err) + return + } + + // format and write message + var format = process.stderr.isTTY + ? formatColor + : formatPlain + var msg = format.call(this, message, caller, stack.slice(i)) + process.stderr.write(msg + '\n', 'utf8') + + return +} + +/** + * Get call site location as array. + */ + +function callSiteLocation(callSite) { + var file = callSite.getFileName() || '' + var line = callSite.getLineNumber() + var colm = callSite.getColumnNumber() + + if (callSite.isEval()) { + file = callSite.getEvalOrigin() + ', ' + file + } + + var site = [file, line, colm] + + site.callSite = callSite + site.name = callSite.getFunctionName() + + return site +} + +/** + * Generate a default message from the site. + */ + +function defaultMessage(site) { + var callSite = site.callSite + var funcName = site.name + + // make useful anonymous name + if (!funcName) { + funcName = '' + } + + var context = callSite.getThis() + var typeName = context && callSite.getTypeName() + + // ignore useless type name + if (typeName === 'Object') { + typeName = undefined + } + + // make useful type name + if (typeName === 'Function') { + typeName = context.name || typeName + } + + return typeName && callSite.getMethodName() + ? typeName + '.' + funcName + : funcName +} + +/** + * Format deprecation message without color. + */ + +function formatPlain(msg, caller, stack) { + var timestamp = new Date().toUTCString() + + var formatted = timestamp + + ' ' + this._namespace + + ' deprecated ' + msg + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n at ' + callSiteToString(stack[i]) + } + + return formatted + } + + if (caller) { + formatted += ' at ' + formatLocation(caller) + } + + return formatted +} + +/** + * Format deprecation message with color. + */ + +function formatColor(msg, caller, stack) { + var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' // bold cyan + + ' \x1b[33;1mdeprecated\x1b[22;39m' // bold yellow + + ' \x1b[0m' + msg + '\x1b[39m' // reset + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan + } + + return formatted + } + + if (caller) { + formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan + } + + return formatted +} + +/** + * Format call site location. + */ + +function formatLocation(callSite) { + return relative(basePath, callSite[0]) + + ':' + callSite[1] + + ':' + callSite[2] +} + +/** + * Get the stack as array of call sites. + */ + +function getStack() { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = Math.max(10, limit) + + // capture the stack + Error.captureStackTrace(obj) + + // slice this function off the top + var stack = obj.stack.slice(1) + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack +} + +/** + * Capture call site stack from v8. + */ + +function prepareObjectStackTrace(obj, stack) { + return stack +} + +/** + * Return a wrapped function in a deprecation message. + */ + +function wrapfunction(fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + var args = createArgumentsString(fn.length) + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + site.name = fn.name + + var deprecatedfn = eval('(function (' + args + ') {\n' + + '"use strict"\n' + + 'log.call(deprecate, message, site)\n' + + 'return fn.apply(this, arguments)\n' + + '})') + + return deprecatedfn +} + +/** + * Wrap property in a deprecation message. + */ + +function wrapproperty(obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + // set site name + site.name = prop + + // convert data descriptor + if ('value' in descriptor) { + descriptor = convertDataDescriptorToAccessor(obj, prop, message) + } + + var get = descriptor.get + var set = descriptor.set + + // wrap getter + if (typeof get === 'function') { + descriptor.get = function getter() { + log.call(deprecate, message, site) + return get.apply(this, arguments) + } + } + + // wrap setter + if (typeof set === 'function') { + descriptor.set = function setter() { + log.call(deprecate, message, site) + return set.apply(this, arguments) + } + } + + Object.defineProperty(obj, prop, descriptor) +} + +/** + * Create DeprecationError for deprecation + */ + +function DeprecationError(namespace, message, stack) { + var error = new Error() + var stackString + + Object.defineProperty(error, 'constructor', { + value: DeprecationError + }) + + Object.defineProperty(error, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }) + + Object.defineProperty(error, 'name', { + enumerable: false, + configurable: true, + value: 'DeprecationError', + writable: true + }) + + Object.defineProperty(error, 'namespace', { + configurable: true, + enumerable: false, + value: namespace, + writable: true + }) + + Object.defineProperty(error, 'stack', { + configurable: true, + enumerable: false, + get: function () { + if (stackString !== undefined) { + return stackString + } + + // prepare stack trace + return stackString = createStackString.call(this, stack) + }, + set: function setter(val) { + stackString = val + } + }) + + return error +} diff --git a/server/node_modules/depd/lib/compat/buffer-concat.js b/server/node_modules/depd/lib/compat/buffer-concat.js new file mode 100644 index 0000000..09d9721 --- /dev/null +++ b/server/node_modules/depd/lib/compat/buffer-concat.js @@ -0,0 +1,33 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = bufferConcat + +/** + * Concatenate an array of Buffers. + */ + +function bufferConcat(bufs) { + var length = 0 + + for (var i = 0, len = bufs.length; i < len; i++) { + length += bufs[i].length + } + + var buf = new Buffer(length) + var pos = 0 + + for (var i = 0, len = bufs.length; i < len; i++) { + bufs[i].copy(buf, pos) + pos += bufs[i].length + } + + return buf +} diff --git a/server/node_modules/depd/lib/compat/callsite-tostring.js b/server/node_modules/depd/lib/compat/callsite-tostring.js new file mode 100644 index 0000000..17cf7ed --- /dev/null +++ b/server/node_modules/depd/lib/compat/callsite-tostring.js @@ -0,0 +1,101 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = callSiteToString + +/** + * Format a CallSite file location to a string. + */ + +function callSiteFileLocation(callSite) { + var fileName + var fileLocation = '' + + if (callSite.isNative()) { + fileLocation = 'native' + } else if (callSite.isEval()) { + fileName = callSite.getScriptNameOrSourceURL() + if (!fileName) { + fileLocation = callSite.getEvalOrigin() + } + } else { + fileName = callSite.getFileName() + } + + if (fileName) { + fileLocation += fileName + + var lineNumber = callSite.getLineNumber() + if (lineNumber != null) { + fileLocation += ':' + lineNumber + + var columnNumber = callSite.getColumnNumber() + if (columnNumber) { + fileLocation += ':' + columnNumber + } + } + } + + return fileLocation || 'unknown source' +} + +/** + * Format a CallSite to a string. + */ + +function callSiteToString(callSite) { + var addSuffix = true + var fileLocation = callSiteFileLocation(callSite) + var functionName = callSite.getFunctionName() + var isConstructor = callSite.isConstructor() + var isMethodCall = !(callSite.isToplevel() || isConstructor) + var line = '' + + if (isMethodCall) { + var methodName = callSite.getMethodName() + var typeName = getConstructorName(callSite) + + if (functionName) { + if (typeName && functionName.indexOf(typeName) !== 0) { + line += typeName + '.' + } + + line += functionName + + if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { + line += ' [as ' + methodName + ']' + } + } else { + line += typeName + '.' + (methodName || '') + } + } else if (isConstructor) { + line += 'new ' + (functionName || '') + } else if (functionName) { + line += functionName + } else { + addSuffix = false + line += fileLocation + } + + if (addSuffix) { + line += ' (' + fileLocation + ')' + } + + return line +} + +/** + * Get constructor name of reviver. + */ + +function getConstructorName(obj) { + var receiver = obj.receiver + return (receiver.constructor && receiver.constructor.name) || null +} diff --git a/server/node_modules/depd/lib/compat/index.js b/server/node_modules/depd/lib/compat/index.js new file mode 100644 index 0000000..7fee026 --- /dev/null +++ b/server/node_modules/depd/lib/compat/index.js @@ -0,0 +1,69 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +lazyProperty(module.exports, 'bufferConcat', function bufferConcat() { + return Buffer.concat || require('./buffer-concat') +}) + +lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + function prepareObjectStackTrace(obj, stack) { + return stack + } + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = 2 + + // capture the stack + Error.captureStackTrace(obj) + + // slice the stack + var stack = obj.stack.slice() + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack[0].toString ? toString : require('./callsite-tostring') +}) + +/** + * Define a lazy property. + */ + +function lazyProperty(obj, prop, getter) { + function get() { + var val = getter() + + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + value: val + }) + + return val + } + + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + get: get + }) +} + +/** + * Call toString() on the obj + */ + +function toString(obj) { + return obj.toString() +} diff --git a/server/node_modules/depd/package.json b/server/node_modules/depd/package.json new file mode 100644 index 0000000..25003bb --- /dev/null +++ b/server/node_modules/depd/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "depd@~1.0.0", + "scope": null, + "escapedName": "depd", + "name": "depd", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express" + ] + ], + "_from": "depd@>=1.0.0 <1.1.0", + "_id": "depd@1.0.1", + "_inCache": true, + "_location": "/depd", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "depd@~1.0.0", + "scope": null, + "escapedName": "depd", + "name": "depd", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/send" + ], + "_resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", + "_shasum": "80aec64c9d6d97e65cc2a9caa93c0aa6abf73aaa", + "_shrinkwrap": null, + "_spec": "depd@~1.0.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/express", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "bugs": { + "url": "https://github.com/dougwilson/nodejs-depd/issues" + }, + "dependencies": {}, + "description": "Deprecate all the things", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "1.0.0", + "istanbul": "0.3.5", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "80aec64c9d6d97e65cc2a9caa93c0aa6abf73aaa", + "tarball": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "lib/", + "History.md", + "LICENSE", + "index.js", + "Readme.md" + ], + "gitHead": "769e0f8108463c35a6937a9d634ab19fee45100a", + "homepage": "https://github.com/dougwilson/nodejs-depd", + "keywords": [ + "deprecate", + "deprecated" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "depd", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/dougwilson/nodejs-depd.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "test": "mocha --reporter spec --bail test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" + }, + "version": "1.0.1" +} diff --git a/server/node_modules/destroy/README.md b/server/node_modules/destroy/README.md new file mode 100644 index 0000000..665acb7 --- /dev/null +++ b/server/node_modules/destroy/README.md @@ -0,0 +1,38 @@ +# Destroy + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Dependency Status][david-image]][david-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Destroy a stream. + +## API + +```js +var destroy = require('destroy') + +var fs = require('fs') +var stream = fs.createReadStream('package.json') +destroy(stream) +``` + +[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square +[npm-url]: https://npmjs.org/package/destroy +[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square +[github-url]: https://github.com/stream-utils/destroy/tags +[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square +[travis-url]: https://travis-ci.org/stream-utils/destroy +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master +[david-image]: http://img.shields.io/david/stream-utils/destroy.svg?style=flat-square +[david-url]: https://david-dm.org/stream-utils/destroy +[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/destroy +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/server/node_modules/destroy/index.js b/server/node_modules/destroy/index.js new file mode 100644 index 0000000..b455217 --- /dev/null +++ b/server/node_modules/destroy/index.js @@ -0,0 +1,36 @@ +var ReadStream = require('fs').ReadStream +var Stream = require('stream') + +module.exports = function destroy(stream) { + if (stream instanceof ReadStream) { + return destroyReadStream(stream) + } + + if (!(stream instanceof Stream)) { + return stream + } + + if (typeof stream.destroy === 'function') { + stream.destroy() + } + + return stream +} + +function destroyReadStream(stream) { + stream.destroy() + + if (typeof stream.close === 'function') { + // node.js core bug work-around + stream.on('open', onopenClose) + } + + return stream +} + +function onopenClose() { + if (typeof this.fd === 'number') { + // actually close down the fd + this.close() + } +} diff --git a/server/node_modules/destroy/package.json b/server/node_modules/destroy/package.json new file mode 100644 index 0000000..398d135 --- /dev/null +++ b/server/node_modules/destroy/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "destroy@1.0.3", + "scope": null, + "escapedName": "destroy", + "name": "destroy", + "rawSpec": "1.0.3", + "spec": "1.0.3", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/send" + ] + ], + "_from": "destroy@1.0.3", + "_id": "destroy@1.0.3", + "_inCache": true, + "_location": "/destroy", + "_npmUser": { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "raw": "destroy@1.0.3", + "scope": null, + "escapedName": "destroy", + "name": "destroy", + "rawSpec": "1.0.3", + "spec": "1.0.3", + "type": "version" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz", + "_shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9", + "_shrinkwrap": null, + "_spec": "destroy@1.0.3", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/send", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/stream-utils/destroy/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "destroy a stream if possible", + "devDependencies": { + "istanbul": "0", + "mocha": "1" + }, + "directories": {}, + "dist": { + "shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9", + "tarball": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "50af95ece4a70202f9301bc3edc8f9fdbbad0f26", + "homepage": "https://github.com/stream-utils/destroy", + "keywords": [ + "stream", + "streams", + "destroy", + "cleanup", + "leak", + "fd" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "destroy", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/stream-utils/destroy.git" + }, + "scripts": { + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "1.0.3" +} diff --git a/server/node_modules/ee-first/LICENSE b/server/node_modules/ee-first/LICENSE new file mode 100644 index 0000000..c1b15a1 --- /dev/null +++ b/server/node_modules/ee-first/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +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/server/node_modules/ee-first/README.md b/server/node_modules/ee-first/README.md new file mode 100644 index 0000000..bb16aab --- /dev/null +++ b/server/node_modules/ee-first/README.md @@ -0,0 +1,80 @@ +# EE First + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Get the first event in a set of event emitters and event pairs, +then clean up after itself. + +## Install + +```sh +$ npm install ee-first +``` + +## API + +```js +var first = require('ee-first') +``` + +### first(arr, listener) + +Invoke `listener` on the first event from the list specified in `arr`. `arr` is +an array of arrays, with each array in the format `[ee, ...event]`. `listener` +will be called only once, the first time any of the given events are emitted. If +`error` is one of the listened events, then if that fires first, the `listener` +will be given the `err` argument. + +The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the +first argument emitted from an `error` event, if applicable; `ee` is the event +emitter that fired; `event` is the string event name that fired; and `args` is an +array of the arguments that were emitted on the event. + +```js +var ee1 = new EventEmitter() +var ee2 = new EventEmitter() + +first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) +``` + +#### .cancel() + +The group of listeners can be cancelled before being invoked and have all the event +listeners removed from the underlying event emitters. + +```js +var thunk = first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) + +// cancel and clean up +thunk.cancel() +``` + +[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square +[npm-url]: https://npmjs.org/package/ee-first +[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square +[github-url]: https://github.com/jonathanong/ee-first/tags +[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square +[travis-url]: https://travis-ci.org/jonathanong/ee-first +[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master +[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/ee-first +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/server/node_modules/ee-first/index.js b/server/node_modules/ee-first/index.js new file mode 100644 index 0000000..1d66203 --- /dev/null +++ b/server/node_modules/ee-first/index.js @@ -0,0 +1,68 @@ + +module.exports = function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError('arg must be an array of [ee, events...] arrays') + + var cleanups = [] + + for (var i = 0; i < stuff.length; i++) { + var arr = stuff[i] + + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError('each array member must be [ee, events...]') + + var ee = arr[0] + + for (var j = 1; j < arr.length; j++) { + var event = arr[j] + var fn = listener(event, callback) + + // listen to the event + ee.on(event, fn) + // push this listener to the list of cleanups + cleanups.push({ + ee: ee, + event: event, + fn: fn, + }) + } + } + + function callback() { + cleanup() + done.apply(null, arguments) + } + + function cleanup() { + var x + for (var i = 0; i < cleanups.length; i++) { + x = cleanups[i] + x.ee.removeListener(x.event, x.fn) + } + } + + function thunk(fn) { + done = fn + } + + thunk.cancel = cleanup + + return thunk +} + +function listener(event, done) { + return function onevent(arg1) { + var args = new Array(arguments.length) + var ee = this + var err = event === 'error' + ? arg1 + : null + + // copy args to prevent arguments escaping scope + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + done(err, ee, event, args) + } +} diff --git a/server/node_modules/ee-first/package.json b/server/node_modules/ee-first/package.json new file mode 100644 index 0000000..738532d --- /dev/null +++ b/server/node_modules/ee-first/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "ee-first@1.1.0", + "scope": null, + "escapedName": "ee-first", + "name": "ee-first", + "rawSpec": "1.1.0", + "spec": "1.1.0", + "type": "version" + }, + "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/on-finished" + ] + ], + "_from": "ee-first@1.1.0", + "_id": "ee-first@1.1.0", + "_inCache": true, + "_location": "/ee-first", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "raw": "ee-first@1.1.0", + "scope": null, + "escapedName": "ee-first", + "name": "ee-first", + "rawSpec": "1.1.0", + "spec": "1.1.0", + "type": "version" + }, + "_requiredBy": [ + "/on-finished" + ], + "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz", + "_shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", + "_shrinkwrap": null, + "_spec": "ee-first@1.1.0", + "_where": "/home/nau/MEGA/CODI/githubRepos/colspace/node_modules/on-finished", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/jonathanong/ee-first/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "return the first event in a set of ee/event pairs", + "devDependencies": { + "istanbul": "0.3.2", + "mocha": "1" + }, + "directories": {}, + "dist": { + "shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", + "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" + }, + "files": [ + "index.js", + "LICENSE" + ], + "gitHead": "a6412004da4745941af2fc98ec30c8da570da7ea", + "homepage": "https://github.com/jonathanong/ee-first", + "license": "MIT", + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "ee-first", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonathanong/ee-first.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.1.0" +} diff --git a/server/node_modules/engine.io-client/History.md b/server/node_modules/engine.io-client/History.md new file mode 100644 index 0000000..7f4a91b --- /dev/null +++ b/server/node_modules/engine.io-client/History.md @@ -0,0 +1,627 @@ + +1.8.2 / 2016-12-11 +=================== + + * [chore] Bump engine.io-parser to version 1.3.2 (#523) + +1.8.1 / 2016-11-27 +=================== + + * [fix] Only add defined callbacks to the stack (#447) + +1.8.0 / 2016-11-20 +=================== + + * [fix] Fixed regression creating connection over https from node (#513) + * [fix] Fixed regression creating connection over wss from node (#514) + * [feature] Enable definition of timeouts for xhr-polling (#456) + * [feature] Added flag forceNode to override the normal behavior of prefering Browser based implementations. (#469) + * [feature] add localAddress option (#487) + * [chore] update dependencies (#516) + * [chore] Speed up lint by avoiding '**/*.js' matching pattern (#517) + * [chore] Bump debug to version 2.3.3 (#520) + +1.7.2 / 2016-10-24 +=================== + + * [fix] Set accept header to */* to support react app proxy (#508) + * [fix] remove a workaround for ios (#465) + * [fix] onPacket now emits data on 'closing' state as well (#484) + * [fix] Obfuscate `ActiveXObject` occurrences (#509) + * [docs] Add missing `onlyBinaryUpgrades` option in the docs (#510) + * [chore] Add Github issue and PR templates (#511) + +1.7.1 / 2016-10-20 +=================== + + * [fix] Define "requestsCount" var and "requests" hash unconditionally (#490) + * [perf] Add all properties to the socket in the constructor (#488) + * [chore] Update zuul browser settings (#504) + * [chore] Bump engine.io-parser to 1.3.1 (#505) + * [chore] Use more-specific imports for StealJS compatibility (#467) + +1.7.0 / 2016-10-05 +=================== + + * [fix] Revert "default `rejectUnauthorized` to `true`" (#496) + * [fix] Use xhr.responseText if xhr.response is not provided (#483) + * [fix] Fix issue with errors during WebSocket creation not being caught (#475) + * [style] Add missing semi-colon (#501) + * [chore] Add gulp & babel in the build process (#455) + * [chore] Add eslint (#458) + * [chore] Bump zuul (#464) + * [chore] Remove unused submodule (#466) + * [chore] Bumping ws to 1.1.1 (#478) + * [chore] Update zuul browser settings following EOL notices (#486) + * [chore] Bump engine.io-parser (#492) + * [chore] Make the build status badge point towards master (#497) + * [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#498) + * [chore] Restrict files included in npm package (#499) + +1.6.11 / 2016-06-23 +=================== + + * bump version + +1.6.10 / 2016-06-23 +=================== + + * bump version + +1.6.9 / 2016-05-02 +================== + + * default `rejectUnauthorized` to `true` + +1.6.8 / 2016-01-25 +================== + + * safely resolve `ws` module + +1.6.7 / 2016-01-10 +================== + + * prevent `ws` from being added to the bundle + * added jsonp fix for when no ` + +``` + +### With browserify + +Engine.IO is a commonjs module, which means you can include it by using +`require` on the browser and package using [browserify](http://browserify.org/): + +1. install the client package + + ```bash + $ npm install engine.io-client + ``` + +1. write your app code + + ```js + var socket = require('engine.io-client')('ws://localhost'); + socket.on('open', function(){ + socket.on('message', function(data){}); + socket.on('close', function(){}); + }); + ``` + +1. build your app bundle + + ```bash + $ browserify app.js > bundle.js + ``` + +1. include on your page + + ```html + + ``` + +### Sending and receiving binary + +```html + + +``` + +### Node.JS + +Add `engine.io-client` to your `package.json` and then: + +```js +var socket = require('engine.io-client')('ws://localhost'); +socket.on('open', function(){ + socket.on('message', function(data){}); + socket.on('close', function(){}); +}); +``` + +### Node.js with certificates +```js +var opts = { + key: fs.readFileSync('test/fixtures/client.key'), + cert: fs.readFileSync('test/fixtures/client.crt'), + ca: fs.readFileSync('test/fixtures/ca.crt') +}; + +var socket = require('engine.io-client')('ws://localhost', opts); +socket.on('open', function(){ + socket.on('message', function(data){}); + socket.on('close', function(){}); +}); +``` + +### Node.js with extraHeaders +```js +var opts = { + extraHeaders: { + 'X-Custom-Header-For-My-Project': 'my-secret-access-token', + 'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly' + } +}; + +var socket = require('engine.io-client')('ws://localhost', opts); +socket.on('open', function(){ + socket.on('message', function(data){}); + socket.on('close', function(){}); +}); +``` + +## Features + +- Lightweight +- Runs on browser and node.js seamlessly +- Transports are independent of `Engine` + - Easy to debug + - Easy to unit test +- Runs inside HTML5 WebWorker +- Can send and receive binary data + - Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer + in Node + - When XHR2 or WebSockets are used, binary is emitted directly. Otherwise + binary is encoded into base64 strings, and decoded when binary types are + supported. + - With browsers that don't support ArrayBuffer, an object { base64: true, + data: dataAsBase64String } is emitted on the `message` event. + +## API + +### Socket + +The client class. Mixes in [Emitter](http://github.com/component/emitter). +Exposed as `eio` in the browser standalone build. + +#### Properties + +- `protocol` _(Number)_: protocol revision number +- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers, + and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's + supported. + +#### Events + +- `open` + - Fired upon successful connection. +- `message` + - Fired when data is received from the server. + - **Arguments** + - `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing + binary data +- `close` + - Fired upon disconnection. In compliance with the WebSocket API spec, this event may be + fired even if the `open` event does not occur (i.e. due to connection error or `close()`). +- `error` + - Fired when an error occurs. +- `flush` + - Fired upon completing a buffer flush +- `drain` + - Fired after `drain` event of transport if writeBuffer is empty +- `upgradeError` + - Fired if an error occurs with a transport we're trying to upgrade to. +- `upgrade` + - Fired upon upgrade success, after the new transport is set +- `ping` + - Fired upon _flushing_ a ping packet (ie: actual packet write out) +- `pong` + - Fired upon receiving a pong packet. + +#### Methods + +- **constructor** + - Initializes the client + - **Parameters** + - `String` uri + - `Object`: optional, options object + - **Options** + - `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only) + - `upgrade` (`Boolean`): defaults to true, whether the client should try + to upgrade the transport from long-polling to something better. + - `forceJSONP` (`Boolean`): forces JSONP for polling transport. + - `jsonp` (`Boolean`): determines whether to use JSONP when + necessary for polling. If disabled (by settings to false) an error will + be emitted (saying "No transports available") if no other transports + are available. If another transport is available for opening a + connection (e.g. WebSocket) that transport + will be used instead. + - `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary. + - `enablesXDR` (`Boolean`): enables XDomainRequest for IE8 to avoid loading bar flashing with click sound. default to `false` because XDomainRequest has a flaw of not sending cookie. + - `timestampRequests` (`Boolean`): whether to add the timestamp with each + transport request. Note: polling requests are always stamped unless this + option is explicitly set to `false` (`false`) + - `timestampParam` (`String`): timestamp parameter (`t`) + - `policyPort` (`Number`): port the policy server listens on (`843`) + - `path` (`String`): path to connect to, default is `/engine.io` + - `transports` (`Array`): a list of transports to try (in order). + Defaults to `['polling', 'websocket']`. `Engine` + always attempts to connect directly with the first one, provided the + feature detection test for it passes. + - `rememberUpgrade` (`Boolean`): defaults to false. + If true and if the previous websocket connection to the server succeeded, + the connection attempt will bypass the normal upgrade process and will initially + try websocket. A connection attempt following a transport error will use the + normal upgrade process. It is recommended you turn this on only when using + SSL/TLS connections, or if you know that your network does not block websockets. + - `pfx` (`String`): Certificate, Private key and CA certificates to use for SSL. Can be used in Node.js client environment to manually specify certificate information. + - `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information. + - `passphrase` (`String`): A string of passphrase for the private key or pfx. Can be used in Node.js client environment to manually specify certificate information. + - `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information. + - `ca` (`String`|`Array`): An authority certificate or array of authority certificates to check the remote host against.. Can be used in Node.js client environment to manually specify certificate information. + - `ciphers` (`String`): A string describing the ciphers to use or exclude. Consult the [cipher format list](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details on the format. Can be used in Node.js client environment to manually specify certificate information. + - `rejectUnauthorized` (`Boolean`): If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Can be used in Node.js client environment to manually specify certificate information. + - `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension + (see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`) + - `threshold` (`Number`): data is compressed only if the byte size is above this value. This option is ignored on the browser. (`1024`) + - `extraHeaders` (`Object`): Headers that will be passed for each request to the server (via xhr-polling and via websockets). These values then can be used during handshake or for special proxies. Can only be used in Node.js client environment. + - `onlyBinaryUpgrades` (`Boolean`): whether transport upgrades should be restricted to transports supporting binary data (`false`) + - `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`) + - `forceNode` (`Boolean`): Uses NodeJS implementation for websockets - even if there is a native Browser-Websocket available, which is preferred by default over the NodeJS implementation. (This is useful when using hybrid platforms like nw.js or electron) (`false`, NodeJS only) + - `localAddress` (`String`): the local IP address to connect to +- `send` + - Sends a message to the server + - **Parameters** + - `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send + - `Object`: optional, options object + - `Function`: optional, callback upon `drain` + - **Options** + - `compress` (`Boolean`): whether to compress sending data. This option is ignored and forced to be `true` on the browser. (`true`) +- `close` + - Disconnects the client. + +### Transport + +The transport class. Private. _Inherits from EventEmitter_. + +#### Events + +- `poll`: emitted by polling transports upon starting a new request +- `pollComplete`: emitted by polling transports upon completing a request +- `drain`: emitted by polling transports upon a buffer drain + +## Tests + +`engine.io-client` is used to test +[engine](http://github.com/socketio/engine.io). Running the `engine.io` +test suite ensures the client works and vice-versa. + +Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can +run the tests locally using the following command. + +``` +./node_modules/.bin/zuul --local 8080 -- test/index.js +``` + +Additionally, `engine.io-client` has a standalone test suite you can run +with `make test` which will run node.js and browser tests. You must have zuul setup with +a saucelabs account. + +## Support + +The support channels for `engine.io-client` are the same as `socket.io`: + - irc.freenode.net **#socket.io** + - [Google Groups](http://groups.google.com/group/socket_io) + - [Website](http://socket.io) + +## Development + +To contribute patches, run tests or benchmarks, make sure to clone the +repository: + +```bash +git clone git://github.com/socketio/engine.io-client.git +``` + +Then: + +```bash +cd engine.io-client +npm install +``` + +See the `Tests` section above for how to run tests before submitting any patches. + +## License + +MIT - Copyright (c) 2014 Automattic, Inc. diff --git a/server/node_modules/engine.io-client/engine.io.js b/server/node_modules/engine.io-client/engine.io.js new file mode 100644 index 0000000..b660daa --- /dev/null +++ b/server/node_modules/engine.io-client/engine.io.js @@ -0,0 +1,4671 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["eio"] = factory(); + else + root["eio"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(1); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(2); + + /** + * Exports parser + * + * @api public + * + */ + module.exports.parser = __webpack_require__(9); + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + /** + * Module dependencies. + */ + + var transports = __webpack_require__(3); + var Emitter = __webpack_require__(19); + var debug = __webpack_require__(23)('engine.io-client:socket'); + var index = __webpack_require__(30); + var parser = __webpack_require__(9); + var parseuri = __webpack_require__(31); + var parsejson = __webpack_require__(32); + var parseqs = __webpack_require__(20); + + /** + * Module exports. + */ + + module.exports = Socket; + + /** + * Socket constructor. + * + * @param {String|Object} uri or options + * @param {Object} options + * @api public + */ + + function Socket(uri, opts) { + if (!(this instanceof Socket)) return new Socket(uri, opts); + + opts = opts || {}; + + if (uri && 'object' === (typeof uri === 'undefined' ? 'undefined' : _typeof(uri))) { + opts = uri; + uri = null; + } + + if (uri) { + uri = parseuri(uri); + opts.hostname = uri.host; + opts.secure = uri.protocol === 'https' || uri.protocol === 'wss'; + opts.port = uri.port; + if (uri.query) opts.query = uri.query; + } else if (opts.host) { + opts.hostname = parseuri(opts.host).host; + } + + this.secure = null != opts.secure ? opts.secure : global.location && 'https:' === location.protocol; + + if (opts.hostname && !opts.port) { + // if no port is specified manually, use the protocol default + opts.port = this.secure ? '443' : '80'; + } + + this.agent = opts.agent || false; + this.hostname = opts.hostname || (global.location ? location.hostname : 'localhost'); + this.port = opts.port || (global.location && location.port ? location.port : this.secure ? 443 : 80); + this.query = opts.query || {}; + if ('string' === typeof this.query) this.query = parseqs.decode(this.query); + this.upgrade = false !== opts.upgrade; + this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/'; + this.forceJSONP = !!opts.forceJSONP; + this.jsonp = false !== opts.jsonp; + this.forceBase64 = !!opts.forceBase64; + this.enablesXDR = !!opts.enablesXDR; + this.timestampParam = opts.timestampParam || 't'; + this.timestampRequests = opts.timestampRequests; + this.transports = opts.transports || ['polling', 'websocket']; + this.readyState = ''; + this.writeBuffer = []; + this.prevBufferLen = 0; + this.policyPort = opts.policyPort || 843; + this.rememberUpgrade = opts.rememberUpgrade || false; + this.binaryType = null; + this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades; + this.perMessageDeflate = false !== opts.perMessageDeflate ? opts.perMessageDeflate || {} : false; + + if (true === this.perMessageDeflate) this.perMessageDeflate = {}; + if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) { + this.perMessageDeflate.threshold = 1024; + } + + // SSL options for Node.js client + this.pfx = opts.pfx || null; + this.key = opts.key || null; + this.passphrase = opts.passphrase || null; + this.cert = opts.cert || null; + this.ca = opts.ca || null; + this.ciphers = opts.ciphers || null; + this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized; + this.forceNode = !!opts.forceNode; + + // other options for Node.js client + var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' && global; + if (freeGlobal.global === freeGlobal) { + if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) { + this.extraHeaders = opts.extraHeaders; + } + + if (opts.localAddress) { + this.localAddress = opts.localAddress; + } + } + + // set on handshake + this.id = null; + this.upgrades = null; + this.pingInterval = null; + this.pingTimeout = null; + + // set on heartbeat + this.pingIntervalTimer = null; + this.pingTimeoutTimer = null; + + this.open(); + } + + Socket.priorWebsocketSuccess = false; + + /** + * Mix in `Emitter`. + */ + + Emitter(Socket.prototype); + + /** + * Protocol version. + * + * @api public + */ + + Socket.protocol = parser.protocol; // this is an int + + /** + * Expose deps for legacy compatibility + * and standalone browser access. + */ + + Socket.Socket = Socket; + Socket.Transport = __webpack_require__(8); + Socket.transports = __webpack_require__(3); + Socket.parser = __webpack_require__(9); + + /** + * Creates transport of the given type. + * + * @param {String} transport name + * @return {Transport} + * @api private + */ + + Socket.prototype.createTransport = function (name) { + debug('creating transport "%s"', name); + var query = clone(this.query); + + // append engine.io protocol identifier + query.EIO = parser.protocol; + + // transport name + query.transport = name; + + // session id if we already have one + if (this.id) query.sid = this.id; + + var transport = new transports[name]({ + agent: this.agent, + hostname: this.hostname, + port: this.port, + secure: this.secure, + path: this.path, + query: query, + forceJSONP: this.forceJSONP, + jsonp: this.jsonp, + forceBase64: this.forceBase64, + enablesXDR: this.enablesXDR, + timestampRequests: this.timestampRequests, + timestampParam: this.timestampParam, + policyPort: this.policyPort, + socket: this, + pfx: this.pfx, + key: this.key, + passphrase: this.passphrase, + cert: this.cert, + ca: this.ca, + ciphers: this.ciphers, + rejectUnauthorized: this.rejectUnauthorized, + perMessageDeflate: this.perMessageDeflate, + extraHeaders: this.extraHeaders, + forceNode: this.forceNode, + localAddress: this.localAddress + }); + + return transport; + }; + + function clone(obj) { + var o = {}; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + o[i] = obj[i]; + } + } + return o; + } + + /** + * Initializes transport to use and starts probe. + * + * @api private + */ + Socket.prototype.open = function () { + var transport; + if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) { + transport = 'websocket'; + } else if (0 === this.transports.length) { + // Emit error on next tick so it can be listened to + var self = this; + setTimeout(function () { + self.emit('error', 'No transports available'); + }, 0); + return; + } else { + transport = this.transports[0]; + } + this.readyState = 'opening'; + + // Retry with the next transport if the transport is disabled (jsonp: false) + try { + transport = this.createTransport(transport); + } catch (e) { + this.transports.shift(); + this.open(); + return; + } + + transport.open(); + this.setTransport(transport); + }; + + /** + * Sets the current transport. Disables the existing one (if any). + * + * @api private + */ + + Socket.prototype.setTransport = function (transport) { + debug('setting transport %s', transport.name); + var self = this; + + if (this.transport) { + debug('clearing existing transport %s', this.transport.name); + this.transport.removeAllListeners(); + } + + // set up transport + this.transport = transport; + + // set up transport listeners + transport.on('drain', function () { + self.onDrain(); + }).on('packet', function (packet) { + self.onPacket(packet); + }).on('error', function (e) { + self.onError(e); + }).on('close', function () { + self.onClose('transport close'); + }); + }; + + /** + * Probes a transport. + * + * @param {String} transport name + * @api private + */ + + Socket.prototype.probe = function (name) { + debug('probing transport "%s"', name); + var transport = this.createTransport(name, { probe: 1 }); + var failed = false; + var self = this; + + Socket.priorWebsocketSuccess = false; + + function onTransportOpen() { + if (self.onlyBinaryUpgrades) { + var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary; + failed = failed || upgradeLosesBinary; + } + if (failed) return; + + debug('probe transport "%s" opened', name); + transport.send([{ type: 'ping', data: 'probe' }]); + transport.once('packet', function (msg) { + if (failed) return; + if ('pong' === msg.type && 'probe' === msg.data) { + debug('probe transport "%s" pong', name); + self.upgrading = true; + self.emit('upgrading', transport); + if (!transport) return; + Socket.priorWebsocketSuccess = 'websocket' === transport.name; + + debug('pausing current transport "%s"', self.transport.name); + self.transport.pause(function () { + if (failed) return; + if ('closed' === self.readyState) return; + debug('changing transport and sending upgrade packet'); + + cleanup(); + + self.setTransport(transport); + transport.send([{ type: 'upgrade' }]); + self.emit('upgrade', transport); + transport = null; + self.upgrading = false; + self.flush(); + }); + } else { + debug('probe transport "%s" failed', name); + var err = new Error('probe error'); + err.transport = transport.name; + self.emit('upgradeError', err); + } + }); + } + + function freezeTransport() { + if (failed) return; + + // Any callback called by transport should be ignored since now + failed = true; + + cleanup(); + + transport.close(); + transport = null; + } + + // Handle any error that happens while probing + function onerror(err) { + var error = new Error('probe error: ' + err); + error.transport = transport.name; + + freezeTransport(); + + debug('probe transport "%s" failed because of error: %s', name, err); + + self.emit('upgradeError', error); + } + + function onTransportClose() { + onerror('transport closed'); + } + + // When the socket is closed while we're probing + function onclose() { + onerror('socket closed'); + } + + // When the socket is upgraded while we're probing + function onupgrade(to) { + if (transport && to.name !== transport.name) { + debug('"%s" works - aborting "%s"', to.name, transport.name); + freezeTransport(); + } + } + + // Remove all listeners on the transport and on self + function cleanup() { + transport.removeListener('open', onTransportOpen); + transport.removeListener('error', onerror); + transport.removeListener('close', onTransportClose); + self.removeListener('close', onclose); + self.removeListener('upgrading', onupgrade); + } + + transport.once('open', onTransportOpen); + transport.once('error', onerror); + transport.once('close', onTransportClose); + + this.once('close', onclose); + this.once('upgrading', onupgrade); + + transport.open(); + }; + + /** + * Called when connection is deemed open. + * + * @api public + */ + + Socket.prototype.onOpen = function () { + debug('socket open'); + this.readyState = 'open'; + Socket.priorWebsocketSuccess = 'websocket' === this.transport.name; + this.emit('open'); + this.flush(); + + // we check for `readyState` in case an `open` + // listener already closed the socket + if ('open' === this.readyState && this.upgrade && this.transport.pause) { + debug('starting upgrade probes'); + for (var i = 0, l = this.upgrades.length; i < l; i++) { + this.probe(this.upgrades[i]); + } + } + }; + + /** + * Handles a packet. + * + * @api private + */ + + Socket.prototype.onPacket = function (packet) { + if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) { + debug('socket receive: type "%s", data "%s"', packet.type, packet.data); + + this.emit('packet', packet); + + // Socket is live - any packet counts + this.emit('heartbeat'); + + switch (packet.type) { + case 'open': + this.onHandshake(parsejson(packet.data)); + break; + + case 'pong': + this.setPing(); + this.emit('pong'); + break; + + case 'error': + var err = new Error('server error'); + err.code = packet.data; + this.onError(err); + break; + + case 'message': + this.emit('data', packet.data); + this.emit('message', packet.data); + break; + } + } else { + debug('packet received with socket readyState "%s"', this.readyState); + } + }; + + /** + * Called upon handshake completion. + * + * @param {Object} handshake obj + * @api private + */ + + Socket.prototype.onHandshake = function (data) { + this.emit('handshake', data); + this.id = data.sid; + this.transport.query.sid = data.sid; + this.upgrades = this.filterUpgrades(data.upgrades); + this.pingInterval = data.pingInterval; + this.pingTimeout = data.pingTimeout; + this.onOpen(); + // In case open handler closes socket + if ('closed' === this.readyState) return; + this.setPing(); + + // Prolong liveness of socket on heartbeat + this.removeListener('heartbeat', this.onHeartbeat); + this.on('heartbeat', this.onHeartbeat); + }; + + /** + * Resets ping timeout. + * + * @api private + */ + + Socket.prototype.onHeartbeat = function (timeout) { + clearTimeout(this.pingTimeoutTimer); + var self = this; + self.pingTimeoutTimer = setTimeout(function () { + if ('closed' === self.readyState) return; + self.onClose('ping timeout'); + }, timeout || self.pingInterval + self.pingTimeout); + }; + + /** + * Pings server every `this.pingInterval` and expects response + * within `this.pingTimeout` or closes connection. + * + * @api private + */ + + Socket.prototype.setPing = function () { + var self = this; + clearTimeout(self.pingIntervalTimer); + self.pingIntervalTimer = setTimeout(function () { + debug('writing ping packet - expecting pong within %sms', self.pingTimeout); + self.ping(); + self.onHeartbeat(self.pingTimeout); + }, self.pingInterval); + }; + + /** + * Sends a ping packet. + * + * @api private + */ + + Socket.prototype.ping = function () { + var self = this; + this.sendPacket('ping', function () { + self.emit('ping'); + }); + }; + + /** + * Called on `drain` event + * + * @api private + */ + + Socket.prototype.onDrain = function () { + this.writeBuffer.splice(0, this.prevBufferLen); + + // setting prevBufferLen = 0 is very important + // for example, when upgrading, upgrade packet is sent over, + // and a nonzero prevBufferLen could cause problems on `drain` + this.prevBufferLen = 0; + + if (0 === this.writeBuffer.length) { + this.emit('drain'); + } else { + this.flush(); + } + }; + + /** + * Flush write buffers. + * + * @api private + */ + + Socket.prototype.flush = function () { + if ('closed' !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) { + debug('flushing %d packets in socket', this.writeBuffer.length); + this.transport.send(this.writeBuffer); + // keep track of current length of writeBuffer + // splice writeBuffer and callbackBuffer on `drain` + this.prevBufferLen = this.writeBuffer.length; + this.emit('flush'); + } + }; + + /** + * Sends a message. + * + * @param {String} message. + * @param {Function} callback function. + * @param {Object} options. + * @return {Socket} for chaining. + * @api public + */ + + Socket.prototype.write = Socket.prototype.send = function (msg, options, fn) { + this.sendPacket('message', msg, options, fn); + return this; + }; + + /** + * Sends a packet. + * + * @param {String} packet type. + * @param {String} data. + * @param {Object} options. + * @param {Function} callback function. + * @api private + */ + + Socket.prototype.sendPacket = function (type, data, options, fn) { + if ('function' === typeof data) { + fn = data; + data = undefined; + } + + if ('function' === typeof options) { + fn = options; + options = null; + } + + if ('closing' === this.readyState || 'closed' === this.readyState) { + return; + } + + options = options || {}; + options.compress = false !== options.compress; + + var packet = { + type: type, + data: data, + options: options + }; + this.emit('packetCreate', packet); + this.writeBuffer.push(packet); + if (fn) this.once('flush', fn); + this.flush(); + }; + + /** + * Closes the connection. + * + * @api private + */ + + Socket.prototype.close = function () { + if ('opening' === this.readyState || 'open' === this.readyState) { + this.readyState = 'closing'; + + var self = this; + + if (this.writeBuffer.length) { + this.once('drain', function () { + if (this.upgrading) { + waitForUpgrade(); + } else { + close(); + } + }); + } else if (this.upgrading) { + waitForUpgrade(); + } else { + close(); + } + } + + function close() { + self.onClose('forced close'); + debug('socket closing - telling transport to close'); + self.transport.close(); + } + + function cleanupAndClose() { + self.removeListener('upgrade', cleanupAndClose); + self.removeListener('upgradeError', cleanupAndClose); + close(); + } + + function waitForUpgrade() { + // wait for upgrade to finish since we can't send packets while pausing a transport + self.once('upgrade', cleanupAndClose); + self.once('upgradeError', cleanupAndClose); + } + + return this; + }; + + /** + * Called upon transport error + * + * @api private + */ + + Socket.prototype.onError = function (err) { + debug('socket error %j', err); + Socket.priorWebsocketSuccess = false; + this.emit('error', err); + this.onClose('transport error', err); + }; + + /** + * Called upon transport close. + * + * @api private + */ + + Socket.prototype.onClose = function (reason, desc) { + if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) { + debug('socket close with reason: "%s"', reason); + var self = this; + + // clear timers + clearTimeout(this.pingIntervalTimer); + clearTimeout(this.pingTimeoutTimer); + + // stop event from firing again for transport + this.transport.removeAllListeners('close'); + + // ensure transport won't stay open + this.transport.close(); + + // ignore further transport communication + this.transport.removeAllListeners(); + + // set ready state + this.readyState = 'closed'; + + // clear session id + this.id = null; + + // emit close event + this.emit('close', reason, desc); + + // clean buffers after, so users can still + // grab the buffers on `close` event + self.writeBuffer = []; + self.prevBufferLen = 0; + } + }; + + /** + * Filters upgrades, returning only those matching client transports. + * + * @param {Array} server upgrades + * @api private + * + */ + + Socket.prototype.filterUpgrades = function (upgrades) { + var filteredUpgrades = []; + for (var i = 0, j = upgrades.length; i < j; i++) { + if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]); + } + return filteredUpgrades; + }; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + /** + * Module dependencies + */ + + var XMLHttpRequest = __webpack_require__(4); + var XHR = __webpack_require__(6); + var JSONP = __webpack_require__(27); + var websocket = __webpack_require__(28); + + /** + * Export transports. + */ + + exports.polling = polling; + exports.websocket = websocket; + + /** + * Polling transport polymorphic constructor. + * Decides on xhr vs jsonp based on feature detection. + * + * @api private + */ + + function polling(opts) { + var xhr; + var xd = false; + var xs = false; + var jsonp = false !== opts.jsonp; + + if (global.location) { + var isSSL = 'https:' === location.protocol; + var port = location.port; + + // some user agents have empty `location.port` + if (!port) { + port = isSSL ? 443 : 80; + } + + xd = opts.hostname !== location.hostname || port !== opts.port; + xs = opts.secure !== isSSL; + } + + opts.xdomain = xd; + opts.xscheme = xs; + xhr = new XMLHttpRequest(opts); + + if ('open' in xhr && !opts.forceJSONP) { + return new XHR(opts); + } else { + if (!jsonp) throw new Error('JSONP disabled'); + return new JSONP(opts); + } + } + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + // browser shim for xmlhttprequest module + + var hasCORS = __webpack_require__(5); + + module.exports = function (opts) { + var xdomain = opts.xdomain; + + // scheme must be same when usign XDomainRequest + // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx + var xscheme = opts.xscheme; + + // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default. + // https://github.com/Automattic/engine.io-client/pull/217 + var enablesXDR = opts.enablesXDR; + + // XMLHttpRequest can be disabled on IE + try { + if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) { + return new XMLHttpRequest(); + } + } catch (e) {} + + // Use XDomainRequest for IE8 if enablesXDR is true + // because loading bar keeps flashing when using jsonp-polling + // https://github.com/yujiosaka/socke.io-ie8-loading-example + try { + if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) { + return new XDomainRequest(); + } + } catch (e) {} + + if (!xdomain) { + try { + return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); + } catch (e) {} + } + }; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + + /** + * Module exports. + * + * Logic borrowed from Modernizr: + * + * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js + */ + + try { + module.exports = typeof XMLHttpRequest !== 'undefined' && + 'withCredentials' in new XMLHttpRequest(); + } catch (err) { + // if XMLHttp support is disabled in IE then it will throw + // when trying to create + module.exports = false; + } + + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + /** + * Module requirements. + */ + + var XMLHttpRequest = __webpack_require__(4); + var Polling = __webpack_require__(7); + var Emitter = __webpack_require__(19); + var inherit = __webpack_require__(21); + var debug = __webpack_require__(23)('engine.io-client:polling-xhr'); + + /** + * Module exports. + */ + + module.exports = XHR; + module.exports.Request = Request; + + /** + * Empty function + */ + + function empty() {} + + /** + * XHR Polling constructor. + * + * @param {Object} opts + * @api public + */ + + function XHR(opts) { + Polling.call(this, opts); + this.requestTimeout = opts.requestTimeout; + + if (global.location) { + var isSSL = 'https:' === location.protocol; + var port = location.port; + + // some user agents have empty `location.port` + if (!port) { + port = isSSL ? 443 : 80; + } + + this.xd = opts.hostname !== global.location.hostname || port !== opts.port; + this.xs = opts.secure !== isSSL; + } else { + this.extraHeaders = opts.extraHeaders; + } + } + + /** + * Inherits from Polling. + */ + + inherit(XHR, Polling); + + /** + * XHR supports binary + */ + + XHR.prototype.supportsBinary = true; + + /** + * Creates a request. + * + * @param {String} method + * @api private + */ + + XHR.prototype.request = function (opts) { + opts = opts || {}; + opts.uri = this.uri(); + opts.xd = this.xd; + opts.xs = this.xs; + opts.agent = this.agent || false; + opts.supportsBinary = this.supportsBinary; + opts.enablesXDR = this.enablesXDR; + + // SSL options for Node.js client + opts.pfx = this.pfx; + opts.key = this.key; + opts.passphrase = this.passphrase; + opts.cert = this.cert; + opts.ca = this.ca; + opts.ciphers = this.ciphers; + opts.rejectUnauthorized = this.rejectUnauthorized; + opts.requestTimeout = this.requestTimeout; + + // other options for Node.js client + opts.extraHeaders = this.extraHeaders; + + return new Request(opts); + }; + + /** + * Sends data. + * + * @param {String} data to send. + * @param {Function} called upon flush. + * @api private + */ + + XHR.prototype.doWrite = function (data, fn) { + var isBinary = typeof data !== 'string' && data !== undefined; + var req = this.request({ method: 'POST', data: data, isBinary: isBinary }); + var self = this; + req.on('success', fn); + req.on('error', function (err) { + self.onError('xhr post error', err); + }); + this.sendXhr = req; + }; + + /** + * Starts a poll cycle. + * + * @api private + */ + + XHR.prototype.doPoll = function () { + debug('xhr poll'); + var req = this.request(); + var self = this; + req.on('data', function (data) { + self.onData(data); + }); + req.on('error', function (err) { + self.onError('xhr poll error', err); + }); + this.pollXhr = req; + }; + + /** + * Request constructor + * + * @param {Object} options + * @api public + */ + + function Request(opts) { + this.method = opts.method || 'GET'; + this.uri = opts.uri; + this.xd = !!opts.xd; + this.xs = !!opts.xs; + this.async = false !== opts.async; + this.data = undefined !== opts.data ? opts.data : null; + this.agent = opts.agent; + this.isBinary = opts.isBinary; + this.supportsBinary = opts.supportsBinary; + this.enablesXDR = opts.enablesXDR; + this.requestTimeout = opts.requestTimeout; + + // SSL options for Node.js client + this.pfx = opts.pfx; + this.key = opts.key; + this.passphrase = opts.passphrase; + this.cert = opts.cert; + this.ca = opts.ca; + this.ciphers = opts.ciphers; + this.rejectUnauthorized = opts.rejectUnauthorized; + + // other options for Node.js client + this.extraHeaders = opts.extraHeaders; + + this.create(); + } + + /** + * Mix in `Emitter`. + */ + + Emitter(Request.prototype); + + /** + * Creates the XHR object and sends the request. + * + * @api private + */ + + Request.prototype.create = function () { + var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR }; + + // SSL options for Node.js client + opts.pfx = this.pfx; + opts.key = this.key; + opts.passphrase = this.passphrase; + opts.cert = this.cert; + opts.ca = this.ca; + opts.ciphers = this.ciphers; + opts.rejectUnauthorized = this.rejectUnauthorized; + + var xhr = this.xhr = new XMLHttpRequest(opts); + var self = this; + + try { + debug('xhr open %s: %s', this.method, this.uri); + xhr.open(this.method, this.uri, this.async); + try { + if (this.extraHeaders) { + xhr.setDisableHeaderCheck(true); + for (var i in this.extraHeaders) { + if (this.extraHeaders.hasOwnProperty(i)) { + xhr.setRequestHeader(i, this.extraHeaders[i]); + } + } + } + } catch (e) {} + if (this.supportsBinary) { + // This has to be done after open because Firefox is stupid + // http://stackoverflow.com/questions/13216903/get-binary-data-with-xmlhttprequest-in-a-firefox-extension + xhr.responseType = 'arraybuffer'; + } + + if ('POST' === this.method) { + try { + if (this.isBinary) { + xhr.setRequestHeader('Content-type', 'application/octet-stream'); + } else { + xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8'); + } + } catch (e) {} + } + + try { + xhr.setRequestHeader('Accept', '*/*'); + } catch (e) {} + + // ie6 check + if ('withCredentials' in xhr) { + xhr.withCredentials = true; + } + + if (this.requestTimeout) { + xhr.timeout = this.requestTimeout; + } + + if (this.hasXDR()) { + xhr.onload = function () { + self.onLoad(); + }; + xhr.onerror = function () { + self.onError(xhr.responseText); + }; + } else { + xhr.onreadystatechange = function () { + if (4 !== xhr.readyState) return; + if (200 === xhr.status || 1223 === xhr.status) { + self.onLoad(); + } else { + // make sure the `error` event handler that's user-set + // does not throw in the same tick and gets caught here + setTimeout(function () { + self.onError(xhr.status); + }, 0); + } + }; + } + + debug('xhr data %s', this.data); + xhr.send(this.data); + } catch (e) { + // Need to defer since .create() is called directly fhrom the constructor + // and thus the 'error' event can only be only bound *after* this exception + // occurs. Therefore, also, we cannot throw here at all. + setTimeout(function () { + self.onError(e); + }, 0); + return; + } + + if (global.document) { + this.index = Request.requestsCount++; + Request.requests[this.index] = this; + } + }; + + /** + * Called upon successful response. + * + * @api private + */ + + Request.prototype.onSuccess = function () { + this.emit('success'); + this.cleanup(); + }; + + /** + * Called if we have data. + * + * @api private + */ + + Request.prototype.onData = function (data) { + this.emit('data', data); + this.onSuccess(); + }; + + /** + * Called upon error. + * + * @api private + */ + + Request.prototype.onError = function (err) { + this.emit('error', err); + this.cleanup(true); + }; + + /** + * Cleans up house. + * + * @api private + */ + + Request.prototype.cleanup = function (fromError) { + if ('undefined' === typeof this.xhr || null === this.xhr) { + return; + } + // xmlhttprequest + if (this.hasXDR()) { + this.xhr.onload = this.xhr.onerror = empty; + } else { + this.xhr.onreadystatechange = empty; + } + + if (fromError) { + try { + this.xhr.abort(); + } catch (e) {} + } + + if (global.document) { + delete Request.requests[this.index]; + } + + this.xhr = null; + }; + + /** + * Called upon load. + * + * @api private + */ + + Request.prototype.onLoad = function () { + var data; + try { + var contentType; + try { + contentType = this.xhr.getResponseHeader('Content-Type').split(';')[0]; + } catch (e) {} + if (contentType === 'application/octet-stream') { + data = this.xhr.response || this.xhr.responseText; + } else { + if (!this.supportsBinary) { + data = this.xhr.responseText; + } else { + try { + data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response)); + } catch (e) { + var ui8Arr = new Uint8Array(this.xhr.response); + var dataArray = []; + for (var idx = 0, length = ui8Arr.length; idx < length; idx++) { + dataArray.push(ui8Arr[idx]); + } + + data = String.fromCharCode.apply(null, dataArray); + } + } + } + } catch (e) { + this.onError(e); + } + if (null != data) { + this.onData(data); + } + }; + + /** + * Check if it has XDomainRequest. + * + * @api private + */ + + Request.prototype.hasXDR = function () { + return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR; + }; + + /** + * Aborts the request. + * + * @api public + */ + + Request.prototype.abort = function () { + this.cleanup(); + }; + + /** + * Aborts pending requests when unloading the window. This is needed to prevent + * memory leaks (e.g. when using IE) and to ensure that no spurious error is + * emitted. + */ + + Request.requestsCount = 0; + Request.requests = {}; + + if (global.document) { + if (global.attachEvent) { + global.attachEvent('onunload', unloadHandler); + } else if (global.addEventListener) { + global.addEventListener('beforeunload', unloadHandler, false); + } + } + + function unloadHandler() { + for (var i in Request.requests) { + if (Request.requests.hasOwnProperty(i)) { + Request.requests[i].abort(); + } + } + } + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + /** + * Module dependencies. + */ + + var Transport = __webpack_require__(8); + var parseqs = __webpack_require__(20); + var parser = __webpack_require__(9); + var inherit = __webpack_require__(21); + var yeast = __webpack_require__(22); + var debug = __webpack_require__(23)('engine.io-client:polling'); + + /** + * Module exports. + */ + + module.exports = Polling; + + /** + * Is XHR2 supported? + */ + + var hasXHR2 = function () { + var XMLHttpRequest = __webpack_require__(4); + var xhr = new XMLHttpRequest({ xdomain: false }); + return null != xhr.responseType; + }(); + + /** + * Polling interface. + * + * @param {Object} opts + * @api private + */ + + function Polling(opts) { + var forceBase64 = opts && opts.forceBase64; + if (!hasXHR2 || forceBase64) { + this.supportsBinary = false; + } + Transport.call(this, opts); + } + + /** + * Inherits from Transport. + */ + + inherit(Polling, Transport); + + /** + * Transport name. + */ + + Polling.prototype.name = 'polling'; + + /** + * Opens the socket (triggers polling). We write a PING message to determine + * when the transport is open. + * + * @api private + */ + + Polling.prototype.doOpen = function () { + this.poll(); + }; + + /** + * Pauses polling. + * + * @param {Function} callback upon buffers are flushed and transport is paused + * @api private + */ + + Polling.prototype.pause = function (onPause) { + var self = this; + + this.readyState = 'pausing'; + + function pause() { + debug('paused'); + self.readyState = 'paused'; + onPause(); + } + + if (this.polling || !this.writable) { + var total = 0; + + if (this.polling) { + debug('we are currently polling - waiting to pause'); + total++; + this.once('pollComplete', function () { + debug('pre-pause polling complete'); + --total || pause(); + }); + } + + if (!this.writable) { + debug('we are currently writing - waiting to pause'); + total++; + this.once('drain', function () { + debug('pre-pause writing complete'); + --total || pause(); + }); + } + } else { + pause(); + } + }; + + /** + * Starts polling cycle. + * + * @api public + */ + + Polling.prototype.poll = function () { + debug('polling'); + this.polling = true; + this.doPoll(); + this.emit('poll'); + }; + + /** + * Overloads onData to detect payloads. + * + * @api private + */ + + Polling.prototype.onData = function (data) { + var self = this; + debug('polling got data %s', data); + var callback = function callback(packet, index, total) { + // if its the first message we consider the transport open + if ('opening' === self.readyState) { + self.onOpen(); + } + + // if its a close packet, we close the ongoing requests + if ('close' === packet.type) { + self.onClose(); + return false; + } + + // otherwise bypass onData and handle the message + self.onPacket(packet); + }; + + // decode payload + parser.decodePayload(data, this.socket.binaryType, callback); + + // if an event did not trigger closing + if ('closed' !== this.readyState) { + // if we got data we're not polling + this.polling = false; + this.emit('pollComplete'); + + if ('open' === this.readyState) { + this.poll(); + } else { + debug('ignoring poll - transport state "%s"', this.readyState); + } + } + }; + + /** + * For polling, send a close packet. + * + * @api private + */ + + Polling.prototype.doClose = function () { + var self = this; + + function close() { + debug('writing close packet'); + self.write([{ type: 'close' }]); + } + + if ('open' === this.readyState) { + debug('transport open - closing'); + close(); + } else { + // in case we're trying to close while + // handshaking is in progress (GH-164) + debug('transport not open - deferring close'); + this.once('open', close); + } + }; + + /** + * Writes a packets payload. + * + * @param {Array} data packets + * @param {Function} drain callback + * @api private + */ + + Polling.prototype.write = function (packets) { + var self = this; + this.writable = false; + var callbackfn = function callbackfn() { + self.writable = true; + self.emit('drain'); + }; + + parser.encodePayload(packets, this.supportsBinary, function (data) { + self.doWrite(data, callbackfn); + }); + }; + + /** + * Generates uri for connection. + * + * @api private + */ + + Polling.prototype.uri = function () { + var query = this.query || {}; + var schema = this.secure ? 'https' : 'http'; + var port = ''; + + // cache busting is forced + if (false !== this.timestampRequests) { + query[this.timestampParam] = yeast(); + } + + if (!this.supportsBinary && !query.sid) { + query.b64 = 1; + } + + query = parseqs.encode(query); + + // avoid port if default for schema + if (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) { + port = ':' + this.port; + } + + // prepend ? to query + if (query.length) { + query = '?' + query; + } + + var ipv6 = this.hostname.indexOf(':') !== -1; + return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query; + }; + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + /** + * Module dependencies. + */ + + var parser = __webpack_require__(9); + var Emitter = __webpack_require__(19); + + /** + * Module exports. + */ + + module.exports = Transport; + + /** + * Transport abstract constructor. + * + * @param {Object} options. + * @api private + */ + + function Transport(opts) { + this.path = opts.path; + this.hostname = opts.hostname; + this.port = opts.port; + this.secure = opts.secure; + this.query = opts.query; + this.timestampParam = opts.timestampParam; + this.timestampRequests = opts.timestampRequests; + this.readyState = ''; + this.agent = opts.agent || false; + this.socket = opts.socket; + this.enablesXDR = opts.enablesXDR; + + // SSL options for Node.js client + this.pfx = opts.pfx; + this.key = opts.key; + this.passphrase = opts.passphrase; + this.cert = opts.cert; + this.ca = opts.ca; + this.ciphers = opts.ciphers; + this.rejectUnauthorized = opts.rejectUnauthorized; + this.forceNode = opts.forceNode; + + // other options for Node.js client + this.extraHeaders = opts.extraHeaders; + this.localAddress = opts.localAddress; + } + + /** + * Mix in `Emitter`. + */ + + Emitter(Transport.prototype); + + /** + * Emits an error. + * + * @param {String} str + * @return {Transport} for chaining + * @api public + */ + + Transport.prototype.onError = function (msg, desc) { + var err = new Error(msg); + err.type = 'TransportError'; + err.description = desc; + this.emit('error', err); + return this; + }; + + /** + * Opens the transport. + * + * @api public + */ + + Transport.prototype.open = function () { + if ('closed' === this.readyState || '' === this.readyState) { + this.readyState = 'opening'; + this.doOpen(); + } + + return this; + }; + + /** + * Closes the transport. + * + * @api private + */ + + Transport.prototype.close = function () { + if ('opening' === this.readyState || 'open' === this.readyState) { + this.doClose(); + this.onClose(); + } + + return this; + }; + + /** + * Sends multiple packets. + * + * @param {Array} packets + * @api private + */ + + Transport.prototype.send = function (packets) { + if ('open' === this.readyState) { + this.write(packets); + } else { + throw new Error('Transport not open'); + } + }; + + /** + * Called upon open + * + * @api private + */ + + Transport.prototype.onOpen = function () { + this.readyState = 'open'; + this.writable = true; + this.emit('open'); + }; + + /** + * Called with data. + * + * @param {String} data + * @api private + */ + + Transport.prototype.onData = function (data) { + var packet = parser.decodePacket(data, this.socket.binaryType); + this.onPacket(packet); + }; + + /** + * Called with a decoded packet. + */ + + Transport.prototype.onPacket = function (packet) { + this.emit('packet', packet); + }; + + /** + * Called upon close. + * + * @api private + */ + + Transport.prototype.onClose = function () { + this.readyState = 'closed'; + this.emit('close'); + }; + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {/** + * Module dependencies. + */ + + var keys = __webpack_require__(10); + var hasBinary = __webpack_require__(11); + var sliceBuffer = __webpack_require__(13); + var after = __webpack_require__(14); + var utf8 = __webpack_require__(15); + + var base64encoder; + if (global && global.ArrayBuffer) { + base64encoder = __webpack_require__(17); + } + + /** + * Check if we are running an android browser. That requires us to use + * ArrayBuffer with polling transports... + * + * http://ghinda.net/jpeg-blob-ajax-android/ + */ + + var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent); + + /** + * Check if we are running in PhantomJS. + * Uploading a Blob with PhantomJS does not work correctly, as reported here: + * https://github.com/ariya/phantomjs/issues/11395 + * @type boolean + */ + var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent); + + /** + * When true, avoids using Blobs to encode payloads. + * @type boolean + */ + var dontSendBlobs = isAndroid || isPhantomJS; + + /** + * Current protocol version. + */ + + exports.protocol = 3; + + /** + * Packet types. + */ + + var packets = exports.packets = { + open: 0 // non-ws + , close: 1 // non-ws + , ping: 2 + , pong: 3 + , message: 4 + , upgrade: 5 + , noop: 6 + }; + + var packetslist = keys(packets); + + /** + * Premade error packet. + */ + + var err = { type: 'error', data: 'parser error' }; + + /** + * Create a blob api even for blob builder when vendor prefixes exist + */ + + var Blob = __webpack_require__(18); + + /** + * Encodes a packet. + * + * [ ] + * + * Example: + * + * 5hello world + * 3 + * 4 + * + * Binary is encoded in an identical principle + * + * @api private + */ + + exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) { + if ('function' == typeof supportsBinary) { + callback = supportsBinary; + supportsBinary = false; + } + + if ('function' == typeof utf8encode) { + callback = utf8encode; + utf8encode = null; + } + + var data = (packet.data === undefined) + ? undefined + : packet.data.buffer || packet.data; + + if (global.ArrayBuffer && data instanceof ArrayBuffer) { + return encodeArrayBuffer(packet, supportsBinary, callback); + } else if (Blob && data instanceof global.Blob) { + return encodeBlob(packet, supportsBinary, callback); + } + + // might be an object with { base64: true, data: dataAsBase64String } + if (data && data.base64) { + return encodeBase64Object(packet, callback); + } + + // Sending data as a utf-8 string + var encoded = packets[packet.type]; + + // data fragment is optional + if (undefined !== packet.data) { + encoded += utf8encode ? utf8.encode(String(packet.data)) : String(packet.data); + } + + return callback('' + encoded); + + }; + + function encodeBase64Object(packet, callback) { + // packet data is an object { base64: true, data: dataAsBase64String } + var message = 'b' + exports.packets[packet.type] + packet.data.data; + return callback(message); + } + + /** + * Encode packet helpers for binary types + */ + + function encodeArrayBuffer(packet, supportsBinary, callback) { + if (!supportsBinary) { + return exports.encodeBase64Packet(packet, callback); + } + + var data = packet.data; + var contentArray = new Uint8Array(data); + var resultBuffer = new Uint8Array(1 + data.byteLength); + + resultBuffer[0] = packets[packet.type]; + for (var i = 0; i < contentArray.length; i++) { + resultBuffer[i+1] = contentArray[i]; + } + + return callback(resultBuffer.buffer); + } + + function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) { + if (!supportsBinary) { + return exports.encodeBase64Packet(packet, callback); + } + + var fr = new FileReader(); + fr.onload = function() { + packet.data = fr.result; + exports.encodePacket(packet, supportsBinary, true, callback); + }; + return fr.readAsArrayBuffer(packet.data); + } + + function encodeBlob(packet, supportsBinary, callback) { + if (!supportsBinary) { + return exports.encodeBase64Packet(packet, callback); + } + + if (dontSendBlobs) { + return encodeBlobAsArrayBuffer(packet, supportsBinary, callback); + } + + var length = new Uint8Array(1); + length[0] = packets[packet.type]; + var blob = new Blob([length.buffer, packet.data]); + + return callback(blob); + } + + /** + * Encodes a packet with binary data in a base64 string + * + * @param {Object} packet, has `type` and `data` + * @return {String} base64 encoded message + */ + + exports.encodeBase64Packet = function(packet, callback) { + var message = 'b' + exports.packets[packet.type]; + if (Blob && packet.data instanceof global.Blob) { + var fr = new FileReader(); + fr.onload = function() { + var b64 = fr.result.split(',')[1]; + callback(message + b64); + }; + return fr.readAsDataURL(packet.data); + } + + var b64data; + try { + b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data)); + } catch (e) { + // iPhone Safari doesn't let you apply with typed arrays + var typed = new Uint8Array(packet.data); + var basic = new Array(typed.length); + for (var i = 0; i < typed.length; i++) { + basic[i] = typed[i]; + } + b64data = String.fromCharCode.apply(null, basic); + } + message += global.btoa(b64data); + return callback(message); + }; + + /** + * Decodes a packet. Changes format to Blob if requested. + * + * @return {Object} with `type` and `data` (if any) + * @api private + */ + + exports.decodePacket = function (data, binaryType, utf8decode) { + if (data === undefined) { + return err; + } + // String data + if (typeof data == 'string') { + if (data.charAt(0) == 'b') { + return exports.decodeBase64Packet(data.substr(1), binaryType); + } + + if (utf8decode) { + data = tryDecode(data); + if (data === false) { + return err; + } + } + var type = data.charAt(0); + + if (Number(type) != type || !packetslist[type]) { + return err; + } + + if (data.length > 1) { + return { type: packetslist[type], data: data.substring(1) }; + } else { + return { type: packetslist[type] }; + } + } + + var asArray = new Uint8Array(data); + var type = asArray[0]; + var rest = sliceBuffer(data, 1); + if (Blob && binaryType === 'blob') { + rest = new Blob([rest]); + } + return { type: packetslist[type], data: rest }; + }; + + function tryDecode(data) { + try { + data = utf8.decode(data); + } catch (e) { + return false; + } + return data; + } + + /** + * Decodes a packet encoded in a base64 string + * + * @param {String} base64 encoded message + * @return {Object} with `type` and `data` (if any) + */ + + exports.decodeBase64Packet = function(msg, binaryType) { + var type = packetslist[msg.charAt(0)]; + if (!base64encoder) { + return { type: type, data: { base64: true, data: msg.substr(1) } }; + } + + var data = base64encoder.decode(msg.substr(1)); + + if (binaryType === 'blob' && Blob) { + data = new Blob([data]); + } + + return { type: type, data: data }; + }; + + /** + * Encodes multiple messages (payload). + * + * :data + * + * Example: + * + * 11:hello world2:hi + * + * If any contents are binary, they will be encoded as base64 strings. Base64 + * encoded strings are marked with a b before the length specifier + * + * @param {Array} packets + * @api private + */ + + exports.encodePayload = function (packets, supportsBinary, callback) { + if (typeof supportsBinary == 'function') { + callback = supportsBinary; + supportsBinary = null; + } + + var isBinary = hasBinary(packets); + + if (supportsBinary && isBinary) { + if (Blob && !dontSendBlobs) { + return exports.encodePayloadAsBlob(packets, callback); + } + + return exports.encodePayloadAsArrayBuffer(packets, callback); + } + + if (!packets.length) { + return callback('0:'); + } + + function setLengthHeader(message) { + return message.length + ':' + message; + } + + function encodeOne(packet, doneCallback) { + exports.encodePacket(packet, !isBinary ? false : supportsBinary, true, function(message) { + doneCallback(null, setLengthHeader(message)); + }); + } + + map(packets, encodeOne, function(err, results) { + return callback(results.join('')); + }); + }; + + /** + * Async array map using after + */ + + function map(ary, each, done) { + var result = new Array(ary.length); + var next = after(ary.length, done); + + var eachWithIndex = function(i, el, cb) { + each(el, function(error, msg) { + result[i] = msg; + cb(error, result); + }); + }; + + for (var i = 0; i < ary.length; i++) { + eachWithIndex(i, ary[i], next); + } + } + + /* + * Decodes data when a payload is maybe expected. Possible binary contents are + * decoded from their base64 representation + * + * @param {String} data, callback method + * @api public + */ + + exports.decodePayload = function (data, binaryType, callback) { + if (typeof data != 'string') { + return exports.decodePayloadAsBinary(data, binaryType, callback); + } + + if (typeof binaryType === 'function') { + callback = binaryType; + binaryType = null; + } + + var packet; + if (data == '') { + // parser error - ignoring payload + return callback(err, 0, 1); + } + + var length = '' + , n, msg; + + for (var i = 0, l = data.length; i < l; i++) { + var chr = data.charAt(i); + + if (':' != chr) { + length += chr; + } else { + if ('' == length || (length != (n = Number(length)))) { + // parser error - ignoring payload + return callback(err, 0, 1); + } + + msg = data.substr(i + 1, n); + + if (length != msg.length) { + // parser error - ignoring payload + return callback(err, 0, 1); + } + + if (msg.length) { + packet = exports.decodePacket(msg, binaryType, true); + + if (err.type == packet.type && err.data == packet.data) { + // parser error in individual packet - ignoring payload + return callback(err, 0, 1); + } + + var ret = callback(packet, i + n, l); + if (false === ret) return; + } + + // advance cursor + i += n; + length = ''; + } + } + + if (length != '') { + // parser error - ignoring payload + return callback(err, 0, 1); + } + + }; + + /** + * Encodes multiple messages (payload) as binary. + * + * <1 = binary, 0 = string>[...] + * + * Example: + * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers + * + * @param {Array} packets + * @return {ArrayBuffer} encoded payload + * @api private + */ + + exports.encodePayloadAsArrayBuffer = function(packets, callback) { + if (!packets.length) { + return callback(new ArrayBuffer(0)); + } + + function encodeOne(packet, doneCallback) { + exports.encodePacket(packet, true, true, function(data) { + return doneCallback(null, data); + }); + } + + map(packets, encodeOne, function(err, encodedPackets) { + var totalLength = encodedPackets.reduce(function(acc, p) { + var len; + if (typeof p === 'string'){ + len = p.length; + } else { + len = p.byteLength; + } + return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2 + }, 0); + + var resultArray = new Uint8Array(totalLength); + + var bufferIndex = 0; + encodedPackets.forEach(function(p) { + var isString = typeof p === 'string'; + var ab = p; + if (isString) { + var view = new Uint8Array(p.length); + for (var i = 0; i < p.length; i++) { + view[i] = p.charCodeAt(i); + } + ab = view.buffer; + } + + if (isString) { // not true binary + resultArray[bufferIndex++] = 0; + } else { // true binary + resultArray[bufferIndex++] = 1; + } + + var lenStr = ab.byteLength.toString(); + for (var i = 0; i < lenStr.length; i++) { + resultArray[bufferIndex++] = parseInt(lenStr[i]); + } + resultArray[bufferIndex++] = 255; + + var view = new Uint8Array(ab); + for (var i = 0; i < view.length; i++) { + resultArray[bufferIndex++] = view[i]; + } + }); + + return callback(resultArray.buffer); + }); + }; + + /** + * Encode as Blob + */ + + exports.encodePayloadAsBlob = function(packets, callback) { + function encodeOne(packet, doneCallback) { + exports.encodePacket(packet, true, true, function(encoded) { + var binaryIdentifier = new Uint8Array(1); + binaryIdentifier[0] = 1; + if (typeof encoded === 'string') { + var view = new Uint8Array(encoded.length); + for (var i = 0; i < encoded.length; i++) { + view[i] = encoded.charCodeAt(i); + } + encoded = view.buffer; + binaryIdentifier[0] = 0; + } + + var len = (encoded instanceof ArrayBuffer) + ? encoded.byteLength + : encoded.size; + + var lenStr = len.toString(); + var lengthAry = new Uint8Array(lenStr.length + 1); + for (var i = 0; i < lenStr.length; i++) { + lengthAry[i] = parseInt(lenStr[i]); + } + lengthAry[lenStr.length] = 255; + + if (Blob) { + var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]); + doneCallback(null, blob); + } + }); + } + + map(packets, encodeOne, function(err, results) { + return callback(new Blob(results)); + }); + }; + + /* + * Decodes data when a payload is maybe expected. Strings are decoded by + * interpreting each byte as a key code for entries marked to start with 0. See + * description of encodePayloadAsBinary + * + * @param {ArrayBuffer} data, callback method + * @api public + */ + + exports.decodePayloadAsBinary = function (data, binaryType, callback) { + if (typeof binaryType === 'function') { + callback = binaryType; + binaryType = null; + } + + var bufferTail = data; + var buffers = []; + + var numberTooLong = false; + while (bufferTail.byteLength > 0) { + var tailArray = new Uint8Array(bufferTail); + var isString = tailArray[0] === 0; + var msgLength = ''; + + for (var i = 1; ; i++) { + if (tailArray[i] == 255) break; + + if (msgLength.length > 310) { + numberTooLong = true; + break; + } + + msgLength += tailArray[i]; + } + + if(numberTooLong) return callback(err, 0, 1); + + bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length); + msgLength = parseInt(msgLength); + + var msg = sliceBuffer(bufferTail, 0, msgLength); + if (isString) { + try { + msg = String.fromCharCode.apply(null, new Uint8Array(msg)); + } catch (e) { + // iPhone Safari doesn't let you apply to typed arrays + var typed = new Uint8Array(msg); + msg = ''; + for (var i = 0; i < typed.length; i++) { + msg += String.fromCharCode(typed[i]); + } + } + } + + buffers.push(msg); + bufferTail = sliceBuffer(bufferTail, msgLength); + } + + var total = buffers.length; + buffers.forEach(function(buffer, i) { + callback(exports.decodePacket(buffer, binaryType, true), i, total); + }); + }; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + + /** + * Gets the keys for an object. + * + * @return {Array} keys + * @api private + */ + + module.exports = Object.keys || function keys (obj){ + var arr = []; + var has = Object.prototype.hasOwnProperty; + + for (var i in obj) { + if (has.call(obj, i)) { + arr.push(i); + } + } + return arr; + }; + + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) { + /* + * Module requirements. + */ + + var isArray = __webpack_require__(12); + + /** + * Module exports. + */ + + module.exports = hasBinary; + + /** + * Checks for binary data. + * + * Right now only Buffer and ArrayBuffer are supported.. + * + * @param {Object} anything + * @api public + */ + + function hasBinary(data) { + + function _hasBinary(obj) { + if (!obj) return false; + + if ( (global.Buffer && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) || + (global.ArrayBuffer && obj instanceof ArrayBuffer) || + (global.Blob && obj instanceof Blob) || + (global.File && obj instanceof File) + ) { + return true; + } + + if (isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + if (_hasBinary(obj[i])) { + return true; + } + } + } else if (obj && 'object' == typeof obj) { + // see: https://github.com/Automattic/has-binary/pull/4 + if (obj.toJSON && 'function' == typeof obj.toJSON) { + obj = obj.toJSON(); + } + + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) { + return true; + } + } + } + + return false; + } + + return _hasBinary(data); + } + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 12 */ +/***/ function(module, exports) { + + module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; + }; + + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + /** + * An abstraction for slicing an arraybuffer even when + * ArrayBuffer.prototype.slice is not supported + * + * @api public + */ + + module.exports = function(arraybuffer, start, end) { + var bytes = arraybuffer.byteLength; + start = start || 0; + end = end || bytes; + + if (arraybuffer.slice) { return arraybuffer.slice(start, end); } + + if (start < 0) { start += bytes; } + if (end < 0) { end += bytes; } + if (end > bytes) { end = bytes; } + + if (start >= bytes || start >= end || bytes === 0) { + return new ArrayBuffer(0); + } + + var abv = new Uint8Array(arraybuffer); + var result = new Uint8Array(end - start); + for (var i = start, ii = 0; i < end; i++, ii++) { + result[ii] = abv[i]; + } + return result.buffer; + }; + + +/***/ }, +/* 14 */ +/***/ function(module, exports) { + + module.exports = after + + function after(count, callback, err_cb) { + var bail = false + err_cb = err_cb || noop + proxy.count = count + + return (count === 0) ? callback() : proxy + + function proxy(err, result) { + if (proxy.count <= 0) { + throw new Error('after called too many times') + } + --proxy.count + + // after first error, rest are passed to err_cb + if (err) { + bail = true + callback(err) + // future error callbacks will go to error handler + callback = err_cb + } else if (proxy.count === 0 && !bail) { + callback(null, result) + } + } + } + + function noop() {} + + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/wtf8 v1.0.0 by @mathias */ + ;(function(root) { + + // Detect free variables `exports` + var freeExports = typeof exports == 'object' && exports; + + // Detect free variable `module` + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + + // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root` + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + var stringFromCharCode = String.fromCharCode; + + // Taken from https://mths.be/punycode + function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + var value; + var extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + // Taken from https://mths.be/punycode + function ucs2encode(array) { + var length = array.length; + var index = -1; + var value; + var output = ''; + while (++index < length) { + value = array[index]; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + } + return output; + } + + /*--------------------------------------------------------------------------*/ + + function createByte(codePoint, shift) { + return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80); + } + + function encodeCodePoint(codePoint) { + if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence + return stringFromCharCode(codePoint); + } + var symbol = ''; + if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence + symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0); + } + else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence + symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0); + symbol += createByte(codePoint, 6); + } + else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence + symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0); + symbol += createByte(codePoint, 12); + symbol += createByte(codePoint, 6); + } + symbol += stringFromCharCode((codePoint & 0x3F) | 0x80); + return symbol; + } + + function wtf8encode(string) { + var codePoints = ucs2decode(string); + var length = codePoints.length; + var index = -1; + var codePoint; + var byteString = ''; + while (++index < length) { + codePoint = codePoints[index]; + byteString += encodeCodePoint(codePoint); + } + return byteString; + } + + /*--------------------------------------------------------------------------*/ + + function readContinuationByte() { + if (byteIndex >= byteCount) { + throw Error('Invalid byte index'); + } + + var continuationByte = byteArray[byteIndex] & 0xFF; + byteIndex++; + + if ((continuationByte & 0xC0) == 0x80) { + return continuationByte & 0x3F; + } + + // If we end up here, it’s not a continuation byte. + throw Error('Invalid continuation byte'); + } + + function decodeSymbol() { + var byte1; + var byte2; + var byte3; + var byte4; + var codePoint; + + if (byteIndex > byteCount) { + throw Error('Invalid byte index'); + } + + if (byteIndex == byteCount) { + return false; + } + + // Read the first byte. + byte1 = byteArray[byteIndex] & 0xFF; + byteIndex++; + + // 1-byte sequence (no continuation bytes) + if ((byte1 & 0x80) == 0) { + return byte1; + } + + // 2-byte sequence + if ((byte1 & 0xE0) == 0xC0) { + var byte2 = readContinuationByte(); + codePoint = ((byte1 & 0x1F) << 6) | byte2; + if (codePoint >= 0x80) { + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + // 3-byte sequence (may include unpaired surrogates) + if ((byte1 & 0xF0) == 0xE0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3; + if (codePoint >= 0x0800) { + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + // 4-byte sequence + if ((byte1 & 0xF8) == 0xF0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + byte4 = readContinuationByte(); + codePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) | + (byte3 << 0x06) | byte4; + if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { + return codePoint; + } + } + + throw Error('Invalid WTF-8 detected'); + } + + var byteArray; + var byteCount; + var byteIndex; + function wtf8decode(byteString) { + byteArray = ucs2decode(byteString); + byteCount = byteArray.length; + byteIndex = 0; + var codePoints = []; + var tmp; + while ((tmp = decodeSymbol()) !== false) { + codePoints.push(tmp); + } + return ucs2encode(codePoints); + } + + /*--------------------------------------------------------------------------*/ + + var wtf8 = { + 'version': '1.0.0', + 'encode': wtf8encode, + 'decode': wtf8decode + }; + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + true + ) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { + return wtf8; + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = wtf8; + } else { // in Narwhal or RingoJS v0.7.0- + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + for (var key in wtf8) { + hasOwnProperty.call(wtf8, key) && (freeExports[key] = wtf8[key]); + } + } + } else { // in Rhino or a web browser + root.wtf8 = wtf8; + } + + }(this)); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module), (function() { return this; }()))) + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + } + + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + /* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ + (function(){ + "use strict"; + + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + // Use a lookup table to find the index. + var lookup = new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + + exports.encode = function(arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, len = bytes.length, base64 = ""; + + for (i = 0; i < len; i+=3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, i, p = 0, + encoded1, encoded2, encoded3, encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i+=4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i+1)]; + encoded3 = lookup[base64.charCodeAt(i+2)]; + encoded4 = lookup[base64.charCodeAt(i+3)]; + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arraybuffer; + }; + })(); + + +/***/ }, +/* 18 */ +/***/ function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {/** + * Create a blob builder even when vendor prefixes exist + */ + + var BlobBuilder = global.BlobBuilder + || global.WebKitBlobBuilder + || global.MSBlobBuilder + || global.MozBlobBuilder; + + /** + * Check if Blob constructor is supported + */ + + var blobSupported = (function() { + try { + var a = new Blob(['hi']); + return a.size === 2; + } catch(e) { + return false; + } + })(); + + /** + * Check if Blob constructor supports ArrayBufferViews + * Fails in Safari 6, so we need to map to ArrayBuffers there. + */ + + var blobSupportsArrayBufferView = blobSupported && (function() { + try { + var b = new Blob([new Uint8Array([1,2])]); + return b.size === 2; + } catch(e) { + return false; + } + })(); + + /** + * Check if BlobBuilder is supported + */ + + var blobBuilderSupported = BlobBuilder + && BlobBuilder.prototype.append + && BlobBuilder.prototype.getBlob; + + /** + * Helper function that maps ArrayBufferViews to ArrayBuffers + * Used by BlobBuilder constructor and old browsers that didn't + * support it in the Blob constructor. + */ + + function mapArrayBufferViews(ary) { + for (var i = 0; i < ary.length; i++) { + var chunk = ary[i]; + if (chunk.buffer instanceof ArrayBuffer) { + var buf = chunk.buffer; + + // if this is a subarray, make a copy so we only + // include the subarray region from the underlying buffer + if (chunk.byteLength !== buf.byteLength) { + var copy = new Uint8Array(chunk.byteLength); + copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); + buf = copy.buffer; + } + + ary[i] = buf; + } + } + } + + function BlobBuilderConstructor(ary, options) { + options = options || {}; + + var bb = new BlobBuilder(); + mapArrayBufferViews(ary); + + for (var i = 0; i < ary.length; i++) { + bb.append(ary[i]); + } + + return (options.type) ? bb.getBlob(options.type) : bb.getBlob(); + }; + + function BlobConstructor(ary, options) { + mapArrayBufferViews(ary); + return new Blob(ary, options || {}); + }; + + module.exports = (function() { + if (blobSupported) { + return blobSupportsArrayBufferView ? global.Blob : BlobConstructor; + } else if (blobBuilderSupported) { + return BlobBuilderConstructor; + } else { + return undefined; + } + })(); + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + + /** + * Expose `Emitter`. + */ + + if (true) { + module.exports = Emitter; + } + + /** + * Initialize a new `Emitter`. + * + * @api public + */ + + function Emitter(obj) { + if (obj) return mixin(obj); + }; + + /** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + + function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; + } + + /** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + + Emitter.prototype.on = + Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; + }; + + /** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + + Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; + }; + + /** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + + Emitter.prototype.off = + Emitter.prototype.removeListener = + Emitter.prototype.removeAllListeners = + Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + return this; + }; + + /** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + + Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks['$' + event]; + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; + }; + + /** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + + Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; + }; + + /** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + + Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; + }; + + +/***/ }, +/* 20 */ +/***/ function(module, exports) { + + /** + * Compiles a querystring + * Returns string representation of the object + * + * @param {Object} + * @api private + */ + + exports.encode = function (obj) { + var str = ''; + + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + if (str.length) str += '&'; + str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]); + } + } + + return str; + }; + + /** + * Parses a simple querystring into an object + * + * @param {String} qs + * @api private + */ + + exports.decode = function(qs){ + var qry = {}; + var pairs = qs.split('&'); + for (var i = 0, l = pairs.length; i < l; i++) { + var pair = pairs[i].split('='); + qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); + } + return qry; + }; + + +/***/ }, +/* 21 */ +/***/ function(module, exports) { + + + module.exports = function(a, b){ + var fn = function(){}; + fn.prototype = b.prototype; + a.prototype = new fn; + a.prototype.constructor = a; + }; + +/***/ }, +/* 22 */ +/***/ function(module, exports) { + + 'use strict'; + + var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('') + , length = 64 + , map = {} + , seed = 0 + , i = 0 + , prev; + + /** + * Return a string representing the specified number. + * + * @param {Number} num The number to convert. + * @returns {String} The string representation of the number. + * @api public + */ + function encode(num) { + var encoded = ''; + + do { + encoded = alphabet[num % length] + encoded; + num = Math.floor(num / length); + } while (num > 0); + + return encoded; + } + + /** + * Return the integer value specified by the given string. + * + * @param {String} str The string to convert. + * @returns {Number} The integer value represented by the string. + * @api public + */ + function decode(str) { + var decoded = 0; + + for (i = 0; i < str.length; i++) { + decoded = decoded * length + map[str.charAt(i)]; + } + + return decoded; + } + + /** + * Yeast: A tiny growing id generator. + * + * @returns {String} A unique id. + * @api public + */ + function yeast() { + var now = encode(+new Date()); + + if (now !== prev) return seed = 0, prev = now; + return now +'.'+ encode(seed++); + } + + // + // Map each character to its index. + // + for (; i < length; i++) map[alphabet[i]] = i; + + // + // Expose the `yeast`, `encode` and `decode` functions. + // + yeast.encode = encode; + yeast.decode = decode; + module.exports = yeast; + + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) { + /** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = __webpack_require__(25); + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + + /** + * Colors. + */ + + exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); + } + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } + }; + + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; + } + + /** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + var r; + try { + return exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (typeof process !== 'undefined' && 'env' in process) { + return process.env.DEBUG; + } + } + + /** + * Enable namespaces listed in `localStorage.debug` initially. + */ + + exports.enable(load()); + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage(){ + try { + return window.localStorage; + } catch (e) {} + } + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(24))) + +/***/ }, +/* 24 */ +/***/ function(module, exports) { + + // shim for using process in browser + var process = module.exports = {}; + + // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. + + var cachedSetTimeout; + var cachedClearTimeout; + + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + } ()) + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = debug.debug = debug; + exports.coerce = coerce; + exports.disable = disable; + exports.enable = enable; + exports.enabled = enabled; + exports.humanize = __webpack_require__(26); + + /** + * The currently active debug mode names, and names to skip. + */ + + exports.names = []; + exports.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + + exports.formatters = {}; + + /** + * Previously assigned color. + */ + + var prevColor = 0; + + /** + * Previous log timestamp. + */ + + var prevTime; + + /** + * Select a color. + * + * @return {Number} + * @api private + */ + + function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; + } + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting + args = exports.formatArgs.apply(self, args); + + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/[\\^$+?.()|[\]{}]/g, '\\$&').replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @api public + */ + + function disable() { + exports.enable(''); + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; + } + + +/***/ }, +/* 26 */ +/***/ function(module, exports) { + + /** + * Helpers. + */ + + var s = 1000 + var m = s * 60 + var h = m * 60 + var d = h * 24 + var y = d * 365.25 + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + module.exports = function (val, options) { + options = options || {} + var type = typeof val + if (type === 'string' && val.length > 0) { + return parse(val) + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? + fmtLong(val) : + fmtShort(val) + } + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)) + } + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str) + if (str.length > 10000) { + return + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str) + if (!match) { + return + } + var n = parseFloat(match[1]) + var type = (match[2] || 'ms').toLowerCase() + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y + case 'days': + case 'day': + case 'd': + return n * d + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n + default: + return undefined + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd' + } + if (ms >= h) { + return Math.round(ms / h) + 'h' + } + if (ms >= m) { + return Math.round(ms / m) + 'm' + } + if (ms >= s) { + return Math.round(ms / s) + 's' + } + return ms + 'ms' + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms' + } + + /** + * Pluralization helper. + */ + + function plural(ms, n, name) { + if (ms < n) { + return + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name + } + return Math.ceil(ms / n) + ' ' + name + 's' + } + + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + /** + * Module requirements. + */ + + var Polling = __webpack_require__(7); + var inherit = __webpack_require__(21); + + /** + * Module exports. + */ + + module.exports = JSONPPolling; + + /** + * Cached regular expressions. + */ + + var rNewline = /\n/g; + var rEscapedNewline = /\\n/g; + + /** + * Global JSONP callbacks. + */ + + var callbacks; + + /** + * Noop. + */ + + function empty() {} + + /** + * JSONP Polling constructor. + * + * @param {Object} opts. + * @api public + */ + + function JSONPPolling(opts) { + Polling.call(this, opts); + + this.query = this.query || {}; + + // define global callbacks array if not present + // we do this here (lazily) to avoid unneeded global pollution + if (!callbacks) { + // we need to consider multiple engines in the same page + if (!global.___eio) global.___eio = []; + callbacks = global.___eio; + } + + // callback identifier + this.index = callbacks.length; + + // add callback to jsonp global + var self = this; + callbacks.push(function (msg) { + self.onData(msg); + }); + + // append to query string + this.query.j = this.index; + + // prevent spurious errors from being emitted when the window is unloaded + if (global.document && global.addEventListener) { + global.addEventListener('beforeunload', function () { + if (self.script) self.script.onerror = empty; + }, false); + } + } + + /** + * Inherits from Polling. + */ + + inherit(JSONPPolling, Polling); + + /* + * JSONP only supports binary as base64 encoded strings + */ + + JSONPPolling.prototype.supportsBinary = false; + + /** + * Closes the socket. + * + * @api private + */ + + JSONPPolling.prototype.doClose = function () { + if (this.script) { + this.script.parentNode.removeChild(this.script); + this.script = null; + } + + if (this.form) { + this.form.parentNode.removeChild(this.form); + this.form = null; + this.iframe = null; + } + + Polling.prototype.doClose.call(this); + }; + + /** + * Starts a poll cycle. + * + * @api private + */ + + JSONPPolling.prototype.doPoll = function () { + var self = this; + var script = document.createElement('script'); + + if (this.script) { + this.script.parentNode.removeChild(this.script); + this.script = null; + } + + script.async = true; + script.src = this.uri(); + script.onerror = function (e) { + self.onError('jsonp poll error', e); + }; + + var insertAt = document.getElementsByTagName('script')[0]; + if (insertAt) { + insertAt.parentNode.insertBefore(script, insertAt); + } else { + (document.head || document.body).appendChild(script); + } + this.script = script; + + var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent); + + if (isUAgecko) { + setTimeout(function () { + var iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + document.body.removeChild(iframe); + }, 100); + } + }; + + /** + * Writes with a hidden iframe. + * + * @param {String} data to send + * @param {Function} called upon flush. + * @api private + */ + + JSONPPolling.prototype.doWrite = function (data, fn) { + var self = this; + + if (!this.form) { + var form = document.createElement('form'); + var area = document.createElement('textarea'); + var id = this.iframeId = 'eio_iframe_' + this.index; + var iframe; + + form.className = 'socketio'; + form.style.position = 'absolute'; + form.style.top = '-1000px'; + form.style.left = '-1000px'; + form.target = id; + form.method = 'POST'; + form.setAttribute('accept-charset', 'utf-8'); + area.name = 'd'; + form.appendChild(area); + document.body.appendChild(form); + + this.form = form; + this.area = area; + } + + this.form.action = this.uri(); + + function complete() { + initIframe(); + fn(); + } + + function initIframe() { + if (self.iframe) { + try { + self.form.removeChild(self.iframe); + } catch (e) { + self.onError('jsonp polling iframe removal error', e); + } + } + + try { + // ie6 dynamic iframes with target="" support (thanks Chris Lambacher) + var html = '