ai 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/LICENSE +10 -24
  2. package/dist/ai-stream.d.ts +18 -0
  3. package/dist/ai-stream.js +132 -0
  4. package/dist/ai-stream.mjs +13 -0
  5. package/dist/anthropic-stream.d.ts +5 -0
  6. package/dist/anthropic-stream.js +133 -0
  7. package/dist/anthropic-stream.mjs +8 -0
  8. package/dist/chunk-265FSSO4.mjs +91 -0
  9. package/dist/chunk-2L3ZO4UM.mjs +45 -0
  10. package/dist/chunk-EZJ7FC5E.mjs +33 -0
  11. package/dist/chunk-JGDC3BXD.mjs +22 -0
  12. package/dist/chunk-NK2CVBLI.mjs +38 -0
  13. package/dist/chunk-PEYAHBDF.mjs +43 -0
  14. package/dist/chunk-TJMME6CL.mjs +24 -0
  15. package/dist/huggingface-stream.d.ts +5 -0
  16. package/dist/huggingface-stream.js +121 -0
  17. package/dist/huggingface-stream.mjs +8 -0
  18. package/dist/index.d.ts +131 -0
  19. package/dist/index.js +278 -0
  20. package/dist/index.mjs +35 -0
  21. package/dist/index.test.d.ts +2 -0
  22. package/dist/index.test.js +12 -0
  23. package/dist/index.test.mjs +10 -0
  24. package/dist/langchain-stream.d.ts +12 -0
  25. package/dist/langchain-stream.js +102 -0
  26. package/dist/langchain-stream.mjs +8 -0
  27. package/dist/openai-stream.d.ts +5 -0
  28. package/dist/openai-stream.js +144 -0
  29. package/dist/openai-stream.mjs +8 -0
  30. package/dist/streaming-text-response.d.ts +17 -0
  31. package/dist/streaming-text-response.js +75 -0
  32. package/dist/streaming-text-response.mjs +9 -0
  33. package/package.json +78 -29
  34. package/react/dist/chunk-5PP6W52J.mjs +202 -0
  35. package/react/dist/chunk-6EH3SWMP.mjs +55 -0
  36. package/react/dist/chunk-PW6HSU2N.mjs +154 -0
  37. package/react/dist/index.d.ts +3 -0
  38. package/react/dist/index.js +424 -0
  39. package/react/dist/index.mjs +12 -0
  40. package/react/dist/types-f862f74a.d.ts +123 -0
  41. package/react/dist/use-chat.d.ts +42 -0
  42. package/react/dist/use-chat.js +276 -0
  43. package/react/dist/use-chat.mjs +8 -0
  44. package/react/dist/use-completion.d.ts +47 -0
  45. package/react/dist/use-completion.js +229 -0
  46. package/react/dist/use-completion.mjs +8 -0
  47. package/svelte/dist/chunk-6USBQIV6.mjs +177 -0
  48. package/svelte/dist/chunk-BQ64GHZ3.mjs +136 -0
  49. package/svelte/dist/chunk-CENOSGDG.mjs +493 -0
  50. package/svelte/dist/index.d.ts +4 -0
  51. package/svelte/dist/index.js +808 -0
  52. package/svelte/dist/index.mjs +11 -0
  53. package/svelte/dist/types-f862f74a.d.ts +123 -0
  54. package/svelte/dist/use-chat.d.ts +39 -0
  55. package/svelte/dist/use-chat.js +680 -0
  56. package/svelte/dist/use-chat.mjs +7 -0
  57. package/svelte/dist/use-completion.d.ts +38 -0
  58. package/svelte/dist/use-completion.js +640 -0
  59. package/svelte/dist/use-completion.mjs +7 -0
  60. package/.npmignore +0 -15
  61. package/.travis.yml +0 -4
  62. package/README.md +0 -21
  63. package/bin/ai.js +0 -22
  64. package/index.js +0 -32
  65. package/node_modules/request/.npmignore +0 -2
  66. package/node_modules/request/.travis.yml +0 -12
  67. package/node_modules/request/CHANGELOG.md +0 -954
  68. package/node_modules/request/LICENSE +0 -55
  69. package/node_modules/request/README.md +0 -421
  70. package/node_modules/request/index.js +0 -166
  71. package/node_modules/request/lib/cookies.js +0 -40
  72. package/node_modules/request/lib/copy.js +0 -8
  73. package/node_modules/request/lib/debug.js +0 -7
  74. package/node_modules/request/lib/getSafe.js +0 -34
  75. package/node_modules/request/lib/optional.js +0 -5
  76. package/node_modules/request/node_modules/aws-sign2/LICENSE +0 -55
  77. package/node_modules/request/node_modules/aws-sign2/README.md +0 -4
  78. package/node_modules/request/node_modules/aws-sign2/index.js +0 -202
  79. package/node_modules/request/node_modules/aws-sign2/package.json +0 -47
  80. package/node_modules/request/node_modules/forever-agent/LICENSE +0 -55
  81. package/node_modules/request/node_modules/forever-agent/README.md +0 -4
  82. package/node_modules/request/node_modules/forever-agent/index.js +0 -119
  83. package/node_modules/request/node_modules/forever-agent/package.json +0 -46
  84. package/node_modules/request/node_modules/form-data/License +0 -19
  85. package/node_modules/request/node_modules/form-data/Readme.md +0 -175
  86. package/node_modules/request/node_modules/form-data/lib/form_data.js +0 -351
  87. package/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +0 -3
  88. package/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +0 -19
  89. package/node_modules/request/node_modules/form-data/node_modules/async/README.md +0 -1646
  90. package/node_modules/request/node_modules/form-data/node_modules/async/component.json +0 -11
  91. package/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +0 -1123
  92. package/node_modules/request/node_modules/form-data/node_modules/async/package.json +0 -60
  93. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +0 -19
  94. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +0 -132
  95. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +0 -186
  96. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +0 -2
  97. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +0 -19
  98. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +0 -7
  99. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +0 -154
  100. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +0 -99
  101. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +0 -42
  102. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +0 -6
  103. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +0 -38
  104. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +0 -21
  105. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +0 -14
  106. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +0 -48
  107. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +0 -15
  108. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +0 -18
  109. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +0 -13
  110. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +0 -13
  111. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +0 -7
  112. package/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +0 -61
  113. package/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE +0 -19
  114. package/node_modules/request/node_modules/form-data/node_modules/mime/README.md +0 -66
  115. package/node_modules/request/node_modules/form-data/node_modules/mime/mime.js +0 -114
  116. package/node_modules/request/node_modules/form-data/node_modules/mime/package.json +0 -59
  117. package/node_modules/request/node_modules/form-data/node_modules/mime/test.js +0 -84
  118. package/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types +0 -1588
  119. package/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types +0 -77
  120. package/node_modules/request/node_modules/form-data/package.json +0 -80
  121. package/node_modules/request/node_modules/hawk/.npmignore +0 -18
  122. package/node_modules/request/node_modules/hawk/.travis.yml +0 -5
  123. package/node_modules/request/node_modules/hawk/LICENSE +0 -24
  124. package/node_modules/request/node_modules/hawk/Makefile +0 -10
  125. package/node_modules/request/node_modules/hawk/README.md +0 -625
  126. package/node_modules/request/node_modules/hawk/example/usage.js +0 -78
  127. package/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
  128. package/node_modules/request/node_modules/hawk/images/logo.png +0 -0
  129. package/node_modules/request/node_modules/hawk/index.js +0 -1
  130. package/node_modules/request/node_modules/hawk/lib/browser.js +0 -507
  131. package/node_modules/request/node_modules/hawk/lib/client.js +0 -371
  132. package/node_modules/request/node_modules/hawk/lib/crypto.js +0 -118
  133. package/node_modules/request/node_modules/hawk/lib/index.js +0 -15
  134. package/node_modules/request/node_modules/hawk/lib/server.js +0 -523
  135. package/node_modules/request/node_modules/hawk/lib/utils.js +0 -183
  136. package/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +0 -18
  137. package/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +0 -5
  138. package/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +0 -24
  139. package/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +0 -11
  140. package/node_modules/request/node_modules/hawk/node_modules/boom/README.md +0 -6
  141. package/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
  142. package/node_modules/request/node_modules/hawk/node_modules/boom/index.js +0 -1
  143. package/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +0 -207
  144. package/node_modules/request/node_modules/hawk/node_modules/boom/package.json +0 -64
  145. package/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +0 -245
  146. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +0 -18
  147. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +0 -5
  148. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +0 -24
  149. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +0 -11
  150. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +0 -6
  151. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +0 -1
  152. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +0 -68
  153. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +0 -65
  154. package/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +0 -101
  155. package/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +0 -18
  156. package/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +0 -5
  157. package/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +0 -33
  158. package/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +0 -10
  159. package/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +0 -436
  160. package/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
  161. package/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +0 -1
  162. package/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +0 -132
  163. package/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +0 -585
  164. package/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +0 -70
  165. package/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +0 -86
  166. package/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +0 -1078
  167. package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +0 -1
  168. package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +0 -1
  169. package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +0 -1
  170. package/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +0 -18
  171. package/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +0 -5
  172. package/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +0 -24
  173. package/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +0 -11
  174. package/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +0 -68
  175. package/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +0 -16
  176. package/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +0 -25
  177. package/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +0 -1
  178. package/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +0 -409
  179. package/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +0 -65
  180. package/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +0 -359
  181. package/node_modules/request/node_modules/hawk/package.json +0 -70
  182. package/node_modules/request/node_modules/hawk/test/browser.js +0 -817
  183. package/node_modules/request/node_modules/hawk/test/client.js +0 -206
  184. package/node_modules/request/node_modules/hawk/test/crypto.js +0 -86
  185. package/node_modules/request/node_modules/hawk/test/index.js +0 -316
  186. package/node_modules/request/node_modules/hawk/test/message.js +0 -246
  187. package/node_modules/request/node_modules/hawk/test/readme.js +0 -98
  188. package/node_modules/request/node_modules/hawk/test/server.js +0 -686
  189. package/node_modules/request/node_modules/hawk/test/uri.js +0 -456
  190. package/node_modules/request/node_modules/hawk/test/utils.js +0 -120
  191. package/node_modules/request/node_modules/http-signature/.dir-locals.el +0 -6
  192. package/node_modules/request/node_modules/http-signature/.npmignore +0 -7
  193. package/node_modules/request/node_modules/http-signature/LICENSE +0 -18
  194. package/node_modules/request/node_modules/http-signature/README.md +0 -75
  195. package/node_modules/request/node_modules/http-signature/http_signing.md +0 -296
  196. package/node_modules/request/node_modules/http-signature/lib/index.js +0 -25
  197. package/node_modules/request/node_modules/http-signature/lib/parser.js +0 -304
  198. package/node_modules/request/node_modules/http-signature/lib/signer.js +0 -179
  199. package/node_modules/request/node_modules/http-signature/lib/util.js +0 -249
  200. package/node_modules/request/node_modules/http-signature/lib/verify.js +0 -42
  201. package/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +0 -2
  202. package/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +0 -19
  203. package/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +0 -50
  204. package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +0 -13
  205. package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +0 -27
  206. package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +0 -267
  207. package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +0 -36
  208. package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +0 -317
  209. package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +0 -20
  210. package/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +0 -63
  211. package/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +0 -172
  212. package/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +0 -296
  213. package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +0 -126
  214. package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +0 -196
  215. package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +0 -38
  216. package/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +0 -71
  217. package/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +0 -24
  218. package/node_modules/request/node_modules/http-signature/node_modules/ctype/README +0 -82
  219. package/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +0 -298
  220. package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +0 -245
  221. package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +0 -1485
  222. package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +0 -944
  223. package/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +0 -241
  224. package/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +0 -36
  225. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +0 -129
  226. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +0 -839
  227. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json +0 -13
  228. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json +0 -13
  229. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json +0 -104
  230. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json +0 -19
  231. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js +0 -39
  232. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js +0 -14
  233. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js +0 -14
  234. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js +0 -17
  235. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js +0 -18
  236. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js +0 -15
  237. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json +0 -14
  238. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js +0 -767
  239. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js +0 -753
  240. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js +0 -638
  241. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js +0 -101
  242. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js +0 -53
  243. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js +0 -92
  244. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js +0 -451
  245. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js +0 -81
  246. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js +0 -95
  247. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js +0 -156
  248. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js +0 -50
  249. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js +0 -44
  250. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js +0 -42
  251. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js +0 -45
  252. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js +0 -28
  253. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js +0 -128
  254. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js +0 -28
  255. package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js +0 -31
  256. package/node_modules/request/node_modules/http-signature/package.json +0 -54
  257. package/node_modules/request/node_modules/json-stringify-safe/LICENSE +0 -27
  258. package/node_modules/request/node_modules/json-stringify-safe/README.md +0 -49
  259. package/node_modules/request/node_modules/json-stringify-safe/package.json +0 -51
  260. package/node_modules/request/node_modules/json-stringify-safe/stringify.js +0 -39
  261. package/node_modules/request/node_modules/json-stringify-safe/test.js +0 -128
  262. package/node_modules/request/node_modules/mime-types/.npmignore +0 -14
  263. package/node_modules/request/node_modules/mime-types/.travis.yml +0 -12
  264. package/node_modules/request/node_modules/mime-types/LICENSE +0 -22
  265. package/node_modules/request/node_modules/mime-types/Makefile +0 -9
  266. package/node_modules/request/node_modules/mime-types/README.md +0 -101
  267. package/node_modules/request/node_modules/mime-types/SOURCES.md +0 -17
  268. package/node_modules/request/node_modules/mime-types/component.json +0 -16
  269. package/node_modules/request/node_modules/mime-types/lib/custom.json +0 -27
  270. package/node_modules/request/node_modules/mime-types/lib/index.js +0 -75
  271. package/node_modules/request/node_modules/mime-types/lib/mime.json +0 -3317
  272. package/node_modules/request/node_modules/mime-types/lib/node.json +0 -55
  273. package/node_modules/request/node_modules/mime-types/package.json +0 -69
  274. package/node_modules/request/node_modules/node-uuid/.npmignore +0 -2
  275. package/node_modules/request/node_modules/node-uuid/LICENSE.md +0 -2
  276. package/node_modules/request/node_modules/node-uuid/README.md +0 -207
  277. package/node_modules/request/node_modules/node-uuid/benchmark/README.md +0 -53
  278. package/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +0 -174
  279. package/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +0 -34
  280. package/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
  281. package/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +0 -84
  282. package/node_modules/request/node_modules/node-uuid/component.json +0 -18
  283. package/node_modules/request/node_modules/node-uuid/package.json +0 -54
  284. package/node_modules/request/node_modules/node-uuid/test/compare_v1.js +0 -63
  285. package/node_modules/request/node_modules/node-uuid/test/test.html +0 -17
  286. package/node_modules/request/node_modules/node-uuid/test/test.js +0 -228
  287. package/node_modules/request/node_modules/node-uuid/uuid.js +0 -245
  288. package/node_modules/request/node_modules/oauth-sign/LICENSE +0 -55
  289. package/node_modules/request/node_modules/oauth-sign/README.md +0 -4
  290. package/node_modules/request/node_modules/oauth-sign/index.js +0 -43
  291. package/node_modules/request/node_modules/oauth-sign/package.json +0 -49
  292. package/node_modules/request/node_modules/oauth-sign/test.js +0 -49
  293. package/node_modules/request/node_modules/qs/.jshintignore +0 -1
  294. package/node_modules/request/node_modules/qs/.jshintrc +0 -10
  295. package/node_modules/request/node_modules/qs/.npmignore +0 -18
  296. package/node_modules/request/node_modules/qs/.travis.yml +0 -4
  297. package/node_modules/request/node_modules/qs/LICENSE +0 -28
  298. package/node_modules/request/node_modules/qs/Makefile +0 -8
  299. package/node_modules/request/node_modules/qs/Readme.md +0 -120
  300. package/node_modules/request/node_modules/qs/index.js +0 -1
  301. package/node_modules/request/node_modules/qs/lib/index.js +0 -15
  302. package/node_modules/request/node_modules/qs/lib/parse.js +0 -151
  303. package/node_modules/request/node_modules/qs/lib/stringify.js +0 -52
  304. package/node_modules/request/node_modules/qs/lib/utils.js +0 -131
  305. package/node_modules/request/node_modules/qs/package.json +0 -61
  306. package/node_modules/request/node_modules/qs/test/parse.js +0 -236
  307. package/node_modules/request/node_modules/qs/test/stringify.js +0 -123
  308. package/node_modules/request/node_modules/stringstream/.npmignore +0 -15
  309. package/node_modules/request/node_modules/stringstream/.travis.yml +0 -4
  310. package/node_modules/request/node_modules/stringstream/LICENSE.txt +0 -4
  311. package/node_modules/request/node_modules/stringstream/README.md +0 -38
  312. package/node_modules/request/node_modules/stringstream/example.js +0 -27
  313. package/node_modules/request/node_modules/stringstream/package.json +0 -48
  314. package/node_modules/request/node_modules/stringstream/stringstream.js +0 -102
  315. package/node_modules/request/node_modules/tough-cookie/.jshintrc +0 -70
  316. package/node_modules/request/node_modules/tough-cookie/.npmignore +0 -3
  317. package/node_modules/request/node_modules/tough-cookie/.travis.yml +0 -8
  318. package/node_modules/request/node_modules/tough-cookie/LICENSE +0 -78
  319. package/node_modules/request/node_modules/tough-cookie/README.md +0 -412
  320. package/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +0 -239
  321. package/node_modules/request/node_modules/tough-cookie/lib/cookie.js +0 -1107
  322. package/node_modules/request/node_modules/tough-cookie/lib/memstore.js +0 -123
  323. package/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +0 -69
  324. package/node_modules/request/node_modules/tough-cookie/lib/store.js +0 -37
  325. package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +0 -20
  326. package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +0 -176
  327. package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +0 -87
  328. package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +0 -528
  329. package/node_modules/request/node_modules/tough-cookie/package.json +0 -67
  330. package/node_modules/request/node_modules/tough-cookie/public-suffix.txt +0 -5229
  331. package/node_modules/request/node_modules/tough-cookie/test.js +0 -1625
  332. package/node_modules/request/node_modules/tunnel-agent/.jshintrc +0 -5
  333. package/node_modules/request/node_modules/tunnel-agent/LICENSE +0 -55
  334. package/node_modules/request/node_modules/tunnel-agent/README.md +0 -4
  335. package/node_modules/request/node_modules/tunnel-agent/index.js +0 -236
  336. package/node_modules/request/node_modules/tunnel-agent/package.json +0 -46
  337. package/node_modules/request/package.json +0 -77
  338. package/node_modules/request/request.js +0 -1428
  339. package/test/fixtures/github-response.json +0 -1367
  340. package/test/index.js +0 -55
