@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,369 +0,0 @@
|
|
|
1
|
-
import { __require as requireSideChannel } from '../../side-channel/index.js';
|
|
2
|
-
import { __require as requireUtils } from './utils.js';
|
|
3
|
-
import { __require as requireFormats } from './formats.js';
|
|
4
|
-
|
|
5
|
-
var stringify_1;
|
|
6
|
-
var hasRequiredStringify;
|
|
7
|
-
|
|
8
|
-
function requireStringify () {
|
|
9
|
-
if (hasRequiredStringify) return stringify_1;
|
|
10
|
-
hasRequiredStringify = 1;
|
|
11
|
-
|
|
12
|
-
var getSideChannel = requireSideChannel();
|
|
13
|
-
var utils = /*@__PURE__*/ requireUtils();
|
|
14
|
-
var formats = /*@__PURE__*/ requireFormats();
|
|
15
|
-
var has = Object.prototype.hasOwnProperty;
|
|
16
|
-
|
|
17
|
-
var arrayPrefixGenerators = {
|
|
18
|
-
brackets: function brackets(prefix) {
|
|
19
|
-
return prefix + '[]';
|
|
20
|
-
},
|
|
21
|
-
comma: 'comma',
|
|
22
|
-
indices: function indices(prefix, key) {
|
|
23
|
-
return prefix + '[' + key + ']';
|
|
24
|
-
},
|
|
25
|
-
repeat: function repeat(prefix) {
|
|
26
|
-
return prefix;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var isArray = Array.isArray;
|
|
31
|
-
var push = Array.prototype.push;
|
|
32
|
-
var pushToArray = function (arr, valueOrArray) {
|
|
33
|
-
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var toISO = Date.prototype.toISOString;
|
|
37
|
-
|
|
38
|
-
var defaultFormat = formats['default'];
|
|
39
|
-
var defaults = {
|
|
40
|
-
addQueryPrefix: false,
|
|
41
|
-
allowDots: false,
|
|
42
|
-
allowEmptyArrays: false,
|
|
43
|
-
arrayFormat: 'indices',
|
|
44
|
-
charset: 'utf-8',
|
|
45
|
-
charsetSentinel: false,
|
|
46
|
-
commaRoundTrip: false,
|
|
47
|
-
delimiter: '&',
|
|
48
|
-
encode: true,
|
|
49
|
-
encodeDotInKeys: false,
|
|
50
|
-
encoder: utils.encode,
|
|
51
|
-
encodeValuesOnly: false,
|
|
52
|
-
filter: void 0,
|
|
53
|
-
format: defaultFormat,
|
|
54
|
-
formatter: formats.formatters[defaultFormat],
|
|
55
|
-
// deprecated
|
|
56
|
-
indices: false,
|
|
57
|
-
serializeDate: function serializeDate(date) {
|
|
58
|
-
return toISO.call(date);
|
|
59
|
-
},
|
|
60
|
-
skipNulls: false,
|
|
61
|
-
strictNullHandling: false
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
65
|
-
return typeof v === 'string'
|
|
66
|
-
|| typeof v === 'number'
|
|
67
|
-
|| typeof v === 'boolean'
|
|
68
|
-
|| typeof v === 'symbol'
|
|
69
|
-
|| typeof v === 'bigint';
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
var sentinel = {};
|
|
73
|
-
|
|
74
|
-
var stringify = function stringify(
|
|
75
|
-
object,
|
|
76
|
-
prefix,
|
|
77
|
-
generateArrayPrefix,
|
|
78
|
-
commaRoundTrip,
|
|
79
|
-
allowEmptyArrays,
|
|
80
|
-
strictNullHandling,
|
|
81
|
-
skipNulls,
|
|
82
|
-
encodeDotInKeys,
|
|
83
|
-
encoder,
|
|
84
|
-
filter,
|
|
85
|
-
sort,
|
|
86
|
-
allowDots,
|
|
87
|
-
serializeDate,
|
|
88
|
-
format,
|
|
89
|
-
formatter,
|
|
90
|
-
encodeValuesOnly,
|
|
91
|
-
charset,
|
|
92
|
-
sideChannel
|
|
93
|
-
) {
|
|
94
|
-
var obj = object;
|
|
95
|
-
|
|
96
|
-
var tmpSc = sideChannel;
|
|
97
|
-
var step = 0;
|
|
98
|
-
var findFlag = false;
|
|
99
|
-
while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
|
|
100
|
-
// Where object last appeared in the ref tree
|
|
101
|
-
var pos = tmpSc.get(object);
|
|
102
|
-
step += 1;
|
|
103
|
-
if (typeof pos !== 'undefined') {
|
|
104
|
-
if (pos === step) {
|
|
105
|
-
throw new RangeError('Cyclic object value');
|
|
106
|
-
} else {
|
|
107
|
-
findFlag = true; // Break while
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (typeof tmpSc.get(sentinel) === 'undefined') {
|
|
111
|
-
step = 0;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (typeof filter === 'function') {
|
|
116
|
-
obj = filter(prefix, obj);
|
|
117
|
-
} else if (obj instanceof Date) {
|
|
118
|
-
obj = serializeDate(obj);
|
|
119
|
-
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
120
|
-
obj = utils.maybeMap(obj, function (value) {
|
|
121
|
-
if (value instanceof Date) {
|
|
122
|
-
return serializeDate(value);
|
|
123
|
-
}
|
|
124
|
-
return value;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (obj === null) {
|
|
129
|
-
if (strictNullHandling) {
|
|
130
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
obj = '';
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
137
|
-
if (encoder) {
|
|
138
|
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
139
|
-
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
140
|
-
}
|
|
141
|
-
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
var values = [];
|
|
145
|
-
|
|
146
|
-
if (typeof obj === 'undefined') {
|
|
147
|
-
return values;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
var objKeys;
|
|
151
|
-
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
152
|
-
// we need to join elements in
|
|
153
|
-
if (encodeValuesOnly && encoder) {
|
|
154
|
-
obj = utils.maybeMap(obj, encoder);
|
|
155
|
-
}
|
|
156
|
-
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void 0 }];
|
|
157
|
-
} else if (isArray(filter)) {
|
|
158
|
-
objKeys = filter;
|
|
159
|
-
} else {
|
|
160
|
-
var keys = Object.keys(obj);
|
|
161
|
-
objKeys = sort ? keys.sort(sort) : keys;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
|
|
165
|
-
|
|
166
|
-
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
167
|
-
|
|
168
|
-
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
169
|
-
return adjustedPrefix + '[]';
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
for (var j = 0; j < objKeys.length; ++j) {
|
|
173
|
-
var key = objKeys[j];
|
|
174
|
-
var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
|
|
175
|
-
? key.value
|
|
176
|
-
: obj[key];
|
|
177
|
-
|
|
178
|
-
if (skipNulls && value === null) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
|
|
183
|
-
var keyPrefix = isArray(obj)
|
|
184
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
185
|
-
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
186
|
-
|
|
187
|
-
sideChannel.set(object, step);
|
|
188
|
-
var valueSideChannel = getSideChannel();
|
|
189
|
-
valueSideChannel.set(sentinel, sideChannel);
|
|
190
|
-
pushToArray(values, stringify(
|
|
191
|
-
value,
|
|
192
|
-
keyPrefix,
|
|
193
|
-
generateArrayPrefix,
|
|
194
|
-
commaRoundTrip,
|
|
195
|
-
allowEmptyArrays,
|
|
196
|
-
strictNullHandling,
|
|
197
|
-
skipNulls,
|
|
198
|
-
encodeDotInKeys,
|
|
199
|
-
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
200
|
-
filter,
|
|
201
|
-
sort,
|
|
202
|
-
allowDots,
|
|
203
|
-
serializeDate,
|
|
204
|
-
format,
|
|
205
|
-
formatter,
|
|
206
|
-
encodeValuesOnly,
|
|
207
|
-
charset,
|
|
208
|
-
valueSideChannel
|
|
209
|
-
));
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return values;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
216
|
-
if (!opts) {
|
|
217
|
-
return defaults;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
221
|
-
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
225
|
-
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
229
|
-
throw new TypeError('Encoder has to be a function.');
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
var charset = opts.charset || defaults.charset;
|
|
233
|
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
234
|
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
var format = formats['default'];
|
|
238
|
-
if (typeof opts.format !== 'undefined') {
|
|
239
|
-
if (!has.call(formats.formatters, opts.format)) {
|
|
240
|
-
throw new TypeError('Unknown format option provided.');
|
|
241
|
-
}
|
|
242
|
-
format = opts.format;
|
|
243
|
-
}
|
|
244
|
-
var formatter = formats.formatters[format];
|
|
245
|
-
|
|
246
|
-
var filter = defaults.filter;
|
|
247
|
-
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
|
248
|
-
filter = opts.filter;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
var arrayFormat;
|
|
252
|
-
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
253
|
-
arrayFormat = opts.arrayFormat;
|
|
254
|
-
} else if ('indices' in opts) {
|
|
255
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
256
|
-
} else {
|
|
257
|
-
arrayFormat = defaults.arrayFormat;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
261
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
265
|
-
|
|
266
|
-
return {
|
|
267
|
-
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
268
|
-
allowDots: allowDots,
|
|
269
|
-
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
270
|
-
arrayFormat: arrayFormat,
|
|
271
|
-
charset: charset,
|
|
272
|
-
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
273
|
-
commaRoundTrip: !!opts.commaRoundTrip,
|
|
274
|
-
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
275
|
-
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
276
|
-
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
277
|
-
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
278
|
-
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
279
|
-
filter: filter,
|
|
280
|
-
format: format,
|
|
281
|
-
formatter: formatter,
|
|
282
|
-
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
|
283
|
-
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
|
284
|
-
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
|
285
|
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
stringify_1 = function (object, opts) {
|
|
290
|
-
var obj = object;
|
|
291
|
-
var options = normalizeStringifyOptions(opts);
|
|
292
|
-
|
|
293
|
-
var objKeys;
|
|
294
|
-
var filter;
|
|
295
|
-
|
|
296
|
-
if (typeof options.filter === 'function') {
|
|
297
|
-
filter = options.filter;
|
|
298
|
-
obj = filter('', obj);
|
|
299
|
-
} else if (isArray(options.filter)) {
|
|
300
|
-
filter = options.filter;
|
|
301
|
-
objKeys = filter;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
var keys = [];
|
|
305
|
-
|
|
306
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
307
|
-
return '';
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
311
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
312
|
-
|
|
313
|
-
if (!objKeys) {
|
|
314
|
-
objKeys = Object.keys(obj);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
if (options.sort) {
|
|
318
|
-
objKeys.sort(options.sort);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
var sideChannel = getSideChannel();
|
|
322
|
-
for (var i = 0; i < objKeys.length; ++i) {
|
|
323
|
-
var key = objKeys[i];
|
|
324
|
-
var value = obj[key];
|
|
325
|
-
|
|
326
|
-
if (options.skipNulls && value === null) {
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
pushToArray(keys, stringify(
|
|
330
|
-
value,
|
|
331
|
-
key,
|
|
332
|
-
generateArrayPrefix,
|
|
333
|
-
commaRoundTrip,
|
|
334
|
-
options.allowEmptyArrays,
|
|
335
|
-
options.strictNullHandling,
|
|
336
|
-
options.skipNulls,
|
|
337
|
-
options.encodeDotInKeys,
|
|
338
|
-
options.encode ? options.encoder : null,
|
|
339
|
-
options.filter,
|
|
340
|
-
options.sort,
|
|
341
|
-
options.allowDots,
|
|
342
|
-
options.serializeDate,
|
|
343
|
-
options.format,
|
|
344
|
-
options.formatter,
|
|
345
|
-
options.encodeValuesOnly,
|
|
346
|
-
options.charset,
|
|
347
|
-
sideChannel
|
|
348
|
-
));
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
var joined = keys.join(options.delimiter);
|
|
352
|
-
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
353
|
-
|
|
354
|
-
if (options.charsetSentinel) {
|
|
355
|
-
if (options.charset === 'iso-8859-1') {
|
|
356
|
-
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
357
|
-
prefix += 'utf8=%26%2310003%3B&';
|
|
358
|
-
} else {
|
|
359
|
-
// encodeURIComponent('✓')
|
|
360
|
-
prefix += 'utf8=%E2%9C%93&';
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
return joined.length > 0 ? prefix + joined : '';
|
|
365
|
-
};
|
|
366
|
-
return stringify_1;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
export { requireStringify as __require };
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import { __require as requireFormats } from './formats.js';
|
|
2
|
-
|
|
3
|
-
var utils;
|
|
4
|
-
var hasRequiredUtils;
|
|
5
|
-
|
|
6
|
-
function requireUtils () {
|
|
7
|
-
if (hasRequiredUtils) return utils;
|
|
8
|
-
hasRequiredUtils = 1;
|
|
9
|
-
|
|
10
|
-
var formats = /*@__PURE__*/ requireFormats();
|
|
11
|
-
|
|
12
|
-
var has = Object.prototype.hasOwnProperty;
|
|
13
|
-
var isArray = Array.isArray;
|
|
14
|
-
|
|
15
|
-
var hexTable = (function () {
|
|
16
|
-
var array = [];
|
|
17
|
-
for (var i = 0; i < 256; ++i) {
|
|
18
|
-
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return array;
|
|
22
|
-
}());
|
|
23
|
-
|
|
24
|
-
var compactQueue = function compactQueue(queue) {
|
|
25
|
-
while (queue.length > 1) {
|
|
26
|
-
var item = queue.pop();
|
|
27
|
-
var obj = item.obj[item.prop];
|
|
28
|
-
|
|
29
|
-
if (isArray(obj)) {
|
|
30
|
-
var compacted = [];
|
|
31
|
-
|
|
32
|
-
for (var j = 0; j < obj.length; ++j) {
|
|
33
|
-
if (typeof obj[j] !== 'undefined') {
|
|
34
|
-
compacted.push(obj[j]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
item.obj[item.prop] = compacted;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var arrayToObject = function arrayToObject(source, options) {
|
|
44
|
-
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
45
|
-
for (var i = 0; i < source.length; ++i) {
|
|
46
|
-
if (typeof source[i] !== 'undefined') {
|
|
47
|
-
obj[i] = source[i];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return obj;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var merge = function merge(target, source, options) {
|
|
55
|
-
/* eslint no-param-reassign: 0 */
|
|
56
|
-
if (!source) {
|
|
57
|
-
return target;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
61
|
-
if (isArray(target)) {
|
|
62
|
-
target.push(source);
|
|
63
|
-
} else if (target && typeof target === 'object') {
|
|
64
|
-
if (
|
|
65
|
-
(options && (options.plainObjects || options.allowPrototypes))
|
|
66
|
-
|| !has.call(Object.prototype, source)
|
|
67
|
-
) {
|
|
68
|
-
target[source] = true;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
return [target, source];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return target;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!target || typeof target !== 'object') {
|
|
78
|
-
return [target].concat(source);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var mergeTarget = target;
|
|
82
|
-
if (isArray(target) && !isArray(source)) {
|
|
83
|
-
mergeTarget = arrayToObject(target, options);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (isArray(target) && isArray(source)) {
|
|
87
|
-
source.forEach(function (item, i) {
|
|
88
|
-
if (has.call(target, i)) {
|
|
89
|
-
var targetItem = target[i];
|
|
90
|
-
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
91
|
-
target[i] = merge(targetItem, item, options);
|
|
92
|
-
} else {
|
|
93
|
-
target.push(item);
|
|
94
|
-
}
|
|
95
|
-
} else {
|
|
96
|
-
target[i] = item;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
return target;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
103
|
-
var value = source[key];
|
|
104
|
-
|
|
105
|
-
if (has.call(acc, key)) {
|
|
106
|
-
acc[key] = merge(acc[key], value, options);
|
|
107
|
-
} else {
|
|
108
|
-
acc[key] = value;
|
|
109
|
-
}
|
|
110
|
-
return acc;
|
|
111
|
-
}, mergeTarget);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var assign = function assignSingleSource(target, source) {
|
|
115
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
116
|
-
acc[key] = source[key];
|
|
117
|
-
return acc;
|
|
118
|
-
}, target);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
var decode = function (str, defaultDecoder, charset) {
|
|
122
|
-
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
123
|
-
if (charset === 'iso-8859-1') {
|
|
124
|
-
// unescape never throws, no try...catch needed:
|
|
125
|
-
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
126
|
-
}
|
|
127
|
-
// utf-8
|
|
128
|
-
try {
|
|
129
|
-
return decodeURIComponent(strWithoutPlus);
|
|
130
|
-
} catch (e) {
|
|
131
|
-
return strWithoutPlus;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
var limit = 1024;
|
|
136
|
-
|
|
137
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
138
|
-
|
|
139
|
-
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
140
|
-
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
141
|
-
// It has been adapted here for stricter adherence to RFC 3986
|
|
142
|
-
if (str.length === 0) {
|
|
143
|
-
return str;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
var string = str;
|
|
147
|
-
if (typeof str === 'symbol') {
|
|
148
|
-
string = Symbol.prototype.toString.call(str);
|
|
149
|
-
} else if (typeof str !== 'string') {
|
|
150
|
-
string = String(str);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (charset === 'iso-8859-1') {
|
|
154
|
-
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
155
|
-
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
var out = '';
|
|
160
|
-
for (var j = 0; j < string.length; j += limit) {
|
|
161
|
-
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
162
|
-
var arr = [];
|
|
163
|
-
|
|
164
|
-
for (var i = 0; i < segment.length; ++i) {
|
|
165
|
-
var c = segment.charCodeAt(i);
|
|
166
|
-
if (
|
|
167
|
-
c === 0x2D // -
|
|
168
|
-
|| c === 0x2E // .
|
|
169
|
-
|| c === 0x5F // _
|
|
170
|
-
|| c === 0x7E // ~
|
|
171
|
-
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
172
|
-
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
173
|
-
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
174
|
-
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
175
|
-
) {
|
|
176
|
-
arr[arr.length] = segment.charAt(i);
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (c < 0x80) {
|
|
181
|
-
arr[arr.length] = hexTable[c];
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (c < 0x800) {
|
|
186
|
-
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
187
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (c < 0xD800 || c >= 0xE000) {
|
|
192
|
-
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
193
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
194
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
i += 1;
|
|
199
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
200
|
-
|
|
201
|
-
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
202
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
203
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
204
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
out += arr.join('');
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return out;
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
var compact = function compact(value) {
|
|
214
|
-
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
215
|
-
var refs = [];
|
|
216
|
-
|
|
217
|
-
for (var i = 0; i < queue.length; ++i) {
|
|
218
|
-
var item = queue[i];
|
|
219
|
-
var obj = item.obj[item.prop];
|
|
220
|
-
|
|
221
|
-
var keys = Object.keys(obj);
|
|
222
|
-
for (var j = 0; j < keys.length; ++j) {
|
|
223
|
-
var key = keys[j];
|
|
224
|
-
var val = obj[key];
|
|
225
|
-
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
226
|
-
queue.push({ obj: obj, prop: key });
|
|
227
|
-
refs.push(val);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
compactQueue(queue);
|
|
233
|
-
|
|
234
|
-
return value;
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
var isRegExp = function isRegExp(obj) {
|
|
238
|
-
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
var isBuffer = function isBuffer(obj) {
|
|
242
|
-
if (!obj || typeof obj !== 'object') {
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
var combine = function combine(a, b) {
|
|
250
|
-
return [].concat(a, b);
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
var maybeMap = function maybeMap(val, fn) {
|
|
254
|
-
if (isArray(val)) {
|
|
255
|
-
var mapped = [];
|
|
256
|
-
for (var i = 0; i < val.length; i += 1) {
|
|
257
|
-
mapped.push(fn(val[i]));
|
|
258
|
-
}
|
|
259
|
-
return mapped;
|
|
260
|
-
}
|
|
261
|
-
return fn(val);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
utils = {
|
|
265
|
-
arrayToObject: arrayToObject,
|
|
266
|
-
assign: assign,
|
|
267
|
-
combine: combine,
|
|
268
|
-
compact: compact,
|
|
269
|
-
decode: decode,
|
|
270
|
-
encode: encode,
|
|
271
|
-
isBuffer: isBuffer,
|
|
272
|
-
isRegExp: isRegExp,
|
|
273
|
-
maybeMap: maybeMap,
|
|
274
|
-
merge: merge
|
|
275
|
-
};
|
|
276
|
-
return utils;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export { requireUtils as __require };
|