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,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* negotiator
|
|
3
|
-
* Copyright(c) 2012 Isaac Z. Schlueter
|
|
4
|
-
* Copyright(c) 2014 Federico Romero
|
|
5
|
-
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
6
|
-
* MIT Licensed
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
'use strict';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Module exports.
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
module.exports = preferredCharsets;
|
|
17
|
-
module.exports.preferredCharsets = preferredCharsets;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Module variables.
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Parse the Accept-Charset header.
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
function parseAcceptCharset(accept) {
|
|
32
|
-
var accepts = accept.split(',');
|
|
33
|
-
|
|
34
|
-
for (var i = 0, j = 0; i < accepts.length; i++) {
|
|
35
|
-
var charset = parseCharset(accepts[i].trim(), i);
|
|
36
|
-
|
|
37
|
-
if (charset) {
|
|
38
|
-
accepts[j++] = charset;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// trim accepts
|
|
43
|
-
accepts.length = j;
|
|
44
|
-
|
|
45
|
-
return accepts;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Parse a charset from the Accept-Charset header.
|
|
50
|
-
* @private
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
function parseCharset(str, i) {
|
|
54
|
-
var match = simpleCharsetRegExp.exec(str);
|
|
55
|
-
if (!match) return null;
|
|
56
|
-
|
|
57
|
-
var charset = match[1];
|
|
58
|
-
var q = 1;
|
|
59
|
-
if (match[2]) {
|
|
60
|
-
var params = match[2].split(';')
|
|
61
|
-
for (var j = 0; j < params.length; j++) {
|
|
62
|
-
var p = params[j].trim().split('=');
|
|
63
|
-
if (p[0] === 'q') {
|
|
64
|
-
q = parseFloat(p[1]);
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
charset: charset,
|
|
72
|
-
q: q,
|
|
73
|
-
i: i
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Get the priority of a charset.
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
function getCharsetPriority(charset, accepted, index) {
|
|
83
|
-
var priority = {o: -1, q: 0, s: 0};
|
|
84
|
-
|
|
85
|
-
for (var i = 0; i < accepted.length; i++) {
|
|
86
|
-
var spec = specify(charset, accepted[i], index);
|
|
87
|
-
|
|
88
|
-
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
89
|
-
priority = spec;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return priority;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Get the specificity of the charset.
|
|
98
|
-
* @private
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
function specify(charset, spec, index) {
|
|
102
|
-
var s = 0;
|
|
103
|
-
if(spec.charset.toLowerCase() === charset.toLowerCase()){
|
|
104
|
-
s |= 1;
|
|
105
|
-
} else if (spec.charset !== '*' ) {
|
|
106
|
-
return null
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
i: index,
|
|
111
|
-
o: spec.i,
|
|
112
|
-
q: spec.q,
|
|
113
|
-
s: s
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Get the preferred charsets from an Accept-Charset header.
|
|
119
|
-
* @public
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
function preferredCharsets(accept, provided) {
|
|
123
|
-
// RFC 2616 sec 14.2: no header = *
|
|
124
|
-
var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');
|
|
125
|
-
|
|
126
|
-
if (!provided) {
|
|
127
|
-
// sorted list of all charsets
|
|
128
|
-
return accepts
|
|
129
|
-
.filter(isQuality)
|
|
130
|
-
.sort(compareSpecs)
|
|
131
|
-
.map(getFullCharset);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
var priorities = provided.map(function getPriority(type, index) {
|
|
135
|
-
return getCharsetPriority(type, accepts, index);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// sorted list of accepted charsets
|
|
139
|
-
return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {
|
|
140
|
-
return provided[priorities.indexOf(priority)];
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Compare two specs.
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
function compareSpecs(a, b) {
|
|
150
|
-
return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Get full charset string.
|
|
155
|
-
* @private
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
function getFullCharset(spec) {
|
|
159
|
-
return spec.charset;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Check if a spec has any quality.
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
function isQuality(spec) {
|
|
168
|
-
return spec.q > 0;
|
|
169
|
-
}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* negotiator
|
|
3
|
-
* Copyright(c) 2012 Isaac Z. Schlueter
|
|
4
|
-
* Copyright(c) 2014 Federico Romero
|
|
5
|
-
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
6
|
-
* MIT Licensed
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
'use strict';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Module exports.
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
module.exports = preferredEncodings;
|
|
17
|
-
module.exports.preferredEncodings = preferredEncodings;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Module variables.
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Parse the Accept-Encoding header.
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
function parseAcceptEncoding(accept) {
|
|
32
|
-
var accepts = accept.split(',');
|
|
33
|
-
var hasIdentity = false;
|
|
34
|
-
var minQuality = 1;
|
|
35
|
-
|
|
36
|
-
for (var i = 0, j = 0; i < accepts.length; i++) {
|
|
37
|
-
var encoding = parseEncoding(accepts[i].trim(), i);
|
|
38
|
-
|
|
39
|
-
if (encoding) {
|
|
40
|
-
accepts[j++] = encoding;
|
|
41
|
-
hasIdentity = hasIdentity || specify('identity', encoding);
|
|
42
|
-
minQuality = Math.min(minQuality, encoding.q || 1);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (!hasIdentity) {
|
|
47
|
-
/*
|
|
48
|
-
* If identity doesn't explicitly appear in the accept-encoding header,
|
|
49
|
-
* it's added to the list of acceptable encoding with the lowest q
|
|
50
|
-
*/
|
|
51
|
-
accepts[j++] = {
|
|
52
|
-
encoding: 'identity',
|
|
53
|
-
q: minQuality,
|
|
54
|
-
i: i
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// trim accepts
|
|
59
|
-
accepts.length = j;
|
|
60
|
-
|
|
61
|
-
return accepts;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Parse an encoding from the Accept-Encoding header.
|
|
66
|
-
* @private
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
function parseEncoding(str, i) {
|
|
70
|
-
var match = simpleEncodingRegExp.exec(str);
|
|
71
|
-
if (!match) return null;
|
|
72
|
-
|
|
73
|
-
var encoding = match[1];
|
|
74
|
-
var q = 1;
|
|
75
|
-
if (match[2]) {
|
|
76
|
-
var params = match[2].split(';');
|
|
77
|
-
for (var j = 0; j < params.length; j++) {
|
|
78
|
-
var p = params[j].trim().split('=');
|
|
79
|
-
if (p[0] === 'q') {
|
|
80
|
-
q = parseFloat(p[1]);
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
encoding: encoding,
|
|
88
|
-
q: q,
|
|
89
|
-
i: i
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Get the priority of an encoding.
|
|
95
|
-
* @private
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
function getEncodingPriority(encoding, accepted, index) {
|
|
99
|
-
var priority = {o: -1, q: 0, s: 0};
|
|
100
|
-
|
|
101
|
-
for (var i = 0; i < accepted.length; i++) {
|
|
102
|
-
var spec = specify(encoding, accepted[i], index);
|
|
103
|
-
|
|
104
|
-
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
105
|
-
priority = spec;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return priority;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Get the specificity of the encoding.
|
|
114
|
-
* @private
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
function specify(encoding, spec, index) {
|
|
118
|
-
var s = 0;
|
|
119
|
-
if(spec.encoding.toLowerCase() === encoding.toLowerCase()){
|
|
120
|
-
s |= 1;
|
|
121
|
-
} else if (spec.encoding !== '*' ) {
|
|
122
|
-
return null
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
i: index,
|
|
127
|
-
o: spec.i,
|
|
128
|
-
q: spec.q,
|
|
129
|
-
s: s
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Get the preferred encodings from an Accept-Encoding header.
|
|
135
|
-
* @public
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
function preferredEncodings(accept, provided) {
|
|
139
|
-
var accepts = parseAcceptEncoding(accept || '');
|
|
140
|
-
|
|
141
|
-
if (!provided) {
|
|
142
|
-
// sorted list of all encodings
|
|
143
|
-
return accepts
|
|
144
|
-
.filter(isQuality)
|
|
145
|
-
.sort(compareSpecs)
|
|
146
|
-
.map(getFullEncoding);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
var priorities = provided.map(function getPriority(type, index) {
|
|
150
|
-
return getEncodingPriority(type, accepts, index);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
// sorted list of accepted encodings
|
|
154
|
-
return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) {
|
|
155
|
-
return provided[priorities.indexOf(priority)];
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Compare two specs.
|
|
161
|
-
* @private
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
function compareSpecs(a, b) {
|
|
165
|
-
return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Get full encoding string.
|
|
170
|
-
* @private
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
function getFullEncoding(spec) {
|
|
174
|
-
return spec.encoding;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Check if a spec has any quality.
|
|
179
|
-
* @private
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
function isQuality(spec) {
|
|
183
|
-
return spec.q > 0;
|
|
184
|
-
}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* negotiator
|
|
3
|
-
* Copyright(c) 2012 Isaac Z. Schlueter
|
|
4
|
-
* Copyright(c) 2014 Federico Romero
|
|
5
|
-
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
6
|
-
* MIT Licensed
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
'use strict';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Module exports.
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
module.exports = preferredLanguages;
|
|
17
|
-
module.exports.preferredLanguages = preferredLanguages;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Module variables.
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Parse the Accept-Language header.
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
function parseAcceptLanguage(accept) {
|
|
32
|
-
var accepts = accept.split(',');
|
|
33
|
-
|
|
34
|
-
for (var i = 0, j = 0; i < accepts.length; i++) {
|
|
35
|
-
var language = parseLanguage(accepts[i].trim(), i);
|
|
36
|
-
|
|
37
|
-
if (language) {
|
|
38
|
-
accepts[j++] = language;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// trim accepts
|
|
43
|
-
accepts.length = j;
|
|
44
|
-
|
|
45
|
-
return accepts;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Parse a language from the Accept-Language header.
|
|
50
|
-
* @private
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
function parseLanguage(str, i) {
|
|
54
|
-
var match = simpleLanguageRegExp.exec(str);
|
|
55
|
-
if (!match) return null;
|
|
56
|
-
|
|
57
|
-
var prefix = match[1]
|
|
58
|
-
var suffix = match[2]
|
|
59
|
-
var full = prefix
|
|
60
|
-
|
|
61
|
-
if (suffix) full += "-" + suffix;
|
|
62
|
-
|
|
63
|
-
var q = 1;
|
|
64
|
-
if (match[3]) {
|
|
65
|
-
var params = match[3].split(';')
|
|
66
|
-
for (var j = 0; j < params.length; j++) {
|
|
67
|
-
var p = params[j].split('=');
|
|
68
|
-
if (p[0] === 'q') q = parseFloat(p[1]);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
prefix: prefix,
|
|
74
|
-
suffix: suffix,
|
|
75
|
-
q: q,
|
|
76
|
-
i: i,
|
|
77
|
-
full: full
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get the priority of a language.
|
|
83
|
-
* @private
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
function getLanguagePriority(language, accepted, index) {
|
|
87
|
-
var priority = {o: -1, q: 0, s: 0};
|
|
88
|
-
|
|
89
|
-
for (var i = 0; i < accepted.length; i++) {
|
|
90
|
-
var spec = specify(language, accepted[i], index);
|
|
91
|
-
|
|
92
|
-
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
93
|
-
priority = spec;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return priority;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Get the specificity of the language.
|
|
102
|
-
* @private
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
function specify(language, spec, index) {
|
|
106
|
-
var p = parseLanguage(language)
|
|
107
|
-
if (!p) return null;
|
|
108
|
-
var s = 0;
|
|
109
|
-
if(spec.full.toLowerCase() === p.full.toLowerCase()){
|
|
110
|
-
s |= 4;
|
|
111
|
-
} else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) {
|
|
112
|
-
s |= 2;
|
|
113
|
-
} else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) {
|
|
114
|
-
s |= 1;
|
|
115
|
-
} else if (spec.full !== '*' ) {
|
|
116
|
-
return null
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
i: index,
|
|
121
|
-
o: spec.i,
|
|
122
|
-
q: spec.q,
|
|
123
|
-
s: s
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Get the preferred languages from an Accept-Language header.
|
|
129
|
-
* @public
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
function preferredLanguages(accept, provided) {
|
|
133
|
-
// RFC 2616 sec 14.4: no header = *
|
|
134
|
-
var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || '');
|
|
135
|
-
|
|
136
|
-
if (!provided) {
|
|
137
|
-
// sorted list of all languages
|
|
138
|
-
return accepts
|
|
139
|
-
.filter(isQuality)
|
|
140
|
-
.sort(compareSpecs)
|
|
141
|
-
.map(getFullLanguage);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
var priorities = provided.map(function getPriority(type, index) {
|
|
145
|
-
return getLanguagePriority(type, accepts, index);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
// sorted list of accepted languages
|
|
149
|
-
return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) {
|
|
150
|
-
return provided[priorities.indexOf(priority)];
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Compare two specs.
|
|
156
|
-
* @private
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
function compareSpecs(a, b) {
|
|
160
|
-
return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Get full language string.
|
|
165
|
-
* @private
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
function getFullLanguage(spec) {
|
|
169
|
-
return spec.full;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Check if a spec has any quality.
|
|
174
|
-
* @private
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
|
-
function isQuality(spec) {
|
|
178
|
-
return spec.q > 0;
|
|
179
|
-
}
|