embeditor-rails 1.1.1 → 2.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1029) hide show
  1. data/README.md +25 -17
  2. data/app/assets/javascripts/embeditor/adapter.js.coffee +21 -2
  3. data/app/assets/javascripts/embeditor/adapters/embedly.js.coffee +4 -40
  4. data/app/assets/javascripts/embeditor/adapters/oembed.js.coffee +37 -2
  5. data/app/assets/javascripts/embeditor/embeditor.js.coffee +16 -4
  6. data/lib/embeditor-rails/version.rb +1 -1
  7. data/lib/node_modules/npm/AUTHORS +158 -0
  8. data/lib/node_modules/npm/CONTRIBUTING.md +9 -0
  9. data/lib/node_modules/npm/LICENSE +235 -0
  10. data/lib/node_modules/npm/Makefile +216 -0
  11. data/lib/node_modules/npm/README.md +241 -0
  12. data/lib/node_modules/npm/bin/node-gyp-bin/node-gyp +2 -0
  13. data/lib/node_modules/npm/bin/node-gyp-bin/node-gyp.cmd +1 -0
  14. data/lib/node_modules/npm/bin/npm +13 -0
  15. data/lib/node_modules/npm/bin/npm-cli.js +87 -0
  16. data/lib/node_modules/npm/bin/npm.cmd +6 -0
  17. data/lib/node_modules/npm/bin/read-package-json.js +22 -0
  18. data/lib/node_modules/npm/cli.js +2 -0
  19. data/lib/node_modules/npm/configure +33 -0
  20. data/lib/node_modules/npm/doc/api/npm-bin.md +13 -0
  21. data/lib/node_modules/npm/doc/api/npm-bugs.md +19 -0
  22. data/lib/node_modules/npm/doc/api/npm-commands.md +22 -0
  23. data/lib/node_modules/npm/doc/api/npm-config.md +45 -0
  24. data/lib/node_modules/npm/doc/api/npm-deprecate.md +34 -0
  25. data/lib/node_modules/npm/doc/api/npm-docs.md +19 -0
  26. data/lib/node_modules/npm/doc/api/npm-edit.md +24 -0
  27. data/lib/node_modules/npm/doc/api/npm-explore.md +18 -0
  28. data/lib/node_modules/npm/doc/api/npm-help-search.md +30 -0
  29. data/lib/node_modules/npm/doc/api/npm-init.md +29 -0
  30. data/lib/node_modules/npm/doc/api/npm-install.md +19 -0
  31. data/lib/node_modules/npm/doc/api/npm-link.md +33 -0
  32. data/lib/node_modules/npm/doc/api/npm-load.md +26 -0
  33. data/lib/node_modules/npm/doc/api/npm-ls.md +56 -0
  34. data/lib/node_modules/npm/doc/api/npm-outdated.md +13 -0
  35. data/lib/node_modules/npm/doc/api/npm-owner.md +31 -0
  36. data/lib/node_modules/npm/doc/api/npm-pack.md +19 -0
  37. data/lib/node_modules/npm/doc/api/npm-prefix.md +15 -0
  38. data/lib/node_modules/npm/doc/api/npm-prune.md +17 -0
  39. data/lib/node_modules/npm/doc/api/npm-publish.md +30 -0
  40. data/lib/node_modules/npm/doc/api/npm-rebuild.md +16 -0
  41. data/lib/node_modules/npm/doc/api/npm-repo.md +19 -0
  42. data/lib/node_modules/npm/doc/api/npm-restart.md +22 -0
  43. data/lib/node_modules/npm/doc/api/npm-root.md +15 -0
  44. data/lib/node_modules/npm/doc/api/npm-run-script.md +27 -0
  45. data/lib/node_modules/npm/doc/api/npm-search.md +35 -0
  46. data/lib/node_modules/npm/doc/api/npm-shrinkwrap.md +20 -0
  47. data/lib/node_modules/npm/doc/api/npm-start.md +13 -0
  48. data/lib/node_modules/npm/doc/api/npm-stop.md +13 -0
  49. data/lib/node_modules/npm/doc/api/npm-submodule.md +28 -0
  50. data/lib/node_modules/npm/doc/api/npm-tag.md +23 -0
  51. data/lib/node_modules/npm/doc/api/npm-test.md +16 -0
  52. data/lib/node_modules/npm/doc/api/npm-uninstall.md +16 -0
  53. data/lib/node_modules/npm/doc/api/npm-unpublish.md +20 -0
  54. data/lib/node_modules/npm/doc/api/npm-update.md +11 -0
  55. data/lib/node_modules/npm/doc/api/npm-version.md +18 -0
  56. data/lib/node_modules/npm/doc/api/npm-view.md +93 -0
  57. data/lib/node_modules/npm/doc/api/npm-whoami.md +15 -0
  58. data/lib/node_modules/npm/doc/api/npm.md +116 -0
  59. data/lib/node_modules/npm/doc/cli/npm-adduser.md +38 -0
  60. data/lib/node_modules/npm/doc/cli/npm-bin.md +19 -0
  61. data/lib/node_modules/npm/doc/cli/npm-bugs.md +42 -0
  62. data/lib/node_modules/npm/doc/cli/npm-build.md +22 -0
  63. data/lib/node_modules/npm/doc/cli/npm-bundle.md +14 -0
  64. data/lib/node_modules/npm/doc/cli/npm-cache.md +72 -0
  65. data/lib/node_modules/npm/doc/cli/npm-completion.md +29 -0
  66. data/lib/node_modules/npm/doc/cli/npm-config.md +71 -0
  67. data/lib/node_modules/npm/doc/cli/npm-dedupe.md +58 -0
  68. data/lib/node_modules/npm/doc/cli/npm-deprecate.md +26 -0
  69. data/lib/node_modules/npm/doc/cli/npm-docs.md +44 -0
  70. data/lib/node_modules/npm/doc/cli/npm-edit.md +37 -0
  71. data/lib/node_modules/npm/doc/cli/npm-explore.md +40 -0
  72. data/lib/node_modules/npm/doc/cli/npm-help-search.md +35 -0
  73. data/lib/node_modules/npm/doc/cli/npm-help.md +40 -0
  74. data/lib/node_modules/npm/doc/cli/npm-init.md +25 -0
  75. data/lib/node_modules/npm/doc/cli/npm-install.md +252 -0
  76. data/lib/node_modules/npm/doc/cli/npm-link.md +63 -0
  77. data/lib/node_modules/npm/doc/cli/npm-ls.md +80 -0
  78. data/lib/node_modules/npm/doc/cli/npm-outdated.md +58 -0
  79. data/lib/node_modules/npm/doc/cli/npm-owner.md +33 -0
  80. data/lib/node_modules/npm/doc/cli/npm-pack.md +27 -0
  81. data/lib/node_modules/npm/doc/cli/npm-prefix.md +19 -0
  82. data/lib/node_modules/npm/doc/cli/npm-prune.md +25 -0
  83. data/lib/node_modules/npm/doc/cli/npm-publish.md +30 -0
  84. data/lib/node_modules/npm/doc/cli/npm-rebuild.md +21 -0
  85. data/lib/node_modules/npm/doc/cli/npm-repo.md +28 -0
  86. data/lib/node_modules/npm/doc/cli/npm-restart.md +22 -0
  87. data/lib/node_modules/npm/doc/cli/npm-rm.md +23 -0
  88. data/lib/node_modules/npm/doc/cli/npm-root.md +19 -0
  89. data/lib/node_modules/npm/doc/cli/npm-run-script.md +21 -0
  90. data/lib/node_modules/npm/doc/cli/npm-search.md +36 -0
  91. data/lib/node_modules/npm/doc/cli/npm-shrinkwrap.md +185 -0
  92. data/lib/node_modules/npm/doc/cli/npm-star.md +22 -0
  93. data/lib/node_modules/npm/doc/cli/npm-stars.md +22 -0
  94. data/lib/node_modules/npm/doc/cli/npm-start.md +18 -0
  95. data/lib/node_modules/npm/doc/cli/npm-stop.md +18 -0
  96. data/lib/node_modules/npm/doc/cli/npm-submodule.md +28 -0
  97. data/lib/node_modules/npm/doc/cli/npm-tag.md +34 -0
  98. data/lib/node_modules/npm/doc/cli/npm-test.md +22 -0
  99. data/lib/node_modules/npm/doc/cli/npm-uninstall.md +21 -0
  100. data/lib/node_modules/npm/doc/cli/npm-unpublish.md +32 -0
  101. data/lib/node_modules/npm/doc/cli/npm-update.md +24 -0
  102. data/lib/node_modules/npm/doc/cli/npm-version.md +45 -0
  103. data/lib/node_modules/npm/doc/cli/npm-view.md +90 -0
  104. data/lib/node_modules/npm/doc/cli/npm-whoami.md +17 -0
  105. data/lib/node_modules/npm/doc/cli/npm.md +153 -0
  106. data/lib/node_modules/npm/doc/files/npm-folders.md +211 -0
  107. data/lib/node_modules/npm/doc/files/npmrc.md +59 -0
  108. data/lib/node_modules/npm/doc/files/package.json.md +576 -0
  109. data/lib/node_modules/npm/doc/misc/npm-coding-style.md +181 -0
  110. data/lib/node_modules/npm/doc/misc/npm-config.md +820 -0
  111. data/lib/node_modules/npm/doc/misc/npm-developers.md +207 -0
  112. data/lib/node_modules/npm/doc/misc/npm-disputes.md +99 -0
  113. data/lib/node_modules/npm/doc/misc/npm-faq.md +364 -0
  114. data/lib/node_modules/npm/doc/misc/npm-index.md +411 -0
  115. data/lib/node_modules/npm/doc/misc/npm-registry.md +69 -0
  116. data/lib/node_modules/npm/doc/misc/npm-scripts.md +245 -0
  117. data/lib/node_modules/npm/doc/misc/removing-npm.md +54 -0
  118. data/lib/node_modules/npm/doc/misc/semver.md +111 -0
  119. data/lib/node_modules/npm/html/doc/README.html +276 -0
  120. data/lib/node_modules/npm/html/doc/api/npm-bin.html +53 -0
  121. data/lib/node_modules/npm/html/doc/api/npm-bugs.html +59 -0
  122. data/lib/node_modules/npm/html/doc/api/npm-commands.html +62 -0
  123. data/lib/node_modules/npm/html/doc/api/npm-config.html +67 -0
  124. data/lib/node_modules/npm/html/doc/api/npm-deprecate.html +66 -0
  125. data/lib/node_modules/npm/html/doc/api/npm-docs.html +59 -0
  126. data/lib/node_modules/npm/html/doc/api/npm-edit.html +64 -0
  127. data/lib/node_modules/npm/html/doc/api/npm-explore.html +58 -0
  128. data/lib/node_modules/npm/html/doc/api/npm-help-search.html +66 -0
  129. data/lib/node_modules/npm/html/doc/api/npm-init.html +69 -0
  130. data/lib/node_modules/npm/html/doc/api/npm-install.html +59 -0
  131. data/lib/node_modules/npm/html/doc/api/npm-link.html +73 -0
  132. data/lib/node_modules/npm/html/doc/api/npm-load.html +66 -0
  133. data/lib/node_modules/npm/html/doc/api/npm-ls.html +93 -0
  134. data/lib/node_modules/npm/html/doc/api/npm-outdated.html +53 -0
  135. data/lib/node_modules/npm/html/doc/api/npm-owner.html +68 -0
  136. data/lib/node_modules/npm/html/doc/api/npm-pack.html +59 -0
  137. data/lib/node_modules/npm/html/doc/api/npm-prefix.html +55 -0
  138. data/lib/node_modules/npm/html/doc/api/npm-prune.html +57 -0
  139. data/lib/node_modules/npm/html/doc/api/npm-publish.html +66 -0
  140. data/lib/node_modules/npm/html/doc/api/npm-rebuild.html +56 -0
  141. data/lib/node_modules/npm/html/doc/api/npm-repo.html +59 -0
  142. data/lib/node_modules/npm/html/doc/api/npm-restart.html +61 -0
  143. data/lib/node_modules/npm/html/doc/api/npm-root.html +55 -0
  144. data/lib/node_modules/npm/html/doc/api/npm-run-script.html +63 -0
  145. data/lib/node_modules/npm/html/doc/api/npm-search.html +66 -0
  146. data/lib/node_modules/npm/html/doc/api/npm-shrinkwrap.html +60 -0
  147. data/lib/node_modules/npm/html/doc/api/npm-start.html +53 -0
  148. data/lib/node_modules/npm/html/doc/api/npm-stop.html +53 -0
  149. data/lib/node_modules/npm/html/doc/api/npm-submodule.html +67 -0
  150. data/lib/node_modules/npm/html/doc/api/npm-tag.html +63 -0
  151. data/lib/node_modules/npm/html/doc/api/npm-test.html +56 -0
  152. data/lib/node_modules/npm/html/doc/api/npm-uninstall.html +56 -0
  153. data/lib/node_modules/npm/html/doc/api/npm-unpublish.html +60 -0
  154. data/lib/node_modules/npm/html/doc/api/npm-update.html +52 -0
  155. data/lib/node_modules/npm/html/doc/api/npm-version.html +58 -0
  156. data/lib/node_modules/npm/html/doc/api/npm-view.html +133 -0
  157. data/lib/node_modules/npm/html/doc/api/npm-whoami.html +55 -0
  158. data/lib/node_modules/npm/html/doc/api/npm.html +126 -0
  159. data/lib/node_modules/npm/html/doc/cli/npm-adduser.html +73 -0
  160. data/lib/node_modules/npm/html/doc/cli/npm-bin.html +54 -0
  161. data/lib/node_modules/npm/html/doc/cli/npm-bugs.html +72 -0
  162. data/lib/node_modules/npm/html/doc/cli/npm-build.html +59 -0
  163. data/lib/node_modules/npm/html/doc/cli/npm-bundle.html +54 -0
  164. data/lib/node_modules/npm/html/doc/cli/npm-cache.html +100 -0
  165. data/lib/node_modules/npm/html/doc/cli/npm-completion.html +67 -0
  166. data/lib/node_modules/npm/html/doc/cli/npm-config.html +107 -0
  167. data/lib/node_modules/npm/html/doc/cli/npm-dedupe.html +96 -0
  168. data/lib/node_modules/npm/html/doc/cli/npm-deprecate.html +65 -0
  169. data/lib/node_modules/npm/html/doc/cli/npm-docs.html +75 -0
  170. data/lib/node_modules/npm/html/doc/cli/npm-edit.html +71 -0
  171. data/lib/node_modules/npm/html/doc/cli/npm-explore.html +74 -0
  172. data/lib/node_modules/npm/html/doc/cli/npm-help-search.html +72 -0
  173. data/lib/node_modules/npm/html/doc/cli/npm-help.html +70 -0
  174. data/lib/node_modules/npm/html/doc/cli/npm-init.html +63 -0
  175. data/lib/node_modules/npm/html/doc/cli/npm-install.html +183 -0
  176. data/lib/node_modules/npm/html/doc/cli/npm-link.html +96 -0
  177. data/lib/node_modules/npm/html/doc/cli/npm-ls.html +108 -0
  178. data/lib/node_modules/npm/html/doc/cli/npm-outdated.html +92 -0
  179. data/lib/node_modules/npm/html/doc/cli/npm-owner.html +68 -0
  180. data/lib/node_modules/npm/html/doc/cli/npm-pack.html +63 -0
  181. data/lib/node_modules/npm/html/doc/cli/npm-prefix.html +54 -0
  182. data/lib/node_modules/npm/html/doc/cli/npm-prune.html +63 -0
  183. data/lib/node_modules/npm/html/doc/cli/npm-publish.html +63 -0
  184. data/lib/node_modules/npm/html/doc/cli/npm-rebuild.html +60 -0
  185. data/lib/node_modules/npm/html/doc/cli/npm-repo.html +66 -0
  186. data/lib/node_modules/npm/html/doc/cli/npm-restart.html +58 -0
  187. data/lib/node_modules/npm/html/doc/cli/npm-rm.html +58 -0
  188. data/lib/node_modules/npm/html/doc/cli/npm-root.html +54 -0
  189. data/lib/node_modules/npm/html/doc/cli/npm-run-script.html +57 -0
  190. data/lib/node_modules/npm/html/doc/cli/npm-search.html +71 -0
  191. data/lib/node_modules/npm/html/doc/cli/npm-shrinkwrap.html +217 -0
  192. data/lib/node_modules/npm/html/doc/cli/npm-star.html +60 -0
  193. data/lib/node_modules/npm/html/doc/cli/npm-stars.html +59 -0
  194. data/lib/node_modules/npm/html/doc/cli/npm-start.html +54 -0
  195. data/lib/node_modules/npm/html/doc/cli/npm-stop.html +54 -0
  196. data/lib/node_modules/npm/html/doc/cli/npm-submodule.html +67 -0
  197. data/lib/node_modules/npm/html/doc/cli/npm-tag.html +68 -0
  198. data/lib/node_modules/npm/html/doc/cli/npm-test.html +58 -0
  199. data/lib/node_modules/npm/html/doc/cli/npm-uninstall.html +56 -0
  200. data/lib/node_modules/npm/html/doc/cli/npm-unpublish.html +68 -0
  201. data/lib/node_modules/npm/html/doc/cli/npm-update.html +60 -0
  202. data/lib/node_modules/npm/html/doc/cli/npm-version.html +83 -0
  203. data/lib/node_modules/npm/html/doc/cli/npm-view.html +125 -0
  204. data/lib/node_modules/npm/html/doc/cli/npm-whoami.html +54 -0
  205. data/lib/node_modules/npm/html/doc/cli/npm.html +165 -0
  206. data/lib/node_modules/npm/html/doc/files/npm-folders.html +239 -0
  207. data/lib/node_modules/npm/html/doc/files/npm-global.html +239 -0
  208. data/lib/node_modules/npm/html/doc/files/npm-json.html +580 -0
  209. data/lib/node_modules/npm/html/doc/files/npmrc.html +93 -0
  210. data/lib/node_modules/npm/html/doc/files/package.json.html +580 -0
  211. data/lib/node_modules/npm/html/doc/index.html +450 -0
  212. data/lib/node_modules/npm/html/doc/misc/npm-coding-style.html +216 -0
  213. data/lib/node_modules/npm/html/doc/misc/npm-config.html +744 -0
  214. data/lib/node_modules/npm/html/doc/misc/npm-developers.html +208 -0
  215. data/lib/node_modules/npm/html/doc/misc/npm-disputes.html +126 -0
  216. data/lib/node_modules/npm/html/doc/misc/npm-faq.html +382 -0
  217. data/lib/node_modules/npm/html/doc/misc/npm-index.html +450 -0
  218. data/lib/node_modules/npm/html/doc/misc/npm-registry.html +105 -0
  219. data/lib/node_modules/npm/html/doc/misc/npm-scripts.html +257 -0
  220. data/lib/node_modules/npm/html/doc/misc/removing-npm.html +92 -0
  221. data/lib/node_modules/npm/html/doc/misc/semver.html +128 -0
  222. data/lib/node_modules/npm/html/docfoot-script.html +31 -0
  223. data/lib/node_modules/npm/html/docfoot.html +2 -0
  224. data/lib/node_modules/npm/html/dochead.html +8 -0
  225. data/lib/node_modules/npm/html/favicon.ico +0 -0
  226. data/lib/node_modules/npm/html/index.html +95 -0
  227. data/lib/node_modules/npm/html/static/style.css +329 -0
  228. data/lib/node_modules/npm/lib/adduser.js +138 -0
  229. data/lib/node_modules/npm/lib/bin.js +18 -0
  230. data/lib/node_modules/npm/lib/bugs.js +61 -0
  231. data/lib/node_modules/npm/lib/build.js +228 -0
  232. data/lib/node_modules/npm/lib/cache.js +1318 -0
  233. data/lib/node_modules/npm/lib/completion.js +253 -0
  234. data/lib/node_modules/npm/lib/config.js +285 -0
  235. data/lib/node_modules/npm/lib/dedupe.js +357 -0
  236. data/lib/node_modules/npm/lib/deprecate.js +47 -0
  237. data/lib/node_modules/npm/lib/docs.js +62 -0
  238. data/lib/node_modules/npm/lib/edit.js +32 -0
  239. data/lib/node_modules/npm/lib/explore.js +36 -0
  240. data/lib/node_modules/npm/lib/faq.js +8 -0
  241. data/lib/node_modules/npm/lib/get.js +12 -0
  242. data/lib/node_modules/npm/lib/help-search.js +218 -0
  243. data/lib/node_modules/npm/lib/help.js +231 -0
  244. data/lib/node_modules/npm/lib/init.js +36 -0
  245. data/lib/node_modules/npm/lib/install.js +979 -0
  246. data/lib/node_modules/npm/lib/link.js +173 -0
  247. data/lib/node_modules/npm/lib/ls.js +357 -0
  248. data/lib/node_modules/npm/lib/npm.js +528 -0
  249. data/lib/node_modules/npm/lib/outdated.js +303 -0
  250. data/lib/node_modules/npm/lib/owner.js +205 -0
  251. data/lib/node_modules/npm/lib/pack.js +65 -0
  252. data/lib/node_modules/npm/lib/prefix.js +11 -0
  253. data/lib/node_modules/npm/lib/prune.js +53 -0
  254. data/lib/node_modules/npm/lib/publish.js +118 -0
  255. data/lib/node_modules/npm/lib/rebuild.js +75 -0
  256. data/lib/node_modules/npm/lib/repo.js +54 -0
  257. data/lib/node_modules/npm/lib/restart.js +1 -0
  258. data/lib/node_modules/npm/lib/root.js +11 -0
  259. data/lib/node_modules/npm/lib/run-script.js +102 -0
  260. data/lib/node_modules/npm/lib/search.js +265 -0
  261. data/lib/node_modules/npm/lib/set.js +13 -0
  262. data/lib/node_modules/npm/lib/shrinkwrap.js +86 -0
  263. data/lib/node_modules/npm/lib/star.js +33 -0
  264. data/lib/node_modules/npm/lib/stars.js +27 -0
  265. data/lib/node_modules/npm/lib/start.js +1 -0
  266. data/lib/node_modules/npm/lib/stop.js +1 -0
  267. data/lib/node_modules/npm/lib/submodule.js +119 -0
  268. data/lib/node_modules/npm/lib/substack.js +20 -0
  269. data/lib/node_modules/npm/lib/tag.js +18 -0
  270. data/lib/node_modules/npm/lib/test.js +14 -0
  271. data/lib/node_modules/npm/lib/unbuild.js +112 -0
  272. data/lib/node_modules/npm/lib/uninstall.js +127 -0
  273. data/lib/node_modules/npm/lib/unpublish.js +83 -0
  274. data/lib/node_modules/npm/lib/update.js +43 -0
  275. data/lib/node_modules/npm/lib/utils/completion.sh +54 -0
  276. data/lib/node_modules/npm/lib/utils/completion/file-completion.js +26 -0
  277. data/lib/node_modules/npm/lib/utils/completion/installed-deep.js +50 -0
  278. data/lib/node_modules/npm/lib/utils/completion/installed-shallow.js +79 -0
  279. data/lib/node_modules/npm/lib/utils/error-handler.js +343 -0
  280. data/lib/node_modules/npm/lib/utils/fetch.js +93 -0
  281. data/lib/node_modules/npm/lib/utils/find-prefix.js +57 -0
  282. data/lib/node_modules/npm/lib/utils/gently-rm.js +61 -0
  283. data/lib/node_modules/npm/lib/utils/is-git-url.js +13 -0
  284. data/lib/node_modules/npm/lib/utils/lifecycle.js +360 -0
  285. data/lib/node_modules/npm/lib/utils/link.js +39 -0
  286. data/lib/node_modules/npm/lib/utils/tar.js +323 -0
  287. data/lib/node_modules/npm/lib/version.js +120 -0
  288. data/lib/node_modules/npm/lib/view.js +246 -0
  289. data/lib/node_modules/npm/lib/visnup.js +42 -0
  290. data/lib/node_modules/npm/lib/whoami.js +13 -0
  291. data/lib/node_modules/npm/lib/xmas.js +56 -0
  292. data/lib/node_modules/npm/make.bat +3 -0
  293. data/lib/node_modules/npm/man/man1/npm-README.1 +328 -0
  294. data/lib/node_modules/npm/man/man1/npm-adduser.1 +63 -0
  295. data/lib/node_modules/npm/man/man1/npm-bin.1 +40 -0
  296. data/lib/node_modules/npm/man/man1/npm-bugs.1 +78 -0
  297. data/lib/node_modules/npm/man/man1/npm-build.1 +43 -0
  298. data/lib/node_modules/npm/man/man1/npm-bundle.1 +23 -0
  299. data/lib/node_modules/npm/man/man1/npm-cache.1 +104 -0
  300. data/lib/node_modules/npm/man/man1/npm-completion.1 +47 -0
  301. data/lib/node_modules/npm/man/man1/npm-config.1 +113 -0
  302. data/lib/node_modules/npm/man/man1/npm-dedupe.1 +96 -0
  303. data/lib/node_modules/npm/man/man1/npm-deprecate.1 +48 -0
  304. data/lib/node_modules/npm/man/man1/npm-docs.1 +78 -0
  305. data/lib/node_modules/npm/man/man1/npm-edit.1 +66 -0
  306. data/lib/node_modules/npm/man/man1/npm-explore.1 +76 -0
  307. data/lib/node_modules/npm/man/man1/npm-help-search.1 +59 -0
  308. data/lib/node_modules/npm/man/man1/npm-help.1 +77 -0
  309. data/lib/node_modules/npm/man/man1/npm-init.1 +43 -0
  310. data/lib/node_modules/npm/man/man1/npm-install.1 +434 -0
  311. data/lib/node_modules/npm/man/man1/npm-link.1 +119 -0
  312. data/lib/node_modules/npm/man/man1/npm-ls.1 +146 -0
  313. data/lib/node_modules/npm/man/man1/npm-outdated.1 +102 -0
  314. data/lib/node_modules/npm/man/man1/npm-owner.1 +58 -0
  315. data/lib/node_modules/npm/man/man1/npm-pack.1 +48 -0
  316. data/lib/node_modules/npm/man/man1/npm-prefix.1 +40 -0
  317. data/lib/node_modules/npm/man/man1/npm-prune.1 +42 -0
  318. data/lib/node_modules/npm/man/man1/npm-publish.1 +53 -0
  319. data/lib/node_modules/npm/man/man1/npm-rebuild.1 +37 -0
  320. data/lib/node_modules/npm/man/man1/npm-repo.1 +47 -0
  321. data/lib/node_modules/npm/man/man1/npm-restart.1 +42 -0
  322. data/lib/node_modules/npm/man/man1/npm-rm.1 +44 -0
  323. data/lib/node_modules/npm/man/man1/npm-root.1 +40 -0
  324. data/lib/node_modules/npm/man/man1/npm-run-script.1 +41 -0
  325. data/lib/node_modules/npm/man/man1/npm-search.1 +62 -0
  326. data/lib/node_modules/npm/man/man1/npm-shrinkwrap.1 +275 -0
  327. data/lib/node_modules/npm/man/man1/npm-star.1 +39 -0
  328. data/lib/node_modules/npm/man/man1/npm-stars.1 +40 -0
  329. data/lib/node_modules/npm/man/man1/npm-start.1 +37 -0
  330. data/lib/node_modules/npm/man/man1/npm-stop.1 +37 -0
  331. data/lib/node_modules/npm/man/man1/npm-submodule.1 +42 -0
  332. data/lib/node_modules/npm/man/man1/npm-tag.1 +74 -0
  333. data/lib/node_modules/npm/man/man1/npm-test.1 +42 -0
  334. data/lib/node_modules/npm/man/man1/npm-uninstall.1 +42 -0
  335. data/lib/node_modules/npm/man/man1/npm-unpublish.1 +53 -0
  336. data/lib/node_modules/npm/man/man1/npm-update.1 +45 -0
  337. data/lib/node_modules/npm/man/man1/npm-version.1 +75 -0
  338. data/lib/node_modules/npm/man/man1/npm-view.1 +186 -0
  339. data/lib/node_modules/npm/man/man1/npm-whoami.1 +34 -0
  340. data/lib/node_modules/npm/man/man1/npm.1 +230 -0
  341. data/lib/node_modules/npm/man/man3/npm-bin.3 +21 -0
  342. data/lib/node_modules/npm/man/man3/npm-bugs.3 +28 -0
  343. data/lib/node_modules/npm/man/man3/npm-commands.3 +35 -0
  344. data/lib/node_modules/npm/man/man3/npm-config.3 +69 -0
  345. data/lib/node_modules/npm/man/man3/npm-deprecate.3 +57 -0
  346. data/lib/node_modules/npm/man/man3/npm-docs.3 +28 -0
  347. data/lib/node_modules/npm/man/man3/npm-edit.3 +35 -0
  348. data/lib/node_modules/npm/man/man3/npm-explore.3 +28 -0
  349. data/lib/node_modules/npm/man/man3/npm-help-search.3 +51 -0
  350. data/lib/node_modules/npm/man/man3/npm-init.3 +39 -0
  351. data/lib/node_modules/npm/man/man3/npm-install.3 +29 -0
  352. data/lib/node_modules/npm/man/man3/npm-link.3 +53 -0
  353. data/lib/node_modules/npm/man/man3/npm-load.3 +44 -0
  354. data/lib/node_modules/npm/man/man3/npm-ls.3 +86 -0
  355. data/lib/node_modules/npm/man/man3/npm-outdated.3 +21 -0
  356. data/lib/node_modules/npm/man/man3/npm-owner.3 +52 -0
  357. data/lib/node_modules/npm/man/man3/npm-pack.3 +28 -0
  358. data/lib/node_modules/npm/man/man3/npm-prefix.3 +24 -0
  359. data/lib/node_modules/npm/man/man3/npm-prune.3 +27 -0
  360. data/lib/node_modules/npm/man/man3/npm-publish.3 +51 -0
  361. data/lib/node_modules/npm/man/man3/npm-rebuild.3 +22 -0
  362. data/lib/node_modules/npm/man/man3/npm-repo.3 +28 -0
  363. data/lib/node_modules/npm/man/man3/npm-restart.3 +37 -0
  364. data/lib/node_modules/npm/man/man3/npm-root.3 +24 -0
  365. data/lib/node_modules/npm/man/man3/npm-run-script.3 +48 -0
  366. data/lib/node_modules/npm/man/man3/npm-search.3 +64 -0
  367. data/lib/node_modules/npm/man/man3/npm-shrinkwrap.3 +30 -0
  368. data/lib/node_modules/npm/man/man3/npm-start.3 +21 -0
  369. data/lib/node_modules/npm/man/man3/npm-stop.3 +21 -0
  370. data/lib/node_modules/npm/man/man3/npm-submodule.3 +42 -0
  371. data/lib/node_modules/npm/man/man3/npm-tag.3 +31 -0
  372. data/lib/node_modules/npm/man/man3/npm-test.3 +25 -0
  373. data/lib/node_modules/npm/man/man3/npm-uninstall.3 +25 -0
  374. data/lib/node_modules/npm/man/man3/npm-unpublish.3 +30 -0
  375. data/lib/node_modules/npm/man/man3/npm-update.3 +18 -0
  376. data/lib/node_modules/npm/man/man3/npm-version.3 +27 -0
  377. data/lib/node_modules/npm/man/man3/npm-view.3 +176 -0
  378. data/lib/node_modules/npm/man/man3/npm-whoami.3 +24 -0
  379. data/lib/node_modules/npm/man/man3/npm.3 +162 -0
  380. data/lib/node_modules/npm/man/man5/npm-folders.5 +264 -0
  381. data/lib/node_modules/npm/man/man5/npm-global.5 +264 -0
  382. data/lib/node_modules/npm/man/man5/npm-json.5 +807 -0
  383. data/lib/node_modules/npm/man/man5/npmrc.5 +89 -0
  384. data/lib/node_modules/npm/man/man5/package.json.5 +807 -0
  385. data/lib/node_modules/npm/man/man7/npm-coding-style.7 +254 -0
  386. data/lib/node_modules/npm/man/man7/npm-config.7 +1445 -0
  387. data/lib/node_modules/npm/man/man7/npm-developers.7 +335 -0
  388. data/lib/node_modules/npm/man/man7/npm-disputes.7 +146 -0
  389. data/lib/node_modules/npm/man/man7/npm-faq.7 +479 -0
  390. data/lib/node_modules/npm/man/man7/npm-index.7 +307 -0
  391. data/lib/node_modules/npm/man/man7/npm-registry.7 +82 -0
  392. data/lib/node_modules/npm/man/man7/npm-scripts.7 +354 -0
  393. data/lib/node_modules/npm/man/man7/removing-npm.7 +107 -0
  394. data/lib/node_modules/npm/man/man7/semver.7 +172 -0
  395. data/lib/node_modules/npm/node_modules/abbrev/LICENSE +23 -0
  396. data/lib/node_modules/npm/node_modules/abbrev/README.md +23 -0
  397. data/lib/node_modules/npm/node_modules/abbrev/lib/abbrev.js +111 -0
  398. data/lib/node_modules/npm/node_modules/abbrev/package.json +25 -0
  399. data/lib/node_modules/npm/node_modules/ansi/README.md +91 -0
  400. data/lib/node_modules/npm/node_modules/ansi/color-spaces.pl +67 -0
  401. data/lib/node_modules/npm/node_modules/ansi/examples/beep/index.js +16 -0
  402. data/lib/node_modules/npm/node_modules/ansi/examples/clear/index.js +15 -0
  403. data/lib/node_modules/npm/node_modules/ansi/examples/cursorPosition.js +32 -0
  404. data/lib/node_modules/npm/node_modules/ansi/examples/progress/index.js +87 -0
  405. data/lib/node_modules/npm/node_modules/ansi/examples/starwars.js +46 -0
  406. data/lib/node_modules/npm/node_modules/ansi/lib/ansi.js +405 -0
  407. data/lib/node_modules/npm/node_modules/ansi/lib/newlines.js +71 -0
  408. data/lib/node_modules/npm/node_modules/ansi/package.json +50 -0
  409. data/lib/node_modules/npm/node_modules/ansicolors/LICENSE +23 -0
  410. data/lib/node_modules/npm/node_modules/ansicolors/README.md +62 -0
  411. data/lib/node_modules/npm/node_modules/ansicolors/ansicolors.js +65 -0
  412. data/lib/node_modules/npm/node_modules/ansicolors/package.json +34 -0
  413. data/lib/node_modules/npm/node_modules/ansistyles/LICENSE +23 -0
  414. data/lib/node_modules/npm/node_modules/ansistyles/README.md +71 -0
  415. data/lib/node_modules/npm/node_modules/ansistyles/ansistyles.js +38 -0
  416. data/lib/node_modules/npm/node_modules/ansistyles/package.json +38 -0
  417. data/lib/node_modules/npm/node_modules/archy/README.markdown +92 -0
  418. data/lib/node_modules/npm/node_modules/archy/index.js +35 -0
  419. data/lib/node_modules/npm/node_modules/archy/package.json +52 -0
  420. data/lib/node_modules/npm/node_modules/block-stream/LICENCE +25 -0
  421. data/lib/node_modules/npm/node_modules/block-stream/README.md +14 -0
  422. data/lib/node_modules/npm/node_modules/block-stream/bench/block-stream-pause.js +70 -0
  423. data/lib/node_modules/npm/node_modules/block-stream/bench/block-stream.js +68 -0
  424. data/lib/node_modules/npm/node_modules/block-stream/bench/dropper-pause.js +70 -0
  425. data/lib/node_modules/npm/node_modules/block-stream/bench/dropper.js +68 -0
  426. data/lib/node_modules/npm/node_modules/block-stream/block-stream.js +209 -0
  427. data/lib/node_modules/npm/node_modules/block-stream/package.json +35 -0
  428. data/lib/node_modules/npm/node_modules/child-process-close/README.md +45 -0
  429. data/lib/node_modules/npm/node_modules/child-process-close/index.js +48 -0
  430. data/lib/node_modules/npm/node_modules/child-process-close/package.json +37 -0
  431. data/lib/node_modules/npm/node_modules/chmodr/LICENSE +27 -0
  432. data/lib/node_modules/npm/node_modules/chmodr/README.md +3 -0
  433. data/lib/node_modules/npm/node_modules/chmodr/chmodr.js +54 -0
  434. data/lib/node_modules/npm/node_modules/chmodr/package.json +28 -0
  435. data/lib/node_modules/npm/node_modules/chownr/LICENCE +25 -0
  436. data/lib/node_modules/npm/node_modules/chownr/README.md +3 -0
  437. data/lib/node_modules/npm/node_modules/chownr/chownr.js +41 -0
  438. data/lib/node_modules/npm/node_modules/chownr/package.json +42 -0
  439. data/lib/node_modules/npm/node_modules/cmd-shim/LICENSE +27 -0
  440. data/lib/node_modules/npm/node_modules/cmd-shim/README.md +42 -0
  441. data/lib/node_modules/npm/node_modules/cmd-shim/index.js +180 -0
  442. data/lib/node_modules/npm/node_modules/cmd-shim/package.json +35 -0
  443. data/lib/node_modules/npm/node_modules/columnify/Readme.md +189 -0
  444. data/lib/node_modules/npm/node_modules/columnify/index.js +210 -0
  445. data/lib/node_modules/npm/node_modules/columnify/package.json +42 -0
  446. data/lib/node_modules/npm/node_modules/columnify/utils.js +76 -0
  447. data/lib/node_modules/npm/node_modules/editor/LICENSE +18 -0
  448. data/lib/node_modules/npm/node_modules/editor/README.markdown +54 -0
  449. data/lib/node_modules/npm/node_modules/editor/example/beep.json +5 -0
  450. data/lib/node_modules/npm/node_modules/editor/example/edit.js +4 -0
  451. data/lib/node_modules/npm/node_modules/editor/index.js +26 -0
  452. data/lib/node_modules/npm/node_modules/editor/package.json +43 -0
  453. data/lib/node_modules/npm/node_modules/fstream-npm/LICENCE +25 -0
  454. data/lib/node_modules/npm/node_modules/fstream-npm/README.md +18 -0
  455. data/lib/node_modules/npm/node_modules/fstream-npm/example/bundle.js +13 -0
  456. data/lib/node_modules/npm/node_modules/fstream-npm/example/dir-tar.js +19 -0
  457. data/lib/node_modules/npm/node_modules/fstream-npm/example/dir.js +25 -0
  458. data/lib/node_modules/npm/node_modules/fstream-npm/example/example.js +12 -0
  459. data/lib/node_modules/npm/node_modules/fstream-npm/example/ig-tar.js +19 -0
  460. data/lib/node_modules/npm/node_modules/fstream-npm/example/tar.js +25 -0
  461. data/lib/node_modules/npm/node_modules/fstream-npm/fstream-npm.js +323 -0
  462. data/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/LICENSE +27 -0
  463. data/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/README.md +22 -0
  464. data/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/example/basic.js +13 -0
  465. data/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/ignore.js +275 -0
  466. data/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json +40 -0
  467. data/lib/node_modules/npm/node_modules/fstream-npm/package.json +27 -0
  468. data/lib/node_modules/npm/node_modules/fstream/LICENSE +27 -0
  469. data/lib/node_modules/npm/node_modules/fstream/README.md +76 -0
  470. data/lib/node_modules/npm/node_modules/fstream/examples/filter-pipe.js +131 -0
  471. data/lib/node_modules/npm/node_modules/fstream/examples/pipe.js +115 -0
  472. data/lib/node_modules/npm/node_modules/fstream/examples/reader.js +54 -0
  473. data/lib/node_modules/npm/node_modules/fstream/examples/symlink-write.js +24 -0
  474. data/lib/node_modules/npm/node_modules/fstream/fstream.js +31 -0
  475. data/lib/node_modules/npm/node_modules/fstream/lib/abstract.js +85 -0
  476. data/lib/node_modules/npm/node_modules/fstream/lib/collect.js +67 -0
  477. data/lib/node_modules/npm/node_modules/fstream/lib/dir-reader.js +251 -0
  478. data/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js +171 -0
  479. data/lib/node_modules/npm/node_modules/fstream/lib/file-reader.js +147 -0
  480. data/lib/node_modules/npm/node_modules/fstream/lib/file-writer.js +100 -0
  481. data/lib/node_modules/npm/node_modules/fstream/lib/get-type.js +32 -0
  482. data/lib/node_modules/npm/node_modules/fstream/lib/link-reader.js +54 -0
  483. data/lib/node_modules/npm/node_modules/fstream/lib/link-writer.js +95 -0
  484. data/lib/node_modules/npm/node_modules/fstream/lib/proxy-reader.js +93 -0
  485. data/lib/node_modules/npm/node_modules/fstream/lib/proxy-writer.js +109 -0
  486. data/lib/node_modules/npm/node_modules/fstream/lib/reader.js +260 -0
  487. data/lib/node_modules/npm/node_modules/fstream/lib/socket-reader.js +38 -0
  488. data/lib/node_modules/npm/node_modules/fstream/lib/writer.js +389 -0
  489. data/lib/node_modules/npm/node_modules/fstream/package.json +43 -0
  490. data/lib/node_modules/npm/node_modules/github-url-from-git/History.md +10 -0
  491. data/lib/node_modules/npm/node_modules/github-url-from-git/Makefile +5 -0
  492. data/lib/node_modules/npm/node_modules/github-url-from-git/Readme.md +41 -0
  493. data/lib/node_modules/npm/node_modules/github-url-from-git/index.js +12 -0
  494. data/lib/node_modules/npm/node_modules/github-url-from-git/package.json +31 -0
  495. data/lib/node_modules/npm/node_modules/github-url-from-git/test.js +40 -0
  496. data/lib/node_modules/npm/node_modules/github-url-from-username-repo/LICENSE +27 -0
  497. data/lib/node_modules/npm/node_modules/github-url-from-username-repo/README.md +14 -0
  498. data/lib/node_modules/npm/node_modules/github-url-from-username-repo/index.js +9 -0
  499. data/lib/node_modules/npm/node_modules/github-url-from-username-repo/package.json +33 -0
  500. data/lib/node_modules/npm/node_modules/glob/LICENSE +27 -0
  501. data/lib/node_modules/npm/node_modules/glob/README.md +250 -0
  502. data/lib/node_modules/npm/node_modules/glob/examples/g.js +9 -0
  503. data/lib/node_modules/npm/node_modules/glob/examples/usr-local.js +9 -0
  504. data/lib/node_modules/npm/node_modules/glob/glob.js +680 -0
  505. data/lib/node_modules/npm/node_modules/glob/package.json +39 -0
  506. data/lib/node_modules/npm/node_modules/graceful-fs/LICENSE +27 -0
  507. data/lib/node_modules/npm/node_modules/graceful-fs/README.md +26 -0
  508. data/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js +161 -0
  509. data/lib/node_modules/npm/node_modules/graceful-fs/package.json +48 -0
  510. data/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js +228 -0
  511. data/lib/node_modules/npm/node_modules/inherits/LICENSE +16 -0
  512. data/lib/node_modules/npm/node_modules/inherits/README.md +42 -0
  513. data/lib/node_modules/npm/node_modules/inherits/inherits.js +1 -0
  514. data/lib/node_modules/npm/node_modules/inherits/inherits_browser.js +23 -0
  515. data/lib/node_modules/npm/node_modules/inherits/package.json +32 -0
  516. data/lib/node_modules/npm/node_modules/inherits/test.js +25 -0
  517. data/lib/node_modules/npm/node_modules/ini/LICENSE +23 -0
  518. data/lib/node_modules/npm/node_modules/ini/README.md +79 -0
  519. data/lib/node_modules/npm/node_modules/ini/ini.js +166 -0
  520. data/lib/node_modules/npm/node_modules/ini/package.json +29 -0
  521. data/lib/node_modules/npm/node_modules/init-package-json/README.md +43 -0
  522. data/lib/node_modules/npm/node_modules/init-package-json/default-input.js +181 -0
  523. data/lib/node_modules/npm/node_modules/init-package-json/example/example-basic.js +8 -0
  524. data/lib/node_modules/npm/node_modules/init-package-json/example/example-default.js +7 -0
  525. data/lib/node_modules/npm/node_modules/init-package-json/example/example-npm.js +13 -0
  526. data/lib/node_modules/npm/node_modules/init-package-json/example/init/basic-init.js +1 -0
  527. data/lib/node_modules/npm/node_modules/init-package-json/init-package-json.js +129 -0
  528. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/LICENSE +15 -0
  529. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/README.md +133 -0
  530. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/index.js +11 -0
  531. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/README.md +8 -0
  532. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init-input.js +191 -0
  533. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init.js +37 -0
  534. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/package.json +10 -0
  535. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js +61 -0
  536. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/package.json +32 -0
  537. data/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard/promzard.js +216 -0
  538. data/lib/node_modules/npm/node_modules/init-package-json/package.json +48 -0
  539. data/lib/node_modules/npm/node_modules/lockfile/LICENSE +27 -0
  540. data/lib/node_modules/npm/node_modules/lockfile/README.md +81 -0
  541. data/lib/node_modules/npm/node_modules/lockfile/lockfile.js +272 -0
  542. data/lib/node_modules/npm/node_modules/lockfile/package.json +45 -0
  543. data/lib/node_modules/npm/node_modules/lru-cache/CONTRIBUTORS +14 -0
  544. data/lib/node_modules/npm/node_modules/lru-cache/LICENSE +23 -0
  545. data/lib/node_modules/npm/node_modules/lru-cache/README.md +97 -0
  546. data/lib/node_modules/npm/node_modules/lru-cache/lib/lru-cache.js +252 -0
  547. data/lib/node_modules/npm/node_modules/lru-cache/package.json +33 -0
  548. data/lib/node_modules/npm/node_modules/minimatch/LICENSE +23 -0
  549. data/lib/node_modules/npm/node_modules/minimatch/README.md +218 -0
  550. data/lib/node_modules/npm/node_modules/minimatch/minimatch.js +1055 -0
  551. data/lib/node_modules/npm/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  552. data/lib/node_modules/npm/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  553. data/lib/node_modules/npm/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  554. data/lib/node_modules/npm/node_modules/minimatch/node_modules/sigmund/package.json +42 -0
  555. data/lib/node_modules/npm/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  556. data/lib/node_modules/npm/node_modules/minimatch/package.json +40 -0
  557. data/lib/node_modules/npm/node_modules/mkdirp/LICENSE +21 -0
  558. data/lib/node_modules/npm/node_modules/mkdirp/README.markdown +63 -0
  559. data/lib/node_modules/npm/node_modules/mkdirp/examples/pow.js +6 -0
  560. data/lib/node_modules/npm/node_modules/mkdirp/index.js +82 -0
  561. data/lib/node_modules/npm/node_modules/mkdirp/package.json +33 -0
  562. data/lib/node_modules/npm/node_modules/node-gyp/LICENSE +24 -0
  563. data/lib/node_modules/npm/node_modules/node-gyp/README.md +163 -0
  564. data/lib/node_modules/npm/node_modules/node-gyp/addon.gypi +59 -0
  565. data/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js +133 -0
  566. data/lib/node_modules/npm/node_modules/node-gyp/gyp/AUTHORS +10 -0
  567. data/lib/node_modules/npm/node_modules/node-gyp/gyp/DEPS +24 -0
  568. data/lib/node_modules/npm/node_modules/node-gyp/gyp/LICENSE +27 -0
  569. data/lib/node_modules/npm/node_modules/node-gyp/gyp/OWNERS +1 -0
  570. data/lib/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py +115 -0
  571. data/lib/node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py +148 -0
  572. data/lib/node_modules/npm/node_modules/node-gyp/gyp/codereview.settings +10 -0
  573. data/lib/node_modules/npm/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
  574. data/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp +7 -0
  575. data/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp.bat +5 -0
  576. data/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_dummy.c +7 -0
  577. data/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py +18 -0
  578. data/lib/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py +274 -0
  579. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +340 -0
  580. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +208 -0
  581. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1051 -0
  582. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1482 -0
  583. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  584. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  585. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +267 -0
  586. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +407 -0
  587. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +537 -0
  588. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py +513 -0
  589. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +72 -0
  590. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +157 -0
  591. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +103 -0
  592. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +49 -0
  593. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  594. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1069 -0
  595. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +81 -0
  596. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +308 -0
  597. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +87 -0
  598. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +56 -0
  599. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2172 -0
  600. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3270 -0
  601. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +37 -0
  602. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2150 -0
  603. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +44 -0
  604. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1224 -0
  605. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  606. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py +2809 -0
  607. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +90 -0
  608. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +264 -0
  609. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +870 -0
  610. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +160 -0
  611. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +176 -0
  612. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1324 -0
  613. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +2888 -0
  614. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +69 -0
  615. data/lib/node_modules/npm/node_modules/node-gyp/gyp/pylintrc +307 -0
  616. data/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples +81 -0
  617. data/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples.bat +5 -0
  618. data/lib/node_modules/npm/node_modules/node-gyp/gyp/setup.py +19 -0
  619. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/README +15 -0
  620. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/README +5 -0
  621. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  622. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  623. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/emacs/README +12 -0
  624. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/emacs/gyp-tests.el +63 -0
  625. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/emacs/gyp.el +252 -0
  626. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/emacs/run-unit-tests.sh +7 -0
  627. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp +1105 -0
  628. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  629. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/graphviz.py +100 -0
  630. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py +155 -0
  631. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py +168 -0
  632. data/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +329 -0
  633. data/lib/node_modules/npm/node_modules/node-gyp/lib/build.js +275 -0
  634. data/lib/node_modules/npm/node_modules/node-gyp/lib/clean.js +22 -0
  635. data/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js +344 -0
  636. data/lib/node_modules/npm/node_modules/node-gyp/lib/install.js +362 -0
  637. data/lib/node_modules/npm/node_modules/node-gyp/lib/list.js +33 -0
  638. data/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js +225 -0
  639. data/lib/node_modules/npm/node_modules/node-gyp/lib/rebuild.js +16 -0
  640. data/lib/node_modules/npm/node_modules/node-gyp/lib/remove.js +56 -0
  641. data/lib/node_modules/npm/node_modules/node-gyp/package.json +55 -0
  642. data/lib/node_modules/npm/node_modules/nopt/LICENSE +23 -0
  643. data/lib/node_modules/npm/node_modules/nopt/README.md +210 -0
  644. data/lib/node_modules/npm/node_modules/nopt/bin/nopt.js +51 -0
  645. data/lib/node_modules/npm/node_modules/nopt/examples/my-program.js +30 -0
  646. data/lib/node_modules/npm/node_modules/nopt/lib/nopt.js +407 -0
  647. data/lib/node_modules/npm/node_modules/nopt/package.json +39 -0
  648. data/lib/node_modules/npm/node_modules/npm-install-checks/LICENSE +234 -0
  649. data/lib/node_modules/npm/node_modules/npm-install-checks/README.md +25 -0
  650. data/lib/node_modules/npm/node_modules/npm-install-checks/index.js +146 -0
  651. data/lib/node_modules/npm/node_modules/npm-install-checks/package.json +43 -0
  652. data/lib/node_modules/npm/node_modules/npm-registry-client/LICENSE +27 -0
  653. data/lib/node_modules/npm/node_modules/npm-registry-client/README.md +176 -0
  654. data/lib/node_modules/npm/node_modules/npm-registry-client/index.js +55 -0
  655. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/adduser.js +138 -0
  656. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/bugs.js +9 -0
  657. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/deprecate.js +28 -0
  658. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js +184 -0
  659. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/publish.js +156 -0
  660. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js +270 -0
  661. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/star.js +29 -0
  662. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/stars.js +9 -0
  663. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/tag.js +6 -0
  664. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/unpublish.js +104 -0
  665. data/lib/node_modules/npm/node_modules/npm-registry-client/lib/upload.js +22 -0
  666. data/lib/node_modules/npm/node_modules/npm-registry-client/package.json +43 -0
  667. data/lib/node_modules/npm/node_modules/npm-user-validate/LICENSE +27 -0
  668. data/lib/node_modules/npm/node_modules/npm-user-validate/README.md +6 -0
  669. data/lib/node_modules/npm/node_modules/npm-user-validate/npm-user-validate.js +49 -0
  670. data/lib/node_modules/npm/node_modules/npm-user-validate/package.json +37 -0
  671. data/lib/node_modules/npm/node_modules/npmconf/LICENSE +27 -0
  672. data/lib/node_modules/npm/node_modules/npmconf/README.md +33 -0
  673. data/lib/node_modules/npm/node_modules/npmconf/config-defs.js +353 -0
  674. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/LICENCE +22 -0
  675. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/index.js +282 -0
  676. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/LICENSE +23 -0
  677. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/README.md +3 -0
  678. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json +33 -0
  679. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js +81 -0
  680. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/package.json +32 -0
  681. data/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/readme.markdown +228 -0
  682. data/lib/node_modules/npm/node_modules/npmconf/npmconf.js +338 -0
  683. data/lib/node_modules/npm/node_modules/npmconf/package.json +50 -0
  684. data/lib/node_modules/npm/node_modules/npmlog/LICENSE +27 -0
  685. data/lib/node_modules/npm/node_modules/npmlog/README.md +153 -0
  686. data/lib/node_modules/npm/node_modules/npmlog/example.js +39 -0
  687. data/lib/node_modules/npm/node_modules/npmlog/log.js +154 -0
  688. data/lib/node_modules/npm/node_modules/npmlog/package.json +32 -0
  689. data/lib/node_modules/npm/node_modules/once/LICENSE +27 -0
  690. data/lib/node_modules/npm/node_modules/once/README.md +51 -0
  691. data/lib/node_modules/npm/node_modules/once/once.js +20 -0
  692. data/lib/node_modules/npm/node_modules/once/package.json +39 -0
  693. data/lib/node_modules/npm/node_modules/opener/LICENSE.txt +14 -0
  694. data/lib/node_modules/npm/node_modules/opener/README.md +44 -0
  695. data/lib/node_modules/npm/node_modules/opener/opener.js +55 -0
  696. data/lib/node_modules/npm/node_modules/opener/package.json +34 -0
  697. data/lib/node_modules/npm/node_modules/osenv/LICENSE +25 -0
  698. data/lib/node_modules/npm/node_modules/osenv/README.md +63 -0
  699. data/lib/node_modules/npm/node_modules/osenv/osenv.js +80 -0
  700. data/lib/node_modules/npm/node_modules/osenv/package.json +38 -0
  701. data/lib/node_modules/npm/node_modules/path-is-inside/LICENSE.txt +14 -0
  702. data/lib/node_modules/npm/node_modules/path-is-inside/README.md +35 -0
  703. data/lib/node_modules/npm/node_modules/path-is-inside/lib/path-is-inside.js +24 -0
  704. data/lib/node_modules/npm/node_modules/path-is-inside/package.json +39 -0
  705. data/lib/node_modules/npm/node_modules/read-installed/LICENSE +16 -0
  706. data/lib/node_modules/npm/node_modules/read-installed/README.md +25 -0
  707. data/lib/node_modules/npm/node_modules/read-installed/package.json +39 -0
  708. data/lib/node_modules/npm/node_modules/read-installed/read-installed.js +338 -0
  709. data/lib/node_modules/npm/node_modules/read-package-json/LICENSE +15 -0
  710. data/lib/node_modules/npm/node_modules/read-package-json/README.md +166 -0
  711. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/AUTHORS +4 -0
  712. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/LICENSE +30 -0
  713. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/README.md +101 -0
  714. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/core_module_names.json +29 -0
  715. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/extract_description.js +14 -0
  716. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js +392 -0
  717. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js +36 -0
  718. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/safe_format.js +9 -0
  719. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json +25 -0
  720. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/warning_messages.json +28 -0
  721. data/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json +53 -0
  722. data/lib/node_modules/npm/node_modules/read-package-json/package.json +39 -0
  723. data/lib/node_modules/npm/node_modules/read-package-json/read-json.js +368 -0
  724. data/lib/node_modules/npm/node_modules/read/LICENCE +25 -0
  725. data/lib/node_modules/npm/node_modules/read/README.md +53 -0
  726. data/lib/node_modules/npm/node_modules/read/example/example.js +13 -0
  727. data/lib/node_modules/npm/node_modules/read/lib/read.js +113 -0
  728. data/lib/node_modules/npm/node_modules/read/node_modules/mute-stream/LICENSE +27 -0
  729. data/lib/node_modules/npm/node_modules/read/node_modules/mute-stream/README.md +68 -0
  730. data/lib/node_modules/npm/node_modules/read/node_modules/mute-stream/mute.js +140 -0
  731. data/lib/node_modules/npm/node_modules/read/node_modules/mute-stream/package.json +37 -0
  732. data/lib/node_modules/npm/node_modules/read/package.json +35 -0
  733. data/lib/node_modules/npm/node_modules/read/rs.js +4 -0
  734. data/lib/node_modules/npm/node_modules/request/LICENSE +55 -0
  735. data/lib/node_modules/npm/node_modules/request/README.md +364 -0
  736. data/lib/node_modules/npm/node_modules/request/index.js +157 -0
  737. data/lib/node_modules/npm/node_modules/request/lib/copy.js +8 -0
  738. data/lib/node_modules/npm/node_modules/request/lib/debug.js +7 -0
  739. data/lib/node_modules/npm/node_modules/request/lib/getSafe.js +34 -0
  740. data/lib/node_modules/npm/node_modules/request/lib/optional.js +5 -0
  741. data/lib/node_modules/npm/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
  742. data/lib/node_modules/npm/node_modules/request/node_modules/aws-sign2/README.md +4 -0
  743. data/lib/node_modules/npm/node_modules/request/node_modules/aws-sign2/index.js +202 -0
  744. data/lib/node_modules/npm/node_modules/request/node_modules/aws-sign2/package.json +28 -0
  745. data/lib/node_modules/npm/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
  746. data/lib/node_modules/npm/node_modules/request/node_modules/forever-agent/README.md +4 -0
  747. data/lib/node_modules/npm/node_modules/request/node_modules/forever-agent/index.js +119 -0
  748. data/lib/node_modules/npm/node_modules/request/node_modules/forever-agent/package.json +28 -0
  749. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/License +19 -0
  750. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/Readme.md +163 -0
  751. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/lib/form_data.js +325 -0
  752. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
  753. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md +1414 -0
  754. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/component.json +11 -0
  755. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +955 -0
  756. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json +43 -0
  757. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
  758. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile +7 -0
  759. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
  760. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +185 -0
  761. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +19 -0
  762. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +7 -0
  763. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +154 -0
  764. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +99 -0
  765. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +31 -0
  766. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +32 -0
  767. data/lib/node_modules/npm/node_modules/request/node_modules/form-data/package.json +46 -0
  768. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/LICENSE +24 -0
  769. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/Makefile +10 -0
  770. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/README.md +627 -0
  771. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/example/usage.js +78 -0
  772. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
  773. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/images/logo.png +0 -0
  774. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/index.js +1 -0
  775. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
  776. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/lib/client.js +367 -0
  777. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
  778. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/lib/index.js +15 -0
  779. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/lib/server.js +524 -0
  780. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
  781. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
  782. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
  783. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
  784. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
  785. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
  786. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
  787. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json +47 -0
  788. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
  789. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
  790. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
  791. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
  792. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
  793. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +48 -0
  794. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
  795. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
  796. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
  797. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
  798. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
  799. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
  800. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
  801. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +49 -0
  802. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
  803. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
  804. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
  805. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
  806. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
  807. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
  808. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
  809. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +48 -0
  810. data/lib/node_modules/npm/node_modules/request/node_modules/hawk/package.json +53 -0
  811. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/LICENSE +18 -0
  812. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/README.md +75 -0
  813. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
  814. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/lib/index.js +25 -0
  815. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
  816. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/lib/signer.js +179 -0
  817. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/lib/util.js +249 -0
  818. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
  819. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
  820. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
  821. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
  822. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
  823. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
  824. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
  825. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
  826. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
  827. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +43 -0
  828. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
  829. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
  830. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
  831. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +196 -0
  832. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +20 -0
  833. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +71 -0
  834. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
  835. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
  836. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
  837. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
  838. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
  839. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
  840. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
  841. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +18 -0
  842. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
  843. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
  844. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json +13 -0
  845. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json +13 -0
  846. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json +104 -0
  847. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json +19 -0
  848. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js +39 -0
  849. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js +14 -0
  850. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js +14 -0
  851. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js +17 -0
  852. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js +18 -0
  853. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js +15 -0
  854. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json +14 -0
  855. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js +767 -0
  856. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js +753 -0
  857. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js +638 -0
  858. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js +101 -0
  859. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js +53 -0
  860. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js +92 -0
  861. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js +451 -0
  862. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js +81 -0
  863. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js +95 -0
  864. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js +156 -0
  865. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js +50 -0
  866. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js +44 -0
  867. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js +42 -0
  868. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js +45 -0
  869. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js +28 -0
  870. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js +128 -0
  871. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js +28 -0
  872. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js +31 -0
  873. data/lib/node_modules/npm/node_modules/request/node_modules/http-signature/package.json +36 -0
  874. data/lib/node_modules/npm/node_modules/request/node_modules/json-stringify-safe/LICENSE +27 -0
  875. data/lib/node_modules/npm/node_modules/request/node_modules/json-stringify-safe/README.md +49 -0
  876. data/lib/node_modules/npm/node_modules/request/node_modules/json-stringify-safe/package.json +33 -0
  877. data/lib/node_modules/npm/node_modules/request/node_modules/json-stringify-safe/stringify.js +39 -0
  878. data/lib/node_modules/npm/node_modules/request/node_modules/json-stringify-safe/test.js +128 -0
  879. data/lib/node_modules/npm/node_modules/request/node_modules/mime/LICENSE +19 -0
  880. data/lib/node_modules/npm/node_modules/request/node_modules/mime/README.md +66 -0
  881. data/lib/node_modules/npm/node_modules/request/node_modules/mime/mime.js +114 -0
  882. data/lib/node_modules/npm/node_modules/request/node_modules/mime/package.json +36 -0
  883. data/lib/node_modules/npm/node_modules/request/node_modules/mime/test.js +84 -0
  884. data/lib/node_modules/npm/node_modules/request/node_modules/mime/types/mime.types +1588 -0
  885. data/lib/node_modules/npm/node_modules/request/node_modules/mime/types/node.types +77 -0
  886. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/LICENSE.md +2 -0
  887. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/README.md +207 -0
  888. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
  889. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
  890. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
  891. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
  892. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
  893. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/component.json +18 -0
  894. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/package.json +35 -0
  895. data/lib/node_modules/npm/node_modules/request/node_modules/node-uuid/uuid.js +245 -0
  896. data/lib/node_modules/npm/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
  897. data/lib/node_modules/npm/node_modules/request/node_modules/oauth-sign/README.md +4 -0
  898. data/lib/node_modules/npm/node_modules/request/node_modules/oauth-sign/index.js +43 -0
  899. data/lib/node_modules/npm/node_modules/request/node_modules/oauth-sign/package.json +31 -0
  900. data/lib/node_modules/npm/node_modules/request/node_modules/oauth-sign/test.js +49 -0
  901. data/lib/node_modules/npm/node_modules/request/node_modules/qs/Readme.md +58 -0
  902. data/lib/node_modules/npm/node_modules/request/node_modules/qs/index.js +366 -0
  903. data/lib/node_modules/npm/node_modules/request/node_modules/qs/package.json +38 -0
  904. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
  905. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/README.md +380 -0
  906. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
  907. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
  908. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
  909. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
  910. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt +278 -0
  911. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
  912. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +73 -0
  913. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +508 -0
  914. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.min.js +2 -0
  915. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/LICENSE.txt +20 -0
  916. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/README.md +35 -0
  917. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/README.md +69 -0
  918. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/parse.php +35 -0
  919. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/docdown.php +38 -0
  920. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Alias.php +226 -0
  921. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Entry.php +442 -0
  922. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Generator.php +563 -0
  923. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/package.json +46 -0
  924. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
  925. data/lib/node_modules/npm/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
  926. data/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
  927. data/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
  928. data/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
  929. data/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/package.json +28 -0
  930. data/lib/node_modules/npm/node_modules/request/package.json +57 -0
  931. data/lib/node_modules/npm/node_modules/request/request.js +1260 -0
  932. data/lib/node_modules/npm/node_modules/retry/License +21 -0
  933. data/lib/node_modules/npm/node_modules/retry/Makefile +7 -0
  934. data/lib/node_modules/npm/node_modules/retry/Readme.md +167 -0
  935. data/lib/node_modules/npm/node_modules/retry/equation.gif +0 -0
  936. data/lib/node_modules/npm/node_modules/retry/example/dns.js +31 -0
  937. data/lib/node_modules/npm/node_modules/retry/index.js +1 -0
  938. data/lib/node_modules/npm/node_modules/retry/lib/retry.js +50 -0
  939. data/lib/node_modules/npm/node_modules/retry/lib/retry_operation.js +109 -0
  940. data/lib/node_modules/npm/node_modules/retry/package.json +29 -0
  941. data/lib/node_modules/npm/node_modules/rimraf/AUTHORS +6 -0
  942. data/lib/node_modules/npm/node_modules/rimraf/LICENSE +23 -0
  943. data/lib/node_modules/npm/node_modules/rimraf/README.md +30 -0
  944. data/lib/node_modules/npm/node_modules/rimraf/bin.js +33 -0
  945. data/lib/node_modules/npm/node_modules/rimraf/package.json +56 -0
  946. data/lib/node_modules/npm/node_modules/rimraf/rimraf.js +178 -0
  947. data/lib/node_modules/npm/node_modules/semver/LICENSE +27 -0
  948. data/lib/node_modules/npm/node_modules/semver/Makefile +24 -0
  949. data/lib/node_modules/npm/node_modules/semver/README.md +142 -0
  950. data/lib/node_modules/npm/node_modules/semver/bin/semver +124 -0
  951. data/lib/node_modules/npm/node_modules/semver/foot.js +6 -0
  952. data/lib/node_modules/npm/node_modules/semver/head.js +2 -0
  953. data/lib/node_modules/npm/node_modules/semver/package.json +32 -0
  954. data/lib/node_modules/npm/node_modules/semver/semver.browser.js +1007 -0
  955. data/lib/node_modules/npm/node_modules/semver/semver.browser.js.gz +0 -0
  956. data/lib/node_modules/npm/node_modules/semver/semver.js +1011 -0
  957. data/lib/node_modules/npm/node_modules/semver/semver.min.js +1 -0
  958. data/lib/node_modules/npm/node_modules/semver/semver.min.js.gz +0 -0
  959. data/lib/node_modules/npm/node_modules/sha/LICENSE +46 -0
  960. data/lib/node_modules/npm/node_modules/sha/README.md +49 -0
  961. data/lib/node_modules/npm/node_modules/sha/index.js +120 -0
  962. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/LICENSE +27 -0
  963. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/README.md +768 -0
  964. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/duplex.js +1 -0
  965. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/float.patch +68 -0
  966. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js +69 -0
  967. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js +41 -0
  968. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js +927 -0
  969. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js +205 -0
  970. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js +369 -0
  971. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/package.json +36 -0
  972. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/passthrough.js +1 -0
  973. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/readable.js +6 -0
  974. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/transform.js +1 -0
  975. data/lib/node_modules/npm/node_modules/sha/node_modules/readable-stream/writable.js +1 -0
  976. data/lib/node_modules/npm/node_modules/sha/package.json +32 -0
  977. data/lib/node_modules/npm/node_modules/slide/LICENSE +15 -0
  978. data/lib/node_modules/npm/node_modules/slide/README.md +143 -0
  979. data/lib/node_modules/npm/node_modules/slide/index.js +1 -0
  980. data/lib/node_modules/npm/node_modules/slide/lib/async-map-ordered.js +65 -0
  981. data/lib/node_modules/npm/node_modules/slide/lib/async-map.js +56 -0
  982. data/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js +16 -0
  983. data/lib/node_modules/npm/node_modules/slide/lib/chain.js +20 -0
  984. data/lib/node_modules/npm/node_modules/slide/lib/slide.js +3 -0
  985. data/lib/node_modules/npm/node_modules/slide/package.json +35 -0
  986. data/lib/node_modules/npm/node_modules/tar/LICENCE +25 -0
  987. data/lib/node_modules/npm/node_modules/tar/README.md +46 -0
  988. data/lib/node_modules/npm/node_modules/tar/examples/extracter.js +11 -0
  989. data/lib/node_modules/npm/node_modules/tar/examples/reader.js +36 -0
  990. data/lib/node_modules/npm/node_modules/tar/lib/buffer-entry.js +30 -0
  991. data/lib/node_modules/npm/node_modules/tar/lib/entry-writer.js +169 -0
  992. data/lib/node_modules/npm/node_modules/tar/lib/entry.js +213 -0
  993. data/lib/node_modules/npm/node_modules/tar/lib/extended-header-writer.js +191 -0
  994. data/lib/node_modules/npm/node_modules/tar/lib/extended-header.js +140 -0
  995. data/lib/node_modules/npm/node_modules/tar/lib/extract.js +78 -0
  996. data/lib/node_modules/npm/node_modules/tar/lib/global-header-writer.js +14 -0
  997. data/lib/node_modules/npm/node_modules/tar/lib/header.js +385 -0
  998. data/lib/node_modules/npm/node_modules/tar/lib/pack.js +231 -0
  999. data/lib/node_modules/npm/node_modules/tar/lib/parse.js +270 -0
  1000. data/lib/node_modules/npm/node_modules/tar/package.json +40 -0
  1001. data/lib/node_modules/npm/node_modules/tar/tar.js +173 -0
  1002. data/lib/node_modules/npm/node_modules/text-table/LICENSE +18 -0
  1003. data/lib/node_modules/npm/node_modules/text-table/example/align.js +8 -0
  1004. data/lib/node_modules/npm/node_modules/text-table/example/center.js +8 -0
  1005. data/lib/node_modules/npm/node_modules/text-table/example/dotalign.js +9 -0
  1006. data/lib/node_modules/npm/node_modules/text-table/example/doubledot.js +11 -0
  1007. data/lib/node_modules/npm/node_modules/text-table/example/table.js +6 -0
  1008. data/lib/node_modules/npm/node_modules/text-table/index.js +86 -0
  1009. data/lib/node_modules/npm/node_modules/text-table/package.json +52 -0
  1010. data/lib/node_modules/npm/node_modules/text-table/readme.markdown +134 -0
  1011. data/lib/node_modules/npm/node_modules/uid-number/LICENCE +25 -0
  1012. data/lib/node_modules/npm/node_modules/uid-number/README.md +17 -0
  1013. data/lib/node_modules/npm/node_modules/uid-number/get-uid-gid.js +24 -0
  1014. data/lib/node_modules/npm/node_modules/uid-number/package.json +35 -0
  1015. data/lib/node_modules/npm/node_modules/uid-number/uid-number.js +54 -0
  1016. data/lib/node_modules/npm/node_modules/which/LICENSE +23 -0
  1017. data/lib/node_modules/npm/node_modules/which/README.md +5 -0
  1018. data/lib/node_modules/npm/node_modules/which/bin/which +14 -0
  1019. data/lib/node_modules/npm/node_modules/which/package.json +34 -0
  1020. data/lib/node_modules/npm/node_modules/which/which.js +104 -0
  1021. data/lib/node_modules/npm/package.json +155 -0
  1022. data/lib/node_modules/npm/scripts/clean-old.sh +165 -0
  1023. data/lib/node_modules/npm/scripts/doc-build.sh +84 -0
  1024. data/lib/node_modules/npm/scripts/index-build.js +62 -0
  1025. data/lib/node_modules/npm/scripts/install.sh +313 -0
  1026. data/lib/node_modules/npm/scripts/release.sh +36 -0
  1027. data/lib/node_modules/npm/scripts/relocate.sh +26 -0
  1028. metadata +1052 -36
  1029. checksums.yaml +0 -7
