openportal 0.1.1 → 0.1.3
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/README.md +113 -0
- package/package.json +1 -1
- package/web/.next/static/{A7pW-dtFIbPCSkvE8uenX → Im7EdK1Q3oOmTznohTOr5}/_buildManifest.js +4 -9
- package/web/.next/static/chunks/{2e7bfb90c343ca96.js → 35cc9dbdc670c73c.js} +4 -4
- package/web/.next/static/chunks/4147ffc67a7b837c.css +1 -0
- package/web/.next/static/chunks/{21ab2574b84ad2d1.js → 52b90bc1740162c2.js} +2 -2
- package/web/.next/static/chunks/{9b265e2198b5525f.js → 8644d68bf325ff24.js} +3 -3
- package/web/.next/static/chunks/{03e1846335a31354.js → 9865709466b09f79.js} +3 -3
- package/web/.next/static/chunks/{c20ae04df8cc28be.js → 9ba9a5774c9421bd.js} +3 -3
- package/web/.next/static/chunks/{967a1e0002fe9ae6.js → b5caad256518cb33.js} +3 -3
- package/web/.next/static/chunks/{turbopack-27558c851386934e.js → turbopack-26af71e419c11487.js} +1 -1
- package/web/.next/static/chunks/{turbopack-f4c0881f9723f5a5.js → turbopack-4ad0df7330c00c8d.js} +1 -1
- package/web/.next/static/chunks/{turbopack-26688626142ac58f.js → turbopack-8e653f3ad3a8ed18.js} +1 -1
- package/web/.next/static/chunks/{turbopack-c40ec6674624f1d7.js → turbopack-d5098189d63fd7b8.js} +1 -1
- package/web/apps/web/.next/BUILD_ID +1 -1
- package/web/apps/web/.next/build-manifest.json +14 -24
- package/web/apps/web/.next/routes-manifest.json +0 -12
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__f366ca98._.js +358 -0
- package/web/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__dfeaf8cf._.js → [root-of-the-server]__1a54ba1e._.js} +3 -3
- package/web/apps/web/.next/server/middleware-build-manifest.js +12 -22
- package/web/apps/web/.next/server/next-font-manifest.js +1 -1
- package/web/apps/web/.next/server/next-font-manifest.json +0 -4
- package/web/apps/web/.next/server/pages/404.html +1 -1
- package/web/apps/web/.next/server/pages/500.html +1 -1
- package/web/apps/web/.next/server/pages/_app/build-manifest.json +3 -3
- package/web/apps/web/.next/server/pages/_app/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/api/[[...slugs]].js +1 -2
- package/web/apps/web/.next/server/pages/api/[[...slugs]].js.nft.json +1 -1
- package/web/apps/web/.next/server/pages/index/build-manifest.json +3 -3
- package/web/apps/web/.next/server/pages/index/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/index.html +1 -1
- package/web/apps/web/.next/server/pages/index.js.nft.json +1 -1
- package/web/apps/web/.next/server/pages/session/[id]/build-manifest.json +4 -4
- package/web/apps/web/.next/server/pages/session/[id]/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/session/[id].html +1 -1
- package/web/apps/web/.next/server/pages/session/[id].js.nft.json +1 -1
- package/web/apps/web/.next/server/pages/settings/build-manifest.json +3 -3
- package/web/apps/web/.next/server/pages/settings/client-build-manifest.json +1 -1
- package/web/apps/web/.next/server/pages/settings.html +1 -1
- package/web/apps/web/.next/server/pages/settings.js.nft.json +1 -1
- package/web/apps/web/.next/server/pages-manifest.json +0 -2
- package/web/apps/web/package.json +1 -9
- package/web/.next/static/chunks/04d4692d75696297.css +0 -1
- package/web/.next/static/chunks/553710f60e2f2b11.js +0 -1
- package/web/.next/static/chunks/58acbbb4090e3362.js +0 -3
- package/web/.next/static/chunks/6ce1e2f08f961db5.js +0 -2
- package/web/.next/static/chunks/d316d63225992c76.js +0 -10
- package/web/.next/static/chunks/e0c97552ba7a9e3d.js +0 -1
- package/web/.next/static/chunks/fc9c4f2dabfb4e0e.css +0 -1
- package/web/.next/static/chunks/turbopack-1837909a677d116b.js +0 -3
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__0f75905d._.js +0 -3
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__89e85365._.js +0 -358
- package/web/apps/web/.next/server/chunks/[root-of-the-server]__ae1361d0._.js +0 -3
- package/web/apps/web/.next/server/pages/api/terminal/ws/pages-manifest.json +0 -3
- package/web/apps/web/.next/server/pages/api/terminal/ws.js +0 -5
- package/web/apps/web/.next/server/pages/api/terminal/ws.js.map +0 -5
- package/web/apps/web/.next/server/pages/api/terminal/ws.js.nft.json +0 -1
- package/web/apps/web/.next/server/pages/terminal/build-manifest.json +0 -20
- package/web/apps/web/.next/server/pages/terminal/client-build-manifest.json +0 -5
- package/web/apps/web/.next/server/pages/terminal/next-font-manifest.json +0 -11
- package/web/apps/web/.next/server/pages/terminal/pages-manifest.json +0 -3
- package/web/apps/web/.next/server/pages/terminal/react-loadable-manifest.json +0 -1
- package/web/apps/web/.next/server/pages/terminal.html +0 -1
- package/web/apps/web/.next/server/pages/terminal.js.map +0 -5
- package/web/apps/web/.next/server/pages/terminal.js.nft.json +0 -1
- package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/cjs/index.js +0 -176
- package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/cjs/package.json +0 -4
- package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/package.json +0 -28
- package/web/node_modules/.bun/accepts@1.3.8/node_modules/accepts/index.js +0 -238
- package/web/node_modules/.bun/accepts@1.3.8/node_modules/accepts/package.json +0 -47
- package/web/node_modules/.bun/base64id@2.0.0/node_modules/base64id/lib/base64id.js +0 -103
- package/web/node_modules/.bun/base64id@2.0.0/node_modules/base64id/package.json +0 -13
- package/web/node_modules/.bun/cookie@0.7.2/node_modules/cookie/index.js +0 -335
- package/web/node_modules/.bun/cookie@0.7.2/node_modules/cookie/package.json +0 -44
- package/web/node_modules/.bun/cookie@1.1.1/node_modules/cookie/package.json +0 -47
- package/web/node_modules/.bun/cors@2.8.5/node_modules/cors/lib/index.js +0 -238
- package/web/node_modules/.bun/cors@2.8.5/node_modules/cors/package.json +0 -41
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/package.json +0 -60
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/browser.js +0 -271
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/common.js +0 -274
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/index.js +0 -10
- package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/node.js +0 -263
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/commons.js +0 -19
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -59
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -38
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/index.js +0 -164
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/package.json +0 -8
- package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/package.json +0 -46
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/engine.io.js +0 -54
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/parser-v3/index.js +0 -424
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/parser-v3/utf8.js +0 -187
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/server.js +0 -786
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/socket.js +0 -460
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transport.js +0 -117
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/index.js +0 -23
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling-jsonp.js +0 -41
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling.js +0 -332
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/websocket.js +0 -94
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/webtransport.js +0 -63
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/index.js +0 -8
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/polling.js +0 -364
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/websocket.js +0 -73
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/userver.js +0 -279
- package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/package.json +0 -70
- package/web/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js +0 -8
- package/web/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/package.json +0 -46
- package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/db.json +0 -8519
- package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/index.js +0 -12
- package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/package.json +0 -60
- package/web/node_modules/.bun/mime-types@2.1.35/node_modules/mime-types/index.js +0 -188
- package/web/node_modules/.bun/mime-types@2.1.35/node_modules/mime-types/package.json +0 -44
- package/web/node_modules/.bun/ms@2.1.3/node_modules/ms/index.js +0 -162
- package/web/node_modules/.bun/ms@2.1.3/node_modules/ms/package.json +0 -38
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/index.js +0 -82
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/charset.js +0 -169
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/encoding.js +0 -184
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/language.js +0 -179
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/mediaType.js +0 -294
- package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/package.json +0 -42
- package/web/node_modules/.bun/object-assign@4.1.1/node_modules/object-assign/index.js +0 -90
- package/web/node_modules/.bun/object-assign@4.1.1/node_modules/object-assign/package.json +0 -42
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/cluster-adapter.js +0 -674
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/contrib/yeast.js +0 -55
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/in-memory-adapter.js +0 -394
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/index.js +0 -10
- package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/package.json +0 -39
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/binary.js +0 -88
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/index.js +0 -321
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -55
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/package.json +0 -3
- package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/package.json +0 -58
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.esm.min.js +0 -7
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.js +0 -4908
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.min.js +0 -7
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.msgpack.min.js +0 -7
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/broadcast-operator.js +0 -436
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/client.js +0 -268
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/index.js +0 -804
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/namespace.js +0 -581
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/parent-namespace.js +0 -88
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/socket-types.js +0 -11
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/socket.js +0 -977
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/typed-events.js +0 -81
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/uws.js +0 -136
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/package.json +0 -85
- package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/wrapper.mjs +0 -3
- package/web/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js +0 -135
- package/web/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/package.json +0 -53
- package/web/node_modules/.bun/vary@1.1.2/node_modules/vary/index.js +0 -149
- package/web/node_modules/.bun/vary@1.1.2/node_modules/vary/package.json +0 -43
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/index.js +0 -13
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/buffer-util.js +0 -131
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/constants.js +0 -12
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/event-target.js +0 -292
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/extension.js +0 -203
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/limiter.js +0 -55
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/permessage-deflate.js +0 -514
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/receiver.js +0 -704
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/sender.js +0 -497
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/stream.js +0 -159
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/subprotocol.js +0 -62
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/validation.js +0 -130
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/websocket-server.js +0 -540
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/websocket.js +0 -1338
- package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/package.json +0 -69
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/buffer-util.js +0 -131
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/constants.js +0 -18
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/event-target.js +0 -292
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/extension.js +0 -203
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/limiter.js +0 -55
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/receiver.js +0 -706
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/sender.js +0 -602
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/stream.js +0 -161
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/subprotocol.js +0 -62
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/validation.js +0 -152
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/websocket-server.js +0 -550
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/websocket.js +0 -1388
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/package.json +0 -69
- package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/wrapper.mjs +0 -8
- /package/web/.next/static/{A7pW-dtFIbPCSkvE8uenX → Im7EdK1Q3oOmTznohTOr5}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{A7pW-dtFIbPCSkvE8uenX → Im7EdK1Q3oOmTznohTOr5}/_ssgManifest.js +0 -0
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StrictEventEmitter = void 0;
|
|
4
|
-
const events_1 = require("events");
|
|
5
|
-
/**
|
|
6
|
-
* Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type
|
|
7
|
-
* parameters for mappings of event names to event data types, and strictly
|
|
8
|
-
* types method calls to the `EventEmitter` according to these event maps.
|
|
9
|
-
*
|
|
10
|
-
* @typeParam ListenEvents - `EventsMap` of user-defined events that can be
|
|
11
|
-
* listened to with `on` or `once`
|
|
12
|
-
* @typeParam EmitEvents - `EventsMap` of user-defined events that can be
|
|
13
|
-
* emitted with `emit`
|
|
14
|
-
* @typeParam ReservedEvents - `EventsMap` of reserved events, that can be
|
|
15
|
-
* emitted by socket.io with `emitReserved`, and can be listened to with
|
|
16
|
-
* `listen`.
|
|
17
|
-
*/
|
|
18
|
-
class StrictEventEmitter extends events_1.EventEmitter {
|
|
19
|
-
/**
|
|
20
|
-
* Adds the `listener` function as an event listener for `ev`.
|
|
21
|
-
*
|
|
22
|
-
* @param ev Name of the event
|
|
23
|
-
* @param listener Callback function
|
|
24
|
-
*/
|
|
25
|
-
on(ev, listener) {
|
|
26
|
-
return super.on(ev, listener);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Adds a one-time `listener` function as an event listener for `ev`.
|
|
30
|
-
*
|
|
31
|
-
* @param ev Name of the event
|
|
32
|
-
* @param listener Callback function
|
|
33
|
-
*/
|
|
34
|
-
once(ev, listener) {
|
|
35
|
-
return super.once(ev, listener);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Emits an event.
|
|
39
|
-
*
|
|
40
|
-
* @param ev Name of the event
|
|
41
|
-
* @param args Values to send to listeners of this event
|
|
42
|
-
*/
|
|
43
|
-
emit(ev, ...args) {
|
|
44
|
-
return super.emit(ev, ...args);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Emits a reserved event.
|
|
48
|
-
*
|
|
49
|
-
* This method is `protected`, so that only a class extending
|
|
50
|
-
* `StrictEventEmitter` can emit its own reserved events.
|
|
51
|
-
*
|
|
52
|
-
* @param ev Reserved event name
|
|
53
|
-
* @param args Arguments to emit along with the event
|
|
54
|
-
*/
|
|
55
|
-
emitReserved(ev, ...args) {
|
|
56
|
-
return super.emit(ev, ...args);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Emits an event.
|
|
60
|
-
*
|
|
61
|
-
* This method is `protected`, so that only a class extending
|
|
62
|
-
* `StrictEventEmitter` can get around the strict typing. This is useful for
|
|
63
|
-
* calling `emit.apply`, which can be called as `emitUntyped.apply`.
|
|
64
|
-
*
|
|
65
|
-
* @param ev Event name
|
|
66
|
-
* @param args Arguments to emit along with the event
|
|
67
|
-
*/
|
|
68
|
-
emitUntyped(ev, ...args) {
|
|
69
|
-
return super.emit(ev, ...args);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Returns the listeners listening to an event.
|
|
73
|
-
*
|
|
74
|
-
* @param event Event name
|
|
75
|
-
* @returns Array of listeners subscribed to `event`
|
|
76
|
-
*/
|
|
77
|
-
listeners(event) {
|
|
78
|
-
return super.listeners(event);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.StrictEventEmitter = StrictEventEmitter;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.patchAdapter = patchAdapter;
|
|
7
|
-
exports.restoreAdapter = restoreAdapter;
|
|
8
|
-
exports.serveFile = serveFile;
|
|
9
|
-
const socket_io_adapter_1 = require("socket.io-adapter");
|
|
10
|
-
const fs_1 = require("fs");
|
|
11
|
-
const debug_1 = __importDefault(require("debug"));
|
|
12
|
-
const debug = (0, debug_1.default)("socket.io:adapter-uws");
|
|
13
|
-
const SEPARATOR = "\x1f"; // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text
|
|
14
|
-
const { addAll, del, broadcast } = socket_io_adapter_1.Adapter.prototype;
|
|
15
|
-
function patchAdapter(app /* : TemplatedApp */) {
|
|
16
|
-
socket_io_adapter_1.Adapter.prototype.addAll = function (id, rooms) {
|
|
17
|
-
const isNew = !this.sids.has(id);
|
|
18
|
-
addAll.call(this, id, rooms);
|
|
19
|
-
const socket = this.nsp.sockets.get(id) || this.nsp._preConnectSockets.get(id);
|
|
20
|
-
if (!socket) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (socket.conn.transport.name === "websocket") {
|
|
24
|
-
subscribe(this.nsp.name, socket, isNew, rooms);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (isNew) {
|
|
28
|
-
socket.conn.on("upgrade", () => {
|
|
29
|
-
const rooms = this.sids.get(id);
|
|
30
|
-
if (rooms) {
|
|
31
|
-
subscribe(this.nsp.name, socket, isNew, rooms);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
socket_io_adapter_1.Adapter.prototype.del = function (id, room) {
|
|
37
|
-
del.call(this, id, room);
|
|
38
|
-
const socket = this.nsp.sockets.get(id) || this.nsp._preConnectSockets.get(id);
|
|
39
|
-
if (socket && socket.conn.transport.name === "websocket") {
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
const sessionId = socket.conn.id;
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
const websocket = socket.conn.transport.socket;
|
|
44
|
-
const topic = `${this.nsp.name}${SEPARATOR}${room}`;
|
|
45
|
-
debug("unsubscribe connection %s from topic %s", sessionId, topic);
|
|
46
|
-
websocket.unsubscribe(topic);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
socket_io_adapter_1.Adapter.prototype.broadcast = function (packet, opts) {
|
|
50
|
-
const useFastPublish = opts.rooms.size <= 1 && opts.except.size === 0;
|
|
51
|
-
if (!useFastPublish) {
|
|
52
|
-
broadcast.call(this, packet, opts);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const flags = opts.flags || {};
|
|
56
|
-
const basePacketOpts = {
|
|
57
|
-
preEncoded: true,
|
|
58
|
-
volatile: flags.volatile,
|
|
59
|
-
compress: flags.compress,
|
|
60
|
-
};
|
|
61
|
-
packet.nsp = this.nsp.name;
|
|
62
|
-
const encodedPackets = this.encoder.encode(packet);
|
|
63
|
-
const topic = opts.rooms.size === 0
|
|
64
|
-
? this.nsp.name
|
|
65
|
-
: `${this.nsp.name}${SEPARATOR}${opts.rooms.keys().next().value}`;
|
|
66
|
-
debug("fast publish to %s", topic);
|
|
67
|
-
// fast publish for clients connected with WebSocket
|
|
68
|
-
encodedPackets.forEach((encodedPacket) => {
|
|
69
|
-
const isBinary = typeof encodedPacket !== "string";
|
|
70
|
-
// "4" being the message type in the Engine.IO protocol, see https://github.com/socketio/engine.io-protocol
|
|
71
|
-
app.publish(topic, isBinary ? encodedPacket : "4" + encodedPacket, isBinary);
|
|
72
|
-
});
|
|
73
|
-
this.apply(opts, (socket) => {
|
|
74
|
-
if (socket.conn.transport.name !== "websocket") {
|
|
75
|
-
// classic publish for clients connected with HTTP long-polling
|
|
76
|
-
socket.client.writeToEngine(encodedPackets, basePacketOpts);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function subscribe(namespaceName, socket, isNew, rooms) {
|
|
82
|
-
// @ts-ignore
|
|
83
|
-
const sessionId = socket.conn.id;
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
const websocket = socket.conn.transport.socket;
|
|
86
|
-
if (isNew) {
|
|
87
|
-
debug("subscribe connection %s to topic %s", sessionId, namespaceName);
|
|
88
|
-
websocket.subscribe(namespaceName);
|
|
89
|
-
}
|
|
90
|
-
rooms.forEach((room) => {
|
|
91
|
-
const topic = `${namespaceName}${SEPARATOR}${room}`; // '#' can be used as wildcard
|
|
92
|
-
debug("subscribe connection %s to topic %s", sessionId, topic);
|
|
93
|
-
websocket.subscribe(topic);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function restoreAdapter() {
|
|
97
|
-
socket_io_adapter_1.Adapter.prototype.addAll = addAll;
|
|
98
|
-
socket_io_adapter_1.Adapter.prototype.del = del;
|
|
99
|
-
socket_io_adapter_1.Adapter.prototype.broadcast = broadcast;
|
|
100
|
-
}
|
|
101
|
-
const toArrayBuffer = (buffer) => {
|
|
102
|
-
const { buffer: arrayBuffer, byteOffset, byteLength } = buffer;
|
|
103
|
-
return arrayBuffer.slice(byteOffset, byteOffset + byteLength);
|
|
104
|
-
};
|
|
105
|
-
// imported from https://github.com/kolodziejczak-sz/uwebsocket-serve
|
|
106
|
-
function serveFile(res /* : HttpResponse */, filepath) {
|
|
107
|
-
const { size } = (0, fs_1.statSync)(filepath);
|
|
108
|
-
const readStream = (0, fs_1.createReadStream)(filepath);
|
|
109
|
-
const destroyReadStream = () => !readStream.destroyed && readStream.destroy();
|
|
110
|
-
const onError = (error) => {
|
|
111
|
-
destroyReadStream();
|
|
112
|
-
throw error;
|
|
113
|
-
};
|
|
114
|
-
const onDataChunk = (chunk) => {
|
|
115
|
-
const arrayBufferChunk = toArrayBuffer(chunk);
|
|
116
|
-
res.cork(() => {
|
|
117
|
-
const lastOffset = res.getWriteOffset();
|
|
118
|
-
const [ok, done] = res.tryEnd(arrayBufferChunk, size);
|
|
119
|
-
if (!done && !ok) {
|
|
120
|
-
readStream.pause();
|
|
121
|
-
res.onWritable((offset) => {
|
|
122
|
-
const [ok, done] = res.tryEnd(arrayBufferChunk.slice(offset - lastOffset), size);
|
|
123
|
-
if (!done && ok) {
|
|
124
|
-
readStream.resume();
|
|
125
|
-
}
|
|
126
|
-
return ok;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
res.onAborted(destroyReadStream);
|
|
132
|
-
readStream
|
|
133
|
-
.on("data", onDataChunk)
|
|
134
|
-
.on("error", onError)
|
|
135
|
-
.on("end", destroyReadStream);
|
|
136
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "socket.io",
|
|
3
|
-
"version": "4.8.1",
|
|
4
|
-
"description": "node.js realtime framework server",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"realtime",
|
|
7
|
-
"framework",
|
|
8
|
-
"websocket",
|
|
9
|
-
"tcp",
|
|
10
|
-
"events",
|
|
11
|
-
"socket",
|
|
12
|
-
"io"
|
|
13
|
-
],
|
|
14
|
-
"files": [
|
|
15
|
-
"dist/",
|
|
16
|
-
"client-dist/",
|
|
17
|
-
"wrapper.mjs",
|
|
18
|
-
"!**/*.tsbuildinfo"
|
|
19
|
-
],
|
|
20
|
-
"directories": {
|
|
21
|
-
"doc": "docs/",
|
|
22
|
-
"example": "example/",
|
|
23
|
-
"lib": "lib/",
|
|
24
|
-
"test": "test/"
|
|
25
|
-
},
|
|
26
|
-
"type": "commonjs",
|
|
27
|
-
"main": "./dist/index.js",
|
|
28
|
-
"exports": {
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"import": "./wrapper.mjs",
|
|
31
|
-
"require": "./dist/index.js"
|
|
32
|
-
},
|
|
33
|
-
"types": "./dist/index.d.ts",
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"homepage": "https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",
|
|
36
|
-
"repository": {
|
|
37
|
-
"type": "git",
|
|
38
|
-
"url": "git+https://github.com/socketio/socket.io.git"
|
|
39
|
-
},
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/socketio/socket.io/issues"
|
|
42
|
-
},
|
|
43
|
-
"scripts": {
|
|
44
|
-
"compile": "rimraf ./dist && tsc",
|
|
45
|
-
"test": "npm run format:check && npm run compile && npm run test:types && npm run test:unit",
|
|
46
|
-
"test:types": "tsd",
|
|
47
|
-
"test:unit": "nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts",
|
|
48
|
-
"format:check": "prettier --check \"lib/**/*.ts\" \"test/**/*.ts\"",
|
|
49
|
-
"format:fix": "prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",
|
|
50
|
-
"prepack": "npm run compile"
|
|
51
|
-
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"accepts": "~1.3.4",
|
|
54
|
-
"base64id": "~2.0.0",
|
|
55
|
-
"cors": "~2.8.5",
|
|
56
|
-
"debug": "~4.3.2",
|
|
57
|
-
"engine.io": "~6.6.0",
|
|
58
|
-
"socket.io-adapter": "~2.5.2",
|
|
59
|
-
"socket.io-parser": "~4.2.4"
|
|
60
|
-
},
|
|
61
|
-
"contributors": [
|
|
62
|
-
{
|
|
63
|
-
"name": "Guillermo Rauch",
|
|
64
|
-
"email": "rauchg@gmail.com"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "Arnout Kazemier",
|
|
68
|
-
"email": "info@3rd-eden.com"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "Vladimir Dronnikov",
|
|
72
|
-
"email": "dronnikov@gmail.com"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "Einar Otto Stangvik",
|
|
76
|
-
"email": "einaros@gmail.com"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"engines": {
|
|
80
|
-
"node": ">=10.2.0"
|
|
81
|
-
},
|
|
82
|
-
"tsd": {
|
|
83
|
-
"directory": "test"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const os = require('os');
|
|
3
|
-
const tty = require('tty');
|
|
4
|
-
const hasFlag = require('has-flag');
|
|
5
|
-
|
|
6
|
-
const {env} = process;
|
|
7
|
-
|
|
8
|
-
let forceColor;
|
|
9
|
-
if (hasFlag('no-color') ||
|
|
10
|
-
hasFlag('no-colors') ||
|
|
11
|
-
hasFlag('color=false') ||
|
|
12
|
-
hasFlag('color=never')) {
|
|
13
|
-
forceColor = 0;
|
|
14
|
-
} else if (hasFlag('color') ||
|
|
15
|
-
hasFlag('colors') ||
|
|
16
|
-
hasFlag('color=true') ||
|
|
17
|
-
hasFlag('color=always')) {
|
|
18
|
-
forceColor = 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if ('FORCE_COLOR' in env) {
|
|
22
|
-
if (env.FORCE_COLOR === 'true') {
|
|
23
|
-
forceColor = 1;
|
|
24
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
25
|
-
forceColor = 0;
|
|
26
|
-
} else {
|
|
27
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function translateLevel(level) {
|
|
32
|
-
if (level === 0) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
level,
|
|
38
|
-
hasBasic: true,
|
|
39
|
-
has256: level >= 2,
|
|
40
|
-
has16m: level >= 3
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
45
|
-
if (forceColor === 0) {
|
|
46
|
-
return 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (hasFlag('color=16m') ||
|
|
50
|
-
hasFlag('color=full') ||
|
|
51
|
-
hasFlag('color=truecolor')) {
|
|
52
|
-
return 3;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (hasFlag('color=256')) {
|
|
56
|
-
return 2;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
60
|
-
return 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const min = forceColor || 0;
|
|
64
|
-
|
|
65
|
-
if (env.TERM === 'dumb') {
|
|
66
|
-
return min;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (process.platform === 'win32') {
|
|
70
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
71
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
72
|
-
const osRelease = os.release().split('.');
|
|
73
|
-
if (
|
|
74
|
-
Number(osRelease[0]) >= 10 &&
|
|
75
|
-
Number(osRelease[2]) >= 10586
|
|
76
|
-
) {
|
|
77
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return 1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if ('CI' in env) {
|
|
84
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
85
|
-
return 1;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return min;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
92
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (env.COLORTERM === 'truecolor') {
|
|
96
|
-
return 3;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if ('TERM_PROGRAM' in env) {
|
|
100
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
101
|
-
|
|
102
|
-
switch (env.TERM_PROGRAM) {
|
|
103
|
-
case 'iTerm.app':
|
|
104
|
-
return version >= 3 ? 3 : 2;
|
|
105
|
-
case 'Apple_Terminal':
|
|
106
|
-
return 2;
|
|
107
|
-
// No default
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
112
|
-
return 2;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
116
|
-
return 1;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if ('COLORTERM' in env) {
|
|
120
|
-
return 1;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return min;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function getSupportLevel(stream) {
|
|
127
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
128
|
-
return translateLevel(level);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
module.exports = {
|
|
132
|
-
supportsColor: getSupportLevel,
|
|
133
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
134
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
135
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "supports-color",
|
|
3
|
-
"version": "7.2.0",
|
|
4
|
-
"description": "Detect whether a terminal supports color",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "chalk/supports-color",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "Sindre Sorhus",
|
|
9
|
-
"email": "sindresorhus@gmail.com",
|
|
10
|
-
"url": "sindresorhus.com"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">=8"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "xo && ava"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"index.js",
|
|
20
|
-
"browser.js"
|
|
21
|
-
],
|
|
22
|
-
"keywords": [
|
|
23
|
-
"color",
|
|
24
|
-
"colour",
|
|
25
|
-
"colors",
|
|
26
|
-
"terminal",
|
|
27
|
-
"console",
|
|
28
|
-
"cli",
|
|
29
|
-
"ansi",
|
|
30
|
-
"styles",
|
|
31
|
-
"tty",
|
|
32
|
-
"rgb",
|
|
33
|
-
"256",
|
|
34
|
-
"shell",
|
|
35
|
-
"xterm",
|
|
36
|
-
"command-line",
|
|
37
|
-
"support",
|
|
38
|
-
"supports",
|
|
39
|
-
"capability",
|
|
40
|
-
"detect",
|
|
41
|
-
"truecolor",
|
|
42
|
-
"16m"
|
|
43
|
-
],
|
|
44
|
-
"dependencies": {
|
|
45
|
-
"has-flag": "^4.0.0"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"ava": "^1.4.1",
|
|
49
|
-
"import-fresh": "^3.0.0",
|
|
50
|
-
"xo": "^0.24.0"
|
|
51
|
-
},
|
|
52
|
-
"browser": "browser.js"
|
|
53
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* vary
|
|
3
|
-
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
4
|
-
* MIT Licensed
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use strict'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Module exports.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
module.exports = vary
|
|
14
|
-
module.exports.append = append
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* RegExp to match field-name in RFC 7230 sec 3.2
|
|
18
|
-
*
|
|
19
|
-
* field-name = token
|
|
20
|
-
* token = 1*tchar
|
|
21
|
-
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
|
|
22
|
-
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
|
|
23
|
-
* / DIGIT / ALPHA
|
|
24
|
-
* ; any VCHAR, except delimiters
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Append a field to a vary header.
|
|
31
|
-
*
|
|
32
|
-
* @param {String} header
|
|
33
|
-
* @param {String|Array} field
|
|
34
|
-
* @return {String}
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
function append (header, field) {
|
|
39
|
-
if (typeof header !== 'string') {
|
|
40
|
-
throw new TypeError('header argument is required')
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!field) {
|
|
44
|
-
throw new TypeError('field argument is required')
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// get fields array
|
|
48
|
-
var fields = !Array.isArray(field)
|
|
49
|
-
? parse(String(field))
|
|
50
|
-
: field
|
|
51
|
-
|
|
52
|
-
// assert on invalid field names
|
|
53
|
-
for (var j = 0; j < fields.length; j++) {
|
|
54
|
-
if (!FIELD_NAME_REGEXP.test(fields[j])) {
|
|
55
|
-
throw new TypeError('field argument contains an invalid header name')
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// existing, unspecified vary
|
|
60
|
-
if (header === '*') {
|
|
61
|
-
return header
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// enumerate current values
|
|
65
|
-
var val = header
|
|
66
|
-
var vals = parse(header.toLowerCase())
|
|
67
|
-
|
|
68
|
-
// unspecified vary
|
|
69
|
-
if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {
|
|
70
|
-
return '*'
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
for (var i = 0; i < fields.length; i++) {
|
|
74
|
-
var fld = fields[i].toLowerCase()
|
|
75
|
-
|
|
76
|
-
// append value (case-preserving)
|
|
77
|
-
if (vals.indexOf(fld) === -1) {
|
|
78
|
-
vals.push(fld)
|
|
79
|
-
val = val
|
|
80
|
-
? val + ', ' + fields[i]
|
|
81
|
-
: fields[i]
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return val
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Parse a vary header into an array.
|
|
90
|
-
*
|
|
91
|
-
* @param {String} header
|
|
92
|
-
* @return {Array}
|
|
93
|
-
* @private
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
function parse (header) {
|
|
97
|
-
var end = 0
|
|
98
|
-
var list = []
|
|
99
|
-
var start = 0
|
|
100
|
-
|
|
101
|
-
// gather tokens
|
|
102
|
-
for (var i = 0, len = header.length; i < len; i++) {
|
|
103
|
-
switch (header.charCodeAt(i)) {
|
|
104
|
-
case 0x20: /* */
|
|
105
|
-
if (start === end) {
|
|
106
|
-
start = end = i + 1
|
|
107
|
-
}
|
|
108
|
-
break
|
|
109
|
-
case 0x2c: /* , */
|
|
110
|
-
list.push(header.substring(start, end))
|
|
111
|
-
start = end = i + 1
|
|
112
|
-
break
|
|
113
|
-
default:
|
|
114
|
-
end = i + 1
|
|
115
|
-
break
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// final token
|
|
120
|
-
list.push(header.substring(start, end))
|
|
121
|
-
|
|
122
|
-
return list
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Mark that a request is varied on a header field.
|
|
127
|
-
*
|
|
128
|
-
* @param {Object} res
|
|
129
|
-
* @param {String|Array} field
|
|
130
|
-
* @public
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
function vary (res, field) {
|
|
134
|
-
if (!res || !res.getHeader || !res.setHeader) {
|
|
135
|
-
// quack quack
|
|
136
|
-
throw new TypeError('res argument is required')
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// get existing header
|
|
140
|
-
var val = res.getHeader('Vary') || ''
|
|
141
|
-
var header = Array.isArray(val)
|
|
142
|
-
? val.join(', ')
|
|
143
|
-
: String(val)
|
|
144
|
-
|
|
145
|
-
// set new header
|
|
146
|
-
if ((val = append(header, field))) {
|
|
147
|
-
res.setHeader('Vary', val)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vary",
|
|
3
|
-
"description": "Manipulate the HTTP Vary header",
|
|
4
|
-
"version": "1.1.2",
|
|
5
|
-
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"http",
|
|
9
|
-
"res",
|
|
10
|
-
"vary"
|
|
11
|
-
],
|
|
12
|
-
"repository": "jshttp/vary",
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"beautify-benchmark": "0.2.4",
|
|
15
|
-
"benchmark": "2.1.4",
|
|
16
|
-
"eslint": "3.19.0",
|
|
17
|
-
"eslint-config-standard": "10.2.1",
|
|
18
|
-
"eslint-plugin-import": "2.7.0",
|
|
19
|
-
"eslint-plugin-markdown": "1.0.0-beta.6",
|
|
20
|
-
"eslint-plugin-node": "5.1.1",
|
|
21
|
-
"eslint-plugin-promise": "3.5.0",
|
|
22
|
-
"eslint-plugin-standard": "3.0.1",
|
|
23
|
-
"istanbul": "0.4.5",
|
|
24
|
-
"mocha": "2.5.3",
|
|
25
|
-
"supertest": "1.1.0"
|
|
26
|
-
},
|
|
27
|
-
"files": [
|
|
28
|
-
"HISTORY.md",
|
|
29
|
-
"LICENSE",
|
|
30
|
-
"README.md",
|
|
31
|
-
"index.js"
|
|
32
|
-
],
|
|
33
|
-
"engines": {
|
|
34
|
-
"node": ">= 0.8"
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"bench": "node benchmark/index.js",
|
|
38
|
-
"lint": "eslint --plugin markdown --ext js,md .",
|
|
39
|
-
"test": "mocha --reporter spec --bail --check-leaks test/",
|
|
40
|
-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
|
41
|
-
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const WebSocket = require('./lib/websocket');
|
|
4
|
-
|
|
5
|
-
WebSocket.createWebSocketStream = require('./lib/stream');
|
|
6
|
-
WebSocket.Server = require('./lib/websocket-server');
|
|
7
|
-
WebSocket.Receiver = require('./lib/receiver');
|
|
8
|
-
WebSocket.Sender = require('./lib/sender');
|
|
9
|
-
|
|
10
|
-
WebSocket.WebSocket = WebSocket;
|
|
11
|
-
WebSocket.WebSocketServer = WebSocket.Server;
|
|
12
|
-
|
|
13
|
-
module.exports = WebSocket;
|