@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.
- package/dist/src/ai/deepseek/DeepSeekChatBotAdapter.js +108 -0
- package/dist/src/channels/cmd/@cmd.js +1 -1
- package/dist/src/channels/cmd/CmdChannel.js +1 -1
- package/dist/src/channels/socket-io/@socket.js +24 -0
- package/dist/src/channels/socket-io/SocketChannel.js +78 -0
- package/dist/src/channels/socket-io/SocketChannelConfig.js +15 -0
- package/dist/src/channels/telegram/@telegram.js +1 -1
- package/dist/src/channels/telegram/TelegramChannel.js +1 -1
- package/dist/src/channels/whatsapp/@whatsapp.js +1 -1
- package/dist/src/channels/whatsapp/WhatsAppChannel.js +1 -1
- package/dist/src/channels/whatsapp/WhatsAppConnection.js +1 -1
- package/dist/src/channels/whatsapp/WhatsAppDevConnection.js +11 -3
- package/dist/src/channels/whatsapp/{whatsAppDevSocketContracts.js → WhatsAppDevSocketContracts.js} +1 -0
- package/dist/src/channels/whatsapp/WhatsAppProdConnection.js +4 -1
- package/dist/src/channels/whatsapp/WhatsAppSender.js +23 -0
- package/dist/src/controller/socket.io/SocketIO.js +1 -1
- package/dist/src/index.d.ts +82 -9
- package/dist/src/index.js +9 -1
- package/dist/src/logger/Logger.js +1 -1
- package/dist/src/mindset/MindsetOperator.js +1 -1
- package/dist/src/server/runChannel.js +1 -1
- package/dist/src/server/runServer.js +4 -4
- package/package.json +2 -1
- package/dist/src/_virtual/XMLHttpRequest.js +0 -7
- package/dist/src/_virtual/_commonjsHelpers.js +0 -32
- package/dist/src/_virtual/base64id.js +0 -3
- package/dist/src/_virtual/binary.js +0 -3
- package/dist/src/_virtual/bom-handling.js +0 -3
- package/dist/src/_virtual/broadcast-operator.js +0 -3
- package/dist/src/_virtual/browser.js +0 -3
- package/dist/src/_virtual/browser2.js +0 -3
- package/dist/src/_virtual/browser3.js +0 -3
- package/dist/src/_virtual/browser4.js +0 -3
- package/dist/src/_virtual/browser5.js +0 -3
- package/dist/src/_virtual/buffer-util.js +0 -3
- package/dist/src/_virtual/buffer-util2.js +0 -3
- package/dist/src/_virtual/buffer-util3.js +0 -3
- package/dist/src/_virtual/charset.js +0 -3
- package/dist/src/_virtual/charset2.js +0 -3
- package/dist/src/_virtual/client.js +0 -3
- package/dist/src/_virtual/cluster-adapter.js +0 -3
- package/dist/src/_virtual/commons.js +0 -3
- package/dist/src/_virtual/dbcs-codec.js +0 -3
- package/dist/src/_virtual/decodePacket.js +0 -3
- package/dist/src/_virtual/encodePacket.js +0 -3
- package/dist/src/_virtual/encoding.js +0 -3
- package/dist/src/_virtual/encoding2.js +0 -3
- package/dist/src/_virtual/engine.io.js +0 -3
- package/dist/src/_virtual/in-memory-adapter.js +0 -3
- package/dist/src/_virtual/index.js +0 -7
- package/dist/src/_virtual/index10.js +0 -3
- package/dist/src/_virtual/index11.js +0 -3
- package/dist/src/_virtual/index12.js +0 -3
- package/dist/src/_virtual/index13.js +0 -3
- package/dist/src/_virtual/index14.js +0 -3
- package/dist/src/_virtual/index15.js +0 -3
- package/dist/src/_virtual/index16.js +0 -3
- package/dist/src/_virtual/index17.js +0 -3
- package/dist/src/_virtual/index18.js +0 -3
- package/dist/src/_virtual/index19.js +0 -3
- package/dist/src/_virtual/index2.js +0 -7
- package/dist/src/_virtual/index20.js +0 -3
- package/dist/src/_virtual/index21.js +0 -3
- package/dist/src/_virtual/index22.js +0 -3
- package/dist/src/_virtual/index23.js +0 -3
- package/dist/src/_virtual/index24.js +0 -3
- package/dist/src/_virtual/index25.js +0 -3
- package/dist/src/_virtual/index26.js +0 -3
- package/dist/src/_virtual/index27.js +0 -3
- package/dist/src/_virtual/index28.js +0 -3
- package/dist/src/_virtual/index29.js +0 -3
- package/dist/src/_virtual/index3.js +0 -7
- package/dist/src/_virtual/index30.js +0 -3
- package/dist/src/_virtual/index31.js +0 -3
- package/dist/src/_virtual/index32.js +0 -3
- package/dist/src/_virtual/index33.js +0 -3
- package/dist/src/_virtual/index4.js +0 -3
- package/dist/src/_virtual/index5.js +0 -3
- package/dist/src/_virtual/index6.js +0 -3
- package/dist/src/_virtual/index7.js +0 -3
- package/dist/src/_virtual/index8.js +0 -6
- package/dist/src/_virtual/index9.js +0 -3
- package/dist/src/_virtual/inherits.js +0 -3
- package/dist/src/_virtual/inherits_browser.js +0 -3
- package/dist/src/_virtual/is-binary.js +0 -3
- package/dist/src/_virtual/language.js +0 -3
- package/dist/src/_virtual/language2.js +0 -3
- package/dist/src/_virtual/mediaType.js +0 -3
- package/dist/src/_virtual/mediaType2.js +0 -3
- package/dist/src/_virtual/namespace.js +0 -3
- package/dist/src/_virtual/node.js +0 -3
- package/dist/src/_virtual/node2.js +0 -3
- package/dist/src/_virtual/node3.js +0 -3
- package/dist/src/_virtual/node4.js +0 -3
- package/dist/src/_virtual/node5.js +0 -3
- package/dist/src/_virtual/parent-namespace.js +0 -3
- package/dist/src/_virtual/polling-jsonp.js +0 -3
- package/dist/src/_virtual/polling.js +0 -3
- package/dist/src/_virtual/polling2.js +0 -3
- package/dist/src/_virtual/receiver.js +0 -3
- package/dist/src/_virtual/sbcs-codec.js +0 -3
- package/dist/src/_virtual/sender.js +0 -3
- package/dist/src/_virtual/server.js +0 -3
- package/dist/src/_virtual/socket-types.js +0 -3
- package/dist/src/_virtual/socket.js +0 -3
- package/dist/src/_virtual/socket2.js +0 -3
- package/dist/src/_virtual/stream.js +0 -3
- package/dist/src/_virtual/transport.js +0 -3
- package/dist/src/_virtual/typed-events.js +0 -3
- package/dist/src/_virtual/userver.js +0 -3
- package/dist/src/_virtual/utf16.js +0 -3
- package/dist/src/_virtual/utf32.js +0 -3
- package/dist/src/_virtual/utf7.js +0 -3
- package/dist/src/_virtual/uws.js +0 -3
- package/dist/src/_virtual/validation.js +0 -3
- package/dist/src/_virtual/validation2.js +0 -3
- package/dist/src/_virtual/validation3.js +0 -3
- package/dist/src/_virtual/websocket-server.js +0 -3
- package/dist/src/_virtual/websocket.js +0 -7
- package/dist/src/_virtual/websocket2.js +0 -3
- package/dist/src/_virtual/websocket3.js +0 -3
- package/dist/src/_virtual/webtransport.js +0 -3
- package/dist/src/_virtual/yeast.js +0 -3
- package/dist/src/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -171
- package/dist/src/node_modules/base64id/lib/base64id.js +0 -117
- package/dist/src/node_modules/body-parser/index.js +0 -96
- package/dist/src/node_modules/body-parser/lib/read.js +0 -225
- package/dist/src/node_modules/body-parser/lib/types/json.js +0 -222
- package/dist/src/node_modules/body-parser/lib/types/raw.js +0 -90
- package/dist/src/node_modules/body-parser/lib/types/text.js +0 -95
- package/dist/src/node_modules/body-parser/lib/types/urlencoded.js +0 -194
- package/dist/src/node_modules/body-parser/lib/utils.js +0 -96
- package/dist/src/node_modules/bytes/index.js +0 -180
- package/dist/src/node_modules/call-bind-apply-helpers/actualApply.js +0 -24
- package/dist/src/node_modules/call-bind-apply-helpers/functionApply.js +0 -13
- package/dist/src/node_modules/call-bind-apply-helpers/functionCall.js +0 -13
- package/dist/src/node_modules/call-bind-apply-helpers/index.js +0 -29
- package/dist/src/node_modules/call-bind-apply-helpers/reflectApply.js +0 -13
- package/dist/src/node_modules/call-bound/index.js +0 -31
- package/dist/src/node_modules/content-type/index.js +0 -235
- package/dist/src/node_modules/cookie/index.js +0 -345
- package/dist/src/node_modules/cors/lib/index.js +0 -249
- package/dist/src/node_modules/debug/src/browser.js +0 -286
- package/dist/src/node_modules/debug/src/common.js +0 -303
- package/dist/src/node_modules/debug/src/index.js +0 -23
- package/dist/src/node_modules/debug/src/node.js +0 -279
- package/dist/src/node_modules/depd/index.js +0 -550
- package/dist/src/node_modules/dunder-proto/get.js +0 -42
- package/dist/src/node_modules/ee-first/index.js +0 -104
- package/dist/src/node_modules/engine.io/build/engine.io.js +0 -73
- package/dist/src/node_modules/engine.io/build/parser-v3/index.js +0 -429
- package/dist/src/node_modules/engine.io/build/parser-v3/utf8.js +0 -198
- package/dist/src/node_modules/engine.io/build/server.js +0 -808
- package/dist/src/node_modules/engine.io/build/socket.js +0 -469
- package/dist/src/node_modules/engine.io/build/transport.js +0 -131
- package/dist/src/node_modules/engine.io/build/transports/index.js +0 -37
- package/dist/src/node_modules/engine.io/build/transports/polling-jsonp.js +0 -53
- package/dist/src/node_modules/engine.io/build/transports/polling.js +0 -346
- package/dist/src/node_modules/engine.io/build/transports/websocket.js +0 -106
- package/dist/src/node_modules/engine.io/build/transports/webtransport.js +0 -76
- package/dist/src/node_modules/engine.io/build/transports-uws/index.js +0 -20
- package/dist/src/node_modules/engine.io/build/transports-uws/polling.js +0 -378
- package/dist/src/node_modules/engine.io/build/transports-uws/websocket.js +0 -85
- package/dist/src/node_modules/engine.io/build/userver.js +0 -292
- package/dist/src/node_modules/engine.io/node_modules/accepts/index.js +0 -250
- package/dist/src/node_modules/engine.io/node_modules/debug/src/browser.js +0 -285
- package/dist/src/node_modules/engine.io/node_modules/debug/src/common.js +0 -285
- package/dist/src/node_modules/engine.io/node_modules/debug/src/index.js +0 -23
- package/dist/src/node_modules/engine.io/node_modules/debug/src/node.js +0 -279
- package/dist/src/node_modules/engine.io/node_modules/mime-db/db.json.js +0 -10704
- package/dist/src/node_modules/engine.io/node_modules/mime-db/index.js +0 -24
- package/dist/src/node_modules/engine.io/node_modules/mime-types/index.js +0 -202
- package/dist/src/node_modules/engine.io/node_modules/negotiator/index.js +0 -96
- package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/charset.js +0 -179
- package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/encoding.js +0 -193
- package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/language.js +0 -188
- package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/mediaType.js +0 -304
- package/dist/src/node_modules/engine.io/node_modules/ws/index.js +0 -28
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/buffer-util.js +0 -142
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/constants.js +0 -21
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/event-target.js +0 -303
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/extension.js +0 -214
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/limiter.js +0 -64
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/receiver.js +0 -719
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/sender.js +0 -513
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/stream.js +0 -170
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/subprotocol.js +0 -73
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/validation.js +0 -141
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket-server.js +0 -559
- package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket.js +0 -1363
- package/dist/src/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -13
- package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -36
- package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -66
- package/dist/src/node_modules/engine.io-client/build/esm/globals.node.js +0 -92
- package/dist/src/node_modules/engine.io-client/build/esm/index.js +0 -17
- package/dist/src/node_modules/engine.io-client/build/esm/socket.js +0 -728
- package/dist/src/node_modules/engine.io-client/build/esm/transport.js +0 -143
- package/dist/src/node_modules/engine.io-client/build/esm/transports/index.js +0 -11
- package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -256
- package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +0 -21
- package/dist/src/node_modules/engine.io-client/build/esm/transports/polling.js +0 -146
- package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -107
- package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.node.js +0 -48
- package/dist/src/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -83
- package/dist/src/node_modules/engine.io-client/build/esm/util.js +0 -62
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js +0 -142
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/constants.js +0 -21
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/event-target.js +0 -303
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/extension.js +0 -214
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/limiter.js +0 -64
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/receiver.js +0 -719
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/sender.js +0 -513
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/stream.js +0 -170
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js +0 -73
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/validation.js +0 -141
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js +0 -559
- package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket.js +0 -1363
- package/dist/src/node_modules/engine.io-parser/build/cjs/commons.js +0 -29
- package/dist/src/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -70
- package/dist/src/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -51
- package/dist/src/node_modules/engine.io-parser/build/cjs/index.js +0 -179
- package/dist/src/node_modules/engine.io-parser/build/esm/commons.js +0 -15
- package/dist/src/node_modules/engine.io-parser/build/esm/decodePacket.js +0 -58
- package/dist/src/node_modules/engine.io-parser/build/esm/encodePacket.js +0 -36
- package/dist/src/node_modules/engine.io-parser/build/esm/index.js +0 -158
- package/dist/src/node_modules/es-define-property/index.js +0 -23
- package/dist/src/node_modules/es-errors/eval.js +0 -13
- package/dist/src/node_modules/es-errors/index.js +0 -13
- package/dist/src/node_modules/es-errors/range.js +0 -13
- package/dist/src/node_modules/es-errors/ref.js +0 -13
- package/dist/src/node_modules/es-errors/syntax.js +0 -13
- package/dist/src/node_modules/es-errors/type.js +0 -13
- package/dist/src/node_modules/es-errors/uri.js +0 -13
- package/dist/src/node_modules/es-object-atoms/index.js +0 -13
- package/dist/src/node_modules/function-bind/implementation.js +0 -93
- package/dist/src/node_modules/function-bind/index.js +0 -16
- package/dist/src/node_modules/get-intrinsic/index.js +0 -413
- package/dist/src/node_modules/get-proto/Object.getPrototypeOf.js +0 -17
- package/dist/src/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -13
- package/dist/src/node_modules/get-proto/index.js +0 -40
- package/dist/src/node_modules/gopd/gOPD.js +0 -13
- package/dist/src/node_modules/gopd/index.js +0 -26
- package/dist/src/node_modules/has-symbols/index.js +0 -25
- package/dist/src/node_modules/has-symbols/shams.js +0 -54
- package/dist/src/node_modules/hasown/index.js +0 -19
- package/dist/src/node_modules/http-errors/index.js +0 -306
- package/dist/src/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -598
- package/dist/src/node_modules/iconv-lite/encodings/dbcs-data.js +0 -206
- package/dist/src/node_modules/iconv-lite/encodings/index.js +0 -44
- package/dist/src/node_modules/iconv-lite/encodings/internal.js +0 -210
- package/dist/src/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -83
- package/dist/src/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -460
- package/dist/src/node_modules/iconv-lite/encodings/sbcs-data.js +0 -187
- package/dist/src/node_modules/iconv-lite/encodings/tables/big5-added.json.js +0 -506
- package/dist/src/node_modules/iconv-lite/encodings/tables/cp936.json.js +0 -2621
- package/dist/src/node_modules/iconv-lite/encodings/tables/cp949.json.js +0 -2380
- package/dist/src/node_modules/iconv-lite/encodings/tables/cp950.json.js +0 -729
- package/dist/src/node_modules/iconv-lite/encodings/tables/eucjp.json.js +0 -822
- package/dist/src/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json.js +0 -424
- package/dist/src/node_modules/iconv-lite/encodings/tables/gbk-added.json.js +0 -264
- package/dist/src/node_modules/iconv-lite/encodings/tables/shiftjis.json.js +0 -548
- package/dist/src/node_modules/iconv-lite/encodings/utf16.js +0 -206
- package/dist/src/node_modules/iconv-lite/encodings/utf32.js +0 -329
- package/dist/src/node_modules/iconv-lite/encodings/utf7.js +0 -297
- package/dist/src/node_modules/iconv-lite/lib/bom-handling.js +0 -61
- package/dist/src/node_modules/iconv-lite/lib/index.js +0 -192
- package/dist/src/node_modules/iconv-lite/lib/streams.js +0 -120
- package/dist/src/node_modules/inherits/inherits.js +0 -21
- package/dist/src/node_modules/inherits/inherits_browser.js +0 -38
- package/dist/src/node_modules/math-intrinsics/abs.js +0 -13
- package/dist/src/node_modules/math-intrinsics/floor.js +0 -13
- package/dist/src/node_modules/math-intrinsics/isNaN.js +0 -15
- package/dist/src/node_modules/math-intrinsics/max.js +0 -13
- package/dist/src/node_modules/math-intrinsics/min.js +0 -13
- package/dist/src/node_modules/math-intrinsics/pow.js +0 -13
- package/dist/src/node_modules/math-intrinsics/round.js +0 -13
- package/dist/src/node_modules/math-intrinsics/sign.js +0 -22
- package/dist/src/node_modules/media-typer/index.js +0 -153
- package/dist/src/node_modules/mime-db/db.json.js +0 -11656
- package/dist/src/node_modules/mime-db/index.js +0 -24
- package/dist/src/node_modules/mime-types/index.js +0 -226
- package/dist/src/node_modules/mime-types/mimeScore.js +0 -62
- package/dist/src/node_modules/ms/index.js +0 -172
- package/dist/src/node_modules/object-assign/index.js +0 -99
- package/dist/src/node_modules/object-inspect/index.js +0 -557
- package/dist/src/node_modules/object-inspect/util.inspect.js +0 -13
- package/dist/src/node_modules/on-finished/index.js +0 -245
- package/dist/src/node_modules/qs/lib/formats.js +0 -32
- package/dist/src/node_modules/qs/lib/index.js +0 -24
- package/dist/src/node_modules/qs/lib/parse.js +0 -339
- package/dist/src/node_modules/qs/lib/stringify.js +0 -369
- package/dist/src/node_modules/qs/lib/utils.js +0 -279
- package/dist/src/node_modules/raw-body/index.js +0 -351
- package/dist/src/node_modules/safer-buffer/safer.js +0 -88
- package/dist/src/node_modules/setprototypeof/index.js +0 -26
- package/dist/src/node_modules/side-channel/index.js +0 -58
- package/dist/src/node_modules/side-channel-list/index.js +0 -125
- package/dist/src/node_modules/side-channel-map/index.js +0 -82
- package/dist/src/node_modules/side-channel-weakmap/index.js +0 -99
- package/dist/src/node_modules/socket.io/dist/broadcast-operator.js +0 -448
- package/dist/src/node_modules/socket.io/dist/client.js +0 -281
- package/dist/src/node_modules/socket.io/dist/index.js +0 -837
- package/dist/src/node_modules/socket.io/dist/namespace.js +0 -597
- package/dist/src/node_modules/socket.io/dist/parent-namespace.js +0 -101
- package/dist/src/node_modules/socket.io/dist/socket-types.js +0 -21
- package/dist/src/node_modules/socket.io/dist/socket.js +0 -993
- package/dist/src/node_modules/socket.io/dist/typed-events.js +0 -92
- package/dist/src/node_modules/socket.io/dist/uws.js +0 -149
- package/dist/src/node_modules/socket.io/node_modules/accepts/index.js +0 -250
- package/dist/src/node_modules/socket.io/node_modules/debug/src/browser.js +0 -285
- package/dist/src/node_modules/socket.io/node_modules/debug/src/common.js +0 -285
- package/dist/src/node_modules/socket.io/node_modules/debug/src/index.js +0 -23
- package/dist/src/node_modules/socket.io/node_modules/debug/src/node.js +0 -279
- package/dist/src/node_modules/socket.io/node_modules/mime-db/db.json.js +0 -10704
- package/dist/src/node_modules/socket.io/node_modules/mime-db/index.js +0 -24
- package/dist/src/node_modules/socket.io/node_modules/mime-types/index.js +0 -202
- package/dist/src/node_modules/socket.io/node_modules/negotiator/index.js +0 -96
- package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/charset.js +0 -179
- package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/encoding.js +0 -193
- package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/language.js +0 -188
- package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/mediaType.js +0 -304
- package/dist/src/node_modules/socket.io/package.json.js +0 -5
- package/dist/src/node_modules/socket.io/wrapper.js +0 -5
- package/dist/src/node_modules/socket.io-adapter/dist/cluster-adapter.js +0 -689
- package/dist/src/node_modules/socket.io-adapter/dist/contrib/yeast.js +0 -64
- package/dist/src/node_modules/socket.io-adapter/dist/in-memory-adapter.js +0 -407
- package/dist/src/node_modules/socket.io-adapter/dist/index.js +0 -24
- package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/browser.js +0 -285
- package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/common.js +0 -285
- package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/index.js +0 -23
- package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/node.js +0 -279
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/index.js +0 -28
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/buffer-util.js +0 -142
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/constants.js +0 -21
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/event-target.js +0 -303
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/extension.js +0 -214
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/limiter.js +0 -64
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/receiver.js +0 -719
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/sender.js +0 -513
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/stream.js +0 -170
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/subprotocol.js +0 -73
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/validation.js +0 -141
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket-server.js +0 -559
- package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket.js +0 -1363
- package/dist/src/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -68
- package/dist/src/node_modules/socket.io-client/build/esm/index.js +0 -50
- package/dist/src/node_modules/socket.io-client/build/esm/manager.js +0 -373
- package/dist/src/node_modules/socket.io-client/build/esm/on.js +0 -8
- package/dist/src/node_modules/socket.io-client/build/esm/socket.js +0 -884
- package/dist/src/node_modules/socket.io-client/build/esm/url.js +0 -63
- package/dist/src/node_modules/socket.io-parser/build/cjs/binary.js +0 -99
- package/dist/src/node_modules/socket.io-parser/build/cjs/index.js +0 -337
- package/dist/src/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -65
- package/dist/src/node_modules/socket.io-parser/build/esm/binary.js +0 -86
- package/dist/src/node_modules/socket.io-parser/build/esm/index.js +0 -314
- package/dist/src/node_modules/socket.io-parser/build/esm/is-binary.js +0 -52
- package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/browser.js +0 -285
- package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/common.js +0 -285
- package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/index.js +0 -23
- package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/node.js +0 -279
- package/dist/src/node_modules/statuses/codes.json.js +0 -67
- package/dist/src/node_modules/statuses/index.js +0 -157
- package/dist/src/node_modules/toidentifier/index.js +0 -41
- package/dist/src/node_modules/type-is/index.js +0 -263
- package/dist/src/node_modules/unpipe/index.js +0 -78
- package/dist/src/node_modules/vary/index.js +0 -159
- package/dist/src/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +0 -702
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import require$$0 from './codes.json.js';
|
|
2
|
-
|
|
3
|
-
/*!
|
|
4
|
-
* statuses
|
|
5
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
6
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
7
|
-
* MIT Licensed
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var statuses;
|
|
11
|
-
var hasRequiredStatuses;
|
|
12
|
-
|
|
13
|
-
function requireStatuses () {
|
|
14
|
-
if (hasRequiredStatuses) return statuses;
|
|
15
|
-
hasRequiredStatuses = 1;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Module dependencies.
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var codes = require$$0;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Module exports.
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
statuses = status;
|
|
30
|
-
|
|
31
|
-
// status code to message map
|
|
32
|
-
status.message = codes;
|
|
33
|
-
|
|
34
|
-
// status message (lower-case) to code map
|
|
35
|
-
status.code = createMessageToStatusCodeMap(codes);
|
|
36
|
-
|
|
37
|
-
// array of status codes
|
|
38
|
-
status.codes = createStatusCodeList(codes);
|
|
39
|
-
|
|
40
|
-
// status codes for redirects
|
|
41
|
-
status.redirect = {
|
|
42
|
-
300: true,
|
|
43
|
-
301: true,
|
|
44
|
-
302: true,
|
|
45
|
-
303: true,
|
|
46
|
-
305: true,
|
|
47
|
-
307: true,
|
|
48
|
-
308: true
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// status codes for empty bodies
|
|
52
|
-
status.empty = {
|
|
53
|
-
204: true,
|
|
54
|
-
205: true,
|
|
55
|
-
304: true
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// status codes for when you should retry the request
|
|
59
|
-
status.retry = {
|
|
60
|
-
502: true,
|
|
61
|
-
503: true,
|
|
62
|
-
504: true
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Create a map of message to status code.
|
|
67
|
-
* @private
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
function createMessageToStatusCodeMap (codes) {
|
|
71
|
-
var map = {};
|
|
72
|
-
|
|
73
|
-
Object.keys(codes).forEach(function forEachCode (code) {
|
|
74
|
-
var message = codes[code];
|
|
75
|
-
var status = Number(code);
|
|
76
|
-
|
|
77
|
-
// populate map
|
|
78
|
-
map[message.toLowerCase()] = status;
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
return map
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Create a list of all status codes.
|
|
86
|
-
* @private
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
function createStatusCodeList (codes) {
|
|
90
|
-
return Object.keys(codes).map(function mapCode (code) {
|
|
91
|
-
return Number(code)
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get the status code for given message.
|
|
97
|
-
* @private
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
function getStatusCode (message) {
|
|
101
|
-
var msg = message.toLowerCase();
|
|
102
|
-
|
|
103
|
-
if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
|
|
104
|
-
throw new Error('invalid status message: "' + message + '"')
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return status.code[msg]
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Get the status message for given code.
|
|
112
|
-
* @private
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
function getStatusMessage (code) {
|
|
116
|
-
if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
|
|
117
|
-
throw new Error('invalid status code: ' + code)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return status.message[code]
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Get the status code.
|
|
125
|
-
*
|
|
126
|
-
* Given a number, this will throw if it is not a known status
|
|
127
|
-
* code, otherwise the code will be returned. Given a string,
|
|
128
|
-
* the string will be parsed for a number and return the code
|
|
129
|
-
* if valid, otherwise will lookup the code assuming this is
|
|
130
|
-
* the status message.
|
|
131
|
-
*
|
|
132
|
-
* @param {string|number} code
|
|
133
|
-
* @returns {number}
|
|
134
|
-
* @public
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
function status (code) {
|
|
138
|
-
if (typeof code === 'number') {
|
|
139
|
-
return getStatusMessage(code)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (typeof code !== 'string') {
|
|
143
|
-
throw new TypeError('code must be a number or string')
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// '403'
|
|
147
|
-
var n = parseInt(code, 10);
|
|
148
|
-
if (!isNaN(n)) {
|
|
149
|
-
return getStatusMessage(n)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return getStatusCode(code)
|
|
153
|
-
}
|
|
154
|
-
return statuses;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export { requireStatuses as __require };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* toidentifier
|
|
3
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
4
|
-
* MIT Licensed
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
var toidentifier;
|
|
8
|
-
var hasRequiredToidentifier;
|
|
9
|
-
|
|
10
|
-
function requireToidentifier () {
|
|
11
|
-
if (hasRequiredToidentifier) return toidentifier;
|
|
12
|
-
hasRequiredToidentifier = 1;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Module exports.
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
toidentifier = toIdentifier;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Trasform the given string into a JavaScript identifier
|
|
23
|
-
*
|
|
24
|
-
* @param {string} str
|
|
25
|
-
* @returns {string}
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
function toIdentifier (str) {
|
|
30
|
-
return str
|
|
31
|
-
.split(' ')
|
|
32
|
-
.map(function (token) {
|
|
33
|
-
return token.slice(0, 1).toUpperCase() + token.slice(1)
|
|
34
|
-
})
|
|
35
|
-
.join('')
|
|
36
|
-
.replace(/[^ _0-9a-z]/gi, '')
|
|
37
|
-
}
|
|
38
|
-
return toidentifier;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { requireToidentifier as __require };
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { __module as typeIs } from '../../_virtual/index11.js';
|
|
2
|
-
import { __require as requireContentType } from '../content-type/index.js';
|
|
3
|
-
import { __require as requireMimeTypes } from '../mime-types/index.js';
|
|
4
|
-
import { __require as requireMediaTyper } from '../media-typer/index.js';
|
|
5
|
-
|
|
6
|
-
/*!
|
|
7
|
-
* type-is
|
|
8
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
9
|
-
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
10
|
-
* MIT Licensed
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
var hasRequiredTypeIs;
|
|
14
|
-
|
|
15
|
-
function requireTypeIs () {
|
|
16
|
-
if (hasRequiredTypeIs) return typeIs.exports;
|
|
17
|
-
hasRequiredTypeIs = 1;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Module dependencies.
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
var contentType = requireContentType();
|
|
25
|
-
var mime = requireMimeTypes();
|
|
26
|
-
var typer = requireMediaTyper();
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Module exports.
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
typeIs.exports = typeofrequest;
|
|
34
|
-
typeIs.exports.is = typeis;
|
|
35
|
-
typeIs.exports.hasBody = hasbody;
|
|
36
|
-
typeIs.exports.normalize = normalize;
|
|
37
|
-
typeIs.exports.match = mimeMatch;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Compare a `value` content-type with `types`.
|
|
41
|
-
* Each `type` can be an extension like `html`,
|
|
42
|
-
* a special shortcut like `multipart` or `urlencoded`,
|
|
43
|
-
* or a mime type.
|
|
44
|
-
*
|
|
45
|
-
* If no types match, `false` is returned.
|
|
46
|
-
* Otherwise, the first `type` that matches is returned.
|
|
47
|
-
*
|
|
48
|
-
* @param {String} value
|
|
49
|
-
* @param {Array} types
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
function typeis (value, types_) {
|
|
54
|
-
var i;
|
|
55
|
-
var types = types_;
|
|
56
|
-
|
|
57
|
-
// remove parameters and normalize
|
|
58
|
-
var val = tryNormalizeType(value);
|
|
59
|
-
|
|
60
|
-
// no type or invalid
|
|
61
|
-
if (!val) {
|
|
62
|
-
return false
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// support flattened arguments
|
|
66
|
-
if (types && !Array.isArray(types)) {
|
|
67
|
-
types = new Array(arguments.length - 1);
|
|
68
|
-
for (i = 0; i < types.length; i++) {
|
|
69
|
-
types[i] = arguments[i + 1];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// no types, return the content type
|
|
74
|
-
if (!types || !types.length) {
|
|
75
|
-
return val
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
var type;
|
|
79
|
-
for (i = 0; i < types.length; i++) {
|
|
80
|
-
if (mimeMatch(normalize(type = types[i]), val)) {
|
|
81
|
-
return type[0] === '+' || type.indexOf('*') !== -1
|
|
82
|
-
? val
|
|
83
|
-
: type
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// no matches
|
|
88
|
-
return false
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Check if a request has a request body.
|
|
93
|
-
* A request with a body __must__ either have `transfer-encoding`
|
|
94
|
-
* or `content-length` headers set.
|
|
95
|
-
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
|
|
96
|
-
*
|
|
97
|
-
* @param {Object} request
|
|
98
|
-
* @return {Boolean}
|
|
99
|
-
* @public
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
function hasbody (req) {
|
|
103
|
-
return req.headers['transfer-encoding'] !== undefined ||
|
|
104
|
-
!isNaN(req.headers['content-length'])
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Check if the incoming request contains the "Content-Type"
|
|
109
|
-
* header field, and it contains any of the give mime `type`s.
|
|
110
|
-
* If there is no request body, `null` is returned.
|
|
111
|
-
* If there is no content type, `false` is returned.
|
|
112
|
-
* Otherwise, it returns the first `type` that matches.
|
|
113
|
-
*
|
|
114
|
-
* Examples:
|
|
115
|
-
*
|
|
116
|
-
* // With Content-Type: text/html; charset=utf-8
|
|
117
|
-
* this.is('html'); // => 'html'
|
|
118
|
-
* this.is('text/html'); // => 'text/html'
|
|
119
|
-
* this.is('text/*', 'application/json'); // => 'text/html'
|
|
120
|
-
*
|
|
121
|
-
* // When Content-Type is application/json
|
|
122
|
-
* this.is('json', 'urlencoded'); // => 'json'
|
|
123
|
-
* this.is('application/json'); // => 'application/json'
|
|
124
|
-
* this.is('html', 'application/*'); // => 'application/json'
|
|
125
|
-
*
|
|
126
|
-
* this.is('html'); // => false
|
|
127
|
-
*
|
|
128
|
-
* @param {Object} req
|
|
129
|
-
* @param {(String|Array)} types...
|
|
130
|
-
* @return {(String|false|null)}
|
|
131
|
-
* @public
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
function typeofrequest (req, types_) {
|
|
135
|
-
// no body
|
|
136
|
-
if (!hasbody(req)) return null
|
|
137
|
-
// support flattened arguments
|
|
138
|
-
var types = arguments.length > 2
|
|
139
|
-
? Array.prototype.slice.call(arguments, 1)
|
|
140
|
-
: types_;
|
|
141
|
-
// request content type
|
|
142
|
-
var value = req.headers['content-type'];
|
|
143
|
-
|
|
144
|
-
return typeis(value, types)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Normalize a mime type.
|
|
149
|
-
* If it's a shorthand, expand it to a valid mime type.
|
|
150
|
-
*
|
|
151
|
-
* In general, you probably want:
|
|
152
|
-
*
|
|
153
|
-
* var type = is(req, ['urlencoded', 'json', 'multipart']);
|
|
154
|
-
*
|
|
155
|
-
* Then use the appropriate body parsers.
|
|
156
|
-
* These three are the most common request body types
|
|
157
|
-
* and are thus ensured to work.
|
|
158
|
-
*
|
|
159
|
-
* @param {String} type
|
|
160
|
-
* @return {String|false|null}
|
|
161
|
-
* @public
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
function normalize (type) {
|
|
165
|
-
if (typeof type !== 'string') {
|
|
166
|
-
// invalid type
|
|
167
|
-
return false
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
switch (type) {
|
|
171
|
-
case 'urlencoded':
|
|
172
|
-
return 'application/x-www-form-urlencoded'
|
|
173
|
-
case 'multipart':
|
|
174
|
-
return 'multipart/*'
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (type[0] === '+') {
|
|
178
|
-
// "+json" -> "*/*+json" expando
|
|
179
|
-
return '*/*' + type
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return type.indexOf('/') === -1
|
|
183
|
-
? mime.lookup(type)
|
|
184
|
-
: type
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Check if `expected` mime type
|
|
189
|
-
* matches `actual` mime type with
|
|
190
|
-
* wildcard and +suffix support.
|
|
191
|
-
*
|
|
192
|
-
* @param {String} expected
|
|
193
|
-
* @param {String} actual
|
|
194
|
-
* @return {Boolean}
|
|
195
|
-
* @public
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
|
-
function mimeMatch (expected, actual) {
|
|
199
|
-
// invalid type
|
|
200
|
-
if (expected === false) {
|
|
201
|
-
return false
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// split types
|
|
205
|
-
var actualParts = actual.split('/');
|
|
206
|
-
var expectedParts = expected.split('/');
|
|
207
|
-
|
|
208
|
-
// invalid format
|
|
209
|
-
if (actualParts.length !== 2 || expectedParts.length !== 2) {
|
|
210
|
-
return false
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// validate type
|
|
214
|
-
if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {
|
|
215
|
-
return false
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// validate suffix wildcard
|
|
219
|
-
if (expectedParts[1].slice(0, 2) === '*+') {
|
|
220
|
-
return expectedParts[1].length <= actualParts[1].length + 1 &&
|
|
221
|
-
expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length)
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// validate subtype
|
|
225
|
-
if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {
|
|
226
|
-
return false
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return true
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Normalize a type and remove parameters.
|
|
234
|
-
*
|
|
235
|
-
* @param {string} value
|
|
236
|
-
* @return {(string|null)}
|
|
237
|
-
* @private
|
|
238
|
-
*/
|
|
239
|
-
function normalizeType (value) {
|
|
240
|
-
// Parse the type
|
|
241
|
-
var type = contentType.parse(value).type;
|
|
242
|
-
|
|
243
|
-
return typer.test(type) ? type : null
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Try to normalize a type and remove parameters.
|
|
248
|
-
*
|
|
249
|
-
* @param {string} value
|
|
250
|
-
* @return {(string|null)}
|
|
251
|
-
* @private
|
|
252
|
-
*/
|
|
253
|
-
function tryNormalizeType (value) {
|
|
254
|
-
try {
|
|
255
|
-
return value ? normalizeType(value) : null
|
|
256
|
-
} catch (err) {
|
|
257
|
-
return null
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return typeIs.exports;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export { requireTypeIs as __require };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* unpipe
|
|
3
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
4
|
-
* MIT Licensed
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
var unpipe_1;
|
|
8
|
-
var hasRequiredUnpipe;
|
|
9
|
-
|
|
10
|
-
function requireUnpipe () {
|
|
11
|
-
if (hasRequiredUnpipe) return unpipe_1;
|
|
12
|
-
hasRequiredUnpipe = 1;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Module exports.
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
unpipe_1 = unpipe;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Determine if there are Node.js pipe-like data listeners.
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
function hasPipeDataListeners(stream) {
|
|
27
|
-
var listeners = stream.listeners('data');
|
|
28
|
-
|
|
29
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
30
|
-
if (listeners[i].name === 'ondata') {
|
|
31
|
-
return true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return false
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Unpipe a stream from all destinations.
|
|
40
|
-
*
|
|
41
|
-
* @param {object} stream
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
function unpipe(stream) {
|
|
46
|
-
if (!stream) {
|
|
47
|
-
throw new TypeError('argument stream is required')
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (typeof stream.unpipe === 'function') {
|
|
51
|
-
// new-style
|
|
52
|
-
stream.unpipe();
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Node.js 0.8 hack
|
|
57
|
-
if (!hasPipeDataListeners(stream)) {
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
var listener;
|
|
62
|
-
var listeners = stream.listeners('close');
|
|
63
|
-
|
|
64
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
65
|
-
listener = listeners[i];
|
|
66
|
-
|
|
67
|
-
if (listener.name !== 'cleanup' && listener.name !== 'onclose') {
|
|
68
|
-
continue
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// invoke the listener
|
|
72
|
-
listener.call(stream);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return unpipe_1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export { requireUnpipe as __require };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { __module as vary } from '../../_virtual/index27.js';
|
|
2
|
-
|
|
3
|
-
/*!
|
|
4
|
-
* vary
|
|
5
|
-
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
6
|
-
* MIT Licensed
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
var hasRequiredVary;
|
|
10
|
-
|
|
11
|
-
function requireVary () {
|
|
12
|
-
if (hasRequiredVary) return vary.exports;
|
|
13
|
-
hasRequiredVary = 1;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Module exports.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
vary.exports = vary$1;
|
|
20
|
-
vary.exports.append = append;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* RegExp to match field-name in RFC 7230 sec 3.2
|
|
24
|
-
*
|
|
25
|
-
* field-name = token
|
|
26
|
-
* token = 1*tchar
|
|
27
|
-
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
|
|
28
|
-
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
|
|
29
|
-
* / DIGIT / ALPHA
|
|
30
|
-
* ; any VCHAR, except delimiters
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Append a field to a vary header.
|
|
37
|
-
*
|
|
38
|
-
* @param {String} header
|
|
39
|
-
* @param {String|Array} field
|
|
40
|
-
* @return {String}
|
|
41
|
-
* @public
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
function append (header, field) {
|
|
45
|
-
if (typeof header !== 'string') {
|
|
46
|
-
throw new TypeError('header argument is required')
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!field) {
|
|
50
|
-
throw new TypeError('field argument is required')
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// get fields array
|
|
54
|
-
var fields = !Array.isArray(field)
|
|
55
|
-
? parse(String(field))
|
|
56
|
-
: field;
|
|
57
|
-
|
|
58
|
-
// assert on invalid field names
|
|
59
|
-
for (var j = 0; j < fields.length; j++) {
|
|
60
|
-
if (!FIELD_NAME_REGEXP.test(fields[j])) {
|
|
61
|
-
throw new TypeError('field argument contains an invalid header name')
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// existing, unspecified vary
|
|
66
|
-
if (header === '*') {
|
|
67
|
-
return header
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// enumerate current values
|
|
71
|
-
var val = header;
|
|
72
|
-
var vals = parse(header.toLowerCase());
|
|
73
|
-
|
|
74
|
-
// unspecified vary
|
|
75
|
-
if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {
|
|
76
|
-
return '*'
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
for (var i = 0; i < fields.length; i++) {
|
|
80
|
-
var fld = fields[i].toLowerCase();
|
|
81
|
-
|
|
82
|
-
// append value (case-preserving)
|
|
83
|
-
if (vals.indexOf(fld) === -1) {
|
|
84
|
-
vals.push(fld);
|
|
85
|
-
val = val
|
|
86
|
-
? val + ', ' + fields[i]
|
|
87
|
-
: fields[i];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return val
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Parse a vary header into an array.
|
|
96
|
-
*
|
|
97
|
-
* @param {String} header
|
|
98
|
-
* @return {Array}
|
|
99
|
-
* @private
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
function parse (header) {
|
|
103
|
-
var end = 0;
|
|
104
|
-
var list = [];
|
|
105
|
-
var start = 0;
|
|
106
|
-
|
|
107
|
-
// gather tokens
|
|
108
|
-
for (var i = 0, len = header.length; i < len; i++) {
|
|
109
|
-
switch (header.charCodeAt(i)) {
|
|
110
|
-
case 0x20: /* */
|
|
111
|
-
if (start === end) {
|
|
112
|
-
start = end = i + 1;
|
|
113
|
-
}
|
|
114
|
-
break
|
|
115
|
-
case 0x2c: /* , */
|
|
116
|
-
list.push(header.substring(start, end));
|
|
117
|
-
start = end = i + 1;
|
|
118
|
-
break
|
|
119
|
-
default:
|
|
120
|
-
end = i + 1;
|
|
121
|
-
break
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// final token
|
|
126
|
-
list.push(header.substring(start, end));
|
|
127
|
-
|
|
128
|
-
return list
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Mark that a request is varied on a header field.
|
|
133
|
-
*
|
|
134
|
-
* @param {Object} res
|
|
135
|
-
* @param {String|Array} field
|
|
136
|
-
* @public
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
function vary$1 (res, field) {
|
|
140
|
-
if (!res || !res.getHeader || !res.setHeader) {
|
|
141
|
-
// quack quack
|
|
142
|
-
throw new TypeError('res argument is required')
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// get existing header
|
|
146
|
-
var val = res.getHeader('Vary') || '';
|
|
147
|
-
var header = Array.isArray(val)
|
|
148
|
-
? val.join(', ')
|
|
149
|
-
: String(val);
|
|
150
|
-
|
|
151
|
-
// set new header
|
|
152
|
-
if ((val = append(header, field))) {
|
|
153
|
-
res.setHeader('Vary', val);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return vary.exports;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { requireVary as __require };
|