@@ -0,0 +1,55 @@
1
+ Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. 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
+
31
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
+
35
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
+
37
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
+
39
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
40
+
41
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
+
43
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,4 @@
1
+ tunnel-agent
2
+ ============
3
+
4
+ HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
@@ -0,0 +1,227 @@
1
+ 'use strict'
2
+
3
+ var net = require('net')
4
+ , tls = require('tls')
5
+ , http = require('http')
6
+ , https = require('https')
7
+ , events = require('events')
8
+ , assert = require('assert')
9
+ , util = require('util')
10
+ ;
11
+
12
+ exports.httpOverHttp = httpOverHttp
13
+ exports.httpsOverHttp = httpsOverHttp
14
+ exports.httpOverHttps = httpOverHttps
15
+ exports.httpsOverHttps = httpsOverHttps
16
+
17
+
18
+ function httpOverHttp(options) {
19
+ var agent = new TunnelingAgent(options)
20
+ agent.request = http.request
21
+ return agent
22
+ }
23
+
24
+ function httpsOverHttp(options) {
25
+ var agent = new TunnelingAgent(options)
26
+ agent.request = http.request
27
+ agent.createSocket = createSecureSocket
28
+ return agent
29
+ }
30
+
31
+ function httpOverHttps(options) {
32
+ var agent = new TunnelingAgent(options)
33
+ agent.request = https.request
34
+ return agent
35
+ }
36
+
37
+ function httpsOverHttps(options) {
38
+ var agent = new TunnelingAgent(options)
39
+ agent.request = https.request
40
+ agent.createSocket = createSecureSocket
41
+ return agent
42
+ }
43
+
44
+
45
+ function TunnelingAgent(options) {
46
+ var self = this
47
+ self.options = options || {}
48
+ self.proxyOptions = self.options.proxy || {}
49
+ self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
50
+ self.requests = []
51
+ self.sockets = []
52
+
53
+ self.on('free', function onFree(socket, host, port) {
54
+ for (var i = 0, len = self.requests.length; i < len; ++i) {
55
+ var pending = self.requests[i]
56
+ if (pending.host === host && pending.port === port) {
57
+ // Detect the request to connect same origin server,
58
+ // reuse the connection.
59
+ self.requests.splice(i, 1)
60
+ pending.request.onSocket(socket)
61
+ return
62
+ }
63
+ }
64
+ socket.destroy()
65
+ self.removeSocket(socket)
66
+ })
67
+ }
68
+ util.inherits(TunnelingAgent, events.EventEmitter)
69
+
70
+ TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) {
71
+ var self = this
72
+
73
+ if (self.sockets.length >= this.maxSockets) {
74
+ // We are over limit so we'll add it to the queue.
75
+ self.requests.push({host: host, port: port, request: req})
76
+ return
77
+ }
78
+
79
+ // If we are under maxSockets create a new one.
80
+ self.createSocket({host: host, port: port, request: req}, function(socket) {
81
+ socket.on('free', onFree)
82
+ socket.on('close', onCloseOrRemove)
83
+ socket.on('agentRemove', onCloseOrRemove)
84
+ req.onSocket(socket)
85
+
86
+ function onFree() {
87
+ self.emit('free', socket, host, port)
88
+ }
89
+
90
+ function onCloseOrRemove(err) {
91
+ self.removeSocket()
92
+ socket.removeListener('free', onFree)
93
+ socket.removeListener('close', onCloseOrRemove)
94
+ socket.removeListener('agentRemove', onCloseOrRemove)
95
+ }
96
+ })
97
+ }
98
+
99
+ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
100
+ var self = this
101
+ var placeholder = {}
102
+ self.sockets.push(placeholder)
103
+
104
+ var connectOptions = mergeOptions({}, self.proxyOptions,
105
+ { method: 'CONNECT'
106
+ , path: options.host + ':' + options.port
107
+ , agent: false
108
+ }
109
+ )
110
+ if (connectOptions.proxyAuth) {
111
+ connectOptions.headers = connectOptions.headers || {}
112
+ connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
113
+ new Buffer(connectOptions.proxyAuth).toString('base64')
114
+ }
115
+
116
+ debug('making CONNECT request')
117
+ var connectReq = self.request(connectOptions)
118
+ connectReq.useChunkedEncodingByDefault = false // for v0.6
119
+ connectReq.once('response', onResponse) // for v0.6
120
+ connectReq.once('upgrade', onUpgrade) // for v0.6
121
+ connectReq.once('connect', onConnect) // for v0.7 or later
122
+ connectReq.once('error', onError)
123
+ connectReq.end()
124
+
125
+ function onResponse(res) {
126
+ // Very hacky. This is necessary to avoid http-parser leaks.
127
+ res.upgrade = true
128
+ }
129
+
130
+ function onUpgrade(res, socket, head) {
131
+ // Hacky.
132
+ process.nextTick(function() {
133
+ onConnect(res, socket, head)
134
+ })
135
+ }
136
+
137
+ function onConnect(res, socket, head) {
138
+ connectReq.removeAllListeners()
139
+ socket.removeAllListeners()
140
+
141
+ if (res.statusCode === 200) {
142
+ assert.equal(head.length, 0)
143
+ debug('tunneling connection has established')
144
+ self.sockets[self.sockets.indexOf(placeholder)] = socket
145
+ cb(socket)
146
+ } else {
147
+ debug('tunneling socket could not be established, statusCode=%d', res.statusCode)
148
+ var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)
149
+ error.code = 'ECONNRESET'
150
+ options.request.emit('error', error)
151
+ self.removeSocket(placeholder)
152
+ }
153
+ }
154
+
155
+ function onError(cause) {
156
+ connectReq.removeAllListeners()
157
+
158
+ debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack)
159
+ var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)
160
+ error.code = 'ECONNRESET'
161
+ options.request.emit('error', error)
162
+ self.removeSocket(placeholder)
163
+ }
164
+ }
165
+
166
+ TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
167
+ var pos = this.sockets.indexOf(socket)
168
+ if (pos === -1) return
169
+
170
+ this.sockets.splice(pos, 1)
171
+
172
+ var pending = this.requests.shift()
173
+ if (pending) {
174
+ // If we have pending requests and a socket gets closed a new one
175
+ // needs to be created to take over in the pool for the one that closed.
176
+ this.createSocket(pending, function(socket) {
177
+ pending.request.onSocket(socket)
178
+ })
179
+ }
180
+ }
181
+
182
+ function createSecureSocket(options, cb) {
183
+ var self = this
184
+ TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
185
+ // 0 is dummy port for v0.6
186
+ var secureSocket = tls.connect(0, mergeOptions({}, self.options,
187
+ { servername: options.host
188
+ , socket: socket
189
+ }
190
+ ))
191
+ cb(secureSocket)
192
+ })
193
+ }
194
+
195
+
196
+ function mergeOptions(target) {
197
+ for (var i = 1, len = arguments.length; i < len; ++i) {
198
+ var overrides = arguments[i]
199
+ if (typeof overrides === 'object') {
200
+ var keys = Object.keys(overrides)
201
+ for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
202
+ var k = keys[j]
203
+ if (overrides[k] !== undefined) {
204
+ target[k] = overrides[k]
205
+ }
206
+ }
207
+ }
208
+ }
209
+ return target
210
+ }
211
+
212
+
213
+ var debug
214
+ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
215
+ debug = function() {
216
+ var args = Array.prototype.slice.call(arguments)
217
+ if (typeof args[0] === 'string') {
218
+ args[0] = 'TUNNEL: ' + args[0]
219
+ } else {
220
+ args.unshift('TUNNEL:')
221
+ }
222
+ console.error.apply(console, args)
223
+ }
224
+ } else {
225
+ debug = function() {}
226
+ }
227
+ exports.debug = debug // for test
@@ -0,0 +1,28 @@
1
+ {
2
+ "author": {
3
+ "name": "Mikeal Rogers",
4
+ "email": "mikeal.rogers@gmail.com",
5
+ "url": "http://www.futurealoof.com"
6
+ },
7
+ "name": "tunnel-agent",
8
+ "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.",
9
+ "version": "0.3.0",
10
+ "repository": {
11
+ "url": "https://github.com/mikeal/tunnel-agent"
12
+ },
13
+ "main": "index.js",
14
+ "dependencies": {},
15
+ "devDependencies": {},
16
+ "optionalDependencies": {},
17
+ "engines": {
18
+ "node": "*"
19
+ },
20
+ "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n",
21
+ "readmeFilename": "README.md",
22
+ "bugs": {
23
+ "url": "https://github.com/mikeal/tunnel-agent/issues"
24
+ },
25
+ "homepage": "https://github.com/mikeal/tunnel-agent",
26
+ "_id": "tunnel-agent@0.3.0",
27
+ "_from": "tunnel-agent@~0.3.0"
28
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "request",
3
+ "description": "Simplified HTTP request client.",
4
+ "tags": [
5
+ "http",
6
+ "simple",
7
+ "util",
8
+ "utility"
9
+ ],
10
+ "version": "2.30.0",
11
+ "author": {
12
+ "name": "Mikeal Rogers",
13
+ "email": "mikeal.rogers@gmail.com"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "http://github.com/mikeal/request.git"
18
+ },
19
+ "bugs": {
20
+ "url": "http://github.com/mikeal/request/issues"
21
+ },
22
+ "engines": [
23
+ "node >= 0.8.0"
24
+ ],
25
+ "main": "index.js",
26
+ "dependencies": {
27
+ "qs": "~0.6.0",
28
+ "json-stringify-safe": "~5.0.0",
29
+ "forever-agent": "~0.5.0",
30
+ "node-uuid": "~1.4.0",
31
+ "mime": "~1.2.9",
32
+ "tough-cookie": "~0.9.15",
33
+ "form-data": "~0.1.0",
34
+ "tunnel-agent": "~0.3.0",
35
+ "http-signature": "~0.10.0",
36
+ "oauth-sign": "~0.3.0",
37
+ "hawk": "~1.0.0",
38
+ "aws-sign2": "~0.5.0"
39
+ },
40
+ "optionalDependencies": {
41
+ "tough-cookie": "~0.9.15",
42
+ "form-data": "~0.1.0",
43
+ "tunnel-agent": "~0.3.0",
44
+ "http-signature": "~0.10.0",
45
+ "oauth-sign": "~0.3.0",
46
+ "hawk": "~1.0.0",
47
+ "aws-sign2": "~0.5.0"
48
+ },
49
+ "scripts": {
50
+ "test": "node tests/run.js"
51
+ },
52
+ "readme": "# Request -- Simplified HTTP client\n\n[![NPM](https://nodei.co/npm/request.png)](https://nodei.co/npm/request/)\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one).\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let’s get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n }\n }\n})\n```\n\nYou can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\n\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nURL-encoded forms are simple.\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don’t need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to `true`, which causes a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a `401` response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false`; otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail.\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has\n // verified with twitter that they are authorizing your app.\n var access_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: access_token.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1/users/show.json?'\n , params =\n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n### Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```\nvar request = require('request');\n\nvar options = {\n\turl: 'https://api.github.com/repos/mikeal/request',\n\theaders: {\n\t\t'User-Agent': 'request'\n\t}\n};\n\nfunction callback(error, response, body) {\n\tif (!error && response.statusCode == 200) {\n\t\tvar info = JSON.parse(body);\n\t\tconsole.log(info.stargazers_count + \" Stars\");\n\t\tconsole.log(info.forks_count + \" Forks\");\n\t}\n}\n\nrequest(options, callback);\n```\n\n### request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n* `qs` - object containing querystring values to be appended to the `uri`\n* `method` - http method (default: `\"GET\"`)\n* `headers` - http headers (default: `{}`)\n* `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`.\n* `form` - when passed an object, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no options, a `FormData` instance is returned (and is piped to request).\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`)\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n* `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n* `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`.\n* `pool` - A hash object containing the agents for these requests. If omitted, the request will use the global pool (which is set to node's default `maxSockets`)\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\n* `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`)\n* `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option.\n* `jar` - If `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n* `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n\n\nThe callback argument gets 3 arguments: \n\n1. An `error` when applicable (usually from the `http.Client` option, not the `http.ClientRequest` object)\n2. An `http.ClientResponse` object\n3. The third is the `response` body (`String` or `Buffer`)\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as `request()`, but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as `request()`, but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as `request()`, but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as `request()`, but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nSame as `request()` (for uniformity).\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\n\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`).\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nTo use a custom cookie jar (instead `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`)\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n request('http://images.google.com')\n})\n```\n",
53
+ "readmeFilename": "README.md",
54
+ "homepage": "https://github.com/mikeal/request",
55
+ "_id": "request@2.30.0",
56
+ "_from": "request@latest"
57
+ }
@@ -0,0 +1,1260 @@
1
+ var optional = require('./lib/optional')
2
+ , http = require('http')
3
+ , https = optional('https')
4
+ , tls = optional('tls')
5
+ , url = require('url')
6
+ , util = require('util')
7
+ , stream = require('stream')
8
+ , qs = require('qs')
9
+ , querystring = require('querystring')
10
+ , crypto = require('crypto')
11
+
12
+ , oauth = optional('oauth-sign')
13
+ , hawk = optional('hawk')
14
+ , aws = optional('aws-sign')
15
+ , httpSignature = optional('http-signature')
16
+ , uuid = require('node-uuid')
17
+ , mime = require('mime')
18
+ , tunnel = optional('tunnel-agent')
19
+ , _safeStringify = require('json-stringify-safe')
20
+
21
+ , ForeverAgent = require('forever-agent')
22
+ , FormData = optional('form-data')
23
+
24
+ , Cookie = optional('tough-cookie')
25
+ , CookieJar = Cookie && Cookie.CookieJar
26
+ , cookieJar = CookieJar && new CookieJar
27
+
28
+ , copy = require('./lib/copy')
29
+ , debug = require('./lib/debug')
30
+ , getSafe = require('./lib/getSafe')
31
+ ;
32
+
33
+ function safeStringify (obj) {
34
+ var ret
35
+ try { ret = JSON.stringify(obj) }
36
+ catch (e) { ret = _safeStringify(obj) }
37
+ return ret
38
+ }
39
+
40
+ var globalPool = {}
41
+ var isUrl = /^https?:/i
42
+
43
+
44
+ // Hacky fix for pre-0.4.4 https
45
+ if (https && !https.Agent) {
46
+ https.Agent = function (options) {
47
+ http.Agent.call(this, options)
48
+ }
49
+ util.inherits(https.Agent, http.Agent)
50
+ https.Agent.prototype._getConnection = function (host, port, cb) {
51
+ var s = tls.connect(port, host, this.options, function () {
52
+ // do other checks here?
53
+ if (cb) cb()
54
+ })
55
+ return s
56
+ }
57
+ }
58
+
59
+ function isReadStream (rs) {
60
+ if (rs.readable && rs.path && rs.mode) {
61
+ return true
62
+ }
63
+ }
64
+
65
+ function toBase64 (str) {
66
+ return (new Buffer(str || "", "ascii")).toString("base64")
67
+ }
68
+
69
+ function md5 (str) {
70
+ return crypto.createHash('md5').update(str).digest('hex')
71
+ }
72
+
73
+ function Request (options) {
74
+ stream.Stream.call(this)
75
+ this.readable = true
76
+ this.writable = true
77
+
78
+ if (typeof options === 'string') {
79
+ options = {uri:options}
80
+ }
81
+
82
+ var reserved = Object.keys(Request.prototype)
83
+ for (var i in options) {
84
+ if (reserved.indexOf(i) === -1) {
85
+ this[i] = options[i]
86
+ } else {
87
+ if (typeof options[i] === 'function') {
88
+ delete options[i]
89
+ }
90
+ }
91
+ }
92
+
93
+ if (options.method) {
94
+ this.explicitMethod = true
95
+ }
96
+
97
+ this.canTunnel = options.tunnel !== false && tunnel;
98
+
99
+ this.init(options)
100
+ }
101
+ util.inherits(Request, stream.Stream)
102
+ Request.prototype.init = function (options) {
103
+ // init() contains all the code to setup the request object.
104
+ // the actual outgoing request is not started until start() is called
105
+ // this function is called from both the constructor and on redirect.
106
+ var self = this
107
+ if (!options) options = {}
108
+
109
+ if (!self.method) self.method = options.method || 'GET'
110
+ self.localAddress = options.localAddress
111
+
112
+ debug(options)
113
+ if (!self.pool && self.pool !== false) self.pool = globalPool
114
+ self.dests = self.dests || []
115
+ self.__isRequestRequest = true
116
+
117
+ // Protect against double callback
118
+ if (!self._callback && self.callback) {
119
+ self._callback = self.callback
120
+ self.callback = function () {
121
+ if (self._callbackCalled) return // Print a warning maybe?
122
+ self._callbackCalled = true
123
+ self._callback.apply(self, arguments)
124
+ }
125
+ self.on('error', self.callback.bind())
126
+ self.on('complete', self.callback.bind(self, null))
127
+ }
128
+
129
+ if (self.url && !self.uri) {
130
+ // People use this property instead all the time so why not just support it.
131
+ self.uri = self.url
132
+ delete self.url
133
+ }
134
+
135
+ if (!self.uri) {
136
+ // this will throw if unhandled but is handleable when in a redirect
137
+ return self.emit('error', new Error("options.uri is a required argument"))
138
+ } else {
139
+ if (typeof self.uri == "string") self.uri = url.parse(self.uri)
140
+ }
141
+
142
+ if (self.strictSSL === false) {
143
+ self.rejectUnauthorized = false
144
+ }
145
+
146
+ if (self.proxy) {
147
+ if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy)
148
+
149
+ // do the HTTP CONNECT dance using koichik/node-tunnel
150
+ if (http.globalAgent && self.uri.protocol === "https:" && self.canTunnel) {
151
+ var tunnelFn = self.proxy.protocol === "http:"
152
+ ? tunnel.httpsOverHttp : tunnel.httpsOverHttps
153
+
154
+ var tunnelOptions = { proxy: { host: self.proxy.hostname
155
+ , port: +self.proxy.port
156
+ , proxyAuth: self.proxy.auth
157
+ , headers: { Host: self.uri.hostname + ':' +
158
+ (self.uri.port || self.uri.protocol === 'https:' ? 443 : 80) }}
159
+ , rejectUnauthorized: self.rejectUnauthorized
160
+ , ca: this.ca }
161
+
162
+ self.agent = tunnelFn(tunnelOptions)
163
+ self.tunnel = true
164
+ }
165
+ }
166
+
167
+ if (!self.uri.pathname) {self.uri.pathname = '/'}
168
+
169
+ if (!self.uri.host) {
170
+ // Invalid URI: it may generate lot of bad errors, like "TypeError: Cannot call method 'indexOf' of undefined" in CookieJar
171
+ // Detect and reject it as soon as possible
172
+ var faultyUri = url.format(self.uri)
173
+ var message = 'Invalid URI "' + faultyUri + '"'
174
+ if (Object.keys(options).length === 0) {
175
+ // No option ? This can be the sign of a redirect
176
+ // As this is a case where the user cannot do anything (they didn't call request directly with this URL)
177
+ // they should be warned that it can be caused by a redirection (can save some hair)
178
+ message += '. This can be caused by a crappy redirection.'
179
+ }
180
+ self.emit('error', new Error(message))
181
+ return // This error was fatal
182
+ }
183
+
184
+ self._redirectsFollowed = self._redirectsFollowed || 0
185
+ self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10
186
+ self.followRedirect = (self.followRedirect !== undefined) ? self.followRedirect : true
187
+ self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false
188
+ if (self.followRedirect || self.followAllRedirects)
189
+ self.redirects = self.redirects || []
190
+
191
+ self.headers = self.headers ? copy(self.headers) : {}
192
+
193
+ self.setHost = false
194
+ if (!self.hasHeader('host')) {
195
+ self.setHeader('host', self.uri.hostname)
196
+ if (self.uri.port) {
197
+ if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') &&
198
+ !(self.uri.port === 443 && self.uri.protocol === 'https:') )
199
+ self.setHeader('host', self.getHeader('host') + (':'+self.uri.port) )
200
+ }
201
+ self.setHost = true
202
+ }
203
+
204
+ self.jar(self._jar || options.jar)
205
+
206
+ if (!self.uri.port) {
207
+ if (self.uri.protocol == 'http:') {self.uri.port = 80}
208
+ else if (self.uri.protocol == 'https:') {self.uri.port = 443}
209
+ }
210
+
211
+ if (self.proxy && !self.tunnel) {
212
+ self.port = self.proxy.port
213
+ self.host = self.proxy.hostname
214
+ } else {
215
+ self.port = self.uri.port
216
+ self.host = self.uri.hostname
217
+ }
218
+
219
+ self.clientErrorHandler = function (error) {
220
+ if (self._aborted) return
221
+ if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET'
222
+ && self.agent.addRequestNoreuse) {
223
+ self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
224
+ self.start()
225
+ self.req.end()
226
+ return
227
+ }
228
+ if (self.timeout && self.timeoutTimer) {
229
+ clearTimeout(self.timeoutTimer)
230
+ self.timeoutTimer = null
231
+ }
232
+ self.emit('error', error)
233
+ }
234
+
235
+ self._parserErrorHandler = function (error) {
236
+ if (this.res) {
237
+ if (this.res.request) {
238
+ this.res.request.emit('error', error)
239
+ } else {
240
+ this.res.emit('error', error)
241
+ }
242
+ } else {
243
+ this._httpMessage.emit('error', error)
244
+ }
245
+ }
246
+
247
+ if (options.form) {
248
+ self.form(options.form)
249
+ }
250
+
251
+ if (options.qs) self.qs(options.qs)
252
+
253
+ if (self.uri.path) {
254
+ self.path = self.uri.path
255
+ } else {
256
+ self.path = self.uri.pathname + (self.uri.search || "")
257
+ }
258
+
259
+ if (self.path.length === 0) self.path = '/'
260
+
261
+
262
+ // Auth must happen last in case signing is dependent on other headers
263
+ if (options.oauth) {
264
+ self.oauth(options.oauth)
265
+ }
266
+
267
+ if (options.aws) {
268
+ self.aws(options.aws)
269
+ }
270
+
271
+ if (options.hawk) {
272
+ self.hawk(options.hawk)
273
+ }
274
+
275
+ if (options.httpSignature) {
276
+ self.httpSignature(options.httpSignature)
277
+ }
278
+
279
+ if (options.auth) {
280
+ if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) options.auth.user = options.auth.username
281
+ if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) options.auth.pass = options.auth.password
282
+
283
+ self.auth(
284
+ options.auth.user,
285
+ options.auth.pass,
286
+ options.auth.sendImmediately
287
+ )
288
+ }
289
+
290
+ if (self.uri.auth && !self.hasHeader('authorization')) {
291
+ var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) })
292
+ self.auth(authPieces[0], authPieces.slice(1).join(':'), true)
293
+ }
294
+ if (self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization') && !self.tunnel) {
295
+ self.setHeader('proxy-authorization', "Basic " + toBase64(self.proxy.auth.split(':').map(function(item){ return querystring.unescape(item)}).join(':')))
296
+ }
297
+
298
+
299
+ if (self.proxy && !self.tunnel) self.path = (self.uri.protocol + '//' + self.uri.host + self.path)
300
+
301
+ if (options.json) {
302
+ self.json(options.json)
303
+ } else if (options.multipart) {
304
+ self.boundary = uuid()
305
+ self.multipart(options.multipart)
306
+ }
307
+
308
+ if (self.body) {
309
+ var length = 0
310
+ if (!Buffer.isBuffer(self.body)) {
311
+ if (Array.isArray(self.body)) {
312
+ for (var i = 0; i < self.body.length; i++) {
313
+ length += self.body[i].length
314
+ }
315
+ } else {
316
+ self.body = new Buffer(self.body)
317
+ length = self.body.length
318
+ }
319
+ } else {
320
+ length = self.body.length
321
+ }
322
+ if (length) {
323
+ if (!self.hasHeader('content-length')) self.setHeader('content-length', length)
324
+ } else {
325
+ throw new Error('Argument error, options.body.')
326
+ }
327
+ }
328
+
329
+ var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
330
+ , defaultModules = {'http:':http, 'https:':https}
331
+ , httpModules = self.httpModules || {}
332
+ ;
333
+ self.httpModule = httpModules[protocol] || defaultModules[protocol]
334
+
335
+ if (!self.httpModule) return this.emit('error', new Error("Invalid protocol"))
336
+
337
+ if (options.ca) self.ca = options.ca
338
+
339
+ if (!self.agent) {
340
+ if (options.agentOptions) self.agentOptions = options.agentOptions
341
+
342
+ if (options.agentClass) {
343
+ self.agentClass = options.agentClass
344
+ } else if (options.forever) {
345
+ self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
346
+ } else {
347
+ self.agentClass = self.httpModule.Agent
348
+ }
349
+ }
350
+
351
+ if (self.pool === false) {
352
+ self.agent = false
353
+ } else {
354
+ self.agent = self.agent || self.getAgent()
355
+ if (self.maxSockets) {
356
+ // Don't use our pooling if node has the refactored client
357
+ self.agent.maxSockets = self.maxSockets
358
+ }
359
+ if (self.pool.maxSockets) {
360
+ // Don't use our pooling if node has the refactored client
361
+ self.agent.maxSockets = self.pool.maxSockets
362
+ }
363
+ }
364
+
365
+ self.on('pipe', function (src) {
366
+ if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.")
367
+ self.src = src
368
+ if (isReadStream(src)) {
369
+ if (!self.hasHeader('content-type')) self.setHeader('content-type', mime.lookup(src.path))
370
+ } else {
371
+ if (src.headers) {
372
+ for (var i in src.headers) {
373
+ if (!self.hasHeader(i)) {
374
+ self.setHeader(i, src.headers[i])
375
+ }
376
+ }
377
+ }
378
+ if (self._json && !self.hasHeader('content-type'))
379
+ self.setHeader('content-type', 'application/json')
380
+ if (src.method && !self.explicitMethod) {
381
+ self.method = src.method
382
+ }
383
+ }
384
+
385
+ // self.on('pipe', function () {
386
+ // console.error("You have already piped to this stream. Pipeing twice is likely to break the request.")
387
+ // })
388
+ })
389
+
390
+ process.nextTick(function () {
391
+ if (self._aborted) return
392
+
393
+ if (self._form) {
394
+ self.setHeaders(self._form.getHeaders())
395
+ self._form.pipe(self)
396
+ }
397
+ if (self.body) {
398
+ if (Array.isArray(self.body)) {
399
+ self.body.forEach(function (part) {
400
+ self.write(part)
401
+ })
402
+ } else {
403
+ self.write(self.body)
404
+ }
405
+ self.end()
406
+ } else if (self.requestBodyStream) {
407
+ console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.")
408
+ self.requestBodyStream.pipe(self)
409
+ } else if (!self.src) {
410
+ if (self.method !== 'GET' && typeof self.method !== 'undefined') {
411
+ self.setHeader('content-length', 0)
412
+ }
413
+ self.end()
414
+ }
415
+ self.ntick = true
416
+ })
417
+ }
418
+
419
+ // Must call this when following a redirect from https to http or vice versa
420
+ // Attempts to keep everything as identical as possible, but update the
421
+ // httpModule, Tunneling agent, and/or Forever Agent in use.
422
+ Request.prototype._updateProtocol = function () {
423
+ var self = this
424
+ var protocol = self.uri.protocol
425
+
426
+ if (protocol === 'https:') {
427
+ // previously was doing http, now doing https
428
+ // if it's https, then we might need to tunnel now.
429
+ if (self.proxy && self.canTunnel) {
430
+ self.tunnel = true
431
+ var tunnelFn = self.proxy.protocol === 'http:'
432
+ ? tunnel.httpsOverHttp : tunnel.httpsOverHttps
433
+ var tunnelOptions = { proxy: { host: self.proxy.hostname
434
+ , port: +self.proxy.port
435
+ , proxyAuth: self.proxy.auth }
436
+ , rejectUnauthorized: self.rejectUnauthorized
437
+ , ca: self.ca }
438
+ self.agent = tunnelFn(tunnelOptions)
439
+ return
440
+ }
441
+
442
+ self.httpModule = https
443
+ switch (self.agentClass) {
444
+ case ForeverAgent:
445
+ self.agentClass = ForeverAgent.SSL
446
+ break
447
+ case http.Agent:
448
+ self.agentClass = https.Agent
449
+ break
450
+ default:
451
+ // nothing we can do. Just hope for the best.
452
+ return
453
+ }
454
+
455
+ // if there's an agent, we need to get a new one.
456
+ if (self.agent) self.agent = self.getAgent()
457
+
458
+ } else {
459
+ // previously was doing https, now doing http
460
+ // stop any tunneling.
461
+ if (self.tunnel) self.tunnel = false
462
+ self.httpModule = http
463
+ switch (self.agentClass) {
464
+ case ForeverAgent.SSL:
465
+ self.agentClass = ForeverAgent
466
+ break
467
+ case https.Agent:
468
+ self.agentClass = http.Agent
469
+ break
470
+ default:
471
+ // nothing we can do. just hope for the best
472
+ return
473
+ }
474
+
475
+ // if there's an agent, then get a new one.
476
+ if (self.agent) {
477
+ self.agent = null
478
+ self.agent = self.getAgent()
479
+ }
480
+ }
481
+ }
482
+
483
+ Request.prototype.getAgent = function () {
484
+ var Agent = this.agentClass
485
+ var options = {}
486
+ if (this.agentOptions) {
487
+ for (var i in this.agentOptions) {
488
+ options[i] = this.agentOptions[i]
489
+ }
490
+ }
491
+ if (this.ca) options.ca = this.ca
492
+ if (this.ciphers) options.ciphers = this.ciphers
493
+ if (this.secureProtocol) options.secureProtocol = this.secureProtocol
494
+ if (typeof this.rejectUnauthorized !== 'undefined') options.rejectUnauthorized = this.rejectUnauthorized
495
+
496
+ if (this.cert && this.key) {
497
+ options.key = this.key
498
+ options.cert = this.cert
499
+ }
500
+
501
+ var poolKey = ''
502
+
503
+ // different types of agents are in different pools
504
+ if (Agent !== this.httpModule.Agent) {
505
+ poolKey += Agent.name
506
+ }
507
+
508
+ if (!this.httpModule.globalAgent) {
509
+ // node 0.4.x
510
+ options.host = this.host
511
+ options.port = this.port
512
+ if (poolKey) poolKey += ':'
513
+ poolKey += this.host + ':' + this.port
514
+ }
515
+
516
+ // ca option is only relevant if proxy or destination are https
517
+ var proxy = this.proxy
518
+ if (typeof proxy === 'string') proxy = url.parse(proxy)
519
+ var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'
520
+ if (isHttps) {
521
+ if (options.ca) {
522
+ if (poolKey) poolKey += ':'
523
+ poolKey += options.ca
524
+ }
525
+
526
+ if (typeof options.rejectUnauthorized !== 'undefined') {
527
+ if (poolKey) poolKey += ':'
528
+ poolKey += options.rejectUnauthorized
529
+ }
530
+
531
+ if (options.cert)
532
+ poolKey += options.cert.toString('ascii') + options.key.toString('ascii')
533
+
534
+ if (options.ciphers) {
535
+ if (poolKey) poolKey += ':'
536
+ poolKey += options.ciphers
537
+ }
538
+
539
+ if (options.secureProtocol) {
540
+ if (poolKey) poolKey += ':'
541
+ poolKey += options.secureProtocol
542
+ }
543
+ }
544
+
545
+ if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) {
546
+ // not doing anything special. Use the globalAgent
547
+ return this.httpModule.globalAgent
548
+ }
549
+
550
+ // we're using a stored agent. Make sure it's protocol-specific
551
+ poolKey = this.uri.protocol + poolKey
552
+
553
+ // already generated an agent for this setting
554
+ if (this.pool[poolKey]) return this.pool[poolKey]
555
+
556
+ return this.pool[poolKey] = new Agent(options)
557
+ }
558
+
559
+ Request.prototype.start = function () {
560
+ // start() is called once we are ready to send the outgoing HTTP request.
561
+ // this is usually called on the first write(), end() or on nextTick()
562
+ var self = this
563
+
564
+ if (self._aborted) return
565
+
566
+ self._started = true
567
+ self.method = self.method || 'GET'
568
+ self.href = self.uri.href
569
+
570
+ if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {
571
+ self.setHeader('content-length', self.src.stat.size)
572
+ }
573
+ if (self._aws) {
574
+ self.aws(self._aws, true)
575
+ }
576
+
577
+ // We have a method named auth, which is completely different from the http.request
578
+ // auth option. If we don't remove it, we're gonna have a bad time.
579
+ var reqOptions = copy(self)
580
+ delete reqOptions.auth
581
+
582
+ debug('make request', self.uri.href)
583
+ self.req = self.httpModule.request(reqOptions, self.onResponse.bind(self))
584
+
585
+ if (self.timeout && !self.timeoutTimer) {
586
+ self.timeoutTimer = setTimeout(function () {
587
+ self.req.abort()
588
+ var e = new Error("ETIMEDOUT")
589
+ e.code = "ETIMEDOUT"
590
+ self.emit("error", e)
591
+ }, self.timeout)
592
+
593
+ // Set additional timeout on socket - in case if remote
594
+ // server freeze after sending headers
595
+ if (self.req.setTimeout) { // only works on node 0.6+
596
+ self.req.setTimeout(self.timeout, function () {
597
+ if (self.req) {
598
+ self.req.abort()
599
+ var e = new Error("ESOCKETTIMEDOUT")
600
+ e.code = "ESOCKETTIMEDOUT"
601
+ self.emit("error", e)
602
+ }
603
+ })
604
+ }
605
+ }
606
+
607
+ self.req.on('error', self.clientErrorHandler)
608
+ self.req.on('drain', function() {
609
+ self.emit('drain')
610
+ })
611
+ self.on('end', function() {
612
+ if ( self.req.connection ) self.req.connection.removeListener('error', self._parserErrorHandler)
613
+ })
614
+ self.emit('request', self.req)
615
+ }
616
+ Request.prototype.onResponse = function (response) {
617
+ var self = this
618
+ debug('onResponse', self.uri.href, response.statusCode, response.headers)
619
+ response.on('end', function() {
620
+ debug('response end', self.uri.href, response.statusCode, response.headers)
621
+ });
622
+
623
+ if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) {
624
+ response.connection.once('error', self._parserErrorHandler)
625
+ }
626
+ if (self._aborted) {
627
+ debug('aborted', self.uri.href)
628
+ response.resume()
629
+ return
630
+ }
631
+ if (self._paused) response.pause()
632
+ else response.resume()
633
+
634
+ self.response = response
635
+ response.request = self
636
+ response.toJSON = toJSON
637
+
638
+ // XXX This is different on 0.10, because SSL is strict by default
639
+ if (self.httpModule === https &&
640
+ self.strictSSL &&
641
+ !response.client.authorized) {
642
+ debug('strict ssl error', self.uri.href)
643
+ var sslErr = response.client.authorizationError
644
+ self.emit('error', new Error('SSL Error: '+ sslErr))
645
+ return
646
+ }
647
+
648
+ if (self.setHost && self.hasHeader('host')) delete self.headers[self.hasHeader('host')]
649
+ if (self.timeout && self.timeoutTimer) {
650
+ clearTimeout(self.timeoutTimer)
651
+ self.timeoutTimer = null
652
+ }
653
+
654
+ var addCookie = function (cookie) {
655
+ if (self._jar){
656
+ var targetCookieJar = self._jar.setCookie?self._jar:cookieJar;
657
+
658
+ //set the cookie if it's domain in the href's domain.
659
+ targetCookieJar.setCookie(cookie, self.uri.href, function(err){
660
+ if (err){
661
+ console.warn('set cookie failed,'+ err)
662
+ }
663
+ })
664
+ }
665
+
666
+ }
667
+
668
+ if (hasHeader('set-cookie', response.headers) && (!self._disableCookies)) {
669
+ var headerName = hasHeader('set-cookie', response.headers)
670
+ if (Array.isArray(response.headers[headerName])) response.headers[headerName].forEach(addCookie)
671
+ else addCookie(response.headers[headerName])
672
+ }
673
+
674
+ var redirectTo = null
675
+ if (response.statusCode >= 300 && response.statusCode < 400 && hasHeader('location', response.headers)) {
676
+ var location = response.headers[hasHeader('location', response.headers)]
677
+ debug('redirect', location)
678
+
679
+ if (self.followAllRedirects) {
680
+ redirectTo = location
681
+ } else if (self.followRedirect) {
682
+ switch (self.method) {
683
+ case 'PATCH':
684
+ case 'PUT':
685
+ case 'POST':
686
+ case 'DELETE':
687
+ // Do not follow redirects
688
+ break
689
+ default:
690
+ redirectTo = location
691
+ break
692
+ }
693
+ }
694
+ } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) {
695
+ var authHeader = response.headers[hasHeader('www-authenticate', response.headers)]
696
+ var authVerb = authHeader && authHeader.split(' ')[0]
697
+ debug('reauth', authVerb)
698
+
699
+ switch (authVerb) {
700
+ case 'Basic':
701
+ self.auth(self._user, self._pass, true)
702
+ redirectTo = self.uri
703
+ break
704
+
705
+ case 'Digest':
706
+ // TODO: More complete implementation of RFC 2617.
707
+ // - check challenge.algorithm
708
+ // - support algorithm="MD5-sess"
709
+ // - handle challenge.domain
710
+ // - support qop="auth-int" only
711
+ // - handle Authentication-Info (not necessarily?)
712
+ // - check challenge.stale (not necessarily?)
713
+ // - increase nc (not necessarily?)
714
+ // For reference:
715
+ // http://tools.ietf.org/html/rfc2617#section-3
716
+ // https://github.com/bagder/curl/blob/master/lib/http_digest.c
717
+
718
+ var challenge = {}
719
+ var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
720
+ for (;;) {
721
+ var match = re.exec(authHeader)
722
+ if (!match) break
723
+ challenge[match[1]] = match[2] || match[3];
724
+ }
725
+
726
+ var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass)
727
+ var ha2 = md5(self.method + ':' + self.uri.path)
728
+ var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
729
+ var nc = qop && '00000001'
730
+ var cnonce = qop && uuid().replace(/-/g, '')
731
+ var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2)
732
+ var authValues = {
733
+ username: self._user,
734
+ realm: challenge.realm,
735
+ nonce: challenge.nonce,
736
+ uri: self.uri.path,
737
+ qop: qop,
738
+ response: digestResponse,
739
+ nc: nc,
740
+ cnonce: cnonce,
741
+ algorithm: challenge.algorithm,
742
+ opaque: challenge.opaque
743
+ }
744
+
745
+ authHeader = []
746
+ for (var k in authValues) {
747
+ if (!authValues[k]) {
748
+ //ignore
749
+ } else if (k === 'qop' || k === 'nc' || k === 'algorithm') {
750
+ authHeader.push(k + '=' + authValues[k])
751
+ } else {
752
+ authHeader.push(k + '="' + authValues[k] + '"')
753
+ }
754
+ }
755
+ authHeader = 'Digest ' + authHeader.join(', ')
756
+ self.setHeader('authorization', authHeader)
757
+ self._sentAuth = true
758
+
759
+ redirectTo = self.uri
760
+ break
761
+ }
762
+ }
763
+
764
+ if (redirectTo) {
765
+ debug('redirect to', redirectTo)
766
+
767
+ // ignore any potential response body. it cannot possibly be useful
768
+ // to us at this point.
769
+ if (self._paused) response.resume()
770
+
771
+ if (self._redirectsFollowed >= self.maxRedirects) {
772
+ self.emit('error', new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+self.uri.href))
773
+ return
774
+ }
775
+ self._redirectsFollowed += 1
776
+
777
+ if (!isUrl.test(redirectTo)) {
778
+ redirectTo = url.resolve(self.uri.href, redirectTo)
779
+ }
780
+
781
+ var uriPrev = self.uri
782
+ self.uri = url.parse(redirectTo)
783
+
784
+ // handle the case where we change protocol from https to http or vice versa
785
+ if (self.uri.protocol !== uriPrev.protocol) {
786
+ self._updateProtocol()
787
+ }
788
+
789
+ self.redirects.push(
790
+ { statusCode : response.statusCode
791
+ , redirectUri: redirectTo
792
+ }
793
+ )
794
+ if (self.followAllRedirects && response.statusCode != 401) self.method = 'GET'
795
+ // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215
796
+ delete self.src
797
+ delete self.req
798
+ delete self.agent
799
+ delete self._started
800
+ if (response.statusCode != 401) {
801
+ // Remove parameters from the previous response, unless this is the second request
802
+ // for a server that requires digest authentication.
803
+ delete self.body
804
+ delete self._form
805
+ if (self.headers) {
806
+ if (self.hasHeader('host')) delete self.headers[self.hasHeader('host')]
807
+ if (self.hasHeader('content-type')) delete self.headers[self.hasHeader('content-type')]
808
+ if (self.hasHeader('content-length')) delete self.headers[self.hasHeader('content-length')]
809
+ }
810
+ }
811
+
812
+ self.emit('redirect');
813
+
814
+ self.init()
815
+ return // Ignore the rest of the response
816
+ } else {
817
+ self._redirectsFollowed = self._redirectsFollowed || 0
818
+ // Be a good stream and emit end when the response is finished.
819
+ // Hack to emit end on close because of a core bug that never fires end
820
+ response.on('close', function () {
821
+ if (!self._ended) self.response.emit('end')
822
+ })
823
+
824
+ if (self.encoding) {
825
+ if (self.dests.length !== 0) {
826
+ console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.")
827
+ } else {
828
+ response.setEncoding(self.encoding)
829
+ }
830
+ }
831
+
832
+ self.emit('response', response)
833
+
834
+ self.dests.forEach(function (dest) {
835
+ self.pipeDest(dest)
836
+ })
837
+
838
+ response.on("data", function (chunk) {
839
+ self._destdata = true
840
+ self.emit("data", chunk)
841
+ })
842
+ response.on("end", function (chunk) {
843
+ self._ended = true
844
+ self.emit("end", chunk)
845
+ })
846
+ response.on("close", function () {self.emit("close")})
847
+
848
+ if (self.callback) {
849
+ var buffer = []
850
+ var bodyLen = 0
851
+ self.on("data", function (chunk) {
852
+ buffer.push(chunk)
853
+ bodyLen += chunk.length
854
+ })
855
+ self.on("end", function () {
856
+ debug('end event', self.uri.href)
857
+ if (self._aborted) {
858
+ debug('aborted', self.uri.href)
859
+ return
860
+ }
861
+
862
+ if (buffer.length && Buffer.isBuffer(buffer[0])) {
863
+ debug('has body', self.uri.href, bodyLen)
864
+ var body = new Buffer(bodyLen)
865
+ var i = 0
866
+ buffer.forEach(function (chunk) {
867
+ chunk.copy(body, i, 0, chunk.length)
868
+ i += chunk.length
869
+ })
870
+ if (self.encoding === null) {
871
+ response.body = body
872
+ } else {
873
+ response.body = body.toString(self.encoding)
874
+ }
875
+ } else if (buffer.length) {
876
+ // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
877
+ // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
878
+ if (self.encoding === 'utf8' && buffer[0].length > 0 && buffer[0][0] === "\uFEFF") {
879
+ buffer[0] = buffer[0].substring(1)
880
+ }
881
+ response.body = buffer.join('')
882
+ }
883
+
884
+ if (self._json) {
885
+ try {
886
+ response.body = JSON.parse(response.body)
887
+ } catch (e) {}
888
+ }
889
+ debug('emitting complete', self.uri.href)
890
+ if(response.body == undefined && !self._json) {
891
+ response.body = "";
892
+ }
893
+ self.emit('complete', response, response.body)
894
+ })
895
+ }
896
+ //if no callback
897
+ else{
898
+ self.on("end", function () {
899
+ if (self._aborted) {
900
+ debug('aborted', self.uri.href)
901
+ return
902
+ }
903
+ self.emit('complete', response);
904
+ });
905
+ }
906
+ }
907
+ debug('finish init function', self.uri.href)
908
+ }
909
+
910
+ Request.prototype.abort = function () {
911
+ this._aborted = true
912
+
913
+ if (this.req) {
914
+ this.req.abort()
915
+ }
916
+ else if (this.response) {
917
+ this.response.abort()
918
+ }
919
+
920
+ this.emit("abort")
921
+ }
922
+
923
+ Request.prototype.pipeDest = function (dest) {
924
+ var response = this.response
925
+ // Called after the response is received
926
+ if (dest.headers && !dest.headersSent) {
927
+ if (hasHeader('content-type', response.headers)) {
928
+ var ctname = hasHeader('content-type', response.headers)
929
+ if (dest.setHeader) dest.setHeader(ctname, response.headers[ctname])
930
+ else dest.headers[ctname] = response.headers[ctname]
931
+ }
932
+
933
+ if (hasHeader('content-length', response.headers)) {
934
+ var clname = hasHeader('content-length', response.headers)
935
+ if (dest.setHeader) dest.setHeader(clname, response.headers[clname])
936
+ else dest.headers[clname] = response.headers[clname]
937
+ }
938
+ }
939
+ if (dest.setHeader && !dest.headersSent) {
940
+ for (var i in response.headers) {
941
+ dest.setHeader(i, response.headers[i])
942
+ }
943
+ dest.statusCode = response.statusCode
944
+ }
945
+ if (this.pipefilter) this.pipefilter(response, dest)
946
+ }
947
+
948
+ // Composable API
949
+ Request.prototype.setHeader = function (name, value, clobber) {
950
+ if (clobber === undefined) clobber = true
951
+ if (clobber || !this.hasHeader(name)) this.headers[name] = value
952
+ else this.headers[this.hasHeader(name)] += ',' + value
953
+ return this
954
+ }
955
+ Request.prototype.setHeaders = function (headers) {
956
+ for (var i in headers) {this.setHeader(i, headers[i])}
957
+ return this
958
+ }
959
+ Request.prototype.hasHeader = function (header, headers) {
960
+ var headers = Object.keys(headers || this.headers)
961
+ , lheaders = headers.map(function (h) {return h.toLowerCase()})
962
+ ;
963
+ header = header.toLowerCase()
964
+ for (var i=0;i<lheaders.length;i++) {
965
+ if (lheaders[i] === header) return headers[i]
966
+ }
967
+ return false
968
+ }
969
+
970
+ var hasHeader = Request.prototype.hasHeader
971
+
972
+ Request.prototype.qs = function (q, clobber) {
973
+ var base
974
+ if (!clobber && this.uri.query) base = qs.parse(this.uri.query)
975
+ else base = {}
976
+
977
+ for (var i in q) {
978
+ base[i] = q[i]
979
+ }
980
+
981
+ if (qs.stringify(base) === ''){
982
+ return this
983
+ }
984
+
985
+ this.uri = url.parse(this.uri.href.split('?')[0] + '?' + qs.stringify(base))
986
+ this.url = this.uri
987
+ this.path = this.uri.path
988
+
989
+ return this
990
+ }
991
+ Request.prototype.form = function (form) {
992
+ if (form) {
993
+ this.setHeader('content-type', 'application/x-www-form-urlencoded; charset=utf-8')
994
+ this.body = qs.stringify(form).toString('utf8')
995
+ return this
996
+ }
997
+ // create form-data object
998
+ this._form = new FormData()
999
+ return this._form
1000
+ }
1001
+ Request.prototype.multipart = function (multipart) {
1002
+ var self = this
1003
+ self.body = []
1004
+
1005
+ if (!self.hasHeader('content-type')) {
1006
+ self.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
1007
+ } else {
1008
+ var headerName = self.hasHeader('content-type');
1009
+ self.setHeader(headerName, self.headers[headerName].split(';')[0] + '; boundary=' + self.boundary)
1010
+ }
1011
+
1012
+ if (!multipart.forEach) throw new Error('Argument error, options.multipart.')
1013
+
1014
+ if (self.preambleCRLF) {
1015
+ self.body.push(new Buffer('\r\n'))
1016
+ }
1017
+
1018
+ multipart.forEach(function (part) {
1019
+ var body = part.body
1020
+ if(body == null) throw Error('Body attribute missing in multipart.')
1021
+ delete part.body
1022
+ var preamble = '--' + self.boundary + '\r\n'
1023
+ Object.keys(part).forEach(function (key) {
1024
+ preamble += key + ': ' + part[key] + '\r\n'
1025
+ })
1026
+ preamble += '\r\n'
1027
+ self.body.push(new Buffer(preamble))
1028
+ self.body.push(new Buffer(body))
1029
+ self.body.push(new Buffer('\r\n'))
1030
+ })
1031
+ self.body.push(new Buffer('--' + self.boundary + '--'))
1032
+ return self
1033
+ }
1034
+ Request.prototype.json = function (val) {
1035
+ var self = this
1036
+
1037
+ if (!self.hasHeader('accept')) self.setHeader('accept', 'application/json')
1038
+
1039
+ this._json = true
1040
+ if (typeof val === 'boolean') {
1041
+ if (typeof this.body === 'object') {
1042
+ this.body = safeStringify(this.body)
1043
+ self.setHeader('content-type', 'application/json')
1044
+ }
1045
+ } else {
1046
+ this.body = safeStringify(val)
1047
+ self.setHeader('content-type', 'application/json')
1048
+ }
1049
+ return this
1050
+ }
1051
+ Request.prototype.getHeader = function (name, headers) {
1052
+ var result, re, match
1053
+ if (!headers) headers = this.headers
1054
+ Object.keys(headers).forEach(function (key) {
1055
+ re = new RegExp(name, 'i')
1056
+ match = key.match(re)
1057
+ if (match) result = headers[key]
1058
+ })
1059
+ return result
1060
+ }
1061
+ var getHeader = Request.prototype.getHeader
1062
+
1063
+ Request.prototype.auth = function (user, pass, sendImmediately) {
1064
+ if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
1065
+ throw new Error('auth() received invalid user or password')
1066
+ }
1067
+ this._user = user
1068
+ this._pass = pass
1069
+ this._hasAuth = true
1070
+ var header = typeof pass !== 'undefined' ? user + ':' + pass : user
1071
+ if (sendImmediately || typeof sendImmediately == 'undefined') {
1072
+ this.setHeader('authorization', 'Basic ' + toBase64(header))
1073
+ this._sentAuth = true
1074
+ }
1075
+ return this
1076
+ }
1077
+ Request.prototype.aws = function (opts, now) {
1078
+ if (!now) {
1079
+ this._aws = opts
1080
+ return this
1081
+ }
1082
+ var date = new Date()
1083
+ this.setHeader('date', date.toUTCString())
1084
+ var auth =
1085
+ { key: opts.key
1086
+ , secret: opts.secret
1087
+ , verb: this.method.toUpperCase()
1088
+ , date: date
1089
+ , contentType: this.getHeader('content-type') || ''
1090
+ , md5: this.getHeader('content-md5') || ''
1091
+ , amazonHeaders: aws.canonicalizeHeaders(this.headers)
1092
+ }
1093
+ if (opts.bucket && this.path) {
1094
+ auth.resource = '/' + opts.bucket + this.path
1095
+ } else if (opts.bucket && !this.path) {
1096
+ auth.resource = '/' + opts.bucket
1097
+ } else if (!opts.bucket && this.path) {
1098
+ auth.resource = this.path
1099
+ } else if (!opts.bucket && !this.path) {
1100
+ auth.resource = '/'
1101
+ }
1102
+ auth.resource = aws.canonicalizeResource(auth.resource)
1103
+ this.setHeader('authorization', aws.authorization(auth))
1104
+
1105
+ return this
1106
+ }
1107
+ Request.prototype.httpSignature = function (opts) {
1108
+ var req = this
1109
+ httpSignature.signRequest({
1110
+ getHeader: function(header) {
1111
+ return getHeader(header, req.headers)
1112
+ },
1113
+ setHeader: function(header, value) {
1114
+ req.setHeader(header, value)
1115
+ },
1116
+ method: this.method,
1117
+ path: this.path
1118
+ }, opts)
1119
+ debug('httpSignature authorization', this.getHeader('authorization'))
1120
+
1121
+ return this
1122
+ }
1123
+
1124
+ Request.prototype.hawk = function (opts) {
1125
+ this.setHeader('Authorization', hawk.client.header(this.uri, this.method, opts).field)
1126
+ }
1127
+
1128
+ Request.prototype.oauth = function (_oauth) {
1129
+ var form
1130
+ if (this.hasHeader('content-type') &&
1131
+ this.getHeader('content-type').slice(0, 'application/x-www-form-urlencoded'.length) ===
1132
+ 'application/x-www-form-urlencoded'
1133
+ ) {
1134
+ form = qs.parse(this.body)
1135
+ }
1136
+ if (this.uri.query) {
1137
+ form = qs.parse(this.uri.query)
1138
+ }
1139
+ if (!form) form = {}
1140
+ var oa = {}
1141
+ for (var i in form) oa[i] = form[i]
1142
+ for (var i in _oauth) oa['oauth_'+i] = _oauth[i]
1143
+ if (!oa.oauth_version) oa.oauth_version = '1.0'
1144
+ if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString()
1145
+ if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '')
1146
+
1147
+ oa.oauth_signature_method = 'HMAC-SHA1'
1148
+
1149
+ var consumer_secret = oa.oauth_consumer_secret
1150
+ delete oa.oauth_consumer_secret
1151
+ var token_secret = oa.oauth_token_secret
1152
+ delete oa.oauth_token_secret
1153
+ var timestamp = oa.oauth_timestamp
1154
+
1155
+ var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname
1156
+ var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret)
1157
+
1158
+ // oa.oauth_signature = signature
1159
+ for (var i in form) {
1160
+ if ( i.slice(0, 'oauth_') in _oauth) {
1161
+ // skip
1162
+ } else {
1163
+ delete oa['oauth_'+i]
1164
+ if (i !== 'x_auth_mode') delete oa[i]
1165
+ }
1166
+ }
1167
+ oa.oauth_timestamp = timestamp
1168
+ var authHeader = 'OAuth '+Object.keys(oa).sort().map(function (i) {return i+'="'+oauth.rfc3986(oa[i])+'"'}).join(',')
1169
+ authHeader += ',oauth_signature="' + oauth.rfc3986(signature) + '"'
1170
+ this.setHeader('Authorization', authHeader)
1171
+ return this
1172
+ }
1173
+ Request.prototype.jar = function (jar) {
1174
+ var cookies
1175
+
1176
+ if (this._redirectsFollowed === 0) {
1177
+ this.originalCookieHeader = this.getHeader('cookie')
1178
+ }
1179
+
1180
+ if (!jar) {
1181
+ // disable cookies
1182
+ cookies = false
1183
+ this._disableCookies = true
1184
+ } else {
1185
+ var targetCookieJar = (jar && jar.getCookieString)?jar:cookieJar;
1186
+ var urihref = this.uri.href
1187
+
1188
+ //fetch cookie in the Specified host
1189
+ targetCookieJar.getCookieString(urihref, function(err, hrefCookie){
1190
+ if (err){
1191
+ console.warn('get cookieString failed,' +err)
1192
+ } else {
1193
+ cookies = hrefCookie
1194
+ }
1195
+ })
1196
+
1197
+ }
1198
+
1199
+ //if need cookie and cookie is not empty
1200
+ if (cookies && cookies.length) {
1201
+ if (this.originalCookieHeader) {
1202
+ // Don't overwrite existing Cookie header
1203
+ this.setHeader('cookie', this.originalCookieHeader + '; ' + cookies)
1204
+ } else {
1205
+ this.setHeader('cookie', cookies)
1206
+ }
1207
+ }
1208
+ this._jar = jar
1209
+ return this
1210
+ }
1211
+
1212
+
1213
+ // Stream API
1214
+ Request.prototype.pipe = function (dest, opts) {
1215
+ if (this.response) {
1216
+ if (this._destdata) {
1217
+ throw new Error("You cannot pipe after data has been emitted from the response.")
1218
+ } else if (this._ended) {
1219
+ throw new Error("You cannot pipe after the response has been ended.")
1220
+ } else {
1221
+ stream.Stream.prototype.pipe.call(this, dest, opts)
1222
+ this.pipeDest(dest)
1223
+ return dest
1224
+ }
1225
+ } else {
1226
+ this.dests.push(dest)
1227
+ stream.Stream.prototype.pipe.call(this, dest, opts)
1228
+ return dest
1229
+ }
1230
+ }
1231
+ Request.prototype.write = function () {
1232
+ if (!this._started) this.start()
1233
+ return this.req.write.apply(this.req, arguments)
1234
+ }
1235
+ Request.prototype.end = function (chunk) {
1236
+ if (chunk) this.write(chunk)
1237
+ if (!this._started) this.start()
1238
+ this.req.end()
1239
+ }
1240
+ Request.prototype.pause = function () {
1241
+ if (!this.response) this._paused = true
1242
+ else this.response.pause.apply(this.response, arguments)
1243
+ }
1244
+ Request.prototype.resume = function () {
1245
+ if (!this.response) this._paused = false
1246
+ else this.response.resume.apply(this.response, arguments)
1247
+ }
1248
+ Request.prototype.destroy = function () {
1249
+ if (!this._ended) this.end()
1250
+ else if (this.response) this.response.destroy()
1251
+ }
1252
+
1253
+ function toJSON () {
1254
+ return getSafe(this, '__' + (((1+Math.random())*0x10000)|0).toString(16))
1255
+ }
1256
+
1257
+ Request.prototype.toJSON = toJSON
1258
+
1259
+
1260
+ module.exports = Request