@@ -1,179 +0,0 @@
1
- // Copyright 2012 Joyent, Inc. All rights reserved.
2
-
3
- var assert = require('assert-plus');
4
- var crypto = require('crypto');
5
- var http = require('http');
6
-
7
- var sprintf = require('util').format;
8
-
9
-
10
-
11
- ///--- Globals
12
-
13
- var Algorithms = {
14
- 'rsa-sha1': true,
15
- 'rsa-sha256': true,
16
- 'rsa-sha512': true,
17
- 'dsa-sha1': true,
18
- 'hmac-sha1': true,
19
- 'hmac-sha256': true,
20
- 'hmac-sha512': true
21
- };
22
-
23
- var Authorization =
24
- 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
25
-
26
-
27
-
28
- ///--- Specific Errors
29
-
30
- function MissingHeaderError(message) {
31
- this.name = 'MissingHeaderError';
32
- this.message = message;
33
- this.stack = (new Error()).stack;
34
- }
35
- MissingHeaderError.prototype = new Error();
36
-
37
-
38
- function InvalidAlgorithmError(message) {
39
- this.name = 'InvalidAlgorithmError';
40
- this.message = message;
41
- this.stack = (new Error()).stack;
42
- }
43
- InvalidAlgorithmError.prototype = new Error();
44
-
45
-
46
-
47
- ///--- Internal Functions
48
-
49
- function _pad(val) {
50
- if (parseInt(val, 10) < 10) {
51
- val = '0' + val;
52
- }
53
- return val;
54
- }
55
-
56
-
57
- function _rfc1123() {
58
- var date = new Date();
59
-
60
- var months = ['Jan',
61
- 'Feb',
62
- 'Mar',
63
- 'Apr',
64
- 'May',
65
- 'Jun',
66
- 'Jul',
67
- 'Aug',
68
- 'Sep',
69
- 'Oct',
70
- 'Nov',
71
- 'Dec'];
72
- var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
73
- return days[date.getUTCDay()] + ', ' +
74
- _pad(date.getUTCDate()) + ' ' +
75
- months[date.getUTCMonth()] + ' ' +
76
- date.getUTCFullYear() + ' ' +
77
- _pad(date.getUTCHours()) + ':' +
78
- _pad(date.getUTCMinutes()) + ':' +
79
- _pad(date.getUTCSeconds()) +
80
- ' GMT';
81
- }
82
-
83
-
84
-
85
- ///--- Exported API
86
-
87
- module.exports = {
88
-
89
- /**
90
- * Adds an 'Authorization' header to an http.ClientRequest object.
91
- *
92
- * Note that this API will add a Date header if it's not already set. Any
93
- * other headers in the options.headers array MUST be present, or this
94
- * will throw.
95
- *
96
- * You shouldn't need to check the return type; it's just there if you want
97
- * to be pedantic.
98
- *
99
- * @param {Object} request an instance of http.ClientRequest.
100
- * @param {Object} options signing parameters object:
101
- * - {String} keyId required.
102
- * - {String} key required (either a PEM or HMAC key).
103
- * - {Array} headers optional; defaults to ['date'].
104
- * - {String} algorithm optional; defaults to 'rsa-sha256'.
105
- * - {String} httpVersion optional; defaults to '1.1'.
106
- * @return {Boolean} true if Authorization (and optionally Date) were added.
107
- * @throws {TypeError} on bad parameter types (input).
108
- * @throws {InvalidAlgorithmError} if algorithm was bad.
109
- * @throws {MissingHeaderError} if a header to be signed was specified but
110
- * was not present.
111
- */
112
- signRequest: function signRequest(request, options) {
113
- assert.object(request, 'request');
114
- assert.object(options, 'options');
115
- assert.optionalString(options.algorithm, 'options.algorithm');
116
- assert.string(options.keyId, 'options.keyId');
117
- assert.optionalArrayOfString(options.headers, 'options.headers');
118
- assert.optionalString(options.httpVersion, 'options.httpVersion');
119
-
120
- if (!request.getHeader('Date'))
121
- request.setHeader('Date', _rfc1123());
122
- if (!options.headers)
123
- options.headers = ['date'];
124
- if (!options.algorithm)
125
- options.algorithm = 'rsa-sha256';
126
- if (!options.httpVersion)
127
- options.httpVersion = '1.1';
128
-
129
- options.algorithm = options.algorithm.toLowerCase();
130
-
131
- if (!Algorithms[options.algorithm])
132
- throw new InvalidAlgorithmError(options.algorithm + ' is not supported');
133
-
134
- var i;
135
- var stringToSign = '';
136
- for (i = 0; i < options.headers.length; i++) {
137
- if (typeof (options.headers[i]) !== 'string')
138
- throw new TypeError('options.headers must be an array of Strings');
139
-
140
- var h = options.headers[i].toLowerCase();
141
-
142
- if (h !== 'request-line') {
143
- var value = request.getHeader(h);
144
- if (!value) {
145
- throw new MissingHeaderError(h + ' was not in the request');
146
- }
147
- stringToSign += h + ': ' + value;
148
- } else {
149
- value =
150
- stringToSign +=
151
- request.method + ' ' + request.path + ' HTTP/' + options.httpVersion;
152
- }
153
-
154
- if ((i + 1) < options.headers.length)
155
- stringToSign += '\n';
156
- }
157
-
158
- var alg = options.algorithm.match(/(hmac|rsa)-(\w+)/);
159
- var signature;
160
- if (alg[1] === 'hmac') {
161
- var hmac = crypto.createHmac(alg[2].toUpperCase(), options.key);
162
- hmac.update(stringToSign);
163
- signature = hmac.digest('base64');
164
- } else {
165
- var signer = crypto.createSign(options.algorithm.toUpperCase());
166
- signer.update(stringToSign);
167
- signature = signer.sign(options.key, 'base64');
168
- }
169
-
170
- request.setHeader('Authorization', sprintf(Authorization,
171
- options.keyId,
172
- options.algorithm,
173
- options.headers.join(' '),
174
- signature));
175
-
176
- return true;
177
- }
178
-
179
- };
@@ -1,249 +0,0 @@
1
- // Copyright 2012 Joyent, Inc. All rights reserved.
2
-
3
- var assert = require('assert-plus');
4
- var crypto = require('crypto');
5
-
6
- var asn1 = require('asn1');
7
- var ctype = require('ctype');
8
-
9
-
10
-
11
- ///--- Helpers
12
-
13
- function readNext(buffer, offset) {
14
- var len = ctype.ruint32(buffer, 'big', offset);
15
- offset += 4;
16
-
17
- var newOffset = offset + len;
18
-
19
- return {
20
- data: buffer.slice(offset, newOffset),
21
- offset: newOffset
22
- };
23
- }
24
-
25
-
26
- function writeInt(writer, buffer) {
27
- writer.writeByte(0x02); // ASN1.Integer
28
- writer.writeLength(buffer.length);
29
-
30
- for (var i = 0; i < buffer.length; i++)
31
- writer.writeByte(buffer[i]);
32
-
33
- return writer;
34
- }
35
-
36
-
37
- function rsaToPEM(key) {
38
- var buffer;
39
- var der;
40
- var exponent;
41
- var i;
42
- var modulus;
43
- var newKey = '';
44
- var offset = 0;
45
- var type;
46
- var tmp;
47
-
48
- try {
49
- buffer = new Buffer(key.split(' ')[1], 'base64');
50
-
51
- tmp = readNext(buffer, offset);
52
- type = tmp.data.toString();
53
- offset = tmp.offset;
54
-
55
- if (type !== 'ssh-rsa')
56
- throw new Error('Invalid ssh key type: ' + type);
57
-
58
- tmp = readNext(buffer, offset);
59
- exponent = tmp.data;
60
- offset = tmp.offset;
61
-
62
- tmp = readNext(buffer, offset);
63
- modulus = tmp.data;
64
- } catch (e) {
65
- throw new Error('Invalid ssh key: ' + key);
66
- }
67
-
68
- // DER is a subset of BER
69
- der = new asn1.BerWriter();
70
-
71
- der.startSequence();
72
-
73
- der.startSequence();
74
- der.writeOID('1.2.840.113549.1.1.1');
75
- der.writeNull();
76
- der.endSequence();
77
-
78
- der.startSequence(0x03); // bit string
79
- der.writeByte(0x00);
80
-
81
- // Actual key
82
- der.startSequence();
83
- writeInt(der, modulus);
84
- writeInt(der, exponent);
85
- der.endSequence();
86
-
87
- // bit string
88
- der.endSequence();
89
-
90
- der.endSequence();
91
-
92
- tmp = der.buffer.toString('base64');
93
- for (i = 0; i < tmp.length; i++) {
94
- if ((i % 64) === 0)
95
- newKey += '\n';
96
- newKey += tmp.charAt(i);
97
- }
98
-
99
- if (!/\\n$/.test(newKey))
100
- newKey += '\n';
101
-
102
- return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
103
- }
104
-
105
-
106
- function dsaToPEM(key) {
107
- var buffer;
108
- var offset = 0;
109
- var tmp;
110
- var der;
111
- var newKey = '';
112
-
113
- var type;
114
- var p;
115
- var q;
116
- var g;
117
- var y;
118
-
119
- try {
120
- buffer = new Buffer(key.split(' ')[1], 'base64');
121
-
122
- tmp = readNext(buffer, offset);
123
- type = tmp.data.toString();
124
- offset = tmp.offset;
125
-
126
- /* JSSTYLED */
127
- if (!/^ssh-ds[as].*/.test(type))
128
- throw new Error('Invalid ssh key type: ' + type);
129
-
130
- tmp = readNext(buffer, offset);
131
- p = tmp.data;
132
- offset = tmp.offset;
133
-
134
- tmp = readNext(buffer, offset);
135
- q = tmp.data;
136
- offset = tmp.offset;
137
-
138
- tmp = readNext(buffer, offset);
139
- g = tmp.data;
140
- offset = tmp.offset;
141
-
142
- tmp = readNext(buffer, offset);
143
- y = tmp.data;
144
- } catch (e) {
145
- console.log(e.stack);
146
- throw new Error('Invalid ssh key: ' + key);
147
- }
148
-
149
- // DER is a subset of BER
150
- der = new asn1.BerWriter();
151
-
152
- der.startSequence();
153
-
154
- der.startSequence();
155
- der.writeOID('1.2.840.10040.4.1');
156
-
157
- der.startSequence();
158
- writeInt(der, p);
159
- writeInt(der, q);
160
- writeInt(der, g);
161
- der.endSequence();
162
-
163
- der.endSequence();
164
-
165
- der.startSequence(0x03); // bit string
166
- der.writeByte(0x00);
167
- writeInt(der, y);
168
- der.endSequence();
169
-
170
- der.endSequence();
171
-
172
- tmp = der.buffer.toString('base64');
173
- for (var i = 0; i < tmp.length; i++) {
174
- if ((i % 64) === 0)
175
- newKey += '\n';
176
- newKey += tmp.charAt(i);
177
- }
178
-
179
- if (!/\\n$/.test(newKey))
180
- newKey += '\n';
181
-
182
- return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
183
- }
184
-
185
-
186
- ///--- API
187
-
188
- module.exports = {
189
-
190
- /**
191
- * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
192
- *
193
- * The intent of this module is to interoperate with OpenSSL only,
194
- * specifically the node crypto module's `verify` method.
195
- *
196
- * @param {String} key an OpenSSH public key.
197
- * @return {String} PEM encoded form of the RSA public key.
198
- * @throws {TypeError} on bad input.
199
- * @throws {Error} on invalid ssh key formatted data.
200
- */
201
- sshKeyToPEM: function sshKeyToPEM(key) {
202
- assert.string(key, 'ssh_key');
203
-
204
- /* JSSTYLED */
205
- if (/^ssh-rsa.*/.test(key))
206
- return rsaToPEM(key);
207
-
208
- /* JSSTYLED */
209
- if (/^ssh-ds[as].*/.test(key))
210
- return dsaToPEM(key);
211
-
212
- throw new Error('Only RSA and DSA public keys are allowed');
213
- },
214
-
215
-
216
- /**
217
- * Generates an OpenSSH fingerprint from an ssh public key.
218
- *
219
- * @param {String} key an OpenSSH public key.
220
- * @return {String} key fingerprint.
221
- * @throws {TypeError} on bad input.
222
- * @throws {Error} if what you passed doesn't look like an ssh public key.
223
- */
224
- fingerprint: function fingerprint(key) {
225
- assert.string(key, 'ssh_key');
226
-
227
- var pieces = key.split(' ');
228
- if (!pieces || !pieces.length || pieces.length < 2)
229
- throw new Error('invalid ssh key');
230
-
231
- var data = new Buffer(pieces[1], 'base64');
232
-
233
- var hash = crypto.createHash('md5');
234
- hash.update(data);
235
- var digest = hash.digest('hex');
236
-
237
- var fp = '';
238
- for (var i = 0; i < digest.length; i++) {
239
- if (i && i % 2 === 0)
240
- fp += ':';
241
-
242
- fp += digest[i];
243
- }
244
-
245
- return fp;
246
- }
247
-
248
-
249
- };
@@ -1,42 +0,0 @@
1
- // Copyright 2011 Joyent, Inc. All rights reserved.
2
-
3
- var assert = require('assert-plus');
4
- var crypto = require('crypto');
5
-
6
-
7
-
8
- ///--- Exported API
9
-
10
- module.exports = {
11
-
12
- /**
13
- * Simply wraps up the node crypto operations for you, and returns
14
- * true or false. You are expected to pass in an object that was
15
- * returned from `parse()`.
16
- *
17
- * @param {Object} parsedSignature the object you got from `parse`.
18
- * @param {String} key either an RSA private key PEM or HMAC secret.
19
- * @return {Boolean} true if valid, false otherwise.
20
- * @throws {TypeError} if you pass in bad arguments.
21
- */
22
- verifySignature: function verifySignature(parsedSignature, key) {
23
- assert.object(parsedSignature, 'parsedSignature');
24
- assert.string(key, 'key');
25
-
26
- var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
27
- if (!alg || alg.length !== 3)
28
- throw new TypeError('parsedSignature: unsupported algorithm ' +
29
- parsedSignature.algorithm);
30
-
31
- if (alg[1] === 'HMAC') {
32
- var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
33
- hmac.update(parsedSignature.signingString);
34
- return (hmac.digest('base64') === parsedSignature.params.signature);
35
- } else {
36
- var verify = crypto.createVerify(alg[0]);
37
- verify.update(parsedSignature.signingString);
38
- return verify.verify(key, parsedSignature.params.signature, 'base64');
39
- }
40
- }
41
-
42
- };
@@ -1,19 +0,0 @@
1
- Copyright (c) 2011 Mark Cavage, All rights reserved.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE
@@ -1,50 +0,0 @@
1
- node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
2
- Currently BER encoding is supported; at some point I'll likely have to do DER.
3
-
4
- ## Usage
5
-
6
- Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
7
- need this readme to explain what and why. If you have no idea what ASN.1 is,
8
- see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
9
-
10
- The source is pretty much self-explanatory, and has read/write methods for the
11
- common types out there.
12
-
13
- ### Decoding
14
-
15
- The following reads an ASN.1 sequence with a boolean.
16
-
17
- var Ber = require('asn1').Ber;
18
-
19
- var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
20
-
21
- reader.readSequence();
22
- console.log('Sequence len: ' + reader.length);
23
- if (reader.peek() === Ber.Boolean)
24
- console.log(reader.readBoolean());
25
-
26
- ### Encoding
27
-
28
- The following generates the same payload as above.
29
-
30
- var Ber = require('asn1').Ber;
31
-
32
- var writer = new Ber.Writer();
33
-
34
- writer.startSequence();
35
- writer.writeBoolean(true);
36
- writer.endSequence();
37
-
38
- console.log(writer.buffer);
39
-
40
- ## Installation
41
-
42
- npm install asn1
43
-
44
- ## License
45
-
46
- MIT.
47
-
48
- ## Bugs
49
-
50
- See <https://github.com/mcavage/node-asn1/issues>.
@@ -1,13 +0,0 @@
1
- // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
2
-
3
-
4
- module.exports = {
5
-
6
- newInvalidAsn1Error: function(msg) {
7
- var e = new Error();
8
- e.name = 'InvalidAsn1Error';
9
- e.message = msg || '';
10
- return e;
11
- }
12
-
13
- };
@@ -1,27 +0,0 @@
1
- // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
2
-
3
- var errors = require('./errors');
4
- var types = require('./types');
5
-
6
- var Reader = require('./reader');
7
- var Writer = require('./writer');
8
-
9
-
10
- ///--- Exports
11
-
12
- module.exports = {
13
-
14
- Reader: Reader,
15
-
16
- Writer: Writer
17
-
18
- };
19
-
20
- for (var t in types) {
21
- if (types.hasOwnProperty(t))
22
- module.exports[t] = types[t];
23
- }
24
- for (var e in errors) {
25
- if (errors.hasOwnProperty(e))
26
- module.exports[e] = errors[e];
27
- }