Merge lp:~robru/cordova-cli/3.4-release into lp:cordova-cli

Proposed by Robert Bruce Park
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 49
Merged at revision: 45
Proposed branch: lp:~robru/cordova-cli/3.4-release
Merge into: lp:cordova-cli
Diff against target: 19544 lines (+10808/-6917)
214 files modified
debian/changelog (+1/-2)
debian/control (+1/-1)
debian/rules (+3/-1)
node_modules/cordova/RELEASENOTES.md (+9/-1)
node_modules/cordova/_vendor/combined-stream/0.0.4/package.json (+2/-1)
node_modules/cordova/_vendor/commander/1.1.1/.npmignore (+0/-4)
node_modules/cordova/_vendor/commander/1.1.1/.travis.yml (+0/-4)
node_modules/cordova/_vendor/commander/1.1.1/History.md (+0/-152)
node_modules/cordova/_vendor/commander/1.1.1/Makefile (+0/-7)
node_modules/cordova/_vendor/commander/1.1.1/Readme.md (+0/-270)
node_modules/cordova/_vendor/commander/1.1.1/index.js (+0/-1131)
node_modules/cordova/_vendor/commander/1.1.1/package.json (+0/-40)
node_modules/cordova/_vendor/forever-agent/0.5.0/LICENSE (+0/-55)
node_modules/cordova/_vendor/forever-agent/0.5.0/README.md (+0/-4)
node_modules/cordova/_vendor/forever-agent/0.5.0/index.js (+0/-119)
node_modules/cordova/_vendor/forever-agent/0.5.0/package.json (+0/-27)
node_modules/cordova/_vendor/forever-agent/0.5.2/LICENSE (+55/-0)
node_modules/cordova/_vendor/forever-agent/0.5.2/README.md (+4/-0)
node_modules/cordova/_vendor/forever-agent/0.5.2/index.js (+119/-0)
node_modules/cordova/_vendor/forever-agent/0.5.2/package.json (+27/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.1/.npmignore (+0/-1)
node_modules/cordova/_vendor/graceful-fs/2.0.1/LICENSE (+0/-27)
node_modules/cordova/_vendor/graceful-fs/2.0.1/README.md (+0/-26)
node_modules/cordova/_vendor/graceful-fs/2.0.1/graceful-fs.js (+0/-159)
node_modules/cordova/_vendor/graceful-fs/2.0.1/package.json (+0/-48)
node_modules/cordova/_vendor/graceful-fs/2.0.1/polyfills.js (+0/-228)
node_modules/cordova/_vendor/graceful-fs/2.0.1/test/open.js (+0/-39)
node_modules/cordova/_vendor/graceful-fs/2.0.2/.npmignore (+1/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/LICENSE (+27/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/README.md (+26/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/graceful-fs.js (+161/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/package.json (+48/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/polyfills.js (+228/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/test/open.js (+39/-0)
node_modules/cordova/_vendor/graceful-fs/2.0.2/test/readdir-sort.js (+21/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/.dir-locals.el (+6/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/.npmignore (+7/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/LICENSE (+18/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/README.md (+75/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/http_signing.md (+296/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/lib/index.js (+25/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/lib/parser.js (+304/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/lib/signer.js (+179/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/lib/util.js (+249/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/lib/verify.js (+42/-0)
node_modules/cordova/_vendor/http-signature/0.10.0/package.json (+35/-0)
node_modules/cordova/_vendor/keypress/0.1.0/README.md (+0/-101)
node_modules/cordova/_vendor/keypress/0.1.0/index.js (+0/-346)
node_modules/cordova/_vendor/keypress/0.1.0/package.json (+0/-31)
node_modules/cordova/_vendor/keypress/0.1.0/test.js (+0/-28)
node_modules/cordova/_vendor/minimist/0.0.5/.travis.yml (+0/-4)
node_modules/cordova/_vendor/minimist/0.0.5/LICENSE (+0/-18)
node_modules/cordova/_vendor/minimist/0.0.5/example/parse.js (+0/-2)
node_modules/cordova/_vendor/minimist/0.0.5/index.js (+0/-193)
node_modules/cordova/_vendor/minimist/0.0.5/package.json (+0/-50)
node_modules/cordova/_vendor/minimist/0.0.5/readme.markdown (+0/-73)
node_modules/cordova/_vendor/minimist/0.0.5/test/dash.js (+0/-24)
node_modules/cordova/_vendor/minimist/0.0.5/test/default_bool.js (+0/-20)
node_modules/cordova/_vendor/minimist/0.0.5/test/dotted.js (+0/-16)
node_modules/cordova/_vendor/minimist/0.0.5/test/long.js (+0/-31)
node_modules/cordova/_vendor/minimist/0.0.5/test/parse.js (+0/-297)
node_modules/cordova/_vendor/minimist/0.0.5/test/parse_modified.js (+0/-9)
node_modules/cordova/_vendor/minimist/0.0.5/test/short.js (+0/-85)
node_modules/cordova/_vendor/minimist/0.0.5/test/whitespace.js (+0/-8)
node_modules/cordova/_vendor/minimist/0.0.8/.travis.yml (+4/-0)
node_modules/cordova/_vendor/minimist/0.0.8/LICENSE (+18/-0)
node_modules/cordova/_vendor/minimist/0.0.8/example/parse.js (+2/-0)
node_modules/cordova/_vendor/minimist/0.0.8/index.js (+187/-0)
node_modules/cordova/_vendor/minimist/0.0.8/package.json (+50/-0)
node_modules/cordova/_vendor/minimist/0.0.8/readme.markdown (+73/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/dash.js (+24/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/default_bool.js (+20/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/dotted.js (+16/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/long.js (+31/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/parse.js (+318/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/parse_modified.js (+9/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/short.js (+67/-0)
node_modules/cordova/_vendor/minimist/0.0.8/test/whitespace.js (+8/-0)
node_modules/cordova/_vendor/nopt/2.1.2/.npmignore (+0/-1)
node_modules/cordova/_vendor/nopt/2.1.2/LICENSE (+0/-23)
node_modules/cordova/_vendor/nopt/2.1.2/README.md (+0/-210)
node_modules/cordova/_vendor/nopt/2.1.2/bin/nopt.js (+0/-51)
node_modules/cordova/_vendor/nopt/2.1.2/examples/my-program.js (+0/-30)
node_modules/cordova/_vendor/nopt/2.1.2/lib/nopt.js (+0/-612)
node_modules/cordova/_vendor/nopt/2.1.2/package.json (+0/-35)
node_modules/cordova/_vendor/nopt/2.2.0/.npmignore (+1/-0)
node_modules/cordova/_vendor/nopt/2.2.0/LICENSE (+23/-0)
node_modules/cordova/_vendor/nopt/2.2.0/README.md (+210/-0)
node_modules/cordova/_vendor/nopt/2.2.0/bin/nopt.js (+51/-0)
node_modules/cordova/_vendor/nopt/2.2.0/examples/my-program.js (+30/-0)
node_modules/cordova/_vendor/nopt/2.2.0/lib/nopt.js (+407/-0)
node_modules/cordova/_vendor/nopt/2.2.0/package.json (+38/-0)
node_modules/cordova/_vendor/nopt/2.2.0/test/basic.js (+235/-0)
node_modules/cordova/_vendor/npmconf/0.1.12/.npmignore (+0/-1)
node_modules/cordova/_vendor/npmconf/0.1.12/LICENSE (+0/-27)
node_modules/cordova/_vendor/npmconf/0.1.12/README.md (+0/-33)
node_modules/cordova/_vendor/npmconf/0.1.12/config-defs.js (+0/-353)
node_modules/cordova/_vendor/npmconf/0.1.12/npmconf.js (+0/-338)
node_modules/cordova/_vendor/npmconf/0.1.12/package.json (+0/-49)
node_modules/cordova/_vendor/npmconf/0.1.12/test/00-setup.js (+0/-27)
node_modules/cordova/_vendor/npmconf/0.1.12/test/basic.js (+0/-74)
node_modules/cordova/_vendor/npmconf/0.1.12/test/builtin.js (+0/-74)
node_modules/cordova/_vendor/npmconf/0.1.12/test/fixtures/builtin (+0/-1)
node_modules/cordova/_vendor/npmconf/0.1.12/test/fixtures/globalconfig (+0/-1)
node_modules/cordova/_vendor/npmconf/0.1.12/test/fixtures/userconfig (+0/-22)
node_modules/cordova/_vendor/npmconf/0.1.12/test/save.js (+0/-74)
node_modules/cordova/_vendor/npmconf/0.1.13/.npmignore (+1/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/LICENSE (+27/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/README.md (+33/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/config-defs.js (+356/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/npmconf.js (+338/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/package.json (+49/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/00-setup.js (+27/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/basic.js (+74/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/builtin.js (+74/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/fixtures/builtin (+1/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/fixtures/globalconfig (+1/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/fixtures/userconfig (+22/-0)
node_modules/cordova/_vendor/npmconf/0.1.13/test/save.js (+74/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/README.md (+27/-1)
node_modules/cordova/_vendor/plugman/0.19.1-dev/doc/base.js (+5/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/doc/help.txt (+31/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/doc/platforms/android/android.xml (+12/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/doc/platforms/android/base.java (+32/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/doc/platforms/ios/base.m (+28/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/doc/platforms/ios/ios.xml (+9/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/main.js (+2/-2)
node_modules/cordova/_vendor/plugman/0.19.1-dev/package.json (+4/-3)
node_modules/cordova/_vendor/plugman/0.19.1-dev/plugman.js (+42/-2)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/create.js (+81/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/fetch.js (+1/-1)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/install.js (+48/-31)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/platform.js (+119/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/platform_operation.js (+5/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/platforms/android.js (+2/-2)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/platforms/ios.js (+24/-8)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/platforms/windows8.js (+30/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/platforms/wp8.js (+30/-0)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/prepare.js (+1/-1)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/registry/registry.js (+80/-37)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/util/config-changes.js (+648/-422)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/util/csproj.js (+60/-50)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/util/plugins.js (+0/-15)
node_modules/cordova/_vendor/plugman/0.19.1-dev/src/util/w8jsproj.js (+53/-2)
node_modules/cordova/_vendor/request/2.22.0/LICENSE (+55/-0)
node_modules/cordova/_vendor/request/2.22.0/README.md (+344/-0)
node_modules/cordova/_vendor/request/2.22.0/index.js (+1377/-0)
node_modules/cordova/_vendor/request/2.22.0/package.json (+47/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/run.js (+40/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/server.js (+90/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/squid.conf (+77/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/ca.cnf (+20/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/ca.crt (+17/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/ca.csr (+13/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/ca.key (+18/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/ca.srl (+1/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/server.cnf (+19/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/server.crt (+16/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/server.csr (+11/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/server.js (+28/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/ca/server.key (+9/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/npm-ca.crt (+16/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/test.crt (+15/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/ssl/test.key (+15/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-agentOptions.js (+23/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-basic-auth.js (+143/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-body.js (+122/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-defaults.js (+129/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-digest-auth.js (+69/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-emptyBody.js (+20/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-errors.js (+37/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-follow-all-303.js (+30/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-follow-all.js (+35/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-form.js (+79/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-hawk.js (+33/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-headers.js (+52/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-http-signature.js (+106/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-httpModule.js (+94/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-https-strict.js (+97/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-https.js (+87/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-localAddress.js (+15/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-oauth.js (+117/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-onelineproxy.js (+46/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-params.js (+93/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-piped-redirect.js (+42/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-pipes.js (+216/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-pool.js (+16/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-protocol-changing-redirect.js (+61/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-proxy.js (+39/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-qs.js (+42/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-redirect.js (+155/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-s3.js (+13/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-timeout.js (+87/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-toJSON.js (+14/-0)
node_modules/cordova/_vendor/request/2.22.0/tests/test-tunnel.js (+75/-0)
node_modules/cordova/_vendor/tar.gz/0.1.1/.npmignore (+0/-3)
node_modules/cordova/_vendor/tar.gz/0.1.1/Cakefile (+0/-75)
node_modules/cordova/_vendor/tar.gz/0.1.1/LICENSE (+0/-20)
node_modules/cordova/_vendor/tar.gz/0.1.1/README.md (+0/-103)
node_modules/cordova/_vendor/tar.gz/0.1.1/bin/targz (+0/-55)
node_modules/cordova/_vendor/tar.gz/0.1.1/example/example.coffee (+0/-10)
node_modules/cordova/_vendor/tar.gz/0.1.1/example/example.js (+0/-10)
node_modules/cordova/_vendor/tar.gz/0.1.1/lib/targz.js (+0/-82)
node_modules/cordova/_vendor/tar.gz/0.1.1/package.json (+0/-61)
node_modules/cordova/_vendor/tar.gz/0.1.1/src/targz.coffee (+0/-80)
node_modules/cordova/_vendor/tar.gz/0.1.1/test/compress/test.txt (+0/-47)
node_modules/cordova/doc/help.txt (+1/-0)
node_modules/cordova/package.json (+3/-3)
node_modules/cordova/platforms.js (+10/-10)
node_modules/cordova/src/cli.js (+0/-4)
node_modules/cordova/src/metadata/amazon_fireos_parser.js (+23/-57)
node_modules/cordova/src/metadata/android_parser.js (+35/-0)
node_modules/cordova/src/platform.js (+39/-0)
node_modules/cordova/templates/hooks-README.md (+1/-1)
To merge this branch: bzr merge lp:~robru/cordova-cli/3.4-release
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Cordova Ubuntu Team Pending
Review via email: mp+207736@code.launchpad.net

Commit message

Update to the Cordova 3.4 release.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-02-04 16:30:54 +0000
+++ debian/changelog 2014-02-21 20:33:03 +0000
@@ -1,7 +1,6 @@
1cordova-cli (3.4-pre-0ubuntu1) UNRELEASED; urgency=low1cordova-cli (3.4-0ubuntu1) UNRELEASED; urgency=low
22
3 [ Robert Bruce Park ]3 [ Robert Bruce Park ]
4 * Initial release.4 * Initial release.
5 * Automatic snapshot from revision 41 (bootstrap)
65
7 -- Robert Bruce Park <robert.park@canonical.com> Tue, 04 Feb 2014 15:54:38 +00006 -- Robert Bruce Park <robert.park@canonical.com> Tue, 04 Feb 2014 15:54:38 +0000
87
=== modified file 'debian/control'
--- debian/control 2014-02-04 15:37:46 +0000
+++ debian/control 2014-02-21 20:33:03 +0000
@@ -1,6 +1,6 @@
1Source: cordova-cli1Source: cordova-cli
2Section: misc2Section: misc
3Priority: extra3Priority: optional
4Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>4Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
5Build-Depends: bzr,5Build-Depends: bzr,
6 debhelper (>= 9),6 debhelper (>= 9),
77
=== modified file 'debian/rules'
--- debian/rules 2014-02-05 14:12:31 +0000
+++ debian/rules 2014-02-21 20:33:03 +0000
@@ -12,9 +12,10 @@
12FIND := find debian/cordova-cli/12FIND := find debian/cordova-cli/
1313
14cordova-%:14cordova-%:
15 git clone --depth=1 git://git.apache.org/cordova-$*.git15 git clone --depth=1 https://git-wip-us.apache.org/repos/asf/cordova-$*
1616
17node_modules: cordova-cli cordova-plugman17node_modules: cordova-cli cordova-plugman
18 cd cordova-cli && git fetch --tags && git checkout 3.4.0-0.1.0
18 npm install ./cordova-plugman/ ./cordova-cli/19 npm install ./cordova-plugman/ ./cordova-cli/
19 rm -rf ./node_modules/cordova/node_modules/plugman/20 rm -rf ./node_modules/cordova/node_modules/plugman/
20 mv ./node_modules/plugman/ ./node_modules/cordova/node_modules/21 mv ./node_modules/plugman/ ./node_modules/cordova/node_modules/
@@ -30,6 +31,7 @@
30override_dh_install:31override_dh_install:
31 dh_install --fail-missing32 dh_install --fail-missing
32 $(FIND) -name '*.sln' -delete33 $(FIND) -name '*.sln' -delete
34 $(FIND) -name '.gitmodules' -delete
33 $(FIND) -name '*[Ll][Ii][Cc][Ee][Nn][CcSs][Ee]*' -delete35 $(FIND) -name '*[Ll][Ii][Cc][Ee][Nn][CcSs][Ee]*' -delete
34 $(FIND) -name 'examples' -type d -prune -exec rm -rf \{} \;36 $(FIND) -name 'examples' -type d -prune -exec rm -rf \{} \;
35 $(FIND) ! -path '*/bin/*' -type f -exec chmod -x \{} \;37 $(FIND) ! -path '*/bin/*' -type f -exec chmod -x \{} \;
3638
=== modified file 'node_modules/cordova/RELEASENOTES.md'
--- node_modules/cordova/RELEASENOTES.md 2014-02-04 15:29:21 +0000
+++ node_modules/cordova/RELEASENOTES.md 2014-02-21 20:33:03 +0000
@@ -20,6 +20,15 @@
20-->20-->
21# Cordova-cli Release Notes21# Cordova-cli Release Notes
2222
23## 3.4.0-0.1.0 (Feb 14, 2014)
24* CB-5638 Clean-up: remove unreachable info case from function
25* CB-5937 Add "platform check" command: Shows platforms that are out of date
26* CB-5634 Minor refactoring + tests for Android's orientation preference.
27* CB-5634 Set Android orientation from config.xml
28* Upleveled amazon_fireos_parser. Making it at par with android_parser.js
29* CB-5947 Throw when trying to create project inside custom www.
30* CB-4153 Update help.txt about --source -> --copy-from
31
23## 3.3.1-0.3.1 (Jan 31, 2014)32## 3.3.1-0.3.1 (Jan 31, 2014)
24* CB-4153 Rename --source and --link flags to --copy-from and --link-to33* CB-4153 Rename --source and --link flags to --copy-from and --link-to
2534
@@ -222,4 +231,3 @@
222231
223- Plugins are now installed serially across all installed platforms, rather than in parallel. This avoids race conditions in dependency installation. [CB-4184](https://issues.apache.org/jira/browse/CB-4184)232- Plugins are now installed serially across all installed platforms, rather than in parallel. This avoids race conditions in dependency installation. [CB-4184](https://issues.apache.org/jira/browse/CB-4184)
224- (WP8) All files from project www dir are now copied into the binary, not the top-level www. This means merges and plugin assets are correctly handled.233- (WP8) All files from project www dir are now copied into the binary, not the top-level www. This means merges and plugin assets are correctly handled.
225
226234
=== modified file 'node_modules/cordova/_vendor/combined-stream/0.0.4/package.json'
--- node_modules/cordova/_vendor/combined-stream/0.0.4/package.json 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/combined-stream/0.0.4/package.json 2014-02-21 20:33:03 +0000
@@ -28,5 +28,6 @@
28 "url": "https://github.com/felixge/node-combined-stream/issues"28 "url": "https://github.com/felixge/node-combined-stream/issues"
29 },29 },
30 "_id": "combined-stream@0.0.4",30 "_id": "combined-stream@0.0.4",
31 "_from": "combined-stream@~0.0.4"31 "_from": "combined-stream@~0.0.4",
32 "scripts": {}
32}33}
3334
=== removed directory 'node_modules/cordova/_vendor/commander'
=== removed directory 'node_modules/cordova/_vendor/commander/1.1.1'
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/.npmignore'
--- node_modules/cordova/_vendor/commander/1.1.1/.npmignore 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/.npmignore 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1support
2test
3examples
4*.sock
50
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/.travis.yml'
--- node_modules/cordova/_vendor/commander/1.1.1/.travis.yml 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/.travis.yml 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1language: node_js
2node_js:
3 - 0.4
4 - 0.6
50
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/History.md'
--- node_modules/cordova/_vendor/commander/1.1.1/History.md 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/History.md 1970-01-01 00:00:00 +0000
@@ -1,152 +0,0 @@
1
21.1.1 / 2012-11-20
3==================
4
5 * add more sub-command padding
6 * fix .usage() when args are present. Closes #106
7
81.1.0 / 2012-11-16
9==================
10
11 * add git-style executable subcommand support. Closes #94
12
131.0.5 / 2012-10-09
14==================
15
16 * fix `--name` clobbering. Closes #92
17 * fix examples/help. Closes #89
18
191.0.4 / 2012-09-03
20==================
21
22 * add `outputHelp()` method.
23
241.0.3 / 2012-08-30
25==================
26
27 * remove invalid .version() defaulting
28
291.0.2 / 2012-08-24
30==================
31
32 * add `--foo=bar` support [arv]
33 * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
34
351.0.1 / 2012-08-03
36==================
37
38 * fix issue #56
39 * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
40
411.0.0 / 2012-07-05
42==================
43
44 * add support for optional option descriptions
45 * add defaulting of `.version()` to package.json's version
46
470.6.1 / 2012-06-01
48==================
49
50 * Added: append (yes or no) on confirmation
51 * Added: allow node.js v0.7.x
52
530.6.0 / 2012-04-10
54==================
55
56 * Added `.prompt(obj, callback)` support. Closes #49
57 * Added default support to .choose(). Closes #41
58 * Fixed the choice example
59
600.5.1 / 2011-12-20
61==================
62
63 * Fixed `password()` for recent nodes. Closes #36
64
650.5.0 / 2011-12-04
66==================
67
68 * Added sub-command option support [itay]
69
700.4.3 / 2011-12-04
71==================
72
73 * Fixed custom help ordering. Closes #32
74
750.4.2 / 2011-11-24
76==================
77
78 * Added travis support
79 * Fixed: line-buffered input automatically trimmed. Closes #31
80
810.4.1 / 2011-11-18
82==================
83
84 * Removed listening for "close" on --help
85
860.4.0 / 2011-11-15
87==================
88
89 * Added support for `--`. Closes #24
90
910.3.3 / 2011-11-14
92==================
93
94 * Fixed: wait for close event when writing help info [Jerry Hamlet]
95
960.3.2 / 2011-11-01
97==================
98
99 * Fixed long flag definitions with values [felixge]
100
1010.3.1 / 2011-10-31
102==================
103
104 * Changed `--version` short flag to `-V` from `-v`
105 * Changed `.version()` so it's configurable [felixge]
106
1070.3.0 / 2011-10-31
108==================
109
110 * Added support for long flags only. Closes #18
111
1120.2.1 / 2011-10-24
113==================
114
115 * "node": ">= 0.4.x < 0.7.0". Closes #20
116
1170.2.0 / 2011-09-26
118==================
119
120 * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
121
1220.1.0 / 2011-08-24
123==================
124
125 * Added support for custom `--help` output
126
1270.0.5 / 2011-08-18
128==================
129
130 * Changed: when the user enters nothing prompt for password again
131 * Fixed issue with passwords beginning with numbers [NuckChorris]
132
1330.0.4 / 2011-08-15
134==================
135
136 * Fixed `Commander#args`
137
1380.0.3 / 2011-08-15
139==================
140
141 * Added default option value support
142
1430.0.2 / 2011-08-15
144==================
145
146 * Added mask support to `Command#password(str[, mask], fn)`
147 * Added `Command#password(str, fn)`
148
1490.0.1 / 2010-01-03
150==================
151
152 * Initial release
1530
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/Makefile'
--- node_modules/cordova/_vendor/commander/1.1.1/Makefile 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/Makefile 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1
2TESTS = $(shell find test/test.*.js)
3
4test:
5 @./test/run $(TESTS)
6
7.PHONY: test
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/Readme.md'
--- node_modules/cordova/_vendor/commander/1.1.1/Readme.md 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/Readme.md 1970-01-01 00:00:00 +0000
@@ -1,270 +0,0 @@
1# Commander.js
2
3 The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
4
5 [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)
6
7## Installation
8
9 $ npm install commander
10
11## Option parsing
12
13 Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
14
15```js
16#!/usr/bin/env node
17
18/**
19 * Module dependencies.
20 */
21
22var program = require('commander');
23
24program
25 .version('0.0.1')
26 .option('-p, --peppers', 'Add peppers')
27 .option('-P, --pineapple', 'Add pineapple')
28 .option('-b, --bbq', 'Add bbq sauce')
29 .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
30 .parse(process.argv);
31
32console.log('you ordered a pizza with:');
33if (program.peppers) console.log(' - peppers');
34if (program.pineapple) console.log(' - pineappe');
35if (program.bbq) console.log(' - bbq');
36console.log(' - %s cheese', program.cheese);
37```
38
39 Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
40
41## Automated --help
42
43 The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
44
45```
46 $ ./examples/pizza --help
47
48 Usage: pizza [options]
49
50 Options:
51
52 -V, --version output the version number
53 -p, --peppers Add peppers
54 -P, --pineapple Add pineappe
55 -b, --bbq Add bbq sauce
56 -c, --cheese <type> Add the specified type of cheese [marble]
57 -h, --help output usage information
58
59```
60
61## Coercion
62
63```js
64function range(val) {
65 return val.split('..').map(Number);
66}
67
68function list(val) {
69 return val.split(',');
70}
71
72program
73 .version('0.0.1')
74 .usage('[options] <file ...>')
75 .option('-i, --integer <n>', 'An integer argument', parseInt)
76 .option('-f, --float <n>', 'A float argument', parseFloat)
77 .option('-r, --range <a>..<b>', 'A range', range)
78 .option('-l, --list <items>', 'A list', list)
79 .option('-o, --optional [value]', 'An optional value')
80 .parse(process.argv);
81
82console.log(' int: %j', program.integer);
83console.log(' float: %j', program.float);
84console.log(' optional: %j', program.optional);
85program.range = program.range || [];
86console.log(' range: %j..%j', program.range[0], program.range[1]);
87console.log(' list: %j', program.list);
88console.log(' args: %j', program.args);
89```
90
91## Custom help
92
93 You can display arbitrary `-h, --help` information
94 by listening for "--help". Commander will automatically
95 exit once you are done so that the remainder of your program
96 does not execute causing undesired behaviours, for example
97 in the following executable "stuff" will not output when
98 `--help` is used.
99
100```js
101#!/usr/bin/env node
102
103/**
104 * Module dependencies.
105 */
106
107var program = require('../');
108
109function list(val) {
110 return val.split(',').map(Number);
111}
112
113program
114 .version('0.0.1')
115 .option('-f, --foo', 'enable some foo')
116 .option('-b, --bar', 'enable some bar')
117 .option('-B, --baz', 'enable some baz');
118
119// must be before .parse() since
120// node's emit() is immediate
121
122program.on('--help', function(){
123 console.log(' Examples:');
124 console.log('');
125 console.log(' $ custom-help --help');
126 console.log(' $ custom-help -h');
127 console.log('');
128});
129
130program.parse(process.argv);
131
132console.log('stuff');
133```
134
135yielding the following help output:
136
137```
138
139Usage: custom-help [options]
140
141Options:
142
143 -h, --help output usage information
144 -V, --version output the version number
145 -f, --foo enable some foo
146 -b, --bar enable some bar
147 -B, --baz enable some baz
148
149Examples:
150
151 $ custom-help --help
152 $ custom-help -h
153
154```
155
156## .prompt(msg, fn)
157
158 Single-line prompt:
159
160```js
161program.prompt('name: ', function(name){
162 console.log('hi %s', name);
163});
164```
165
166 Multi-line prompt:
167
168```js
169program.prompt('description:', function(name){
170 console.log('hi %s', name);
171});
172```
173
174 Coercion:
175
176```js
177program.prompt('Age: ', Number, function(age){
178 console.log('age: %j', age);
179});
180```
181
182```js
183program.prompt('Birthdate: ', Date, function(date){
184 console.log('date: %s', date);
185});
186```
187
188## .password(msg[, mask], fn)
189
190Prompt for password without echoing:
191
192```js
193program.password('Password: ', function(pass){
194 console.log('got "%s"', pass);
195 process.stdin.destroy();
196});
197```
198
199Prompt for password with mask char "*":
200
201```js
202program.password('Password: ', '*', function(pass){
203 console.log('got "%s"', pass);
204 process.stdin.destroy();
205});
206```
207
208## .confirm(msg, fn)
209
210 Confirm with the given `msg`:
211
212```js
213program.confirm('continue? ', function(ok){
214 console.log(' got %j', ok);
215});
216```
217
218## .choose(list, fn)
219
220 Let the user choose from a `list`:
221
222```js
223var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
224
225console.log('Choose the coolest pet:');
226program.choose(list, function(i){
227 console.log('you chose %d "%s"', i, list[i]);
228});
229```
230
231## .outputHelp()
232
233 Output help information without exiting.
234
235## .help()
236
237 Output help information and exit immediately.
238
239## Links
240
241 - [API documentation](http://visionmedia.github.com/commander.js/)
242 - [ascii tables](https://github.com/LearnBoost/cli-table)
243 - [progress bars](https://github.com/visionmedia/node-progress)
244 - [more progress bars](https://github.com/substack/node-multimeter)
245 - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
246
247## License
248
249(The MIT License)
250
251Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
252
253Permission is hereby granted, free of charge, to any person obtaining
254a copy of this software and associated documentation files (the
255'Software'), to deal in the Software without restriction, including
256without limitation the rights to use, copy, modify, merge, publish,
257distribute, sublicense, and/or sell copies of the Software, and to
258permit persons to whom the Software is furnished to do so, subject to
259the following conditions:
260
261The above copyright notice and this permission notice shall be
262included in all copies or substantial portions of the Software.
263
264THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
265EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
266MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
267IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
268CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
269TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
270SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
271\ No newline at end of file0\ No newline at end of file
2721
=== removed symlink 'node_modules/cordova/_vendor/commander/1.1.1/_vendor'
=== target was u'../..'
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/index.js'
--- node_modules/cordova/_vendor/commander/1.1.1/index.js 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/index.js 1970-01-01 00:00:00 +0000
@@ -1,1131 +0,0 @@
1/*!
2 * commander
3 * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
4 * MIT Licensed
5 */
6
7/**
8 * Module dependencies.
9 */
10
11var EventEmitter = require('events').EventEmitter
12 , spawn = require('child_process').spawn
13 , keypress = require('keypress')
14 , fs = require('fs')
15 , exists = fs.existsSync
16 , path = require('path')
17 , tty = require('tty')
18 , dirname = path.dirname
19 , basename = path.basename;
20
21/**
22 * Expose the root command.
23 */
24
25exports = module.exports = new Command;
26
27/**
28 * Expose `Command`.
29 */
30
31exports.Command = Command;
32
33/**
34 * Expose `Option`.
35 */
36
37exports.Option = Option;
38
39/**
40 * Initialize a new `Option` with the given `flags` and `description`.
41 *
42 * @param {String} flags
43 * @param {String} description
44 * @api public
45 */
46
47function Option(flags, description) {
48 this.flags = flags;
49 this.required = ~flags.indexOf('<');
50 this.optional = ~flags.indexOf('[');
51 this.bool = !~flags.indexOf('-no-');
52 flags = flags.split(/[ ,|]+/);
53 if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
54 this.long = flags.shift();
55 this.description = description || '';
56}
57
58/**
59 * Return option name.
60 *
61 * @return {String}
62 * @api private
63 */
64
65Option.prototype.name = function(){
66 return this.long
67 .replace('--', '')
68 .replace('no-', '');
69};
70
71/**
72 * Check if `arg` matches the short or long flag.
73 *
74 * @param {String} arg
75 * @return {Boolean}
76 * @api private
77 */
78
79Option.prototype.is = function(arg){
80 return arg == this.short
81 || arg == this.long;
82};
83
84/**
85 * Initialize a new `Command`.
86 *
87 * @param {String} name
88 * @api public
89 */
90
91function Command(name) {
92 this.commands = [];
93 this.options = [];
94 this._args = [];
95 this._name = name;
96}
97
98/**
99 * Inherit from `EventEmitter.prototype`.
100 */
101
102Command.prototype.__proto__ = EventEmitter.prototype;
103
104/**
105 * Add command `name`.
106 *
107 * The `.action()` callback is invoked when the
108 * command `name` is specified via __ARGV__,
109 * and the remaining arguments are applied to the
110 * function for access.
111 *
112 * When the `name` is "*" an un-matched command
113 * will be passed as the first arg, followed by
114 * the rest of __ARGV__ remaining.
115 *
116 * Examples:
117 *
118 * program
119 * .version('0.0.1')
120 * .option('-C, --chdir <path>', 'change the working directory')
121 * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
122 * .option('-T, --no-tests', 'ignore test hook')
123 *
124 * program
125 * .command('setup')
126 * .description('run remote setup commands')
127 * .action(function(){
128 * console.log('setup');
129 * });
130 *
131 * program
132 * .command('exec <cmd>')
133 * .description('run the given remote command')
134 * .action(function(cmd){
135 * console.log('exec "%s"', cmd);
136 * });
137 *
138 * program
139 * .command('*')
140 * .description('deploy the given env')
141 * .action(function(env){
142 * console.log('deploying "%s"', env);
143 * });
144 *
145 * program.parse(process.argv);
146 *
147 * @param {String} name
148 * @param {String} [desc]
149 * @return {Command} the new command
150 * @api public
151 */
152
153Command.prototype.command = function(name, desc){
154 var args = name.split(/ +/);
155 var cmd = new Command(args.shift());
156 if (desc) cmd.description(desc);
157 if (desc) this.executables = true;
158 this.commands.push(cmd);
159 cmd.parseExpectedArgs(args);
160 cmd.parent = this;
161 if (desc) return this;
162 return cmd;
163};
164
165/**
166 * Add an implicit `help [cmd]` subcommand
167 * which invokes `--help` for the given command.
168 *
169 * @api private
170 */
171
172Command.prototype.addImplicitHelpCommand = function() {
173 this.command('help [cmd]', 'display help for [cmd]');
174};
175
176/**
177 * Parse expected `args`.
178 *
179 * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
180 *
181 * @param {Array} args
182 * @return {Command} for chaining
183 * @api public
184 */
185
186Command.prototype.parseExpectedArgs = function(args){
187 if (!args.length) return;
188 var self = this;
189 args.forEach(function(arg){
190 switch (arg[0]) {
191 case '<':
192 self._args.push({ required: true, name: arg.slice(1, -1) });
193 break;
194 case '[':
195 self._args.push({ required: false, name: arg.slice(1, -1) });
196 break;
197 }
198 });
199 return this;
200};
201
202/**
203 * Register callback `fn` for the command.
204 *
205 * Examples:
206 *
207 * program
208 * .command('help')
209 * .description('display verbose help')
210 * .action(function(){
211 * // output help here
212 * });
213 *
214 * @param {Function} fn
215 * @return {Command} for chaining
216 * @api public
217 */
218
219Command.prototype.action = function(fn){
220 var self = this;
221 this.parent.on(this._name, function(args, unknown){
222 // Parse any so-far unknown options
223 unknown = unknown || [];
224 var parsed = self.parseOptions(unknown);
225
226 // Output help if necessary
227 outputHelpIfNecessary(self, parsed.unknown);
228
229 // If there are still any unknown options, then we simply
230 // die, unless someone asked for help, in which case we give it
231 // to them, and then we die.
232 if (parsed.unknown.length > 0) {
233 self.unknownOption(parsed.unknown[0]);
234 }
235
236 // Leftover arguments need to be pushed back. Fixes issue #56
237 if (parsed.args.length) args = parsed.args.concat(args);
238
239 self._args.forEach(function(arg, i){
240 if (arg.required && null == args[i]) {
241 self.missingArgument(arg.name);
242 }
243 });
244
245 // Always append ourselves to the end of the arguments,
246 // to make sure we match the number of arguments the user
247 // expects
248 if (self._args.length) {
249 args[self._args.length] = self;
250 } else {
251 args.push(self);
252 }
253
254 fn.apply(this, args);
255 });
256 return this;
257};
258
259/**
260 * Define option with `flags`, `description` and optional
261 * coercion `fn`.
262 *
263 * The `flags` string should contain both the short and long flags,
264 * separated by comma, a pipe or space. The following are all valid
265 * all will output this way when `--help` is used.
266 *
267 * "-p, --pepper"
268 * "-p|--pepper"
269 * "-p --pepper"
270 *
271 * Examples:
272 *
273 * // simple boolean defaulting to false
274 * program.option('-p, --pepper', 'add pepper');
275 *
276 * --pepper
277 * program.pepper
278 * // => Boolean
279 *
280 * // simple boolean defaulting to false
281 * program.option('-C, --no-cheese', 'remove cheese');
282 *
283 * program.cheese
284 * // => true
285 *
286 * --no-cheese
287 * program.cheese
288 * // => true
289 *
290 * // required argument
291 * program.option('-C, --chdir <path>', 'change the working directory');
292 *
293 * --chdir /tmp
294 * program.chdir
295 * // => "/tmp"
296 *
297 * // optional argument
298 * program.option('-c, --cheese [type]', 'add cheese [marble]');
299 *
300 * @param {String} flags
301 * @param {String} description
302 * @param {Function|Mixed} fn or default
303 * @param {Mixed} defaultValue
304 * @return {Command} for chaining
305 * @api public
306 */
307
308Command.prototype.option = function(flags, description, fn, defaultValue){
309 var self = this
310 , option = new Option(flags, description)
311 , oname = option.name()
312 , name = camelcase(oname);
313
314 // default as 3rd arg
315 if ('function' != typeof fn) defaultValue = fn, fn = null;
316
317 // preassign default value only for --no-*, [optional], or <required>
318 if (false == option.bool || option.optional || option.required) {
319 // when --no-* we make sure default is true
320 if (false == option.bool) defaultValue = true;
321 // preassign only if we have a default
322 if (undefined !== defaultValue) self[name] = defaultValue;
323 }
324
325 // register the option
326 this.options.push(option);
327
328 // when it's passed assign the value
329 // and conditionally invoke the callback
330 this.on(oname, function(val){
331 // coercion
332 if (null != val && fn) val = fn(val);
333
334 // unassigned or bool
335 if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
336 // if no value, bool true, and we have a default, then use it!
337 if (null == val) {
338 self[name] = option.bool
339 ? defaultValue || true
340 : false;
341 } else {
342 self[name] = val;
343 }
344 } else if (null !== val) {
345 // reassign
346 self[name] = val;
347 }
348 });
349
350 return this;
351};
352
353/**
354 * Parse `argv`, settings options and invoking commands when defined.
355 *
356 * @param {Array} argv
357 * @return {Command} for chaining
358 * @api public
359 */
360
361Command.prototype.parse = function(argv){
362 // implicit help
363 if (this.executables) this.addImplicitHelpCommand();
364
365 // store raw args
366 this.rawArgs = argv;
367
368 // guess name
369 this._name = this._name || basename(argv[1]);
370
371 // process argv
372 var parsed = this.parseOptions(this.normalize(argv.slice(2)));
373 var args = this.args = parsed.args;
374
375 // executable sub-commands, skip .parseArgs()
376 if (this.executables) return this.executeSubCommand(argv, args, parsed.unknown);
377
378 return this.parseArgs(this.args, parsed.unknown);
379};
380
381/**
382 * Execute a sub-command executable.
383 *
384 * @param {Array} argv
385 * @param {Array} args
386 * @param {Array} unknown
387 * @api private
388 */
389
390Command.prototype.executeSubCommand = function(argv, args, unknown) {
391 args = args.concat(unknown);
392
393 if (!args.length) this.help();
394 if ('help' == args[0] && 1 == args.length) this.help();
395
396 // <cmd> --help
397 if ('help' == args[0]) {
398 args[0] = args[1];
399 args[1] = '--help';
400 }
401
402 // executable
403 var dir = dirname(argv[1]);
404 var bin = basename(argv[1]) + '-' + args[0];
405
406 // check for ./<bin> first
407 var local = path.join(dir, bin);
408 if (exists(local)) bin = local;
409
410 // run it
411 args = args.slice(1);
412 var proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
413 proc.on('exit', function(code){
414 if (code == 127) {
415 console.error('\n %s(1) does not exist\n', bin);
416 }
417 });
418};
419
420/**
421 * Normalize `args`, splitting joined short flags. For example
422 * the arg "-abc" is equivalent to "-a -b -c".
423 * This also normalizes equal sign and splits "--abc=def" into "--abc def".
424 *
425 * @param {Array} args
426 * @return {Array}
427 * @api private
428 */
429
430Command.prototype.normalize = function(args){
431 var ret = []
432 , arg
433 , index;
434
435 for (var i = 0, len = args.length; i < len; ++i) {
436 arg = args[i];
437 if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
438 arg.slice(1).split('').forEach(function(c){
439 ret.push('-' + c);
440 });
441 } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
442 ret.push(arg.slice(0, index), arg.slice(index + 1));
443 } else {
444 ret.push(arg);
445 }
446 }
447
448 return ret;
449};
450
451/**
452 * Parse command `args`.
453 *
454 * When listener(s) are available those
455 * callbacks are invoked, otherwise the "*"
456 * event is emitted and those actions are invoked.
457 *
458 * @param {Array} args
459 * @return {Command} for chaining
460 * @api private
461 */
462
463Command.prototype.parseArgs = function(args, unknown){
464 var cmds = this.commands
465 , len = cmds.length
466 , name;
467
468 if (args.length) {
469 name = args[0];
470 if (this.listeners(name).length) {
471 this.emit(args.shift(), args, unknown);
472 } else {
473 this.emit('*', args);
474 }
475 } else {
476 outputHelpIfNecessary(this, unknown);
477
478 // If there were no args and we have unknown options,
479 // then they are extraneous and we need to error.
480 if (unknown.length > 0) {
481 this.unknownOption(unknown[0]);
482 }
483 }
484
485 return this;
486};
487
488/**
489 * Return an option matching `arg` if any.
490 *
491 * @param {String} arg
492 * @return {Option}
493 * @api private
494 */
495
496Command.prototype.optionFor = function(arg){
497 for (var i = 0, len = this.options.length; i < len; ++i) {
498 if (this.options[i].is(arg)) {
499 return this.options[i];
500 }
501 }
502};
503
504/**
505 * Parse options from `argv` returning `argv`
506 * void of these options.
507 *
508 * @param {Array} argv
509 * @return {Array}
510 * @api public
511 */
512
513Command.prototype.parseOptions = function(argv){
514 var args = []
515 , len = argv.length
516 , literal
517 , option
518 , arg;
519
520 var unknownOptions = [];
521
522 // parse options
523 for (var i = 0; i < len; ++i) {
524 arg = argv[i];
525
526 // literal args after --
527 if ('--' == arg) {
528 literal = true;
529 continue;
530 }
531
532 if (literal) {
533 args.push(arg);
534 continue;
535 }
536
537 // find matching Option
538 option = this.optionFor(arg);
539
540 // option is defined
541 if (option) {
542 // requires arg
543 if (option.required) {
544 arg = argv[++i];
545 if (null == arg) return this.optionMissingArgument(option);
546 if ('-' == arg[0]) return this.optionMissingArgument(option, arg);
547 this.emit(option.name(), arg);
548 // optional arg
549 } else if (option.optional) {
550 arg = argv[i+1];
551 if (null == arg || '-' == arg[0]) {
552 arg = null;
553 } else {
554 ++i;
555 }
556 this.emit(option.name(), arg);
557 // bool
558 } else {
559 this.emit(option.name());
560 }
561 continue;
562 }
563
564 // looks like an option
565 if (arg.length > 1 && '-' == arg[0]) {
566 unknownOptions.push(arg);
567
568 // If the next argument looks like it might be
569 // an argument for this option, we pass it on.
570 // If it isn't, then it'll simply be ignored
571 if (argv[i+1] && '-' != argv[i+1][0]) {
572 unknownOptions.push(argv[++i]);
573 }
574 continue;
575 }
576
577 // arg
578 args.push(arg);
579 }
580
581 return { args: args, unknown: unknownOptions };
582};
583
584/**
585 * Argument `name` is missing.
586 *
587 * @param {String} name
588 * @api private
589 */
590
591Command.prototype.missingArgument = function(name){
592 console.error();
593 console.error(" error: missing required argument `%s'", name);
594 console.error();
595 process.exit(1);
596};
597
598/**
599 * `Option` is missing an argument, but received `flag` or nothing.
600 *
601 * @param {String} option
602 * @param {String} flag
603 * @api private
604 */
605
606Command.prototype.optionMissingArgument = function(option, flag){
607 console.error();
608 if (flag) {
609 console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
610 } else {
611 console.error(" error: option `%s' argument missing", option.flags);
612 }
613 console.error();
614 process.exit(1);
615};
616
617/**
618 * Unknown option `flag`.
619 *
620 * @param {String} flag
621 * @api private
622 */
623
624Command.prototype.unknownOption = function(flag){
625 console.error();
626 console.error(" error: unknown option `%s'", flag);
627 console.error();
628 process.exit(1);
629};
630
631
632/**
633 * Set the program version to `str`.
634 *
635 * This method auto-registers the "-V, --version" flag
636 * which will print the version number when passed.
637 *
638 * @param {String} str
639 * @param {String} flags
640 * @return {Command} for chaining
641 * @api public
642 */
643
644Command.prototype.version = function(str, flags){
645 if (0 == arguments.length) return this._version;
646 this._version = str;
647 flags = flags || '-V, --version';
648 this.option(flags, 'output the version number');
649 this.on('version', function(){
650 console.log(str);
651 process.exit(0);
652 });
653 return this;
654};
655
656/**
657 * Set the description `str`.
658 *
659 * @param {String} str
660 * @return {String|Command}
661 * @api public
662 */
663
664Command.prototype.description = function(str){
665 if (0 == arguments.length) return this._description;
666 this._description = str;
667 return this;
668};
669
670/**
671 * Set / get the command usage `str`.
672 *
673 * @param {String} str
674 * @return {String|Command}
675 * @api public
676 */
677
678Command.prototype.usage = function(str){
679 var args = this._args.map(function(arg){
680 return arg.required
681 ? '<' + arg.name + '>'
682 : '[' + arg.name + ']';
683 });
684
685 var usage = '[options'
686 + (this.commands.length ? '] [command' : '')
687 + ']'
688 + (this._args.length ? ' ' + args : '');
689
690 if (0 == arguments.length) return this._usage || usage;
691 this._usage = str;
692
693 return this;
694};
695
696/**
697 * Return the largest option length.
698 *
699 * @return {Number}
700 * @api private
701 */
702
703Command.prototype.largestOptionLength = function(){
704 return this.options.reduce(function(max, option){
705 return Math.max(max, option.flags.length);
706 }, 0);
707};
708
709/**
710 * Return help for options.
711 *
712 * @return {String}
713 * @api private
714 */
715
716Command.prototype.optionHelp = function(){
717 var width = this.largestOptionLength();
718
719 // Prepend the help information
720 return [pad('-h, --help', width) + ' ' + 'output usage information']
721 .concat(this.options.map(function(option){
722 return pad(option.flags, width)
723 + ' ' + option.description;
724 }))
725 .join('\n');
726};
727
728/**
729 * Return command help documentation.
730 *
731 * @return {String}
732 * @api private
733 */
734
735Command.prototype.commandHelp = function(){
736 if (!this.commands.length) return '';
737 return [
738 ''
739 , ' Commands:'
740 , ''
741 , this.commands.map(function(cmd){
742 var args = cmd._args.map(function(arg){
743 return arg.required
744 ? '<' + arg.name + '>'
745 : '[' + arg.name + ']';
746 }).join(' ');
747
748 return pad(cmd._name
749 + (cmd.options.length
750 ? ' [options]'
751 : '') + ' ' + args, 22)
752 + (cmd.description()
753 ? ' ' + cmd.description()
754 : '');
755 }).join('\n').replace(/^/gm, ' ')
756 , ''
757 ].join('\n');
758};
759
760/**
761 * Return program help documentation.
762 *
763 * @return {String}
764 * @api private
765 */
766
767Command.prototype.helpInformation = function(){
768 return [
769 ''
770 , ' Usage: ' + this._name + ' ' + this.usage()
771 , '' + this.commandHelp()
772 , ' Options:'
773 , ''
774 , '' + this.optionHelp().replace(/^/gm, ' ')
775 , ''
776 , ''
777 ].join('\n');
778};
779
780/**
781 * Prompt for a `Number`.
782 *
783 * @param {String} str
784 * @param {Function} fn
785 * @api private
786 */
787
788Command.prototype.promptForNumber = function(str, fn){
789 var self = this;
790 this.promptSingleLine(str, function parseNumber(val){
791 val = Number(val);
792 if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber);
793 fn(val);
794 });
795};
796
797/**
798 * Prompt for a `Date`.
799 *
800 * @param {String} str
801 * @param {Function} fn
802 * @api private
803 */
804
805Command.prototype.promptForDate = function(str, fn){
806 var self = this;
807 this.promptSingleLine(str, function parseDate(val){
808 val = new Date(val);
809 if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate);
810 fn(val);
811 });
812};
813
814/**
815 * Single-line prompt.
816 *
817 * @param {String} str
818 * @param {Function} fn
819 * @api private
820 */
821
822Command.prototype.promptSingleLine = function(str, fn){
823 if ('function' == typeof arguments[2]) {
824 return this['promptFor' + (fn.name || fn)](str, arguments[2]);
825 }
826
827 process.stdout.write(str);
828 process.stdin.setEncoding('utf8');
829 process.stdin.once('data', function(val){
830 fn(val.trim());
831 }).resume();
832};
833
834/**
835 * Multi-line prompt.
836 *
837 * @param {String} str
838 * @param {Function} fn
839 * @api private
840 */
841
842Command.prototype.promptMultiLine = function(str, fn){
843 var buf = [];
844 console.log(str);
845 process.stdin.setEncoding('utf8');
846 process.stdin.on('data', function(val){
847 if ('\n' == val || '\r\n' == val) {
848 process.stdin.removeAllListeners('data');
849 fn(buf.join('\n'));
850 } else {
851 buf.push(val.trimRight());
852 }
853 }).resume();
854};
855
856/**
857 * Prompt `str` and callback `fn(val)`
858 *
859 * Commander supports single-line and multi-line prompts.
860 * To issue a single-line prompt simply add white-space
861 * to the end of `str`, something like "name: ", whereas
862 * for a multi-line prompt omit this "description:".
863 *
864 *
865 * Examples:
866 *
867 * program.prompt('Username: ', function(name){
868 * console.log('hi %s', name);
869 * });
870 *
871 * program.prompt('Description:', function(desc){
872 * console.log('description was "%s"', desc.trim());
873 * });
874 *
875 * @param {String|Object} str
876 * @param {Function} fn
877 * @api public
878 */
879
880Command.prototype.prompt = function(str, fn){
881 var self = this;
882
883 if ('string' == typeof str) {
884 if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments);
885 this.promptMultiLine(str, fn);
886 } else {
887 var keys = Object.keys(str)
888 , obj = {};
889
890 function next() {
891 var key = keys.shift()
892 , label = str[key];
893
894 if (!key) return fn(obj);
895 self.prompt(label, function(val){
896 obj[key] = val;
897 next();
898 });
899 }
900
901 next();
902 }
903};
904
905/**
906 * Prompt for password with `str`, `mask` char and callback `fn(val)`.
907 *
908 * The mask string defaults to '', aka no output is
909 * written while typing, you may want to use "*" etc.
910 *
911 * Examples:
912 *
913 * program.password('Password: ', function(pass){
914 * console.log('got "%s"', pass);
915 * process.stdin.destroy();
916 * });
917 *
918 * program.password('Password: ', '*', function(pass){
919 * console.log('got "%s"', pass);
920 * process.stdin.destroy();
921 * });
922 *
923 * @param {String} str
924 * @param {String} mask
925 * @param {Function} fn
926 * @api public
927 */
928
929Command.prototype.password = function(str, mask, fn){
930 var self = this
931 , buf = '';
932
933 // default mask
934 if ('function' == typeof mask) {
935 fn = mask;
936 mask = '';
937 }
938
939 keypress(process.stdin);
940
941 function setRawMode(mode) {
942 if (process.stdin.setRawMode) {
943 process.stdin.setRawMode(mode);
944 } else {
945 tty.setRawMode(mode);
946 }
947 };
948 setRawMode(true);
949 process.stdout.write(str);
950
951 // keypress
952 process.stdin.on('keypress', function(c, key){
953 if (key && 'enter' == key.name) {
954 console.log();
955 process.stdin.pause();
956 process.stdin.removeAllListeners('keypress');
957 setRawMode(false);
958 if (!buf.trim().length) return self.password(str, mask, fn);
959 fn(buf);
960 return;
961 }
962
963 if (key && key.ctrl && 'c' == key.name) {
964 console.log('%s', buf);
965 process.exit();
966 }
967
968 process.stdout.write(mask);
969 buf += c;
970 }).resume();
971};
972
973/**
974 * Confirmation prompt with `str` and callback `fn(bool)`
975 *
976 * Examples:
977 *
978 * program.confirm('continue? ', function(ok){
979 * console.log(' got %j', ok);
980 * process.stdin.destroy();
981 * });
982 *
983 * @param {String} str
984 * @param {Function} fn
985 * @api public
986 */
987
988
989Command.prototype.confirm = function(str, fn, verbose){
990 var self = this;
991 this.prompt(str, function(ok){
992 if (!ok.trim()) {
993 if (!verbose) str += '(yes or no) ';
994 return self.confirm(str, fn, true);
995 }
996 fn(parseBool(ok));
997 });
998};
999
1000/**
1001 * Choice prompt with `list` of items and callback `fn(index, item)`
1002 *
1003 * Examples:
1004 *
1005 * var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
1006 *
1007 * console.log('Choose the coolest pet:');
1008 * program.choose(list, function(i){
1009 * console.log('you chose %d "%s"', i, list[i]);
1010 * process.stdin.destroy();
1011 * });
1012 *
1013 * @param {Array} list
1014 * @param {Number|Function} index or fn
1015 * @param {Function} fn
1016 * @api public
1017 */
1018
1019Command.prototype.choose = function(list, index, fn){
1020 var self = this
1021 , hasDefault = 'number' == typeof index;
1022
1023 if (!hasDefault) {
1024 fn = index;
1025 index = null;
1026 }
1027
1028 list.forEach(function(item, i){
1029 if (hasDefault && i == index) {
1030 console.log('* %d) %s', i + 1, item);
1031 } else {
1032 console.log(' %d) %s', i + 1, item);
1033 }
1034 });
1035
1036 function again() {
1037 self.prompt(' : ', function(val){
1038 val = parseInt(val, 10) - 1;
1039 if (hasDefault && isNaN(val)) val = index;
1040
1041 if (null == list[val]) {
1042 again();
1043 } else {
1044 fn(val, list[val]);
1045 }
1046 });
1047 }
1048
1049 again();
1050};
1051
1052
1053/**
1054 * Output help information for this command
1055 *
1056 * @api public
1057 */
1058
1059Command.prototype.outputHelp = function(){
1060 process.stdout.write(this.helpInformation());
1061 this.emit('--help');
1062};
1063
1064/**
1065 * Output help information and exit.
1066 *
1067 * @api public
1068 */
1069
1070Command.prototype.help = function(){
1071 this.outputHelp();
1072 process.exit();
1073};
1074
1075/**
1076 * Camel-case the given `flag`
1077 *
1078 * @param {String} flag
1079 * @return {String}
1080 * @api private
1081 */
1082
1083function camelcase(flag) {
1084 return flag.split('-').reduce(function(str, word){
1085 return str + word[0].toUpperCase() + word.slice(1);
1086 });
1087}
1088
1089/**
1090 * Parse a boolean `str`.
1091 *
1092 * @param {String} str
1093 * @return {Boolean}
1094 * @api private
1095 */
1096
1097function parseBool(str) {
1098 return /^y|yes|ok|true$/i.test(str);
1099}
1100
1101/**
1102 * Pad `str` to `width`.
1103 *
1104 * @param {String} str
1105 * @param {Number} width
1106 * @return {String}
1107 * @api private
1108 */
1109
1110function pad(str, width) {
1111 var len = Math.max(0, width - str.length);
1112 return str + Array(len + 1).join(' ');
1113}
1114
1115/**
1116 * Output help information if necessary
1117 *
1118 * @param {Command} command to output help for
1119 * @param {Array} array of options to search for -h or --help
1120 * @api private
1121 */
1122
1123function outputHelpIfNecessary(cmd, options) {
1124 options = options || [];
1125 for (var i = 0; i < options.length; i++) {
1126 if (options[i] == '--help' || options[i] == '-h') {
1127 cmd.outputHelp();
1128 process.exit(0);
1129 }
1130 }
1131}
11320
=== removed directory 'node_modules/cordova/_vendor/commander/1.1.1/node_modules'
=== removed symlink 'node_modules/cordova/_vendor/commander/1.1.1/node_modules/keypress'
=== target was u'../_vendor/keypress/0.1.0'
=== removed file 'node_modules/cordova/_vendor/commander/1.1.1/package.json'
--- node_modules/cordova/_vendor/commander/1.1.1/package.json 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/commander/1.1.1/package.json 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
1{
2 "name": "commander",
3 "version": "1.1.1",
4 "description": "the complete solution for node.js command-line programs",
5 "keywords": [
6 "command",
7 "option",
8 "parser",
9 "prompt",
10 "stdin"
11 ],
12 "author": {
13 "name": "TJ Holowaychuk",
14 "email": "tj@vision-media.ca"
15 },
16 "repository": {
17 "type": "git",
18 "url": "https://github.com/visionmedia/commander.js.git"
19 },
20 "dependencies": {
21 "keypress": "0.1.x"
22 },
23 "devDependencies": {
24 "should": ">= 0.0.1"
25 },
26 "scripts": {
27 "test": "make test"
28 },
29 "main": "index",
30 "engines": {
31 "node": ">= 0.6.x"
32 },
33 "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineappe');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineappe\n -b, --bbq Add bbq sauce\n -c, --cheese <type> Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] <file ...>')\n .option('-i, --integer <n>', 'An integer argument', parseInt)\n .option('-f, --float <n>', 'A float argument', parseFloat)\n .option('-r, --range <a>..<b>', 'A range', range)\n .option('-l, --list <items>', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Password: ', '*', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## .outputHelp()\n\n Output help information without exiting.\n\n## .help()\n\n Output help information and exit immediately.\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
34 "readmeFilename": "Readme.md",
35 "bugs": {
36 "url": "https://github.com/visionmedia/commander.js/issues"
37 },
38 "_id": "commander@1.1.1",
39 "_from": "commander@1.1.x"
40}
410
=== removed directory 'node_modules/cordova/_vendor/forever-agent/0.5.0'
=== removed file 'node_modules/cordova/_vendor/forever-agent/0.5.0/LICENSE'
--- node_modules/cordova/_vendor/forever-agent/0.5.0/LICENSE 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.0/LICENSE 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1Apache License
2
3Version 2.0, January 2004
4
5http://www.apache.org/licenses/
6
7TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
91. Definitions.
10
11"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
13"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
15"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
17"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
19"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
21"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
23"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
25"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
27"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
29"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
312. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
333. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
354. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
37You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
39You must cause any modified files to carry prominent notices stating that You changed the files; and
40
41You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
43If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
455. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
476. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
497. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
518. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
539. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
55END OF TERMS AND CONDITIONS
56\ No newline at end of file0\ No newline at end of file
571
=== removed file 'node_modules/cordova/_vendor/forever-agent/0.5.0/README.md'
--- node_modules/cordova/_vendor/forever-agent/0.5.0/README.md 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.0/README.md 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1forever-agent
2=============
3
4HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.
50
=== removed symlink 'node_modules/cordova/_vendor/forever-agent/0.5.0/_vendor'
=== target was u'../..'
=== removed file 'node_modules/cordova/_vendor/forever-agent/0.5.0/index.js'
--- node_modules/cordova/_vendor/forever-agent/0.5.0/index.js 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.0/index.js 1970-01-01 00:00:00 +0000
@@ -1,119 +0,0 @@
1module.exports = ForeverAgent
2ForeverAgent.SSL = ForeverAgentSSL
3
4var util = require('util')
5 , Agent = require('http').Agent
6 , net = require('net')
7 , tls = require('tls')
8 , AgentSSL = require('https').Agent
9
10function ForeverAgent(options) {
11 var self = this
12 self.options = options || {}
13 self.requests = {}
14 self.sockets = {}
15 self.freeSockets = {}
16 self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
17 self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
18 self.on('free', function(socket, host, port) {
19 var name = host + ':' + port
20 if (self.requests[name] && self.requests[name].length) {
21 self.requests[name].shift().onSocket(socket)
22 } else if (self.sockets[name].length < self.minSockets) {
23 if (!self.freeSockets[name]) self.freeSockets[name] = []
24 self.freeSockets[name].push(socket)
25
26 // if an error happens while we don't use the socket anyway, meh, throw the socket away
27 function onIdleError() {
28 socket.destroy()
29 }
30 socket._onIdleError = onIdleError
31 socket.on('error', onIdleError)
32 } else {
33 // If there are no pending requests just destroy the
34 // socket and it will get removed from the pool. This
35 // gets us out of timeout issues and allows us to
36 // default to Connection:keep-alive.
37 socket.destroy()
38 }
39 })
40
41}
42util.inherits(ForeverAgent, Agent)
43
44ForeverAgent.defaultMinSockets = 5
45
46
47ForeverAgent.prototype.createConnection = net.createConnection
48ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
49ForeverAgent.prototype.addRequest = function(req, host, port) {
50 var name = host + ':' + port
51 if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
52 var idleSocket = this.freeSockets[name].pop()
53 idleSocket.removeListener('error', idleSocket._onIdleError)
54 delete idleSocket._onIdleError
55 req._reusedSocket = true
56 req.onSocket(idleSocket)
57 } else {
58 this.addRequestNoreuse(req, host, port)
59 }
60}
61
62ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
63 if (this.sockets[name]) {
64 var index = this.sockets[name].indexOf(s)
65 if (index !== -1) {
66 this.sockets[name].splice(index, 1)
67 }
68 } else if (this.sockets[name] && this.sockets[name].length === 0) {
69 // don't leak
70 delete this.sockets[name]
71 delete this.requests[name]
72 }
73
74 if (this.freeSockets[name]) {
75 var index = this.freeSockets[name].indexOf(s)
76 if (index !== -1) {
77 this.freeSockets[name].splice(index, 1)
78 if (this.freeSockets[name].length === 0) {
79 delete this.freeSockets[name]
80 }
81 }
82 }
83
84 if (this.requests[name] && this.requests[name].length) {
85 // If we have pending requests and a socket gets closed a new one
86 // needs to be created to take over in the pool for the one that closed.
87 this.createSocket(name, host, port).emit('free')
88 }
89}
90
91function ForeverAgentSSL (options) {
92 ForeverAgent.call(this, options)
93}
94util.inherits(ForeverAgentSSL, ForeverAgent)
95
96ForeverAgentSSL.prototype.createConnection = createConnectionSSL
97ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
98
99function createConnectionSSL (port, host, options) {
100 if (typeof port === 'object') {
101 options = port;
102 } else if (typeof host === 'object') {
103 options = host;
104 } else if (typeof options === 'object') {
105 options = options;
106 } else {
107 options = {};
108 }
109
110 if (typeof port === 'number') {
111 options.port = port;
112 }
113
114 if (typeof host === 'string') {
115 options.host = host;
116 }
117
118 return tls.connect(options);
119}
1200
=== removed file 'node_modules/cordova/_vendor/forever-agent/0.5.0/package.json'
--- node_modules/cordova/_vendor/forever-agent/0.5.0/package.json 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.0/package.json 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
1{
2 "author": {
3 "name": "Mikeal Rogers",
4 "email": "mikeal.rogers@gmail.com",
5 "url": "http://www.futurealoof.com"
6 },
7 "name": "forever-agent",
8 "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
9 "version": "0.5.0",
10 "repository": {
11 "url": "https://github.com/mikeal/forever-agent"
12 },
13 "main": "index.js",
14 "dependencies": {},
15 "devDependencies": {},
16 "optionalDependencies": {},
17 "engines": {
18 "node": "*"
19 },
20 "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n",
21 "readmeFilename": "README.md",
22 "bugs": {
23 "url": "https://github.com/mikeal/forever-agent/issues"
24 },
25 "_id": "forever-agent@0.5.0",
26 "_from": "forever-agent@~0.5.0"
27}
280
=== added directory 'node_modules/cordova/_vendor/forever-agent/0.5.2'
=== added file 'node_modules/cordova/_vendor/forever-agent/0.5.2/LICENSE'
--- node_modules/cordova/_vendor/forever-agent/0.5.2/LICENSE 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.2/LICENSE 2014-02-21 20:33:03 +0000
@@ -0,0 +1,55 @@
1Apache License
2
3Version 2.0, January 2004
4
5http://www.apache.org/licenses/
6
7TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
91. Definitions.
10
11"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
13"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
15"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
17"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
19"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
21"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
23"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
25"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
27"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
29"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
312. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
333. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
354. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
37You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
39You must cause any modified files to carry prominent notices stating that You changed the files; and
40
41You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
43If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
455. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
476. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
497. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
518. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
539. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
55END OF TERMS AND CONDITIONS
0\ No newline at end of file56\ No newline at end of file
157
=== added file 'node_modules/cordova/_vendor/forever-agent/0.5.2/README.md'
--- node_modules/cordova/_vendor/forever-agent/0.5.2/README.md 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.2/README.md 2014-02-21 20:33:03 +0000
@@ -0,0 +1,4 @@
1forever-agent
2=============
3
4HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.
05
=== added symlink 'node_modules/cordova/_vendor/forever-agent/0.5.2/_vendor'
=== target is u'../..'
=== added file 'node_modules/cordova/_vendor/forever-agent/0.5.2/index.js'
--- node_modules/cordova/_vendor/forever-agent/0.5.2/index.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.2/index.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,119 @@
1module.exports = ForeverAgent
2ForeverAgent.SSL = ForeverAgentSSL
3
4var util = require('util')
5 , Agent = require('http').Agent
6 , net = require('net')
7 , tls = require('tls')
8 , AgentSSL = require('https').Agent
9
10function ForeverAgent(options) {
11 var self = this
12 self.options = options || {}
13 self.requests = {}
14 self.sockets = {}
15 self.freeSockets = {}
16 self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
17 self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
18 self.on('free', function(socket, host, port) {
19 var name = host + ':' + port
20 if (self.requests[name] && self.requests[name].length) {
21 self.requests[name].shift().onSocket(socket)
22 } else if (self.sockets[name].length < self.minSockets) {
23 if (!self.freeSockets[name]) self.freeSockets[name] = []
24 self.freeSockets[name].push(socket)
25
26 // if an error happens while we don't use the socket anyway, meh, throw the socket away
27 var onIdleError = function() {
28 socket.destroy()
29 }
30 socket._onIdleError = onIdleError
31 socket.on('error', onIdleError)
32 } else {
33 // If there are no pending requests just destroy the
34 // socket and it will get removed from the pool. This
35 // gets us out of timeout issues and allows us to
36 // default to Connection:keep-alive.
37 socket.destroy()
38 }
39 })
40
41}
42util.inherits(ForeverAgent, Agent)
43
44ForeverAgent.defaultMinSockets = 5
45
46
47ForeverAgent.prototype.createConnection = net.createConnection
48ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
49ForeverAgent.prototype.addRequest = function(req, host, port) {
50 var name = host + ':' + port
51 if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
52 var idleSocket = this.freeSockets[name].pop()
53 idleSocket.removeListener('error', idleSocket._onIdleError)
54 delete idleSocket._onIdleError
55 req._reusedSocket = true
56 req.onSocket(idleSocket)
57 } else {
58 this.addRequestNoreuse(req, host, port)
59 }
60}
61
62ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
63 if (this.sockets[name]) {
64 var index = this.sockets[name].indexOf(s)
65 if (index !== -1) {
66 this.sockets[name].splice(index, 1)
67 }
68 } else if (this.sockets[name] && this.sockets[name].length === 0) {
69 // don't leak
70 delete this.sockets[name]
71 delete this.requests[name]
72 }
73
74 if (this.freeSockets[name]) {
75 var index = this.freeSockets[name].indexOf(s)
76 if (index !== -1) {
77 this.freeSockets[name].splice(index, 1)
78 if (this.freeSockets[name].length === 0) {
79 delete this.freeSockets[name]
80 }
81 }
82 }
83
84 if (this.requests[name] && this.requests[name].length) {
85 // If we have pending requests and a socket gets closed a new one
86 // needs to be created to take over in the pool for the one that closed.
87 this.createSocket(name, host, port).emit('free')
88 }
89}
90
91function ForeverAgentSSL (options) {
92 ForeverAgent.call(this, options)
93}
94util.inherits(ForeverAgentSSL, ForeverAgent)
95
96ForeverAgentSSL.prototype.createConnection = createConnectionSSL
97ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
98
99function createConnectionSSL (port, host, options) {
100 if (typeof port === 'object') {
101 options = port;
102 } else if (typeof host === 'object') {
103 options = host;
104 } else if (typeof options === 'object') {
105 options = options;
106 } else {
107 options = {};
108 }
109
110 if (typeof port === 'number') {
111 options.port = port;
112 }
113
114 if (typeof host === 'string') {
115 options.host = host;
116 }
117
118 return tls.connect(options);
119}
0120
=== added file 'node_modules/cordova/_vendor/forever-agent/0.5.2/package.json'
--- node_modules/cordova/_vendor/forever-agent/0.5.2/package.json 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/forever-agent/0.5.2/package.json 2014-02-21 20:33:03 +0000
@@ -0,0 +1,27 @@
1{
2 "author": {
3 "name": "Mikeal Rogers",
4 "email": "mikeal.rogers@gmail.com",
5 "url": "http://www.futurealoof.com"
6 },
7 "name": "forever-agent",
8 "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
9 "version": "0.5.2",
10 "repository": {
11 "url": "https://github.com/mikeal/forever-agent"
12 },
13 "main": "index.js",
14 "dependencies": {},
15 "devDependencies": {},
16 "optionalDependencies": {},
17 "engines": {
18 "node": "*"
19 },
20 "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n",
21 "readmeFilename": "README.md",
22 "bugs": {
23 "url": "https://github.com/mikeal/forever-agent/issues"
24 },
25 "_id": "forever-agent@0.5.2",
26 "_from": "forever-agent@~0.5.0"
27}
028
=== modified symlink 'node_modules/cordova/_vendor/fstream/0.1.25/node_modules/graceful-fs'
=== target changed u'../_vendor/graceful-fs/2.0.1' => u'../_vendor/graceful-fs/2.0.2'
=== removed directory 'node_modules/cordova/_vendor/graceful-fs/2.0.1'
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/.npmignore'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/.npmignore 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/.npmignore 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1node_modules/
20
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/LICENSE'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/LICENSE 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/LICENSE 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
1Copyright (c) Isaac Z. Schlueter ("Author")
2All rights reserved.
3
4The BSD License
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions
8are met:
9
101. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
132. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16
17THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
21BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
280
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/README.md'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/README.md 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/README.md 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1# graceful-fs
2
3graceful-fs functions as a drop-in replacement for the fs module,
4making various improvements.
5
6The improvements are meant to normalize behavior across different
7platforms and environments, and to make filesystem access more
8resilient to errors.
9
10## Improvements over fs module
11
12graceful-fs:
13
14* Queues up `open` and `readdir` calls, and retries them once
15 something closes if there is an EMFILE error from too many file
16 descriptors.
17* fixes `lchmod` for Node versions prior to 0.6.2.
18* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
19* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
20 `lchown` if the user isn't root.
21* makes `lchmod` and `lchown` become noops, if not available.
22* retries reading a file if `read` results in EAGAIN error.
23
24On Windows, it retries renaming a file for up to one second if `EACCESS`
25or `EPERM` error occurs, likely because antivirus software has locked
26the directory.
270
=== removed symlink 'node_modules/cordova/_vendor/graceful-fs/2.0.1/_vendor'
=== target was u'../..'
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/graceful-fs.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/graceful-fs.js 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/graceful-fs.js 1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
1// Monkey-patching the fs module.
2// It's ugly, but there is simply no other way to do this.
3var fs = module.exports = require('fs')
4
5var assert = require('assert')
6
7// fix up some busted stuff, mostly on windows and old nodes
8require('./polyfills.js')
9
10// The EMFILE enqueuing stuff
11
12var util = require('util')
13
14function noop () {}
15
16var debug = noop
17var util = require('util')
18if (util.debuglog)
19 debug = util.debuglog('gfs')
20else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || ''))
21 debug = function() {
22 var m = util.format.apply(util, arguments)
23 m = 'GFS: ' + m.split(/\n/).join('\nGFS: ')
24 console.error(m)
25 }
26
27if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) {
28 process.on('exit', function() {
29 debug('fds', fds)
30 debug(queue)
31 assert.equal(queue.length, 0)
32 })
33}
34
35
36var originalOpen = fs.open
37fs.open = open
38
39function open(path, flags, mode, cb) {
40 if (typeof mode === "function") cb = mode, mode = null
41 if (typeof cb !== "function") cb = noop
42 new OpenReq(path, flags, mode, cb)
43}
44
45function OpenReq(path, flags, mode, cb) {
46 this.path = path
47 this.flags = flags
48 this.mode = mode
49 this.cb = cb
50 Req.call(this)
51}
52
53util.inherits(OpenReq, Req)
54
55OpenReq.prototype.process = function() {
56 originalOpen.call(fs, this.path, this.flags, this.mode, this.done)
57}
58
59var fds = {}
60OpenReq.prototype.done = function(er, fd) {
61 debug('open done', er, fd)
62 if (fd)
63 fds['fd' + fd] = this.path
64 Req.prototype.done.call(this, er, fd)
65}
66
67
68var originalReaddir = fs.readdir
69fs.readdir = readdir
70
71function readdir(path, cb) {
72 if (typeof cb !== "function") cb = noop
73 new ReaddirReq(path, cb)
74}
75
76function ReaddirReq(path, cb) {
77 this.path = path
78 this.cb = cb
79 Req.call(this)
80}
81
82util.inherits(ReaddirReq, Req)
83
84ReaddirReq.prototype.process = function() {
85 originalReaddir.call(fs, this.path, this.done)
86}
87
88ReaddirReq.prototype.done = function(er, files) {
89 Req.prototype.done.call(this, er, files)
90 onclose()
91}
92
93
94var originalClose = fs.close
95fs.close = close
96
97function close (fd, cb) {
98 debug('close', fd)
99 if (typeof cb !== "function") cb = noop
100 delete fds['fd' + fd]
101 originalClose.call(fs, fd, function(er) {
102 onclose()
103 cb(er)
104 })
105}
106
107
108var originalCloseSync = fs.closeSync
109fs.closeSync = closeSync
110
111function closeSync (fd) {
112 try {
113 return originalCloseSync(fd)
114 } finally {
115 onclose()
116 }
117}
118
119
120// Req class
121function Req () {
122 // start processing
123 this.done = this.done.bind(this)
124 this.failures = 0
125 this.process()
126}
127
128Req.prototype.done = function (er, result) {
129 var tryAgain = false
130 if (er) {
131 var code = er.code
132 var tryAgain = code === "EMFILE"
133 if (process.platform === "win32")
134 tryAgain = tryAgain || code === "OK"
135 }
136
137 if (tryAgain) {
138 this.failures ++
139 enqueue(this)
140 } else {
141 var cb = this.cb
142 cb(er, result)
143 }
144}
145
146var queue = []
147
148function enqueue(req) {
149 queue.push(req)
150 debug('enqueue %d %s', queue.length, req.constructor.name, req)
151}
152
153function onclose() {
154 var req = queue.shift()
155 if (req) {
156 debug('process', req.constructor.name, req)
157 req.process()
158 }
159}
1600
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/package.json'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/package.json 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/package.json 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
1{
2 "author": {
3 "name": "Isaac Z. Schlueter",
4 "email": "i@izs.me",
5 "url": "http://blog.izs.me"
6 },
7 "name": "graceful-fs",
8 "description": "A drop-in replacement for fs, making various improvements.",
9 "version": "2.0.1",
10 "repository": {
11 "type": "git",
12 "url": "git://github.com/isaacs/node-graceful-fs.git"
13 },
14 "main": "graceful-fs.js",
15 "engines": {
16 "node": ">=0.4.0"
17 },
18 "directories": {
19 "test": "test"
20 },
21 "scripts": {
22 "test": "tap test/*.js"
23 },
24 "keywords": [
25 "fs",
26 "module",
27 "reading",
28 "retry",
29 "retries",
30 "queue",
31 "error",
32 "errors",
33 "handling",
34 "EMFILE",
35 "EAGAIN",
36 "EINVAL",
37 "EPERM",
38 "EACCESS"
39 ],
40 "license": "BSD",
41 "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n",
42 "readmeFilename": "README.md",
43 "bugs": {
44 "url": "https://github.com/isaacs/node-graceful-fs/issues"
45 },
46 "_id": "graceful-fs@2.0.1",
47 "_from": "graceful-fs@~2.0.0"
48}
490
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/polyfills.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/polyfills.js 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/polyfills.js 1970-01-01 00:00:00 +0000
@@ -1,228 +0,0 @@
1var fs = require('fs')
2var constants = require('constants')
3
4var origCwd = process.cwd
5var cwd = null
6process.cwd = function() {
7 if (!cwd)
8 cwd = origCwd.call(process)
9 return cwd
10}
11var chdir = process.chdir
12process.chdir = function(d) {
13 cwd = null
14 chdir.call(process, d)
15}
16
17// (re-)implement some things that are known busted or missing.
18
19// lchmod, broken prior to 0.6.2
20// back-port the fix here.
21if (constants.hasOwnProperty('O_SYMLINK') &&
22 process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
23 fs.lchmod = function (path, mode, callback) {
24 callback = callback || noop
25 fs.open( path
26 , constants.O_WRONLY | constants.O_SYMLINK
27 , mode
28 , function (err, fd) {
29 if (err) {
30 callback(err)
31 return
32 }
33 // prefer to return the chmod error, if one occurs,
34 // but still try to close, and report closing errors if they occur.
35 fs.fchmod(fd, mode, function (err) {
36 fs.close(fd, function(err2) {
37 callback(err || err2)
38 })
39 })
40 })
41 }
42
43 fs.lchmodSync = function (path, mode) {
44 var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
45
46 // prefer to return the chmod error, if one occurs,
47 // but still try to close, and report closing errors if they occur.
48 var err, err2
49 try {
50 var ret = fs.fchmodSync(fd, mode)
51 } catch (er) {
52 err = er
53 }
54 try {
55 fs.closeSync(fd)
56 } catch (er) {
57 err2 = er
58 }
59 if (err || err2) throw (err || err2)
60 return ret
61 }
62}
63
64
65// lutimes implementation, or no-op
66if (!fs.lutimes) {
67 if (constants.hasOwnProperty("O_SYMLINK")) {
68 fs.lutimes = function (path, at, mt, cb) {
69 fs.open(path, constants.O_SYMLINK, function (er, fd) {
70 cb = cb || noop
71 if (er) return cb(er)
72 fs.futimes(fd, at, mt, function (er) {
73 fs.close(fd, function (er2) {
74 return cb(er || er2)
75 })
76 })
77 })
78 }
79
80 fs.lutimesSync = function (path, at, mt) {
81 var fd = fs.openSync(path, constants.O_SYMLINK)
82 , err
83 , err2
84 , ret
85
86 try {
87 var ret = fs.futimesSync(fd, at, mt)
88 } catch (er) {
89 err = er
90 }
91 try {
92 fs.closeSync(fd)
93 } catch (er) {
94 err2 = er
95 }
96 if (err || err2) throw (err || err2)
97 return ret
98 }
99
100 } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
101 // maybe utimensat will be bound soonish?
102 fs.lutimes = function (path, at, mt, cb) {
103 fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
104 }
105
106 fs.lutimesSync = function (path, at, mt) {
107 return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
108 }
109
110 } else {
111 fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
112 fs.lutimesSync = function () {}
113 }
114}
115
116
117// https://github.com/isaacs/node-graceful-fs/issues/4
118// Chown should not fail on einval or eperm if non-root.
119
120fs.chown = chownFix(fs.chown)
121fs.fchown = chownFix(fs.fchown)
122fs.lchown = chownFix(fs.lchown)
123
124fs.chownSync = chownFixSync(fs.chownSync)
125fs.fchownSync = chownFixSync(fs.fchownSync)
126fs.lchownSync = chownFixSync(fs.lchownSync)
127
128function chownFix (orig) {
129 if (!orig) return orig
130 return function (target, uid, gid, cb) {
131 return orig.call(fs, target, uid, gid, function (er, res) {
132 if (chownErOk(er)) er = null
133 cb(er, res)
134 })
135 }
136}
137
138function chownFixSync (orig) {
139 if (!orig) return orig
140 return function (target, uid, gid) {
141 try {
142 return orig.call(fs, target, uid, gid)
143 } catch (er) {
144 if (!chownErOk(er)) throw er
145 }
146 }
147}
148
149function chownErOk (er) {
150 // if there's no getuid, or if getuid() is something other than 0,
151 // and the error is EINVAL or EPERM, then just ignore it.
152 // This specific case is a silent failure in cp, install, tar,
153 // and most other unix tools that manage permissions.
154 // When running as root, or if other types of errors are encountered,
155 // then it's strict.
156 if (!er || (!process.getuid || process.getuid() !== 0)
157 && (er.code === "EINVAL" || er.code === "EPERM")) return true
158}
159
160
161// if lchmod/lchown do not exist, then make them no-ops
162if (!fs.lchmod) {
163 fs.lchmod = function (path, mode, cb) {
164 process.nextTick(cb)
165 }
166 fs.lchmodSync = function () {}
167}
168if (!fs.lchown) {
169 fs.lchown = function (path, uid, gid, cb) {
170 process.nextTick(cb)
171 }
172 fs.lchownSync = function () {}
173}
174
175
176
177// on Windows, A/V software can lock the directory, causing this
178// to fail with an EACCES or EPERM if the directory contains newly
179// created files. Try again on failure, for up to 1 second.
180if (process.platform === "win32") {
181 var rename_ = fs.rename
182 fs.rename = function rename (from, to, cb) {
183 var start = Date.now()
184 rename_(from, to, function CB (er) {
185 if (er
186 && (er.code === "EACCES" || er.code === "EPERM")
187 && Date.now() - start < 1000) {
188 return rename_(from, to, CB)
189 }
190 cb(er)
191 })
192 }
193}
194
195
196// if read() returns EAGAIN, then just try it again.
197var read = fs.read
198fs.read = function (fd, buffer, offset, length, position, callback_) {
199 var callback
200 if (callback_ && typeof callback_ === 'function') {
201 var eagCounter = 0
202 callback = function (er, _, __) {
203 if (er && er.code === 'EAGAIN' && eagCounter < 10) {
204 eagCounter ++
205 return read.call(fs, fd, buffer, offset, length, position, callback)
206 }
207 callback_.apply(this, arguments)
208 }
209 }
210 return read.call(fs, fd, buffer, offset, length, position, callback)
211}
212
213var readSync = fs.readSync
214fs.readSync = function (fd, buffer, offset, length, position) {
215 var eagCounter = 0
216 while (true) {
217 try {
218 return readSync.call(fs, fd, buffer, offset, length, position)
219 } catch (er) {
220 if (er.code === 'EAGAIN' && eagCounter < 10) {
221 eagCounter ++
222 continue
223 }
224 throw er
225 }
226 }
227}
228
2290
=== removed directory 'node_modules/cordova/_vendor/graceful-fs/2.0.1/test'
=== removed file 'node_modules/cordova/_vendor/graceful-fs/2.0.1/test/open.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.1/test/open.js 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.1/test/open.js 1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
1var test = require('tap').test
2var fs = require('../graceful-fs.js')
3
4test('graceful fs is monkeypatched fs', function (t) {
5 t.equal(fs, require('fs'))
6 t.end()
7})
8
9test('open an existing file works', function (t) {
10 var fd = fs.openSync(__filename, 'r')
11 fs.closeSync(fd)
12 fs.open(__filename, 'r', function (er, fd) {
13 if (er) throw er
14 fs.close(fd, function (er) {
15 if (er) throw er
16 t.pass('works')
17 t.end()
18 })
19 })
20})
21
22test('open a non-existing file throws', function (t) {
23 var er
24 try {
25 var fd = fs.openSync('this file does not exist', 'r')
26 } catch (x) {
27 er = x
28 }
29 t.ok(er, 'should throw')
30 t.notOk(fd, 'should not get an fd')
31 t.equal(er.code, 'ENOENT')
32
33 fs.open('neither does this file', 'r', function (er, fd) {
34 t.ok(er, 'should throw')
35 t.notOk(fd, 'should not get an fd')
36 t.equal(er.code, 'ENOENT')
37 t.end()
38 })
39})
400
=== added directory 'node_modules/cordova/_vendor/graceful-fs/2.0.2'
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/.npmignore'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/.npmignore 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/.npmignore 2014-02-21 20:33:03 +0000
@@ -0,0 +1,1 @@
1node_modules/
02
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/LICENSE'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/LICENSE 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/LICENSE 2014-02-21 20:33:03 +0000
@@ -0,0 +1,27 @@
1Copyright (c) Isaac Z. Schlueter ("Author")
2All rights reserved.
3
4The BSD License
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions
8are met:
9
101. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
132. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16
17THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
21BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/README.md'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/README.md 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/README.md 2014-02-21 20:33:03 +0000
@@ -0,0 +1,26 @@
1# graceful-fs
2
3graceful-fs functions as a drop-in replacement for the fs module,
4making various improvements.
5
6The improvements are meant to normalize behavior across different
7platforms and environments, and to make filesystem access more
8resilient to errors.
9
10## Improvements over fs module
11
12graceful-fs:
13
14* Queues up `open` and `readdir` calls, and retries them once
15 something closes if there is an EMFILE error from too many file
16 descriptors.
17* fixes `lchmod` for Node versions prior to 0.6.2.
18* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
19* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
20 `lchown` if the user isn't root.
21* makes `lchmod` and `lchown` become noops, if not available.
22* retries reading a file if `read` results in EAGAIN error.
23
24On Windows, it retries renaming a file for up to one second if `EACCESS`
25or `EPERM` error occurs, likely because antivirus software has locked
26the directory.
027
=== added symlink 'node_modules/cordova/_vendor/graceful-fs/2.0.2/_vendor'
=== target is u'../..'
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/graceful-fs.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/graceful-fs.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/graceful-fs.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,161 @@
1// Monkey-patching the fs module.
2// It's ugly, but there is simply no other way to do this.
3var fs = module.exports = require('fs')
4
5var assert = require('assert')
6
7// fix up some busted stuff, mostly on windows and old nodes
8require('./polyfills.js')
9
10// The EMFILE enqueuing stuff
11
12var util = require('util')
13
14function noop () {}
15
16var debug = noop
17var util = require('util')
18if (util.debuglog)
19 debug = util.debuglog('gfs')
20else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || ''))
21 debug = function() {
22 var m = util.format.apply(util, arguments)
23 m = 'GFS: ' + m.split(/\n/).join('\nGFS: ')
24 console.error(m)
25 }
26
27if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) {
28 process.on('exit', function() {
29 debug('fds', fds)
30 debug(queue)
31 assert.equal(queue.length, 0)
32 })
33}
34
35
36var originalOpen = fs.open
37fs.open = open
38
39function open(path, flags, mode, cb) {
40 if (typeof mode === "function") cb = mode, mode = null
41 if (typeof cb !== "function") cb = noop
42 new OpenReq(path, flags, mode, cb)
43}
44
45function OpenReq(path, flags, mode, cb) {
46 this.path = path
47 this.flags = flags
48 this.mode = mode
49 this.cb = cb
50 Req.call(this)
51}
52
53util.inherits(OpenReq, Req)
54
55OpenReq.prototype.process = function() {
56 originalOpen.call(fs, this.path, this.flags, this.mode, this.done)
57}
58
59var fds = {}
60OpenReq.prototype.done = function(er, fd) {
61 debug('open done', er, fd)
62 if (fd)
63 fds['fd' + fd] = this.path
64 Req.prototype.done.call(this, er, fd)
65}
66
67
68var originalReaddir = fs.readdir
69fs.readdir = readdir
70
71function readdir(path, cb) {
72 if (typeof cb !== "function") cb = noop
73 new ReaddirReq(path, cb)
74}
75
76function ReaddirReq(path, cb) {
77 this.path = path
78 this.cb = cb
79 Req.call(this)
80}
81
82util.inherits(ReaddirReq, Req)
83
84ReaddirReq.prototype.process = function() {
85 originalReaddir.call(fs, this.path, this.done)
86}
87
88ReaddirReq.prototype.done = function(er, files) {
89 if (files && files.sort)
90 files = files.sort()
91 Req.prototype.done.call(this, er, files)
92 onclose()
93}
94
95
96var originalClose = fs.close
97fs.close = close
98
99function close (fd, cb) {
100 debug('close', fd)
101 if (typeof cb !== "function") cb = noop
102 delete fds['fd' + fd]
103 originalClose.call(fs, fd, function(er) {
104 onclose()
105 cb(er)
106 })
107}
108
109
110var originalCloseSync = fs.closeSync
111fs.closeSync = closeSync
112
113function closeSync (fd) {
114 try {
115 return originalCloseSync(fd)
116 } finally {
117 onclose()
118 }
119}
120
121
122// Req class
123function Req () {
124 // start processing
125 this.done = this.done.bind(this)
126 this.failures = 0
127 this.process()
128}
129
130Req.prototype.done = function (er, result) {
131 var tryAgain = false
132 if (er) {
133 var code = er.code
134 var tryAgain = code === "EMFILE"
135 if (process.platform === "win32")
136 tryAgain = tryAgain || code === "OK"
137 }
138
139 if (tryAgain) {
140 this.failures ++
141 enqueue(this)
142 } else {
143 var cb = this.cb
144 cb(er, result)
145 }
146}
147
148var queue = []
149
150function enqueue(req) {
151 queue.push(req)
152 debug('enqueue %d %s', queue.length, req.constructor.name, req)
153}
154
155function onclose() {
156 var req = queue.shift()
157 if (req) {
158 debug('process', req.constructor.name, req)
159 req.process()
160 }
161}
0162
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/package.json'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/package.json 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/package.json 2014-02-21 20:33:03 +0000
@@ -0,0 +1,48 @@
1{
2 "author": {
3 "name": "Isaac Z. Schlueter",
4 "email": "i@izs.me",
5 "url": "http://blog.izs.me"
6 },
7 "name": "graceful-fs",
8 "description": "A drop-in replacement for fs, making various improvements.",
9 "version": "2.0.2",
10 "repository": {
11 "type": "git",
12 "url": "git://github.com/isaacs/node-graceful-fs.git"
13 },
14 "main": "graceful-fs.js",
15 "engines": {
16 "node": ">=0.4.0"
17 },
18 "directories": {
19 "test": "test"
20 },
21 "scripts": {
22 "test": "tap test/*.js"
23 },
24 "keywords": [
25 "fs",
26 "module",
27 "reading",
28 "retry",
29 "retries",
30 "queue",
31 "error",
32 "errors",
33 "handling",
34 "EMFILE",
35 "EAGAIN",
36 "EINVAL",
37 "EPERM",
38 "EACCESS"
39 ],
40 "license": "BSD",
41 "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n",
42 "readmeFilename": "README.md",
43 "bugs": {
44 "url": "https://github.com/isaacs/node-graceful-fs/issues"
45 },
46 "_id": "graceful-fs@2.0.2",
47 "_from": "graceful-fs@~2.0.0"
48}
049
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/polyfills.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/polyfills.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/polyfills.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,228 @@
1var fs = require('fs')
2var constants = require('constants')
3
4var origCwd = process.cwd
5var cwd = null
6process.cwd = function() {
7 if (!cwd)
8 cwd = origCwd.call(process)
9 return cwd
10}
11var chdir = process.chdir
12process.chdir = function(d) {
13 cwd = null
14 chdir.call(process, d)
15}
16
17// (re-)implement some things that are known busted or missing.
18
19// lchmod, broken prior to 0.6.2
20// back-port the fix here.
21if (constants.hasOwnProperty('O_SYMLINK') &&
22 process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
23 fs.lchmod = function (path, mode, callback) {
24 callback = callback || noop
25 fs.open( path
26 , constants.O_WRONLY | constants.O_SYMLINK
27 , mode
28 , function (err, fd) {
29 if (err) {
30 callback(err)
31 return
32 }
33 // prefer to return the chmod error, if one occurs,
34 // but still try to close, and report closing errors if they occur.
35 fs.fchmod(fd, mode, function (err) {
36 fs.close(fd, function(err2) {
37 callback(err || err2)
38 })
39 })
40 })
41 }
42
43 fs.lchmodSync = function (path, mode) {
44 var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
45
46 // prefer to return the chmod error, if one occurs,
47 // but still try to close, and report closing errors if they occur.
48 var err, err2
49 try {
50 var ret = fs.fchmodSync(fd, mode)
51 } catch (er) {
52 err = er
53 }
54 try {
55 fs.closeSync(fd)
56 } catch (er) {
57 err2 = er
58 }
59 if (err || err2) throw (err || err2)
60 return ret
61 }
62}
63
64
65// lutimes implementation, or no-op
66if (!fs.lutimes) {
67 if (constants.hasOwnProperty("O_SYMLINK")) {
68 fs.lutimes = function (path, at, mt, cb) {
69 fs.open(path, constants.O_SYMLINK, function (er, fd) {
70 cb = cb || noop
71 if (er) return cb(er)
72 fs.futimes(fd, at, mt, function (er) {
73 fs.close(fd, function (er2) {
74 return cb(er || er2)
75 })
76 })
77 })
78 }
79
80 fs.lutimesSync = function (path, at, mt) {
81 var fd = fs.openSync(path, constants.O_SYMLINK)
82 , err
83 , err2
84 , ret
85
86 try {
87 var ret = fs.futimesSync(fd, at, mt)
88 } catch (er) {
89 err = er
90 }
91 try {
92 fs.closeSync(fd)
93 } catch (er) {
94 err2 = er
95 }
96 if (err || err2) throw (err || err2)
97 return ret
98 }
99
100 } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
101 // maybe utimensat will be bound soonish?
102 fs.lutimes = function (path, at, mt, cb) {
103 fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
104 }
105
106 fs.lutimesSync = function (path, at, mt) {
107 return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
108 }
109
110 } else {
111 fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
112 fs.lutimesSync = function () {}
113 }
114}
115
116
117// https://github.com/isaacs/node-graceful-fs/issues/4
118// Chown should not fail on einval or eperm if non-root.
119
120fs.chown = chownFix(fs.chown)
121fs.fchown = chownFix(fs.fchown)
122fs.lchown = chownFix(fs.lchown)
123
124fs.chownSync = chownFixSync(fs.chownSync)
125fs.fchownSync = chownFixSync(fs.fchownSync)
126fs.lchownSync = chownFixSync(fs.lchownSync)
127
128function chownFix (orig) {
129 if (!orig) return orig
130 return function (target, uid, gid, cb) {
131 return orig.call(fs, target, uid, gid, function (er, res) {
132 if (chownErOk(er)) er = null
133 cb(er, res)
134 })
135 }
136}
137
138function chownFixSync (orig) {
139 if (!orig) return orig
140 return function (target, uid, gid) {
141 try {
142 return orig.call(fs, target, uid, gid)
143 } catch (er) {
144 if (!chownErOk(er)) throw er
145 }
146 }
147}
148
149function chownErOk (er) {
150 // if there's no getuid, or if getuid() is something other than 0,
151 // and the error is EINVAL or EPERM, then just ignore it.
152 // This specific case is a silent failure in cp, install, tar,
153 // and most other unix tools that manage permissions.
154 // When running as root, or if other types of errors are encountered,
155 // then it's strict.
156 if (!er || (!process.getuid || process.getuid() !== 0)
157 && (er.code === "EINVAL" || er.code === "EPERM")) return true
158}
159
160
161// if lchmod/lchown do not exist, then make them no-ops
162if (!fs.lchmod) {
163 fs.lchmod = function (path, mode, cb) {
164 process.nextTick(cb)
165 }
166 fs.lchmodSync = function () {}
167}
168if (!fs.lchown) {
169 fs.lchown = function (path, uid, gid, cb) {
170 process.nextTick(cb)
171 }
172 fs.lchownSync = function () {}
173}
174
175
176
177// on Windows, A/V software can lock the directory, causing this
178// to fail with an EACCES or EPERM if the directory contains newly
179// created files. Try again on failure, for up to 1 second.
180if (process.platform === "win32") {
181 var rename_ = fs.rename
182 fs.rename = function rename (from, to, cb) {
183 var start = Date.now()
184 rename_(from, to, function CB (er) {
185 if (er
186 && (er.code === "EACCES" || er.code === "EPERM")
187 && Date.now() - start < 1000) {
188 return rename_(from, to, CB)
189 }
190 cb(er)
191 })
192 }
193}
194
195
196// if read() returns EAGAIN, then just try it again.
197var read = fs.read
198fs.read = function (fd, buffer, offset, length, position, callback_) {
199 var callback
200 if (callback_ && typeof callback_ === 'function') {
201 var eagCounter = 0
202 callback = function (er, _, __) {
203 if (er && er.code === 'EAGAIN' && eagCounter < 10) {
204 eagCounter ++
205 return read.call(fs, fd, buffer, offset, length, position, callback)
206 }
207 callback_.apply(this, arguments)
208 }
209 }
210 return read.call(fs, fd, buffer, offset, length, position, callback)
211}
212
213var readSync = fs.readSync
214fs.readSync = function (fd, buffer, offset, length, position) {
215 var eagCounter = 0
216 while (true) {
217 try {
218 return readSync.call(fs, fd, buffer, offset, length, position)
219 } catch (er) {
220 if (er.code === 'EAGAIN' && eagCounter < 10) {
221 eagCounter ++
222 continue
223 }
224 throw er
225 }
226 }
227}
228
0229
=== added directory 'node_modules/cordova/_vendor/graceful-fs/2.0.2/test'
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/test/open.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/test/open.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/test/open.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,39 @@
1var test = require('tap').test
2var fs = require('../graceful-fs.js')
3
4test('graceful fs is monkeypatched fs', function (t) {
5 t.equal(fs, require('fs'))
6 t.end()
7})
8
9test('open an existing file works', function (t) {
10 var fd = fs.openSync(__filename, 'r')
11 fs.closeSync(fd)
12 fs.open(__filename, 'r', function (er, fd) {
13 if (er) throw er
14 fs.close(fd, function (er) {
15 if (er) throw er
16 t.pass('works')
17 t.end()
18 })
19 })
20})
21
22test('open a non-existing file throws', function (t) {
23 var er
24 try {
25 var fd = fs.openSync('this file does not exist', 'r')
26 } catch (x) {
27 er = x
28 }
29 t.ok(er, 'should throw')
30 t.notOk(fd, 'should not get an fd')
31 t.equal(er.code, 'ENOENT')
32
33 fs.open('neither does this file', 'r', function (er, fd) {
34 t.ok(er, 'should throw')
35 t.notOk(fd, 'should not get an fd')
36 t.equal(er.code, 'ENOENT')
37 t.end()
38 })
39})
040
=== added file 'node_modules/cordova/_vendor/graceful-fs/2.0.2/test/readdir-sort.js'
--- node_modules/cordova/_vendor/graceful-fs/2.0.2/test/readdir-sort.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/graceful-fs/2.0.2/test/readdir-sort.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,21 @@
1var test = require("tap").test
2var fs = require("fs")
3
4var readdir = fs.readdir
5fs.readdir = function(path, cb) {
6 process.nextTick(function() {
7 cb(null, ["b", "z", "a"])
8 })
9}
10
11var g = require("../")
12
13test("readdir reorder", function (t) {
14 g.readdir("whatevers", function (er, files) {
15 if (er)
16 throw er
17 console.error(files)
18 t.same(files, [ "a", "b", "z" ])
19 t.end()
20 })
21})
022
=== added directory 'node_modules/cordova/_vendor/http-signature/0.10.0'
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/.dir-locals.el'
--- node_modules/cordova/_vendor/http-signature/0.10.0/.dir-locals.el 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/.dir-locals.el 2014-02-21 20:33:03 +0000
@@ -0,0 +1,6 @@
1((nil . ((indent-tabs-mode . nil)
2 (tab-width . 8)
3 (fill-column . 80)))
4 (js-mode . ((js-indent-level . 2)
5 (indent-tabs-mode . nil)
6 )))
0\ No newline at end of file7\ No newline at end of file
18
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/.npmignore'
--- node_modules/cordova/_vendor/http-signature/0.10.0/.npmignore 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/.npmignore 2014-02-21 20:33:03 +0000
@@ -0,0 +1,7 @@
1.gitmodules
2deps
3docs
4Makefile
5node_modules
6test
7tools
0\ No newline at end of file8\ No newline at end of file
19
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/LICENSE'
--- node_modules/cordova/_vendor/http-signature/0.10.0/LICENSE 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/LICENSE 2014-02-21 20:33:03 +0000
@@ -0,0 +1,18 @@
1Copyright Joyent, Inc. All rights reserved.
2Permission is hereby granted, free of charge, to any person obtaining a copy
3of this software and associated documentation files (the "Software"), to
4deal in the Software without restriction, including without limitation the
5rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6sell copies of the Software, and to permit persons to whom the Software is
7furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in
10all copies or substantial portions of the Software.
11
12THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18IN THE SOFTWARE.
019
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/README.md'
--- node_modules/cordova/_vendor/http-signature/0.10.0/README.md 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/README.md 2014-02-21 20:33:03 +0000
@@ -0,0 +1,75 @@
1# node-http-signature
2
3node-http-signature is a node.js library that has client and server components
4for Joyent's [HTTP Signature Scheme](http_signing.md).
5
6## Usage
7
8Note the example below signs a request with the same key/cert used to start an
9HTTP server. This is almost certainly not what you actaully want, but is just
10used to illustrate the API calls; you will need to provide your own key
11management in addition to this library.
12
13### Client
14
15 var fs = require('fs');
16 var https = require('https');
17 var httpSignature = require('http-signature');
18
19 var key = fs.readFileSync('./key.pem', 'ascii');
20
21 var options = {
22 host: 'localhost',
23 port: 8443,
24 path: '/',
25 method: 'GET',
26 headers: {}
27 };
28
29 // Adds a 'Date' header in, signs it, and adds the
30 // 'Authorization' header in.
31 var req = https.request(options, function(res) {
32 console.log(res.statusCode);
33 });
34
35
36 httpSignature.sign(req, {
37 key: key,
38 keyId: './cert.pem'
39 });
40
41 req.end();
42
43### Server
44
45 var fs = require('fs');
46 var https = require('https');
47 var httpSignature = require('http-signature');
48
49 var options = {
50 key: fs.readFileSync('./key.pem'),
51 cert: fs.readFileSync('./cert.pem')
52 };
53
54 https.createServer(options, function (req, res) {
55 var rc = 200;
56 var parsed = httpSignature.parseRequest(req);
57 var pub = fs.readFileSync(parsed.keyId, 'ascii');
58 if (!httpSignature.verifySignature(parsed, pub))
59 rc = 401;
60
61 res.writeHead(rc);
62 res.end();
63 }).listen(8443);
64
65## Installation
66
67 npm install http-signature
68
69## License
70
71MIT.
72
73## Bugs
74
75See <https://github.com/joyent/node-http-signature/issues>.
076
=== added symlink 'node_modules/cordova/_vendor/http-signature/0.10.0/_vendor'
=== target is u'../..'
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/http_signing.md'
--- node_modules/cordova/_vendor/http-signature/0.10.0/http_signing.md 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/http_signing.md 2014-02-21 20:33:03 +0000
@@ -0,0 +1,296 @@
1# Abstract
2
3This document describes a way to add origin authentication, message integrity,
4and replay resistance to HTTP REST requests. It is intended to be used over
5the HTTPS protocol.
6
7# Copyright Notice
8
9Copyright (c) 2011 Joyent, Inc. and the persons identified as document authors.
10All rights reserved.
11
12Code Components extracted from this document must include MIT License text.
13
14# Introduction
15
16This protocol is intended to provide a standard way for clients to sign HTTP
17requests. RFC2617 (HTTP Authentication) defines Basic and Digest authentication
18mechanisms, and RFC5246 (TLS 1.2) defines client-auth, both of which are widely
19employed on the Internet today. However, it is common place that the burdens of
20PKI prevent web service operators from deploying that methodoloy, and so many
21fall back to Basic authentication, which has poor security characteristics.
22
23Additionally, OAuth provides a fully-specified alternative for authorization
24of web service requests, but is not (always) ideal for machine to machine
25communication, as the key acquisition steps (generally) imply a fixed
26infrastructure that may not make sense to a service provider (e.g., symmetric
27keys).
28
29Several web service providers have invented their own schemes for signing
30HTTP requests, but to date, none have been placed in the public domain as a
31standard. This document serves that purpose. There are no techniques in this
32proposal that are novel beyond previous art, however, this aims to be a simple
33mechanism for signing these requests.
34
35# Signature Authentication Scheme
36
37The "signature" authentication scheme is based on the model that the client must
38authenticate itself with a digital signature produced by either a private
39asymmetric key (e.g., RSA) or a shared symmetric key (e.g., HMAC). The scheme
40is parameterized enough such that it is not bound to any particular key type or
41signing algorithm. However, it does explicitly assume that clients can send an
42HTTP `Date` header.
43
44## Authorization Header
45
46The client is expected to send an Authorization header (as defined in RFC 2617)
47with the following parameterization:
48
49 credentials := "Signature" params
50 params := 1#(keyId | algorithm | [headers] | [ext] | signature)
51 digitalSignature := plain-string
52
53 keyId := "keyId" "=" <"> plain-string <">
54 algorithm := "algorithm" "=" <"> plain-string <">
55 headers := "headers" "=" <"> 1#headers-value <">
56 ext := "ext" "=" <"> plain-string <">
57 signature := "signature" "=" <"> plain-string <">
58
59 headers-value := plain-string
60 plain-string = 1*( %x20-21 / %x23-5B / %x5D-7E )
61
62### Signature Parameters
63
64#### keyId
65
66REQUIRED. The `keyId` field is an opaque string that the server can use to look
67up the component they need to validate the signature. It could be an SSH key
68fingerprint, an LDAP DN, etc. Management of keys and assignment of `keyId` is
69out of scope for this document.
70
71#### algorithm
72
73REQUIRED. The `algorithm` parameter is used if the client and server agree on a
74non-standard digital signature algorithm. The full list of supported signature
75mechanisms is listed below.
76
77#### headers
78
79OPTIONAL. The `headers` parameter is used to specify the list of HTTP headers
80used to sign the request. If specified, it should be a quoted list of HTTP
81header names, separated by a single space character. By default, only one
82HTTP header is signed, which is the `Date` header. Note that the list MUST be
83specified in the order the values are concatenated together during signing. To
84include the HTTP request line in the signature calculation, use the special
85`request-line` value. While this is overloading the definition of `headers` in
86HTTP linguism, the request-line is defined in RFC 2616, and as the outlier from
87headers in useful signature calculation, it is deemed simpler to simply use
88`request-line` than to add a separate parameter for it.
89
90#### extensions
91
92OPTIONAL. The `extensions` parameter is used to include additional information
93which is covered by the request. The content and format of the string is out of
94scope for this document, and expected to be specified by implementors.
95
96#### signature
97
98REQUIRED. The `signature` parameter is a `Base64` encoded digital signature
99generated by the client. The client uses the `algorithm` and `headers` request
100parameters to form a canonicalized `signing string`. This `signing string` is
101then signed with the key associated with `keyId` and the algorithm
102corresponding to `algorithm`. The `signature` parameter is then set to the
103`Base64` encoding of the signature.
104
105### Signing String Composition
106
107In order to generate the string that is signed with a key, the client MUST take
108the values of each HTTP header specified by `headers` in the order they appear.
109
1101. If the header name is not `request-line` then append the lowercased header
111 name followed with an ASCII colon `:` and an ASCII space ` `.
1122. If the header name is `request-line` then appened the HTTP request line,
113 otherwise append the header value.
1143. If value is not the last value then append an ASCII newline `\n`. The string
115 MUST NOT include a trailing ASCII newline.
116
117# Example Requests
118
119All requests refer to the following request (body ommitted):
120
121 POST /foo HTTP/1.1
122 Host: example.org
123 Date: Tue, 07 Jun 2011 20:51:35 GMT
124 Content-Type: application/json
125 Content-MD5: h0auK8hnYJKmHTLhKtMTkQ==
126 Content-Length: 123
127
128The "rsa-key-1" keyId refers to a private key known to the client and a public
129key known to the server. The "hmac-key-1" keyId refers to key known to the
130client and server.
131
132## Default parameterization
133
134The authorization header and signature would be generated as:
135
136 Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",signature="Base64(RSA-SHA256(signing string))"
137
138The client would compose the signing string as:
139
140 date: Tue, 07 Jun 2011 20:51:35 GMT
141
142## Header List
143
144The authorization header and signature would be generated as:
145
146 Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",headers="request-line date content-type content-md5",signature="Base64(RSA-SHA256(signing string))"
147
148The client would compose the signing string as (`+ "\n"` inserted for
149readability):
150
151 POST /foo HTTP/1.1 + "\n"
152 date: Tue, 07 Jun 2011 20:51:35 GMT + "\n"
153 content-type: application/json + "\n"
154 content-md5: h0auK8hnYJKmHTLhKtMTkQ==
155
156## Algorithm
157
158The authorization header and signature would be generated as:
159
160 Authorization: Signature keyId="hmac-key-1",algorithm="hmac-sha1",signature="Base64(HMAC-SHA1(signing string))"
161
162The client would compose the signing string as:
163
164 date: Tue, 07 Jun 2011 20:51:35 GMT
165
166# Signing Algorithms
167
168Currently supported algorithm names are:
169
170* rsa-sha1
171* rsa-sha256
172* rsa-sha512
173* dsa-sha1
174* hmac-sha1
175* hmac-sha256
176* hmac-sha512
177
178# Security Considerations
179
180## Default Parameters
181
182Note the default parameterization of the `Signature` scheme is only safe if all
183requests are carried over a secure transport (i.e., TLS). Sending the default
184scheme over a non-secure transport will leave the request vulnerable to
185spoofing, tampering, replay/repudiaton, and integrity violations (if using the
186STRIDE threat-modeling methodology).
187
188## Insecure Transports
189
190If sending the request over plain HTTP, service providers SHOULD require clients
191to sign ALL HTTP headers, and the `request-line`. Additionally, service
192providers SHOULD require `Content-MD5` calculations to be performed to ensure
193against any tampering from clients.
194
195## Nonces
196
197Nonces are out of scope for this document simply because many service providers
198fail to implement them correctly, or do not adopt security specfiications
199because of the infrastructure complexity. Given the `header` parameterization,
200a service provider is fully enabled to add nonce semantics into this scheme by
201using something like an `x-request-nonce` header, and ensuring it is signed
202with the `Date` header.
203
204## Clock Skew
205
206As the default scheme is to sign the `Date` header, service providers SHOULD
207protect against logged replay attacks by enforcing a clock skew. The server
208SHOULD be synchronized with NTP, and the recommendation in this specification
209is to allow 300s of clock skew (in either direction).
210
211## Required Headers to Sign
212
213It is out of scope for this document to dictate what headers a service provider
214will want to enforce, but service providers SHOULD at minimum include the
215`Date` header.
216
217# References
218
219## Normative References
220
221* [RFC2616] Hypertext Transfer Protocol -- HTTP/1.1
222* [RFC2617] HTTP Authentication: Basic and Digest Access Authentication
223* [RFC5246] The Transport Layer Security (TLS) Protocol Version 1.2
224
225## Informative References
226
227 Name: Mark Cavage (editor)
228 Company: Joyent, Inc.
229 Email: mark.cavage@joyent.com
230 URI: http://www.joyent.com
231
232# Appendix A - Test Values
233
234The following test data uses the RSA (2048b) keys, which we will refer
235to as `keyId=Test` in the following samples:
236
237 -----BEGIN PUBLIC KEY-----
238 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
239 6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
240 Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
241 oYi+1hqp1fIekaxsyQIDAQAB
242 -----END PUBLIC KEY-----
243
244 -----BEGIN RSA PRIVATE KEY-----
245 MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
246 NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
247 UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
248 AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
249 QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
250 kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
251 f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
252 412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
253 mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
254 kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
255 gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
256 G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
257 7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
258 -----END RSA PRIVATE KEY-----
259
260And all examples use this request:
261
262 POST /foo?param=value&pet=dog HTTP/1.1
263 Host: example.com
264 Date: Thu, 05 Jan 2012 21:31:40 GMT
265 Content-Type: application/json
266 Content-MD5: Sd/dVLAcvNLSq16eXua5uQ==
267 Content-Length: 18
268
269 {"hello": "world"}
270
271### Default
272
273The string to sign would be:
274
275 date: Thu, 05 Jan 2012 21:31:40 GMT
276
277The Authorization header would be:
278
279 Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="JldXnt8W9t643M2Sce10gqCh/+E7QIYLiI+bSjnFBGCti7s+mPPvOjVb72sbd1FjeOUwPTDpKbrQQORrm+xBYfAwCxF3LBSSzORvyJ5nRFCFxfJ3nlQD6Kdxhw8wrVZX5nSem4A/W3C8qH5uhFTRwF4ruRjh+ENHWuovPgO/HGQ="
280
281### All Headers
282
283Parameterized to include all headers, the string to sign would be (`+ "\n"`
284inserted for readability):
285
286 POST /foo?param=value&pet=dog HTTP/1.1 + "\n"
287 host: example.com + "\n"
288 date: Thu, 05 Jan 2012 21:31:40 GMT + "\n"
289 content-type: application/json + "\n"
290 content-md5: Sd/dVLAcvNLSq16eXua5uQ== + "\n"
291 content-length: 18
292
293The Authorization header would be:
294
295 Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="request-line host date content-type content-md5 content-length",signature="Gm7W/r+e90REDpWytALMrft4MqZxCmslOTOvwJX17ViEBA5E65QqvWI0vIH3l/vSsGiaMVmuUgzYsJLYMLcm5dGrv1+a+0fCoUdVKPZWHyImQEqpLkopVwqEH67LVECFBqFTAKlQgBn676zrfXQbb+b/VebAsNUtvQMe6cTjnDY="
296
0297
=== added directory 'node_modules/cordova/_vendor/http-signature/0.10.0/lib'
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/lib/index.js'
--- node_modules/cordova/_vendor/http-signature/0.10.0/lib/index.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/lib/index.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,25 @@
1// Copyright 2011 Joyent, Inc. All rights reserved.
2
3var parser = require('./parser');
4var signer = require('./signer');
5var verify = require('./verify');
6var util = require('./util');
7
8
9
10///--- API
11
12module.exports = {
13
14 parse: parser.parseRequest,
15 parseRequest: parser.parseRequest,
16
17 sign: signer.signRequest,
18 signRequest: signer.signRequest,
19
20 sshKeyToPEM: util.sshKeyToPEM,
21 sshKeyFingerprint: util.fingerprint,
22
23 verify: verify.verifySignature,
24 verifySignature: verify.verifySignature
25};
026
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/lib/parser.js'
--- node_modules/cordova/_vendor/http-signature/0.10.0/lib/parser.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/lib/parser.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,304 @@
1// Copyright 2012 Joyent, Inc. All rights reserved.
2
3var assert = require('assert-plus');
4var util = require('util');
5
6
7
8///--- Globals
9
10var Algorithms = {
11 'rsa-sha1': true,
12 'rsa-sha256': true,
13 'rsa-sha512': true,
14 'dsa-sha1': true,
15 'hmac-sha1': true,
16 'hmac-sha256': true,
17 'hmac-sha512': true
18};
19
20var State = {
21 New: 0,
22 Params: 1
23};
24
25var ParamsState = {
26 Name: 0,
27 Quote: 1,
28 Value: 2,
29 Comma: 3
30};
31
32
33
34///--- Specific Errors
35
36function HttpSignatureError(message, caller) {
37 if (Error.captureStackTrace)
38 Error.captureStackTrace(this, caller || HttpSignatureError);
39
40 this.message = message;
41 this.name = caller.name;
42}
43util.inherits(HttpSignatureError, Error);
44
45function ExpiredRequestError(message) {
46 HttpSignatureError.call(this, message, ExpiredRequestError);
47}
48util.inherits(ExpiredRequestError, HttpSignatureError);
49
50
51function InvalidHeaderError(message) {
52 HttpSignatureError.call(this, message, InvalidHeaderError);
53}
54util.inherits(InvalidHeaderError, HttpSignatureError);
55
56
57function InvalidParamsError(message) {
58 HttpSignatureError.call(this, message, InvalidParamsError);
59}
60util.inherits(InvalidParamsError, HttpSignatureError);
61
62
63function MissingHeaderError(message) {
64 HttpSignatureError.call(this, message, MissingHeaderError);
65}
66util.inherits(MissingHeaderError, HttpSignatureError);
67
68
69
70///--- Exported API
71
72module.exports = {
73
74 /**
75 * Parses the 'Authorization' header out of an http.ServerRequest object.
76 *
77 * Note that this API will fully validate the Authorization header, and throw
78 * on any error. It will not however check the signature, or the keyId format
79 * as those are specific to your environment. You can use the options object
80 * to pass in extra constraints.
81 *
82 * As a response object you can expect this:
83 *
84 * {
85 * "scheme": "Signature",
86 * "params": {
87 * "keyId": "foo",
88 * "algorithm": "rsa-sha256",
89 * "headers": [
90 * "date" or "x-date",
91 * "content-md5"
92 * ],
93 * "signature": "base64"
94 * },
95 * "signingString": "ready to be passed to crypto.verify()"
96 * }
97 *
98 * @param {Object} request an http.ServerRequest.
99 * @param {Object} options an optional options object with:
100 * - clockSkew: allowed clock skew in seconds (default 300).
101 * - headers: required header names (def: date or x-date)
102 * - algorithms: algorithms to support (default: all).
103 * @return {Object} parsed out object (see above).
104 * @throws {TypeError} on invalid input.
105 * @throws {InvalidHeaderError} on an invalid Authorization header error.
106 * @throws {InvalidParamsError} if the params in the scheme are invalid.
107 * @throws {MissingHeaderError} if the params indicate a header not present,
108 * either in the request headers from the params,
109 * or not in the params from a required header
110 * in options.
111 * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
112 */
113 parseRequest: function parseRequest(request, options) {
114 assert.object(request, 'request');
115 assert.object(request.headers, 'request.headers');
116 if (options === undefined) {
117 options = {};
118 }
119 if (options.headers === undefined) {
120 options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
121 }
122 assert.object(options, 'options');
123 assert.arrayOfString(options.headers, 'options.headers');
124 assert.optionalNumber(options.clockSkew, 'options.clockSkew');
125
126 if (!request.headers.authorization)
127 throw new MissingHeaderError('no authorization header present in ' +
128 'the request');
129
130 options.clockSkew = options.clockSkew || 300;
131
132
133 var i = 0;
134 var state = State.New;
135 var substate = ParamsState.Name;
136 var tmpName = '';
137 var tmpValue = '';
138
139 var parsed = {
140 scheme: '',
141 params: {},
142 signingString: '',
143
144 get algorithm() {
145 return this.params.algorithm.toUpperCase();
146 },
147
148 get keyId() {
149 return this.params.keyId;
150 }
151
152 };
153
154 var authz = request.headers.authorization;
155 for (i = 0; i < authz.length; i++) {
156 var c = authz.charAt(i);
157
158 switch (Number(state)) {
159
160 case State.New:
161 if (c !== ' ') parsed.scheme += c;
162 else state = State.Params;
163 break;
164
165 case State.Params:
166 switch (Number(substate)) {
167
168 case ParamsState.Name:
169 var code = c.charCodeAt(0);
170 // restricted name of A-Z / a-z
171 if ((code >= 0x41 && code <= 0x5a) || // A-Z
172 (code >= 0x61 && code <= 0x7a)) { // a-z
173 tmpName += c;
174 } else if (c === '=') {
175 if (tmpName.length === 0)
176 throw new InvalidHeaderError('bad param format');
177 substate = ParamsState.Quote;
178 } else {
179 throw new InvalidHeaderError('bad param format');
180 }
181 break;
182
183 case ParamsState.Quote:
184 if (c === '"') {
185 tmpValue = '';
186 substate = ParamsState.Value;
187 } else {
188 throw new InvalidHeaderError('bad param format');
189 }
190 break;
191
192 case ParamsState.Value:
193 if (c === '"') {
194 parsed.params[tmpName] = tmpValue;
195 substate = ParamsState.Comma;
196 } else {
197 tmpValue += c;
198 }
199 break;
200
201 case ParamsState.Comma:
202 if (c === ',') {
203 tmpName = '';
204 substate = ParamsState.Name;
205 } else {
206 throw new InvalidHeaderError('bad param format');
207 }
208 break;
209
210 default:
211 throw new Error('Invalid substate');
212 }
213 break;
214
215 default:
216 throw new Error('Invalid substate');
217 }
218
219 }
220
221 if (!parsed.params.headers || parsed.params.headers === '') {
222 if (request.headers['x-date']) {
223 parsed.params.headers = ['x-date'];
224 } else {
225 parsed.params.headers = ['date'];
226 }
227 } else {
228 parsed.params.headers = parsed.params.headers.split(' ');
229 }
230
231 // Minimally validate the parsed object
232 if (!parsed.scheme || parsed.scheme !== 'Signature')
233 throw new InvalidHeaderError('scheme was not "Signature"');
234
235 if (!parsed.params.keyId)
236 throw new InvalidHeaderError('keyId was not specified');
237
238 if (!parsed.params.algorithm)
239 throw new InvalidHeaderError('algorithm was not specified');
240
241 if (!parsed.params.signature)
242 throw new InvalidHeaderError('signature was not specified');
243
244 // Check the algorithm against the official list
245 parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
246 if (!Algorithms[parsed.params.algorithm])
247 throw new InvalidParamsError(parsed.params.algorithm +
248 ' is not supported');
249
250 // Build the signingString
251 for (i = 0; i < parsed.params.headers.length; i++) {
252 var h = parsed.params.headers[i].toLowerCase();
253 parsed.params.headers[i] = h;
254
255 if (h !== 'request-line') {
256 var value = request.headers[h];
257 if (!value)
258 throw new MissingHeaderError(h + ' was not in the request');
259 parsed.signingString += h + ': ' + value;
260 } else {
261 parsed.signingString +=
262 request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
263 }
264
265 if ((i + 1) < parsed.params.headers.length)
266 parsed.signingString += '\n';
267 }
268
269 // Check against the constraints
270 var date;
271 if (request.headers.date || request.headers['x-date']) {
272 if (request.headers['x-date']) {
273 date = new Date(request.headers['x-date']);
274 } else {
275 date = new Date(request.headers.date);
276 }
277 var now = new Date();
278 var skew = Math.abs(now.getTime() - date.getTime());
279
280 if (skew > options.clockSkew * 1000) {
281 throw new ExpiredRequestError('clock skew of ' +
282 (skew / 1000) +
283 's was greater than ' +
284 options.clockSkew + 's');
285 }
286 }
287
288 options.headers.forEach(function (hdr) {
289 // Remember that we already checked any headers in the params
290 // were in the request, so if this passes we're good.
291 if (parsed.params.headers.indexOf(hdr) < 0)
292 throw new MissingHeaderError(hdr + ' was not a signed header');
293 });
294
295 if (options.algorithms) {
296 if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
297 throw new InvalidParamsError(parsed.params.algorithm +
298 ' is not a supported algorithm');
299 }
300
301 return parsed;
302 }
303
304};
0305
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/lib/signer.js'
--- node_modules/cordova/_vendor/http-signature/0.10.0/lib/signer.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/lib/signer.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,179 @@
1// Copyright 2012 Joyent, Inc. All rights reserved.
2
3var assert = require('assert-plus');
4var crypto = require('crypto');
5var http = require('http');
6
7var sprintf = require('util').format;
8
9
10
11///--- Globals
12
13var Algorithms = {
14 'rsa-sha1': true,
15 'rsa-sha256': true,
16 'rsa-sha512': true,
17 'dsa-sha1': true,
18 'hmac-sha1': true,
19 'hmac-sha256': true,
20 'hmac-sha512': true
21};
22
23var Authorization =
24 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
25
26
27
28///--- Specific Errors
29
30function MissingHeaderError(message) {
31 this.name = 'MissingHeaderError';
32 this.message = message;
33 this.stack = (new Error()).stack;
34}
35MissingHeaderError.prototype = new Error();
36
37
38function InvalidAlgorithmError(message) {
39 this.name = 'InvalidAlgorithmError';
40 this.message = message;
41 this.stack = (new Error()).stack;
42}
43InvalidAlgorithmError.prototype = new Error();
44
45
46
47///--- Internal Functions
48
49function _pad(val) {
50 if (parseInt(val, 10) < 10) {
51 val = '0' + val;
52 }
53 return val;
54}
55
56
57function _rfc1123() {
58 var date = new Date();
59
60 var months = ['Jan',
61 'Feb',
62 'Mar',
63 'Apr',
64 'May',
65 'Jun',
66 'Jul',
67 'Aug',
68 'Sep',
69 'Oct',
70 'Nov',
71 'Dec'];
72 var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
73 return days[date.getUTCDay()] + ', ' +
74 _pad(date.getUTCDate()) + ' ' +
75 months[date.getUTCMonth()] + ' ' +
76 date.getUTCFullYear() + ' ' +
77 _pad(date.getUTCHours()) + ':' +
78 _pad(date.getUTCMinutes()) + ':' +
79 _pad(date.getUTCSeconds()) +
80 ' GMT';
81}
82
83
84
85///--- Exported API
86
87module.exports = {
88
89 /**
90 * Adds an 'Authorization' header to an http.ClientRequest object.
91 *
92 * Note that this API will add a Date header if it's not already set. Any
93 * other headers in the options.headers array MUST be present, or this
94 * will throw.
95 *
96 * You shouldn't need to check the return type; it's just there if you want
97 * to be pedantic.
98 *
99 * @param {Object} request an instance of http.ClientRequest.
100 * @param {Object} options signing parameters object:
101 * - {String} keyId required.
102 * - {String} key required (either a PEM or HMAC key).
103 * - {Array} headers optional; defaults to ['date'].
104 * - {String} algorithm optional; defaults to 'rsa-sha256'.
105 * - {String} httpVersion optional; defaults to '1.1'.
106 * @return {Boolean} true if Authorization (and optionally Date) were added.
107 * @throws {TypeError} on bad parameter types (input).
108 * @throws {InvalidAlgorithmError} if algorithm was bad.
109 * @throws {MissingHeaderError} if a header to be signed was specified but
110 * was not present.
111 */
112 signRequest: function signRequest(request, options) {
113 assert.object(request, 'request');
114 assert.object(options, 'options');
115 assert.optionalString(options.algorithm, 'options.algorithm');
116 assert.string(options.keyId, 'options.keyId');
117 assert.optionalArrayOfString(options.headers, 'options.headers');
118 assert.optionalString(options.httpVersion, 'options.httpVersion');
119
120 if (!request.getHeader('Date'))
121 request.setHeader('Date', _rfc1123());
122 if (!options.headers)
123 options.headers = ['date'];
124 if (!options.algorithm)
125 options.algorithm = 'rsa-sha256';
126 if (!options.httpVersion)
127 options.httpVersion = '1.1';
128
129 options.algorithm = options.algorithm.toLowerCase();
130
131 if (!Algorithms[options.algorithm])
132 throw new InvalidAlgorithmError(options.algorithm + ' is not supported');
133
134 var i;
135 var stringToSign = '';
136 for (i = 0; i < options.headers.length; i++) {
137 if (typeof (options.headers[i]) !== 'string')
138 throw new TypeError('options.headers must be an array of Strings');
139
140 var h = options.headers[i].toLowerCase();
141
142 if (h !== 'request-line') {
143 var value = request.getHeader(h);
144 if (!value) {
145 throw new MissingHeaderError(h + ' was not in the request');
146 }
147 stringToSign += h + ': ' + value;
148 } else {
149 value =
150 stringToSign +=
151 request.method + ' ' + request.path + ' HTTP/' + options.httpVersion;
152 }
153
154 if ((i + 1) < options.headers.length)
155 stringToSign += '\n';
156 }
157
158 var alg = options.algorithm.match(/(hmac|rsa)-(\w+)/);
159 var signature;
160 if (alg[1] === 'hmac') {
161 var hmac = crypto.createHmac(alg[2].toUpperCase(), options.key);
162 hmac.update(stringToSign);
163 signature = hmac.digest('base64');
164 } else {
165 var signer = crypto.createSign(options.algorithm.toUpperCase());
166 signer.update(stringToSign);
167 signature = signer.sign(options.key, 'base64');
168 }
169
170 request.setHeader('Authorization', sprintf(Authorization,
171 options.keyId,
172 options.algorithm,
173 options.headers.join(' '),
174 signature));
175
176 return true;
177 }
178
179};
0180
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/lib/util.js'
--- node_modules/cordova/_vendor/http-signature/0.10.0/lib/util.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/lib/util.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,249 @@
1// Copyright 2012 Joyent, Inc. All rights reserved.
2
3var assert = require('assert-plus');
4var crypto = require('crypto');
5
6var asn1 = require('asn1');
7var ctype = require('ctype');
8
9
10
11///--- Helpers
12
13function readNext(buffer, offset) {
14 var len = ctype.ruint32(buffer, 'big', offset);
15 offset += 4;
16
17 var newOffset = offset + len;
18
19 return {
20 data: buffer.slice(offset, newOffset),
21 offset: newOffset
22 };
23}
24
25
26function writeInt(writer, buffer) {
27 writer.writeByte(0x02); // ASN1.Integer
28 writer.writeLength(buffer.length);
29
30 for (var i = 0; i < buffer.length; i++)
31 writer.writeByte(buffer[i]);
32
33 return writer;
34}
35
36
37function rsaToPEM(key) {
38 var buffer;
39 var der;
40 var exponent;
41 var i;
42 var modulus;
43 var newKey = '';
44 var offset = 0;
45 var type;
46 var tmp;
47
48 try {
49 buffer = new Buffer(key.split(' ')[1], 'base64');
50
51 tmp = readNext(buffer, offset);
52 type = tmp.data.toString();
53 offset = tmp.offset;
54
55 if (type !== 'ssh-rsa')
56 throw new Error('Invalid ssh key type: ' + type);
57
58 tmp = readNext(buffer, offset);
59 exponent = tmp.data;
60 offset = tmp.offset;
61
62 tmp = readNext(buffer, offset);
63 modulus = tmp.data;
64 } catch (e) {
65 throw new Error('Invalid ssh key: ' + key);
66 }
67
68 // DER is a subset of BER
69 der = new asn1.BerWriter();
70
71 der.startSequence();
72
73 der.startSequence();
74 der.writeOID('1.2.840.113549.1.1.1');
75 der.writeNull();
76 der.endSequence();
77
78 der.startSequence(0x03); // bit string
79 der.writeByte(0x00);
80
81 // Actual key
82 der.startSequence();
83 writeInt(der, modulus);
84 writeInt(der, exponent);
85 der.endSequence();
86
87 // bit string
88 der.endSequence();
89
90 der.endSequence();
91
92 tmp = der.buffer.toString('base64');
93 for (i = 0; i < tmp.length; i++) {
94 if ((i % 64) === 0)
95 newKey += '\n';
96 newKey += tmp.charAt(i);
97 }
98
99 if (!/\\n$/.test(newKey))
100 newKey += '\n';
101
102 return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
103}
104
105
106function dsaToPEM(key) {
107 var buffer;
108 var offset = 0;
109 var tmp;
110 var der;
111 var newKey = '';
112
113 var type;
114 var p;
115 var q;
116 var g;
117 var y;
118
119 try {
120 buffer = new Buffer(key.split(' ')[1], 'base64');
121
122 tmp = readNext(buffer, offset);
123 type = tmp.data.toString();
124 offset = tmp.offset;
125
126 /* JSSTYLED */
127 if (!/^ssh-ds[as].*/.test(type))
128 throw new Error('Invalid ssh key type: ' + type);
129
130 tmp = readNext(buffer, offset);
131 p = tmp.data;
132 offset = tmp.offset;
133
134 tmp = readNext(buffer, offset);
135 q = tmp.data;
136 offset = tmp.offset;
137
138 tmp = readNext(buffer, offset);
139 g = tmp.data;
140 offset = tmp.offset;
141
142 tmp = readNext(buffer, offset);
143 y = tmp.data;
144 } catch (e) {
145 console.log(e.stack);
146 throw new Error('Invalid ssh key: ' + key);
147 }
148
149 // DER is a subset of BER
150 der = new asn1.BerWriter();
151
152 der.startSequence();
153
154 der.startSequence();
155 der.writeOID('1.2.840.10040.4.1');
156
157 der.startSequence();
158 writeInt(der, p);
159 writeInt(der, q);
160 writeInt(der, g);
161 der.endSequence();
162
163 der.endSequence();
164
165 der.startSequence(0x03); // bit string
166 der.writeByte(0x00);
167 writeInt(der, y);
168 der.endSequence();
169
170 der.endSequence();
171
172 tmp = der.buffer.toString('base64');
173 for (var i = 0; i < tmp.length; i++) {
174 if ((i % 64) === 0)
175 newKey += '\n';
176 newKey += tmp.charAt(i);
177 }
178
179 if (!/\\n$/.test(newKey))
180 newKey += '\n';
181
182 return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
183}
184
185
186///--- API
187
188module.exports = {
189
190 /**
191 * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
192 *
193 * The intent of this module is to interoperate with OpenSSL only,
194 * specifically the node crypto module's `verify` method.
195 *
196 * @param {String} key an OpenSSH public key.
197 * @return {String} PEM encoded form of the RSA public key.
198 * @throws {TypeError} on bad input.
199 * @throws {Error} on invalid ssh key formatted data.
200 */
201 sshKeyToPEM: function sshKeyToPEM(key) {
202 assert.string(key, 'ssh_key');
203
204 /* JSSTYLED */
205 if (/^ssh-rsa.*/.test(key))
206 return rsaToPEM(key);
207
208 /* JSSTYLED */
209 if (/^ssh-ds[as].*/.test(key))
210 return dsaToPEM(key);
211
212 throw new Error('Only RSA and DSA public keys are allowed');
213 },
214
215
216 /**
217 * Generates an OpenSSH fingerprint from an ssh public key.
218 *
219 * @param {String} key an OpenSSH public key.
220 * @return {String} key fingerprint.
221 * @throws {TypeError} on bad input.
222 * @throws {Error} if what you passed doesn't look like an ssh public key.
223 */
224 fingerprint: function fingerprint(key) {
225 assert.string(key, 'ssh_key');
226
227 var pieces = key.split(' ');
228 if (!pieces || !pieces.length || pieces.length < 2)
229 throw new Error('invalid ssh key');
230
231 var data = new Buffer(pieces[1], 'base64');
232
233 var hash = crypto.createHash('md5');
234 hash.update(data);
235 var digest = hash.digest('hex');
236
237 var fp = '';
238 for (var i = 0; i < digest.length; i++) {
239 if (i && i % 2 === 0)
240 fp += ':';
241
242 fp += digest[i];
243 }
244
245 return fp;
246 }
247
248
249};
0250
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/lib/verify.js'
--- node_modules/cordova/_vendor/http-signature/0.10.0/lib/verify.js 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/lib/verify.js 2014-02-21 20:33:03 +0000
@@ -0,0 +1,42 @@
1// Copyright 2011 Joyent, Inc. All rights reserved.
2
3var assert = require('assert-plus');
4var crypto = require('crypto');
5
6
7
8///--- Exported API
9
10module.exports = {
11
12 /**
13 * Simply wraps up the node crypto operations for you, and returns
14 * true or false. You are expected to pass in an object that was
15 * returned from `parse()`.
16 *
17 * @param {Object} parsedSignature the object you got from `parse`.
18 * @param {String} key either an RSA private key PEM or HMAC secret.
19 * @return {Boolean} true if valid, false otherwise.
20 * @throws {TypeError} if you pass in bad arguments.
21 */
22 verifySignature: function verifySignature(parsedSignature, key) {
23 assert.object(parsedSignature, 'parsedSignature');
24 assert.string(key, 'key');
25
26 var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
27 if (!alg || alg.length !== 3)
28 throw new TypeError('parsedSignature: unsupported algorithm ' +
29 parsedSignature.algorithm);
30
31 if (alg[1] === 'HMAC') {
32 var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
33 hmac.update(parsedSignature.signingString);
34 return (hmac.digest('base64') === parsedSignature.params.signature);
35 } else {
36 var verify = crypto.createVerify(alg[0]);
37 verify.update(parsedSignature.signingString);
38 return verify.verify(key, parsedSignature.params.signature, 'base64');
39 }
40 }
41
42};
043
=== added directory 'node_modules/cordova/_vendor/http-signature/0.10.0/node_modules'
=== added symlink 'node_modules/cordova/_vendor/http-signature/0.10.0/node_modules/asn1'
=== target is u'../_vendor/asn1/0.1.11'
=== added symlink 'node_modules/cordova/_vendor/http-signature/0.10.0/node_modules/assert-plus'
=== target is u'../_vendor/assert-plus/0.1.2'
=== added symlink 'node_modules/cordova/_vendor/http-signature/0.10.0/node_modules/ctype'
=== target is u'../_vendor/ctype/0.5.2'
=== added file 'node_modules/cordova/_vendor/http-signature/0.10.0/package.json'
--- node_modules/cordova/_vendor/http-signature/0.10.0/package.json 1970-01-01 00:00:00 +0000
+++ node_modules/cordova/_vendor/http-signature/0.10.0/package.json 2014-02-21 20:33:03 +0000
@@ -0,0 +1,35 @@
1{
2 "author": {
3 "name": "Joyent, Inc"
4 },
5 "name": "http-signature",
6 "description": "Reference implementation of Joyent's HTTP Signature Scheme",
7 "version": "0.10.0",
8 "repository": {
9 "type": "git",
10 "url": "git://github.com/joyent/node-http-signature.git"
11 },
12 "engines": {
13 "node": ">=0.8"
14 },
15 "main": "lib/index.js",
16 "scripts": {
17 "test": "./node_modules/.bin/tap tst/*.js"
18 },
19 "dependencies": {
20 "assert-plus": "0.1.2",
21 "asn1": "0.1.11",
22 "ctype": "0.5.2"
23 },
24 "devDependencies": {
25 "node-uuid": "1.4.0",
26 "tap": "0.4.2"
27 },
28 "readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actaully want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var key = fs.readFileSync('./key.pem', 'ascii');\n\n var options = {\n host: 'localhost',\n port: 8443,\n path: '/',\n method: 'GET',\n headers: {}\n };\n\n // Adds a 'Date' header in, signs it, and adds the\n // 'Authorization' header in.\n var req = https.request(options, function(res) {\n console.log(res.statusCode);\n });\n\n\n httpSignature.sign(req, {\n key: key,\n keyId: './cert.pem'\n });\n\n req.end();\n\n### Server\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var options = {\n key: fs.readFileSync('./key.pem'),\n cert: fs.readFileSync('./cert.pem')\n };\n\n https.createServer(options, function (req, res) {\n var rc = 200;\n var parsed = httpSignature.parseRequest(req);\n var pub = fs.readFileSync(parsed.keyId, 'ascii');\n if (!httpSignature.verifySignature(parsed, pub))\n rc = 401;\n\n res.writeHead(rc);\n res.end();\n }).listen(8443);\n\n## Installation\n\n npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n",
29 "readmeFilename": "README.md",
30 "bugs": {
31 "url": "https://github.com/joyent/node-http-signature/issues"
32 },
33 "_id": "http-signature@0.10.0",
34 "_from": "http-signature@~0.10.0"
35}
036
=== removed directory 'node_modules/cordova/_vendor/keypress'
=== removed directory 'node_modules/cordova/_vendor/keypress/0.1.0'
=== removed file 'node_modules/cordova/_vendor/keypress/0.1.0/README.md'
--- node_modules/cordova/_vendor/keypress/0.1.0/README.md 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/keypress/0.1.0/README.md 1970-01-01 00:00:00 +0000
@@ -1,101 +0,0 @@
1keypress
2========
3### Make any Node ReadableStream emit "keypress" events
4
5
6Previous to Node `v0.8.x`, there was an undocumented `"keypress"` event that
7`process.stdin` would emit when it was a TTY. Some people discovered this hidden
8gem, and started using it in their own code.
9
10Now in Node `v0.8.x`, this `"keypress"` event does not get emitted by default,
11but rather only when it is being used in conjuction with the `readline` (or by
12extension, the `repl`) module.
13
14This module is the exact logic from the node `v0.8.x` releases ripped out into its
15own module.
16
17__Bonus:__ Now with mouse support!
18
19Installation
20------------
21
22Install with `npm`:
23
24``` bash
25$ npm install keypress
26```
27
28Or add it to the `"dependencies"` section of your _package.json_ file.
29
30
31Example
32-------
33
34#### Listening for "keypress" events
35
36``` js
37var keypress = require('keypress');
38
39// make `process.stdin` begin emitting "keypress" events
40keypress(process.stdin);
41
42// listen for the "keypress" event
43process.stdin.on('keypress', function (ch, key) {
44 console.log('got "keypress"', key);
45 if (key && key.ctrl && key.name == 'c') {
46 process.stdin.pause();
47 }
48});
49
50process.stdin.setRawMode(true);
51process.stdin.resume();
52```
53
54#### Listening for "mousepress" events
55
56``` js
57var keypress = require('keypress');
58
59// make `process.stdin` begin emitting "mousepress" (and "keypress") events
60keypress(process.stdin);
61
62// you must enable the mouse events before they will begin firing
63keypress.enableMouse(process.stdout);
64
65process.stdin.on('mousepress', function (info) {
66 console.log('got "mousepress" event at %d x %d', info.x, info.y);
67});
68
69process.on('exit', function () {
70 // disable mouse on exit, so that the state
71 // is back to normal for the terminal
72 keypress.disableMouse(process.stdout);
73});
74```
75
76
77License
78-------
79
80(The MIT License)
81
82Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
83
84Permission is hereby granted, free of charge, to any person obtaining
85a copy of this software and associated documentation files (the
86'Software'), to deal in the Software without restriction, including
87without limitation the rights to use, copy, modify, merge, publish,
88distribute, sublicense, and/or sell copies of the Software, and to
89permit persons to whom the Software is furnished to do so, subject to
90the following conditions:
91
92The above copyright notice and this permission notice shall be
93included in all copies or substantial portions of the Software.
94
95THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
96EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
97MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
98IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
99CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
100TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
101SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1020
=== removed symlink 'node_modules/cordova/_vendor/keypress/0.1.0/_vendor'
=== target was u'../..'
=== removed file 'node_modules/cordova/_vendor/keypress/0.1.0/index.js'
--- node_modules/cordova/_vendor/keypress/0.1.0/index.js 2013-12-12 20:49:30 +0000
+++ node_modules/cordova/_vendor/keypress/0.1.0/index.js 1970-01-01 00:00:00 +0000
@@ -1,346 +0,0 @@
1
2/**
3 * This module offers the internal "keypress" functionality from node-core's
4 * `readline` module, for your own programs and modules to use.
5 *
6 * Usage:
7 *
8 * require('keypress')(process.stdin);
9 *
10 * process.stdin.on('keypress', function (ch, key) {
11 * console.log(ch, key);
12 * if (key.ctrl && key.name == 'c') {
13 * process.stdin.pause();
14 * }
15 * });
16 * proces.stdin.resume();
17 */
18var exports = module.exports = keypress;
19
20exports.enableMouse = function (stream) {
21 stream.write('\x1b' +'[?1000h')
22}
23
24exports.disableMouse = function (stream) {
25 stream.write('\x1b' +'[?1000l')
26}
27
28
29/**
30 * accepts a readable Stream instance and makes it emit "keypress" events
31 */
32
33function keypress(stream) {
34 if (isEmittingKeypress(stream)) return;
35 stream._emitKeypress = true;
36
37 function onData(b) {
38 if (stream.listeners('keypress').length > 0) {
39 emitKey(stream, b);
40 } else {
41 // Nobody's watching anyway
42 stream.removeListener('data', onData);
43 stream.on('newListener', onNewListener);
44 }
45 }
46
47 function onNewListener(event) {
48 if (event == 'keypress') {
49 stream.on('data', onData);
50 stream.removeListener('newListener', onNewListener);
51 }
52 }
53
54 if (stream.listeners('keypress').length > 0) {
55 stream.on('data', onData);
56 } else {
57 stream.on('newListener', onNewListener);
58 }
59}
60
61/**
62 * Returns `true` if the stream is already emitting "keypress" events.
63 * `false` otherwise.
64 */
65
66function isEmittingKeypress(stream) {
67 var rtn = stream._emitKeypress;
68 if (!rtn) {
69 // hack: check for the v0.6.x "data" event
70 stream.listeners('data').forEach(function (l) {
71 if (l.name == 'onData' && /emitKey/.test(l.toString())) {
72 rtn = true;
73 stream._emitKeypress = true;
74 }
75 });
76 }
77 if (!rtn) {
78 // hack: check for the v0.6.x "newListener" event
79 stream.listeners('newListener').forEach(function (l) {
80 if (l.name == 'onNewListener' && /keypress/.test(l.toString())) {
81 rtn = true;
82 stream._emitKeypress = true;
83 }
84 });
85 }
86 return rtn;
87}
88
89
90/*
91 Some patterns seen in terminal key escape codes, derived from combos seen
92 at http://www.midnight-commander.org/browser/lib/tty/key.c
93
94 ESC letter
95 ESC [ letter
96 ESC [ modifier letter
97 ESC [ 1 ; modifier letter
98 ESC [ num char
99 ESC [ num ; modifier char
100 ESC O letter
101 ESC O modifier letter
102 ESC O 1 ; modifier letter
103 ESC N letter
104 ESC [ [ num ; modifier char
105 ESC [ [ 1 ; modifier letter
106 ESC ESC [ num char
107 ESC ESC O letter
108
109 - char is usually ~ but $ and ^ also happen with rxvt
110 - modifier is 1 +
111 (shift * 1) +
112 (left_alt * 2) +
113 (ctrl * 4) +
114 (right_alt * 8)
115 - two leading ESCs apparently mean the same as one leading ESC
116*/
117
118// Regexes used for ansi escape code splitting
119var metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/;
120var functionKeyCodeRe =
121 /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;
122
123function emitKey(stream, s) {
124 var ch,
125 key = {
126 name: undefined,
127 ctrl: false,
128 meta: false,
129 shift: false
130 },
131 parts;
132
133 if (Buffer.isBuffer(s)) {
134 if (s[0] > 127 && s[1] === undefined) {
135 s[0] -= 128;
136 s = '\x1b' + s.toString(stream.encoding || 'utf-8');
137 } else {
138 s = s.toString(stream.encoding || 'utf-8');
139 }
140 }
141
142 key.sequence = s;
143
144 if (s === '\r' || s === '\n') {
145 // enter
146 key.name = 'enter';
147
148 } else if (s === '\t') {
149 // tab
150 key.name = 'tab';
151
152 } else if (s === '\b' || s === '\x7f' ||
153 s === '\x1b\x7f' || s === '\x1b\b') {
154 // backspace or ctrl+h
155 key.name = 'backspace';
156 key.meta = (s.charAt(0) === '\x1b');
157
158 } else if (s === '\x1b' || s === '\x1b\x1b') {
159 // escape key
160 key.name = 'escape';
161 key.meta = (s.length === 2);
162
163 } else if (s === ' ' || s === '\x1b ') {
164 key.name = 'space';
165 key.meta = (s.length === 2);
166
167 } else if (s <= '\x1a') {
168 // ctrl+letter
169 key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1);
170 key.ctrl = true;
171
172 } else if (s.length === 1 && s >= 'a' && s <= 'z') {
173 // lowercase letter
174 key.name = s;
175
176 } else if (s.length === 1 && s >= 'A' && s <= 'Z') {
177 // shift+letter
178 key.name = s.toLowerCase();
179 key.shift = true;
180
181 } else if (parts = metaKeyCodeRe.exec(s)) {
182 // meta+character key
183 key.name = parts[1].toLowerCase();
184 key.meta = true;
185 key.shift = /^[A-Z]$/.test(parts[1]);
186
187 } else if (parts = functionKeyCodeRe.exec(s)) {
188 // ansi escape sequence
189
190 // reassemble the key code leaving out leading \x1b's,
191 // the modifier key bitflag and any meaningless "1;" sequence
192 var code = (parts[1] || '') + (parts[2] || '') +
193 (parts[4] || '') + (parts[6] || ''),
194 modifier = (parts[3] || parts[5] || 1) - 1;
195
196 // Parse the key modifier
197 key.ctrl = !!(modifier & 4);
198 key.meta = !!(modifier & 10);
199 key.shift = !!(modifier & 1);
200 key.code = code;
201
202 // Parse the key itself
203 switch (code) {
204 /* xterm/gnome ESC O letter */
205 case 'OP': key.name = 'f1'; break;
206 case 'OQ': key.name = 'f2'; break;
207 case 'OR': key.name = 'f3'; break;
208 case 'OS': key.name = 'f4'; break;
209
210 /* xterm/rxvt ESC [ number ~ */
211 case '[11~': key.name = 'f1'; break;
212 case '[12~': key.name = 'f2'; break;
213 case '[13~': key.name = 'f3'; break;
214 case '[14~': key.name = 'f4'; break;
215
216 /* from Cygwin and used in libuv */
217 case '[[A': key.name = 'f1'; break;
218 case '[[B': key.name = 'f2'; break;
219 case '[[C': key.name = 'f3'; break;
220 case '[[D': key.name = 'f4'; break;
221 case '[[E': key.name = 'f5'; break;
222
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches