@wabot-dev/framework 0.0.14 → 0.0.17

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 (370) hide show
  1. package/dist/src/ai/deepseek/DeepSeekChatBotAdapter.js +108 -0
  2. package/dist/src/channels/cmd/@cmd.js +1 -1
  3. package/dist/src/channels/cmd/CmdChannel.js +1 -1
  4. package/dist/src/channels/socket-io/@socket.js +24 -0
  5. package/dist/src/channels/socket-io/SocketChannel.js +78 -0
  6. package/dist/src/channels/socket-io/SocketChannelConfig.js +15 -0
  7. package/dist/src/channels/telegram/@telegram.js +1 -1
  8. package/dist/src/channels/telegram/TelegramChannel.js +1 -1
  9. package/dist/src/channels/whatsapp/@whatsapp.js +1 -1
  10. package/dist/src/channels/whatsapp/WhatsAppChannel.js +1 -1
  11. package/dist/src/channels/whatsapp/WhatsAppConnection.js +1 -1
  12. package/dist/src/channels/whatsapp/WhatsAppDevConnection.js +11 -3
  13. package/dist/src/channels/whatsapp/{whatsAppDevSocketContracts.js → WhatsAppDevSocketContracts.js} +1 -0
  14. package/dist/src/channels/whatsapp/WhatsAppProdConnection.js +4 -1
  15. package/dist/src/channels/whatsapp/WhatsAppSender.js +23 -0
  16. package/dist/src/controller/socket.io/SocketIO.js +1 -1
  17. package/dist/src/index.d.ts +82 -9
  18. package/dist/src/index.js +9 -1
  19. package/dist/src/logger/Logger.js +1 -1
  20. package/dist/src/mindset/MindsetOperator.js +1 -1
  21. package/dist/src/server/runChannel.js +1 -1
  22. package/dist/src/server/runServer.js +4 -4
  23. package/package.json +2 -1
  24. package/dist/src/_virtual/XMLHttpRequest.js +0 -7
  25. package/dist/src/_virtual/_commonjsHelpers.js +0 -32
  26. package/dist/src/_virtual/base64id.js +0 -3
  27. package/dist/src/_virtual/binary.js +0 -3
  28. package/dist/src/_virtual/bom-handling.js +0 -3
  29. package/dist/src/_virtual/broadcast-operator.js +0 -3
  30. package/dist/src/_virtual/browser.js +0 -3
  31. package/dist/src/_virtual/browser2.js +0 -3
  32. package/dist/src/_virtual/browser3.js +0 -3
  33. package/dist/src/_virtual/browser4.js +0 -3
  34. package/dist/src/_virtual/browser5.js +0 -3
  35. package/dist/src/_virtual/buffer-util.js +0 -3
  36. package/dist/src/_virtual/buffer-util2.js +0 -3
  37. package/dist/src/_virtual/buffer-util3.js +0 -3
  38. package/dist/src/_virtual/charset.js +0 -3
  39. package/dist/src/_virtual/charset2.js +0 -3
  40. package/dist/src/_virtual/client.js +0 -3
  41. package/dist/src/_virtual/cluster-adapter.js +0 -3
  42. package/dist/src/_virtual/commons.js +0 -3
  43. package/dist/src/_virtual/dbcs-codec.js +0 -3
  44. package/dist/src/_virtual/decodePacket.js +0 -3
  45. package/dist/src/_virtual/encodePacket.js +0 -3
  46. package/dist/src/_virtual/encoding.js +0 -3
  47. package/dist/src/_virtual/encoding2.js +0 -3
  48. package/dist/src/_virtual/engine.io.js +0 -3
  49. package/dist/src/_virtual/in-memory-adapter.js +0 -3
  50. package/dist/src/_virtual/index.js +0 -7
  51. package/dist/src/_virtual/index10.js +0 -3
  52. package/dist/src/_virtual/index11.js +0 -3
  53. package/dist/src/_virtual/index12.js +0 -3
  54. package/dist/src/_virtual/index13.js +0 -3
  55. package/dist/src/_virtual/index14.js +0 -3
  56. package/dist/src/_virtual/index15.js +0 -3
  57. package/dist/src/_virtual/index16.js +0 -3
  58. package/dist/src/_virtual/index17.js +0 -3
  59. package/dist/src/_virtual/index18.js +0 -3
  60. package/dist/src/_virtual/index19.js +0 -3
  61. package/dist/src/_virtual/index2.js +0 -7
  62. package/dist/src/_virtual/index20.js +0 -3
  63. package/dist/src/_virtual/index21.js +0 -3
  64. package/dist/src/_virtual/index22.js +0 -3
  65. package/dist/src/_virtual/index23.js +0 -3
  66. package/dist/src/_virtual/index24.js +0 -3
  67. package/dist/src/_virtual/index25.js +0 -3
  68. package/dist/src/_virtual/index26.js +0 -3
  69. package/dist/src/_virtual/index27.js +0 -3
  70. package/dist/src/_virtual/index28.js +0 -3
  71. package/dist/src/_virtual/index29.js +0 -3
  72. package/dist/src/_virtual/index3.js +0 -7
  73. package/dist/src/_virtual/index30.js +0 -3
  74. package/dist/src/_virtual/index31.js +0 -3
  75. package/dist/src/_virtual/index32.js +0 -3
  76. package/dist/src/_virtual/index33.js +0 -3
  77. package/dist/src/_virtual/index4.js +0 -3
  78. package/dist/src/_virtual/index5.js +0 -3
  79. package/dist/src/_virtual/index6.js +0 -3
  80. package/dist/src/_virtual/index7.js +0 -3
  81. package/dist/src/_virtual/index8.js +0 -6
  82. package/dist/src/_virtual/index9.js +0 -3
  83. package/dist/src/_virtual/inherits.js +0 -3
  84. package/dist/src/_virtual/inherits_browser.js +0 -3
  85. package/dist/src/_virtual/is-binary.js +0 -3
  86. package/dist/src/_virtual/language.js +0 -3
  87. package/dist/src/_virtual/language2.js +0 -3
  88. package/dist/src/_virtual/mediaType.js +0 -3
  89. package/dist/src/_virtual/mediaType2.js +0 -3
  90. package/dist/src/_virtual/namespace.js +0 -3
  91. package/dist/src/_virtual/node.js +0 -3
  92. package/dist/src/_virtual/node2.js +0 -3
  93. package/dist/src/_virtual/node3.js +0 -3
  94. package/dist/src/_virtual/node4.js +0 -3
  95. package/dist/src/_virtual/node5.js +0 -3
  96. package/dist/src/_virtual/parent-namespace.js +0 -3
  97. package/dist/src/_virtual/polling-jsonp.js +0 -3
  98. package/dist/src/_virtual/polling.js +0 -3
  99. package/dist/src/_virtual/polling2.js +0 -3
  100. package/dist/src/_virtual/receiver.js +0 -3
  101. package/dist/src/_virtual/sbcs-codec.js +0 -3
  102. package/dist/src/_virtual/sender.js +0 -3
  103. package/dist/src/_virtual/server.js +0 -3
  104. package/dist/src/_virtual/socket-types.js +0 -3
  105. package/dist/src/_virtual/socket.js +0 -3
  106. package/dist/src/_virtual/socket2.js +0 -3
  107. package/dist/src/_virtual/stream.js +0 -3
  108. package/dist/src/_virtual/transport.js +0 -3
  109. package/dist/src/_virtual/typed-events.js +0 -3
  110. package/dist/src/_virtual/userver.js +0 -3
  111. package/dist/src/_virtual/utf16.js +0 -3
  112. package/dist/src/_virtual/utf32.js +0 -3
  113. package/dist/src/_virtual/utf7.js +0 -3
  114. package/dist/src/_virtual/uws.js +0 -3
  115. package/dist/src/_virtual/validation.js +0 -3
  116. package/dist/src/_virtual/validation2.js +0 -3
  117. package/dist/src/_virtual/validation3.js +0 -3
  118. package/dist/src/_virtual/websocket-server.js +0 -3
  119. package/dist/src/_virtual/websocket.js +0 -7
  120. package/dist/src/_virtual/websocket2.js +0 -3
  121. package/dist/src/_virtual/websocket3.js +0 -3
  122. package/dist/src/_virtual/webtransport.js +0 -3
  123. package/dist/src/_virtual/yeast.js +0 -3
  124. package/dist/src/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -171
  125. package/dist/src/node_modules/base64id/lib/base64id.js +0 -117
  126. package/dist/src/node_modules/body-parser/index.js +0 -96
  127. package/dist/src/node_modules/body-parser/lib/read.js +0 -225
  128. package/dist/src/node_modules/body-parser/lib/types/json.js +0 -222
  129. package/dist/src/node_modules/body-parser/lib/types/raw.js +0 -90
  130. package/dist/src/node_modules/body-parser/lib/types/text.js +0 -95
  131. package/dist/src/node_modules/body-parser/lib/types/urlencoded.js +0 -194
  132. package/dist/src/node_modules/body-parser/lib/utils.js +0 -96
  133. package/dist/src/node_modules/bytes/index.js +0 -180
  134. package/dist/src/node_modules/call-bind-apply-helpers/actualApply.js +0 -24
  135. package/dist/src/node_modules/call-bind-apply-helpers/functionApply.js +0 -13
  136. package/dist/src/node_modules/call-bind-apply-helpers/functionCall.js +0 -13
  137. package/dist/src/node_modules/call-bind-apply-helpers/index.js +0 -29
  138. package/dist/src/node_modules/call-bind-apply-helpers/reflectApply.js +0 -13
  139. package/dist/src/node_modules/call-bound/index.js +0 -31
  140. package/dist/src/node_modules/content-type/index.js +0 -235
  141. package/dist/src/node_modules/cookie/index.js +0 -345
  142. package/dist/src/node_modules/cors/lib/index.js +0 -249
  143. package/dist/src/node_modules/debug/src/browser.js +0 -286
  144. package/dist/src/node_modules/debug/src/common.js +0 -303
  145. package/dist/src/node_modules/debug/src/index.js +0 -23
  146. package/dist/src/node_modules/debug/src/node.js +0 -279
  147. package/dist/src/node_modules/depd/index.js +0 -550
  148. package/dist/src/node_modules/dunder-proto/get.js +0 -42
  149. package/dist/src/node_modules/ee-first/index.js +0 -104
  150. package/dist/src/node_modules/engine.io/build/engine.io.js +0 -73
  151. package/dist/src/node_modules/engine.io/build/parser-v3/index.js +0 -429
  152. package/dist/src/node_modules/engine.io/build/parser-v3/utf8.js +0 -198
  153. package/dist/src/node_modules/engine.io/build/server.js +0 -808
  154. package/dist/src/node_modules/engine.io/build/socket.js +0 -469
  155. package/dist/src/node_modules/engine.io/build/transport.js +0 -131
  156. package/dist/src/node_modules/engine.io/build/transports/index.js +0 -37
  157. package/dist/src/node_modules/engine.io/build/transports/polling-jsonp.js +0 -53
  158. package/dist/src/node_modules/engine.io/build/transports/polling.js +0 -346
  159. package/dist/src/node_modules/engine.io/build/transports/websocket.js +0 -106
  160. package/dist/src/node_modules/engine.io/build/transports/webtransport.js +0 -76
  161. package/dist/src/node_modules/engine.io/build/transports-uws/index.js +0 -20
  162. package/dist/src/node_modules/engine.io/build/transports-uws/polling.js +0 -378
  163. package/dist/src/node_modules/engine.io/build/transports-uws/websocket.js +0 -85
  164. package/dist/src/node_modules/engine.io/build/userver.js +0 -292
  165. package/dist/src/node_modules/engine.io/node_modules/accepts/index.js +0 -250
  166. package/dist/src/node_modules/engine.io/node_modules/debug/src/browser.js +0 -285
  167. package/dist/src/node_modules/engine.io/node_modules/debug/src/common.js +0 -285
  168. package/dist/src/node_modules/engine.io/node_modules/debug/src/index.js +0 -23
  169. package/dist/src/node_modules/engine.io/node_modules/debug/src/node.js +0 -279
  170. package/dist/src/node_modules/engine.io/node_modules/mime-db/db.json.js +0 -10704
  171. package/dist/src/node_modules/engine.io/node_modules/mime-db/index.js +0 -24
  172. package/dist/src/node_modules/engine.io/node_modules/mime-types/index.js +0 -202
  173. package/dist/src/node_modules/engine.io/node_modules/negotiator/index.js +0 -96
  174. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/charset.js +0 -179
  175. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/encoding.js +0 -193
  176. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/language.js +0 -188
  177. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/mediaType.js +0 -304
  178. package/dist/src/node_modules/engine.io/node_modules/ws/index.js +0 -28
  179. package/dist/src/node_modules/engine.io/node_modules/ws/lib/buffer-util.js +0 -142
  180. package/dist/src/node_modules/engine.io/node_modules/ws/lib/constants.js +0 -21
  181. package/dist/src/node_modules/engine.io/node_modules/ws/lib/event-target.js +0 -303
  182. package/dist/src/node_modules/engine.io/node_modules/ws/lib/extension.js +0 -214
  183. package/dist/src/node_modules/engine.io/node_modules/ws/lib/limiter.js +0 -64
  184. package/dist/src/node_modules/engine.io/node_modules/ws/lib/permessage-deflate.js +0 -528
  185. package/dist/src/node_modules/engine.io/node_modules/ws/lib/receiver.js +0 -719
  186. package/dist/src/node_modules/engine.io/node_modules/ws/lib/sender.js +0 -513
  187. package/dist/src/node_modules/engine.io/node_modules/ws/lib/stream.js +0 -170
  188. package/dist/src/node_modules/engine.io/node_modules/ws/lib/subprotocol.js +0 -73
  189. package/dist/src/node_modules/engine.io/node_modules/ws/lib/validation.js +0 -141
  190. package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket-server.js +0 -559
  191. package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket.js +0 -1363
  192. package/dist/src/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -13
  193. package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -36
  194. package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -66
  195. package/dist/src/node_modules/engine.io-client/build/esm/globals.node.js +0 -92
  196. package/dist/src/node_modules/engine.io-client/build/esm/index.js +0 -17
  197. package/dist/src/node_modules/engine.io-client/build/esm/socket.js +0 -728
  198. package/dist/src/node_modules/engine.io-client/build/esm/transport.js +0 -143
  199. package/dist/src/node_modules/engine.io-client/build/esm/transports/index.js +0 -11
  200. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -256
  201. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +0 -21
  202. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling.js +0 -146
  203. package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -107
  204. package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.node.js +0 -48
  205. package/dist/src/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -83
  206. package/dist/src/node_modules/engine.io-client/build/esm/util.js +0 -62
  207. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js +0 -142
  208. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/constants.js +0 -21
  209. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/event-target.js +0 -303
  210. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/extension.js +0 -214
  211. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/limiter.js +0 -64
  212. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js +0 -528
  213. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/receiver.js +0 -719
  214. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/sender.js +0 -513
  215. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/stream.js +0 -170
  216. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js +0 -73
  217. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/validation.js +0 -141
  218. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js +0 -559
  219. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket.js +0 -1363
  220. package/dist/src/node_modules/engine.io-parser/build/cjs/commons.js +0 -29
  221. package/dist/src/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -70
  222. package/dist/src/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -51
  223. package/dist/src/node_modules/engine.io-parser/build/cjs/index.js +0 -179
  224. package/dist/src/node_modules/engine.io-parser/build/esm/commons.js +0 -15
  225. package/dist/src/node_modules/engine.io-parser/build/esm/decodePacket.js +0 -58
  226. package/dist/src/node_modules/engine.io-parser/build/esm/encodePacket.js +0 -36
  227. package/dist/src/node_modules/engine.io-parser/build/esm/index.js +0 -158
  228. package/dist/src/node_modules/es-define-property/index.js +0 -23
  229. package/dist/src/node_modules/es-errors/eval.js +0 -13
  230. package/dist/src/node_modules/es-errors/index.js +0 -13
  231. package/dist/src/node_modules/es-errors/range.js +0 -13
  232. package/dist/src/node_modules/es-errors/ref.js +0 -13
  233. package/dist/src/node_modules/es-errors/syntax.js +0 -13
  234. package/dist/src/node_modules/es-errors/type.js +0 -13
  235. package/dist/src/node_modules/es-errors/uri.js +0 -13
  236. package/dist/src/node_modules/es-object-atoms/index.js +0 -13
  237. package/dist/src/node_modules/function-bind/implementation.js +0 -93
  238. package/dist/src/node_modules/function-bind/index.js +0 -16
  239. package/dist/src/node_modules/get-intrinsic/index.js +0 -413
  240. package/dist/src/node_modules/get-proto/Object.getPrototypeOf.js +0 -17
  241. package/dist/src/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -13
  242. package/dist/src/node_modules/get-proto/index.js +0 -40
  243. package/dist/src/node_modules/gopd/gOPD.js +0 -13
  244. package/dist/src/node_modules/gopd/index.js +0 -26
  245. package/dist/src/node_modules/has-symbols/index.js +0 -25
  246. package/dist/src/node_modules/has-symbols/shams.js +0 -54
  247. package/dist/src/node_modules/hasown/index.js +0 -19
  248. package/dist/src/node_modules/http-errors/index.js +0 -306
  249. package/dist/src/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -598
  250. package/dist/src/node_modules/iconv-lite/encodings/dbcs-data.js +0 -206
  251. package/dist/src/node_modules/iconv-lite/encodings/index.js +0 -44
  252. package/dist/src/node_modules/iconv-lite/encodings/internal.js +0 -210
  253. package/dist/src/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -83
  254. package/dist/src/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -460
  255. package/dist/src/node_modules/iconv-lite/encodings/sbcs-data.js +0 -187
  256. package/dist/src/node_modules/iconv-lite/encodings/tables/big5-added.json.js +0 -506
  257. package/dist/src/node_modules/iconv-lite/encodings/tables/cp936.json.js +0 -2621
  258. package/dist/src/node_modules/iconv-lite/encodings/tables/cp949.json.js +0 -2380
  259. package/dist/src/node_modules/iconv-lite/encodings/tables/cp950.json.js +0 -729
  260. package/dist/src/node_modules/iconv-lite/encodings/tables/eucjp.json.js +0 -822
  261. package/dist/src/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json.js +0 -424
  262. package/dist/src/node_modules/iconv-lite/encodings/tables/gbk-added.json.js +0 -264
  263. package/dist/src/node_modules/iconv-lite/encodings/tables/shiftjis.json.js +0 -548
  264. package/dist/src/node_modules/iconv-lite/encodings/utf16.js +0 -206
  265. package/dist/src/node_modules/iconv-lite/encodings/utf32.js +0 -329
  266. package/dist/src/node_modules/iconv-lite/encodings/utf7.js +0 -297
  267. package/dist/src/node_modules/iconv-lite/lib/bom-handling.js +0 -61
  268. package/dist/src/node_modules/iconv-lite/lib/index.js +0 -192
  269. package/dist/src/node_modules/iconv-lite/lib/streams.js +0 -120
  270. package/dist/src/node_modules/inherits/inherits.js +0 -21
  271. package/dist/src/node_modules/inherits/inherits_browser.js +0 -38
  272. package/dist/src/node_modules/math-intrinsics/abs.js +0 -13
  273. package/dist/src/node_modules/math-intrinsics/floor.js +0 -13
  274. package/dist/src/node_modules/math-intrinsics/isNaN.js +0 -15
  275. package/dist/src/node_modules/math-intrinsics/max.js +0 -13
  276. package/dist/src/node_modules/math-intrinsics/min.js +0 -13
  277. package/dist/src/node_modules/math-intrinsics/pow.js +0 -13
  278. package/dist/src/node_modules/math-intrinsics/round.js +0 -13
  279. package/dist/src/node_modules/math-intrinsics/sign.js +0 -22
  280. package/dist/src/node_modules/media-typer/index.js +0 -153
  281. package/dist/src/node_modules/mime-db/db.json.js +0 -11656
  282. package/dist/src/node_modules/mime-db/index.js +0 -24
  283. package/dist/src/node_modules/mime-types/index.js +0 -226
  284. package/dist/src/node_modules/mime-types/mimeScore.js +0 -62
  285. package/dist/src/node_modules/ms/index.js +0 -172
  286. package/dist/src/node_modules/object-assign/index.js +0 -99
  287. package/dist/src/node_modules/object-inspect/index.js +0 -557
  288. package/dist/src/node_modules/object-inspect/util.inspect.js +0 -13
  289. package/dist/src/node_modules/on-finished/index.js +0 -245
  290. package/dist/src/node_modules/qs/lib/formats.js +0 -32
  291. package/dist/src/node_modules/qs/lib/index.js +0 -24
  292. package/dist/src/node_modules/qs/lib/parse.js +0 -339
  293. package/dist/src/node_modules/qs/lib/stringify.js +0 -369
  294. package/dist/src/node_modules/qs/lib/utils.js +0 -279
  295. package/dist/src/node_modules/raw-body/index.js +0 -351
  296. package/dist/src/node_modules/safer-buffer/safer.js +0 -88
  297. package/dist/src/node_modules/setprototypeof/index.js +0 -26
  298. package/dist/src/node_modules/side-channel/index.js +0 -58
  299. package/dist/src/node_modules/side-channel-list/index.js +0 -125
  300. package/dist/src/node_modules/side-channel-map/index.js +0 -82
  301. package/dist/src/node_modules/side-channel-weakmap/index.js +0 -99
  302. package/dist/src/node_modules/socket.io/dist/broadcast-operator.js +0 -448
  303. package/dist/src/node_modules/socket.io/dist/client.js +0 -281
  304. package/dist/src/node_modules/socket.io/dist/index.js +0 -837
  305. package/dist/src/node_modules/socket.io/dist/namespace.js +0 -597
  306. package/dist/src/node_modules/socket.io/dist/parent-namespace.js +0 -101
  307. package/dist/src/node_modules/socket.io/dist/socket-types.js +0 -21
  308. package/dist/src/node_modules/socket.io/dist/socket.js +0 -993
  309. package/dist/src/node_modules/socket.io/dist/typed-events.js +0 -92
  310. package/dist/src/node_modules/socket.io/dist/uws.js +0 -149
  311. package/dist/src/node_modules/socket.io/node_modules/accepts/index.js +0 -250
  312. package/dist/src/node_modules/socket.io/node_modules/debug/src/browser.js +0 -285
  313. package/dist/src/node_modules/socket.io/node_modules/debug/src/common.js +0 -285
  314. package/dist/src/node_modules/socket.io/node_modules/debug/src/index.js +0 -23
  315. package/dist/src/node_modules/socket.io/node_modules/debug/src/node.js +0 -279
  316. package/dist/src/node_modules/socket.io/node_modules/mime-db/db.json.js +0 -10704
  317. package/dist/src/node_modules/socket.io/node_modules/mime-db/index.js +0 -24
  318. package/dist/src/node_modules/socket.io/node_modules/mime-types/index.js +0 -202
  319. package/dist/src/node_modules/socket.io/node_modules/negotiator/index.js +0 -96
  320. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/charset.js +0 -179
  321. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/encoding.js +0 -193
  322. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/language.js +0 -188
  323. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/mediaType.js +0 -304
  324. package/dist/src/node_modules/socket.io/package.json.js +0 -5
  325. package/dist/src/node_modules/socket.io/wrapper.js +0 -5
  326. package/dist/src/node_modules/socket.io-adapter/dist/cluster-adapter.js +0 -689
  327. package/dist/src/node_modules/socket.io-adapter/dist/contrib/yeast.js +0 -64
  328. package/dist/src/node_modules/socket.io-adapter/dist/in-memory-adapter.js +0 -407
  329. package/dist/src/node_modules/socket.io-adapter/dist/index.js +0 -24
  330. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/browser.js +0 -285
  331. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/common.js +0 -285
  332. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/index.js +0 -23
  333. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/node.js +0 -279
  334. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/index.js +0 -28
  335. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/buffer-util.js +0 -142
  336. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/constants.js +0 -21
  337. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/event-target.js +0 -303
  338. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/extension.js +0 -214
  339. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/limiter.js +0 -64
  340. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/permessage-deflate.js +0 -528
  341. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/receiver.js +0 -719
  342. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/sender.js +0 -513
  343. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/stream.js +0 -170
  344. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/subprotocol.js +0 -73
  345. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/validation.js +0 -141
  346. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket-server.js +0 -559
  347. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket.js +0 -1363
  348. package/dist/src/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -68
  349. package/dist/src/node_modules/socket.io-client/build/esm/index.js +0 -50
  350. package/dist/src/node_modules/socket.io-client/build/esm/manager.js +0 -373
  351. package/dist/src/node_modules/socket.io-client/build/esm/on.js +0 -8
  352. package/dist/src/node_modules/socket.io-client/build/esm/socket.js +0 -884
  353. package/dist/src/node_modules/socket.io-client/build/esm/url.js +0 -63
  354. package/dist/src/node_modules/socket.io-parser/build/cjs/binary.js +0 -99
  355. package/dist/src/node_modules/socket.io-parser/build/cjs/index.js +0 -337
  356. package/dist/src/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -65
  357. package/dist/src/node_modules/socket.io-parser/build/esm/binary.js +0 -86
  358. package/dist/src/node_modules/socket.io-parser/build/esm/index.js +0 -314
  359. package/dist/src/node_modules/socket.io-parser/build/esm/is-binary.js +0 -52
  360. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/browser.js +0 -285
  361. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/common.js +0 -285
  362. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/index.js +0 -23
  363. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/node.js +0 -279
  364. package/dist/src/node_modules/statuses/codes.json.js +0 -67
  365. package/dist/src/node_modules/statuses/index.js +0 -157
  366. package/dist/src/node_modules/toidentifier/index.js +0 -41
  367. package/dist/src/node_modules/type-is/index.js +0 -263
  368. package/dist/src/node_modules/unpipe/index.js +0 -78
  369. package/dist/src/node_modules/vary/index.js +0 -159
  370. package/dist/src/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +0 -702
@@ -1,297 +0,0 @@
1
- import { __exports as utf7 } from '../../../_virtual/utf7.js';
2
- import { __require as requireSafer } from '../../safer-buffer/safer.js';
3
-
4
- var hasRequiredUtf7;
5
-
6
- function requireUtf7 () {
7
- if (hasRequiredUtf7) return utf7;
8
- hasRequiredUtf7 = 1;
9
- var Buffer = requireSafer().Buffer;
10
-
11
- // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
12
- // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
13
-
14
- utf7.utf7 = Utf7Codec;
15
- utf7.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
16
- function Utf7Codec(codecOptions, iconv) {
17
- this.iconv = iconv;
18
- }
19
- Utf7Codec.prototype.encoder = Utf7Encoder;
20
- Utf7Codec.prototype.decoder = Utf7Decoder;
21
- Utf7Codec.prototype.bomAware = true;
22
-
23
-
24
- // -- Encoding
25
-
26
- var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
27
-
28
- function Utf7Encoder(options, codec) {
29
- this.iconv = codec.iconv;
30
- }
31
-
32
- Utf7Encoder.prototype.write = function(str) {
33
- // Naive implementation.
34
- // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
35
- return Buffer.from(str.replace(nonDirectChars, function(chunk) {
36
- return "+" + (chunk === '+' ? '' :
37
- this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
38
- + "-";
39
- }.bind(this)));
40
- };
41
-
42
- Utf7Encoder.prototype.end = function() {
43
- };
44
-
45
-
46
- // -- Decoding
47
-
48
- function Utf7Decoder(options, codec) {
49
- this.iconv = codec.iconv;
50
- this.inBase64 = false;
51
- this.base64Accum = '';
52
- }
53
-
54
- var base64Regex = /[A-Za-z0-9\/+]/;
55
- var base64Chars = [];
56
- for (var i = 0; i < 256; i++)
57
- base64Chars[i] = base64Regex.test(String.fromCharCode(i));
58
-
59
- var plusChar = '+'.charCodeAt(0),
60
- minusChar = '-'.charCodeAt(0),
61
- andChar = '&'.charCodeAt(0);
62
-
63
- Utf7Decoder.prototype.write = function(buf) {
64
- var res = "", lastI = 0,
65
- inBase64 = this.inBase64,
66
- base64Accum = this.base64Accum;
67
-
68
- // The decoder is more involved as we must handle chunks in stream.
69
-
70
- for (var i = 0; i < buf.length; i++) {
71
- if (!inBase64) { // We're in direct mode.
72
- // Write direct chars until '+'
73
- if (buf[i] == plusChar) {
74
- res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
75
- lastI = i+1;
76
- inBase64 = true;
77
- }
78
- } else { // We decode base64.
79
- if (!base64Chars[buf[i]]) { // Base64 ended.
80
- if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
81
- res += "+";
82
- } else {
83
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii");
84
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
85
- }
86
-
87
- if (buf[i] != minusChar) // Minus is absorbed after base64.
88
- i--;
89
-
90
- lastI = i+1;
91
- inBase64 = false;
92
- base64Accum = '';
93
- }
94
- }
95
- }
96
-
97
- if (!inBase64) {
98
- res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
99
- } else {
100
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii");
101
-
102
- var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
103
- base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
104
- b64str = b64str.slice(0, canBeDecoded);
105
-
106
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
107
- }
108
-
109
- this.inBase64 = inBase64;
110
- this.base64Accum = base64Accum;
111
-
112
- return res;
113
- };
114
-
115
- Utf7Decoder.prototype.end = function() {
116
- var res = "";
117
- if (this.inBase64 && this.base64Accum.length > 0)
118
- res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
119
-
120
- this.inBase64 = false;
121
- this.base64Accum = '';
122
- return res;
123
- };
124
-
125
-
126
- // UTF-7-IMAP codec.
127
- // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
128
- // Differences:
129
- // * Base64 part is started by "&" instead of "+"
130
- // * Direct characters are 0x20-0x7E, except "&" (0x26)
131
- // * In Base64, "," is used instead of "/"
132
- // * Base64 must not be used to represent direct characters.
133
- // * No implicit shift back from Base64 (should always end with '-')
134
- // * String must end in non-shifted position.
135
- // * "-&" while in base64 is not allowed.
136
-
137
-
138
- utf7.utf7imap = Utf7IMAPCodec;
139
- function Utf7IMAPCodec(codecOptions, iconv) {
140
- this.iconv = iconv;
141
- }
142
- Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
143
- Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
144
- Utf7IMAPCodec.prototype.bomAware = true;
145
-
146
-
147
- // -- Encoding
148
-
149
- function Utf7IMAPEncoder(options, codec) {
150
- this.iconv = codec.iconv;
151
- this.inBase64 = false;
152
- this.base64Accum = Buffer.alloc(6);
153
- this.base64AccumIdx = 0;
154
- }
155
-
156
- Utf7IMAPEncoder.prototype.write = function(str) {
157
- var inBase64 = this.inBase64,
158
- base64Accum = this.base64Accum,
159
- base64AccumIdx = this.base64AccumIdx,
160
- buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
161
-
162
- for (var i = 0; i < str.length; i++) {
163
- var uChar = str.charCodeAt(i);
164
- if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
165
- if (inBase64) {
166
- if (base64AccumIdx > 0) {
167
- bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
168
- base64AccumIdx = 0;
169
- }
170
-
171
- buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
172
- inBase64 = false;
173
- }
174
-
175
- if (!inBase64) {
176
- buf[bufIdx++] = uChar; // Write direct character
177
-
178
- if (uChar === andChar) // Ampersand -> '&-'
179
- buf[bufIdx++] = minusChar;
180
- }
181
-
182
- } else { // Non-direct character
183
- if (!inBase64) {
184
- buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
185
- inBase64 = true;
186
- }
187
- if (inBase64) {
188
- base64Accum[base64AccumIdx++] = uChar >> 8;
189
- base64Accum[base64AccumIdx++] = uChar & 0xFF;
190
-
191
- if (base64AccumIdx == base64Accum.length) {
192
- bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
193
- base64AccumIdx = 0;
194
- }
195
- }
196
- }
197
- }
198
-
199
- this.inBase64 = inBase64;
200
- this.base64AccumIdx = base64AccumIdx;
201
-
202
- return buf.slice(0, bufIdx);
203
- };
204
-
205
- Utf7IMAPEncoder.prototype.end = function() {
206
- var buf = Buffer.alloc(10), bufIdx = 0;
207
- if (this.inBase64) {
208
- if (this.base64AccumIdx > 0) {
209
- bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
210
- this.base64AccumIdx = 0;
211
- }
212
-
213
- buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
214
- this.inBase64 = false;
215
- }
216
-
217
- return buf.slice(0, bufIdx);
218
- };
219
-
220
-
221
- // -- Decoding
222
-
223
- function Utf7IMAPDecoder(options, codec) {
224
- this.iconv = codec.iconv;
225
- this.inBase64 = false;
226
- this.base64Accum = '';
227
- }
228
-
229
- var base64IMAPChars = base64Chars.slice();
230
- base64IMAPChars[','.charCodeAt(0)] = true;
231
-
232
- Utf7IMAPDecoder.prototype.write = function(buf) {
233
- var res = "", lastI = 0,
234
- inBase64 = this.inBase64,
235
- base64Accum = this.base64Accum;
236
-
237
- // The decoder is more involved as we must handle chunks in stream.
238
- // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
239
-
240
- for (var i = 0; i < buf.length; i++) {
241
- if (!inBase64) { // We're in direct mode.
242
- // Write direct chars until '&'
243
- if (buf[i] == andChar) {
244
- res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
245
- lastI = i+1;
246
- inBase64 = true;
247
- }
248
- } else { // We decode base64.
249
- if (!base64IMAPChars[buf[i]]) { // Base64 ended.
250
- if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
251
- res += "&";
252
- } else {
253
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/');
254
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
255
- }
256
-
257
- if (buf[i] != minusChar) // Minus may be absorbed after base64.
258
- i--;
259
-
260
- lastI = i+1;
261
- inBase64 = false;
262
- base64Accum = '';
263
- }
264
- }
265
- }
266
-
267
- if (!inBase64) {
268
- res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
269
- } else {
270
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/');
271
-
272
- var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
273
- base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
274
- b64str = b64str.slice(0, canBeDecoded);
275
-
276
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
277
- }
278
-
279
- this.inBase64 = inBase64;
280
- this.base64Accum = base64Accum;
281
-
282
- return res;
283
- };
284
-
285
- Utf7IMAPDecoder.prototype.end = function() {
286
- var res = "";
287
- if (this.inBase64 && this.base64Accum.length > 0)
288
- res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
289
-
290
- this.inBase64 = false;
291
- this.base64Accum = '';
292
- return res;
293
- };
294
- return utf7;
295
- }
296
-
297
- export { requireUtf7 as __require };
@@ -1,61 +0,0 @@
1
- import { __exports as bomHandling } from '../../../_virtual/bom-handling.js';
2
-
3
- var hasRequiredBomHandling;
4
-
5
- function requireBomHandling () {
6
- if (hasRequiredBomHandling) return bomHandling;
7
- hasRequiredBomHandling = 1;
8
-
9
- var BOMChar = '\uFEFF';
10
-
11
- bomHandling.PrependBOM = PrependBOMWrapper;
12
- function PrependBOMWrapper(encoder, options) {
13
- this.encoder = encoder;
14
- this.addBOM = true;
15
- }
16
-
17
- PrependBOMWrapper.prototype.write = function(str) {
18
- if (this.addBOM) {
19
- str = BOMChar + str;
20
- this.addBOM = false;
21
- }
22
-
23
- return this.encoder.write(str);
24
- };
25
-
26
- PrependBOMWrapper.prototype.end = function() {
27
- return this.encoder.end();
28
- };
29
-
30
-
31
- //------------------------------------------------------------------------------
32
-
33
- bomHandling.StripBOM = StripBOMWrapper;
34
- function StripBOMWrapper(decoder, options) {
35
- this.decoder = decoder;
36
- this.pass = false;
37
- this.options = options || {};
38
- }
39
-
40
- StripBOMWrapper.prototype.write = function(buf) {
41
- var res = this.decoder.write(buf);
42
- if (this.pass || !res)
43
- return res;
44
-
45
- if (res[0] === BOMChar) {
46
- res = res.slice(1);
47
- if (typeof this.options.stripBOM === 'function')
48
- this.options.stripBOM();
49
- }
50
-
51
- this.pass = true;
52
- return res;
53
- };
54
-
55
- StripBOMWrapper.prototype.end = function() {
56
- return this.decoder.end();
57
- };
58
- return bomHandling;
59
- }
60
-
61
- export { requireBomHandling as __require };
@@ -1,192 +0,0 @@
1
- import { __module as lib } from '../../../_virtual/index19.js';
2
- import { __require as requireSafer } from '../../safer-buffer/safer.js';
3
- import { __require as requireBomHandling } from './bom-handling.js';
4
- import { __require as requireEncodings } from '../encodings/index.js';
5
- import { __require as requireStreams } from './streams.js';
6
-
7
- var hasRequiredLib;
8
-
9
- function requireLib () {
10
- if (hasRequiredLib) return lib.exports;
11
- hasRequiredLib = 1;
12
- (function (module) {
13
-
14
- var Buffer = requireSafer().Buffer;
15
-
16
- var bomHandling = requireBomHandling(),
17
- iconv = module.exports;
18
-
19
- // All codecs and aliases are kept here, keyed by encoding name/alias.
20
- // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
21
- iconv.encodings = null;
22
-
23
- // Characters emitted in case of error.
24
- iconv.defaultCharUnicode = '�';
25
- iconv.defaultCharSingleByte = '?';
26
-
27
- // Public API.
28
- iconv.encode = function encode(str, encoding, options) {
29
- str = "" + (str || ""); // Ensure string.
30
-
31
- var encoder = iconv.getEncoder(encoding, options);
32
-
33
- var res = encoder.write(str);
34
- var trail = encoder.end();
35
-
36
- return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
37
- };
38
-
39
- iconv.decode = function decode(buf, encoding, options) {
40
- if (typeof buf === 'string') {
41
- if (!iconv.skipDecodeWarning) {
42
- console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
43
- iconv.skipDecodeWarning = true;
44
- }
45
-
46
- buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
47
- }
48
-
49
- var decoder = iconv.getDecoder(encoding, options);
50
-
51
- var res = decoder.write(buf);
52
- var trail = decoder.end();
53
-
54
- return trail ? (res + trail) : res;
55
- };
56
-
57
- iconv.encodingExists = function encodingExists(enc) {
58
- try {
59
- iconv.getCodec(enc);
60
- return true;
61
- } catch (e) {
62
- return false;
63
- }
64
- };
65
-
66
- // Legacy aliases to convert functions
67
- iconv.toEncoding = iconv.encode;
68
- iconv.fromEncoding = iconv.decode;
69
-
70
- // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
71
- iconv._codecDataCache = {};
72
- iconv.getCodec = function getCodec(encoding) {
73
- if (!iconv.encodings)
74
- iconv.encodings = requireEncodings(); // Lazy load all encoding definitions.
75
-
76
- // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
77
- var enc = iconv._canonicalizeEncoding(encoding);
78
-
79
- // Traverse iconv.encodings to find actual codec.
80
- var codecOptions = {};
81
- while (true) {
82
- var codec = iconv._codecDataCache[enc];
83
- if (codec)
84
- return codec;
85
-
86
- var codecDef = iconv.encodings[enc];
87
-
88
- switch (typeof codecDef) {
89
- case "string": // Direct alias to other encoding.
90
- enc = codecDef;
91
- break;
92
-
93
- case "object": // Alias with options. Can be layered.
94
- for (var key in codecDef)
95
- codecOptions[key] = codecDef[key];
96
-
97
- if (!codecOptions.encodingName)
98
- codecOptions.encodingName = enc;
99
-
100
- enc = codecDef.type;
101
- break;
102
-
103
- case "function": // Codec itself.
104
- if (!codecOptions.encodingName)
105
- codecOptions.encodingName = enc;
106
-
107
- // The codec function must load all tables and return object with .encoder and .decoder methods.
108
- // It'll be called only once (for each different options object).
109
- codec = new codecDef(codecOptions, iconv);
110
-
111
- iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
112
- return codec;
113
-
114
- default:
115
- throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
116
- }
117
- }
118
- };
119
-
120
- iconv._canonicalizeEncoding = function(encoding) {
121
- // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
122
- return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
123
- };
124
-
125
- iconv.getEncoder = function getEncoder(encoding, options) {
126
- var codec = iconv.getCodec(encoding),
127
- encoder = new codec.encoder(options, codec);
128
-
129
- if (codec.bomAware && options && options.addBOM)
130
- encoder = new bomHandling.PrependBOM(encoder, options);
131
-
132
- return encoder;
133
- };
134
-
135
- iconv.getDecoder = function getDecoder(encoding, options) {
136
- var codec = iconv.getCodec(encoding),
137
- decoder = new codec.decoder(options, codec);
138
-
139
- if (codec.bomAware && !(options && options.stripBOM === false))
140
- decoder = new bomHandling.StripBOM(decoder, options);
141
-
142
- return decoder;
143
- };
144
-
145
- // Streaming API
146
- // NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add
147
- // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
148
- // If you would like to enable it explicitly, please add the following code to your app:
149
- // > iconv.enableStreamingAPI(require('stream'));
150
- iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) {
151
- if (iconv.supportsStreams)
152
- return;
153
-
154
- // Dependency-inject stream module to create IconvLite stream classes.
155
- var streams = requireStreams()(stream_module);
156
-
157
- // Not public API yet, but expose the stream classes.
158
- iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
159
- iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
160
-
161
- // Streaming API.
162
- iconv.encodeStream = function encodeStream(encoding, options) {
163
- return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
164
- };
165
-
166
- iconv.decodeStream = function decodeStream(encoding, options) {
167
- return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
168
- };
169
-
170
- iconv.supportsStreams = true;
171
- };
172
-
173
- // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
174
- var stream_module;
175
- try {
176
- stream_module = require("stream");
177
- } catch (e) {}
178
-
179
- if (stream_module && stream_module.Transform) {
180
- iconv.enableStreamingAPI(stream_module);
181
-
182
- } else {
183
- // In rare cases where 'stream' module is not available by default, throw a helpful exception.
184
- iconv.encodeStream = iconv.decodeStream = function() {
185
- throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
186
- };
187
- }
188
- } (lib));
189
- return lib.exports;
190
- }
191
-
192
- export { requireLib as __require };
@@ -1,120 +0,0 @@
1
- import { __require as requireSafer } from '../../safer-buffer/safer.js';
2
-
3
- var streams;
4
- var hasRequiredStreams;
5
-
6
- function requireStreams () {
7
- if (hasRequiredStreams) return streams;
8
- hasRequiredStreams = 1;
9
-
10
- var Buffer = requireSafer().Buffer;
11
-
12
- // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
13
- // we opt to dependency-inject it instead of creating a hard dependency.
14
- streams = function(stream_module) {
15
- var Transform = stream_module.Transform;
16
-
17
- // == Encoder stream =======================================================
18
-
19
- function IconvLiteEncoderStream(conv, options) {
20
- this.conv = conv;
21
- options = options || {};
22
- options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
23
- Transform.call(this, options);
24
- }
25
-
26
- IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
27
- constructor: { value: IconvLiteEncoderStream }
28
- });
29
-
30
- IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
31
- if (typeof chunk != 'string')
32
- return done(new Error("Iconv encoding stream needs strings as its input."));
33
- try {
34
- var res = this.conv.write(chunk);
35
- if (res && res.length) this.push(res);
36
- done();
37
- }
38
- catch (e) {
39
- done(e);
40
- }
41
- };
42
-
43
- IconvLiteEncoderStream.prototype._flush = function(done) {
44
- try {
45
- var res = this.conv.end();
46
- if (res && res.length) this.push(res);
47
- done();
48
- }
49
- catch (e) {
50
- done(e);
51
- }
52
- };
53
-
54
- IconvLiteEncoderStream.prototype.collect = function(cb) {
55
- var chunks = [];
56
- this.on('error', cb);
57
- this.on('data', function(chunk) { chunks.push(chunk); });
58
- this.on('end', function() {
59
- cb(null, Buffer.concat(chunks));
60
- });
61
- return this;
62
- };
63
-
64
-
65
- // == Decoder stream =======================================================
66
-
67
- function IconvLiteDecoderStream(conv, options) {
68
- this.conv = conv;
69
- options = options || {};
70
- options.encoding = this.encoding = 'utf8'; // We output strings.
71
- Transform.call(this, options);
72
- }
73
-
74
- IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
75
- constructor: { value: IconvLiteDecoderStream }
76
- });
77
-
78
- IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
79
- if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array))
80
- return done(new Error("Iconv decoding stream needs buffers as its input."));
81
- try {
82
- var res = this.conv.write(chunk);
83
- if (res && res.length) this.push(res, this.encoding);
84
- done();
85
- }
86
- catch (e) {
87
- done(e);
88
- }
89
- };
90
-
91
- IconvLiteDecoderStream.prototype._flush = function(done) {
92
- try {
93
- var res = this.conv.end();
94
- if (res && res.length) this.push(res, this.encoding);
95
- done();
96
- }
97
- catch (e) {
98
- done(e);
99
- }
100
- };
101
-
102
- IconvLiteDecoderStream.prototype.collect = function(cb) {
103
- var res = '';
104
- this.on('error', cb);
105
- this.on('data', function(chunk) { res += chunk; });
106
- this.on('end', function() {
107
- cb(null, res);
108
- });
109
- return this;
110
- };
111
-
112
- return {
113
- IconvLiteEncoderStream: IconvLiteEncoderStream,
114
- IconvLiteDecoderStream: IconvLiteDecoderStream,
115
- };
116
- };
117
- return streams;
118
- }
119
-
120
- export { requireStreams as __require };
@@ -1,21 +0,0 @@
1
- import { __module as inherits } from '../../_virtual/inherits.js';
2
- import { __require as requireInherits_browser } from './inherits_browser.js';
3
-
4
- var hasRequiredInherits;
5
-
6
- function requireInherits () {
7
- if (hasRequiredInherits) return inherits.exports;
8
- hasRequiredInherits = 1;
9
- try {
10
- var util = require('util');
11
- /* istanbul ignore next */
12
- if (typeof util.inherits !== 'function') throw '';
13
- inherits.exports = util.inherits;
14
- } catch (e) {
15
- /* istanbul ignore next */
16
- inherits.exports = requireInherits_browser();
17
- }
18
- return inherits.exports;
19
- }
20
-
21
- export { requireInherits as __require };