@wvkit/skevdb 0.0.1
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 +68 -0
- package/bin/aldb.js +58 -0
- package/build/client/_app/immutable/assets/0.4921WYCN.css +2 -0
- package/build/client/_app/immutable/assets/0.4921WYCN.css.br +0 -0
- package/build/client/_app/immutable/assets/0.4921WYCN.css.gz +0 -0
- package/build/client/_app/immutable/assets/codicon.ngg6Pgfi.ttf +0 -0
- package/build/client/_app/immutable/assets/editor.DV6jjE6F.css +1 -0
- package/build/client/_app/immutable/assets/editor.DV6jjE6F.css.br +0 -0
- package/build/client/_app/immutable/assets/editor.DV6jjE6F.css.gz +0 -0
- package/build/client/_app/immutable/assets/geist-cyrillic-ext-wght-normal.DjL33-gN.woff2 +0 -0
- package/build/client/_app/immutable/assets/geist-cyrillic-wght-normal.BEAKL7Jp.woff2 +0 -0
- package/build/client/_app/immutable/assets/geist-latin-ext-wght-normal.DC-KSUi6.woff2 +0 -0
- package/build/client/_app/immutable/assets/geist-latin-wght-normal.BgDaEnEv.woff2 +0 -0
- package/build/client/_app/immutable/assets/geist-vietnamese-wght-normal.6IgcOCM7.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
- package/build/client/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-cyrillic-ext-wght-normal.DSNfmdVt.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-cyrillic-wght-normal.B2hlT84T.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-devanagari-wght-normal.Cv-Vwajv.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-greek-ext-wght-normal.12T8GTDR.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-greek-wght-normal.Ymb6dZNd.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-latin-ext-wght-normal.W1qJv59z.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-latin-wght-normal.BYSzYMf3.woff2 +0 -0
- package/build/client/_app/immutable/assets/noto-sans-vietnamese-wght-normal.DLTJy58D.woff2 +0 -0
- package/build/client/_app/immutable/assets/sql.FmGBn3YN.css +1 -0
- package/build/client/_app/immutable/assets/sql.FmGBn3YN.css.br +0 -0
- package/build/client/_app/immutable/assets/sql.FmGBn3YN.css.gz +0 -0
- package/build/client/_app/immutable/chunks/-u0aF6D6.js +1 -0
- package/build/client/_app/immutable/chunks/-u0aF6D6.js.br +2 -0
- package/build/client/_app/immutable/chunks/-u0aF6D6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BZYon8uW.js +1 -0
- package/build/client/_app/immutable/chunks/BZYon8uW.js.br +0 -0
- package/build/client/_app/immutable/chunks/BZYon8uW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CT_ExraQ.js +820 -0
- package/build/client/_app/immutable/chunks/CT_ExraQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/CT_ExraQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CUXBnqxM.js +53 -0
- package/build/client/_app/immutable/chunks/CUXBnqxM.js.br +0 -0
- package/build/client/_app/immutable/chunks/CUXBnqxM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CqQuHtWb.js +1 -0
- package/build/client/_app/immutable/chunks/CqQuHtWb.js.br +0 -0
- package/build/client/_app/immutable/chunks/CqQuHtWb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DDJ7Hsqn.js +1 -0
- package/build/client/_app/immutable/chunks/DDJ7Hsqn.js.br +0 -0
- package/build/client/_app/immutable/chunks/DDJ7Hsqn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D_beq-47.js +3 -0
- package/build/client/_app/immutable/chunks/D_beq-47.js.br +0 -0
- package/build/client/_app/immutable/chunks/D_beq-47.js.gz +0 -0
- package/build/client/_app/immutable/chunks/NEE52Syq.js +1 -0
- package/build/client/_app/immutable/chunks/NEE52Syq.js.br +0 -0
- package/build/client/_app/immutable/chunks/NEE52Syq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/h8jGUf5s.js +1 -0
- package/build/client/_app/immutable/chunks/h8jGUf5s.js.br +0 -0
- package/build/client/_app/immutable/chunks/h8jGUf5s.js.gz +0 -0
- package/build/client/_app/immutable/chunks/kNaey6uv.js +1 -0
- package/build/client/_app/immutable/chunks/kNaey6uv.js.br +0 -0
- package/build/client/_app/immutable/chunks/kNaey6uv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.DmcKZPoo.js +2 -0
- package/build/client/_app/immutable/entry/app.DmcKZPoo.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DmcKZPoo.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.AWD7U8zX.js +1 -0
- package/build/client/_app/immutable/entry/start.AWD7U8zX.js.br +1 -0
- package/build/client/_app/immutable/entry/start.AWD7U8zX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.D42BAFic.js +46 -0
- package/build/client/_app/immutable/nodes/0.D42BAFic.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.D42BAFic.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.EnR_repC.js +1 -0
- package/build/client/_app/immutable/nodes/1.EnR_repC.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.EnR_repC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.Daii4oR8.js +1 -0
- package/build/client/_app/immutable/nodes/2.Daii4oR8.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.Daii4oR8.js.gz +0 -0
- package/build/client/_app/immutable/workers/editor.worker-Cn2oRESe.js +26 -0
- package/build/client/_app/immutable/workers/editor.worker-Cn2oRESe.js.br +0 -0
- package/build/client/_app/immutable/workers/editor.worker-Cn2oRESe.js.gz +0 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/client/robots.txt +3 -0
- package/build/client/robots.txt.br +0 -0
- package/build/client/robots.txt.gz +0 -0
- package/build/env.js +94 -0
- package/build/handler.js +1494 -0
- package/build/index.js +345 -0
- package/build/server/chunks/0-2tF2h-sW.js +13 -0
- package/build/server/chunks/0-2tF2h-sW.js.map +1 -0
- package/build/server/chunks/1-uqT1he7Y.js +9 -0
- package/build/server/chunks/1-uqT1he7Y.js.map +1 -0
- package/build/server/chunks/2-WinpGkOi.js +9 -0
- package/build/server/chunks/2-WinpGkOi.js.map +1 -0
- package/build/server/chunks/_layout.svelte-BO0NOSiE.js +43521 -0
- package/build/server/chunks/_layout.svelte-BO0NOSiE.js.map +1 -0
- package/build/server/chunks/_page.svelte-BP2EdQl3.js +5 -0
- package/build/server/chunks/_page.svelte-BP2EdQl3.js.map +1 -0
- package/build/server/chunks/_server.ts-6mqhv5WM.js +30 -0
- package/build/server/chunks/_server.ts-6mqhv5WM.js.map +1 -0
- package/build/server/chunks/_server.ts-B7evxvHU.js +61 -0
- package/build/server/chunks/_server.ts-B7evxvHU.js.map +1 -0
- package/build/server/chunks/_server.ts-BN5QAzfI.js +89 -0
- package/build/server/chunks/_server.ts-BN5QAzfI.js.map +1 -0
- package/build/server/chunks/_server.ts-BWe0PPhA.js +26 -0
- package/build/server/chunks/_server.ts-BWe0PPhA.js.map +1 -0
- package/build/server/chunks/_server.ts-BgrwjIyE.js +84 -0
- package/build/server/chunks/_server.ts-BgrwjIyE.js.map +1 -0
- package/build/server/chunks/_server.ts-CFzBDuF1.js +52 -0
- package/build/server/chunks/_server.ts-CFzBDuF1.js.map +1 -0
- package/build/server/chunks/_server.ts-CHBba1cE.js +55 -0
- package/build/server/chunks/_server.ts-CHBba1cE.js.map +1 -0
- package/build/server/chunks/_server.ts-ChxeqJr9.js +23 -0
- package/build/server/chunks/_server.ts-ChxeqJr9.js.map +1 -0
- package/build/server/chunks/_server.ts-Cq27_8sR.js +40 -0
- package/build/server/chunks/_server.ts-Cq27_8sR.js.map +1 -0
- package/build/server/chunks/_server.ts-DGK-tW9e.js +26 -0
- package/build/server/chunks/_server.ts-DGK-tW9e.js.map +1 -0
- package/build/server/chunks/_server.ts-DNbiBQKI.js +107 -0
- package/build/server/chunks/_server.ts-DNbiBQKI.js.map +1 -0
- package/build/server/chunks/_server.ts-LPl3rTE2.js +42 -0
- package/build/server/chunks/_server.ts-LPl3rTE2.js.map +1 -0
- package/build/server/chunks/_server.ts-WS7E0dC9.js +20 -0
- package/build/server/chunks/_server.ts-WS7E0dC9.js.map +1 -0
- package/build/server/chunks/_server.ts-o5h153l6.js +22 -0
- package/build/server/chunks/_server.ts-o5h153l6.js.map +1 -0
- package/build/server/chunks/error.svelte-WWFmDYfs.js +77 -0
- package/build/server/chunks/error.svelte-WWFmDYfs.js.map +1 -0
- package/build/server/chunks/index-DBqjc0Yf.js +77 -0
- package/build/server/chunks/index-DBqjc0Yf.js.map +1 -0
- package/build/server/chunks/index-Dq7YP_jO.js +134 -0
- package/build/server/chunks/index-Dq7YP_jO.js.map +1 -0
- package/build/server/chunks/internal2-R0fapQ2T.js +1164 -0
- package/build/server/chunks/internal2-R0fapQ2T.js.map +1 -0
- package/build/server/chunks/legacy-client-DEBQKXfT.js +5174 -0
- package/build/server/chunks/legacy-client-DEBQKXfT.js.map +1 -0
- package/build/server/chunks/mysql-DX3ct8Wa.js +74 -0
- package/build/server/chunks/mysql-DX3ct8Wa.js.map +1 -0
- package/build/server/chunks/plantuml-BT_hcRqZ.js +32 -0
- package/build/server/chunks/plantuml-BT_hcRqZ.js.map +1 -0
- package/build/server/chunks/shared-server-DkccXZBX.js +22 -0
- package/build/server/chunks/shared-server-DkccXZBX.js.map +1 -0
- package/build/server/index.js +4421 -0
- package/build/server/index.js.map +1 -0
- package/build/server/manifest.js +144 -0
- package/build/server/manifest.js.map +1 -0
- package/build/shims.js +32 -0
- package/package.json +61 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { handler } from './handler.js';
|
|
4
|
+
import { env, timeout_env } from './env.js';
|
|
5
|
+
import { setImmediate } from 'node:timers';
|
|
6
|
+
import * as qs from 'node:querystring';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {string|RegExp} input The route pattern
|
|
10
|
+
* @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.
|
|
11
|
+
*/
|
|
12
|
+
function parse$1(input, loose) {
|
|
13
|
+
if (input instanceof RegExp) return { keys:false, pattern:input };
|
|
14
|
+
var c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');
|
|
15
|
+
arr[0] || arr.shift();
|
|
16
|
+
|
|
17
|
+
while (tmp = arr.shift()) {
|
|
18
|
+
c = tmp[0];
|
|
19
|
+
if (c === '*') {
|
|
20
|
+
keys.push(c);
|
|
21
|
+
pattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';
|
|
22
|
+
} else if (c === ':') {
|
|
23
|
+
o = tmp.indexOf('?', 1);
|
|
24
|
+
ext = tmp.indexOf('.', 1);
|
|
25
|
+
keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
|
|
26
|
+
pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
|
|
27
|
+
if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
|
|
28
|
+
} else {
|
|
29
|
+
pattern += '/' + tmp;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
keys: keys,
|
|
35
|
+
pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i')
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const MAP = {
|
|
40
|
+
"": 0,
|
|
41
|
+
GET: 1,
|
|
42
|
+
HEAD: 2,
|
|
43
|
+
PATCH: 3,
|
|
44
|
+
OPTIONS: 4,
|
|
45
|
+
CONNECT: 5,
|
|
46
|
+
DELETE: 6,
|
|
47
|
+
TRACE: 7,
|
|
48
|
+
POST: 8,
|
|
49
|
+
PUT: 9,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
class Trouter {
|
|
53
|
+
constructor() {
|
|
54
|
+
this.routes = [];
|
|
55
|
+
|
|
56
|
+
this.all = this.add.bind(this, '');
|
|
57
|
+
this.get = this.add.bind(this, 'GET');
|
|
58
|
+
this.head = this.add.bind(this, 'HEAD');
|
|
59
|
+
this.patch = this.add.bind(this, 'PATCH');
|
|
60
|
+
this.options = this.add.bind(this, 'OPTIONS');
|
|
61
|
+
this.connect = this.add.bind(this, 'CONNECT');
|
|
62
|
+
this.delete = this.add.bind(this, 'DELETE');
|
|
63
|
+
this.trace = this.add.bind(this, 'TRACE');
|
|
64
|
+
this.post = this.add.bind(this, 'POST');
|
|
65
|
+
this.put = this.add.bind(this, 'PUT');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
use(route, ...fns) {
|
|
69
|
+
let handlers = [].concat.apply([], fns);
|
|
70
|
+
let { keys, pattern } = parse$1(route, true);
|
|
71
|
+
this.routes.push({ keys, pattern, method: '', handlers, midx: MAP[''] });
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
add(method, route, ...fns) {
|
|
76
|
+
let { keys, pattern } = parse$1(route);
|
|
77
|
+
let handlers = [].concat.apply([], fns);
|
|
78
|
+
this.routes.push({ keys, pattern, method, handlers, midx: MAP[method] });
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
find(method, url) {
|
|
83
|
+
let midx = MAP[method];
|
|
84
|
+
let isHEAD = (midx === 2);
|
|
85
|
+
let i=0, j=0, k, tmp, arr=this.routes;
|
|
86
|
+
let matches=[], params={}, handlers=[];
|
|
87
|
+
for (; i < arr.length; i++) {
|
|
88
|
+
tmp = arr[i];
|
|
89
|
+
if (tmp.midx === midx || tmp.midx === 0 || (isHEAD && tmp.midx===1) ) {
|
|
90
|
+
if (tmp.keys === false) {
|
|
91
|
+
matches = tmp.pattern.exec(url);
|
|
92
|
+
if (matches === null) continue;
|
|
93
|
+
if (matches.groups !== void 0) for (k in matches.groups) params[k]=matches.groups[k];
|
|
94
|
+
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
|
95
|
+
} else if (tmp.keys.length > 0) {
|
|
96
|
+
matches = tmp.pattern.exec(url);
|
|
97
|
+
if (matches === null) continue;
|
|
98
|
+
for (j=0; j < tmp.keys.length;) params[tmp.keys[j]]=matches[++j];
|
|
99
|
+
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
|
100
|
+
} else if (tmp.pattern.test(url)) {
|
|
101
|
+
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
|
102
|
+
}
|
|
103
|
+
} // else not a match
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return { params, handlers };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @typedef ParsedURL
|
|
112
|
+
* @type {import('.').ParsedURL}
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @typedef Request
|
|
117
|
+
* @property {string} url
|
|
118
|
+
* @property {ParsedURL} _parsedUrl
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @param {Request} req
|
|
123
|
+
* @returns {ParsedURL|void}
|
|
124
|
+
*/
|
|
125
|
+
function parse(req) {
|
|
126
|
+
let raw = req.url;
|
|
127
|
+
if (raw == null) return;
|
|
128
|
+
|
|
129
|
+
let prev = req._parsedUrl;
|
|
130
|
+
if (prev && prev.raw === raw) return prev;
|
|
131
|
+
|
|
132
|
+
let pathname=raw, search='', query;
|
|
133
|
+
|
|
134
|
+
if (raw.length > 1) {
|
|
135
|
+
let idx = raw.indexOf('?', 1);
|
|
136
|
+
|
|
137
|
+
if (idx !== -1) {
|
|
138
|
+
search = raw.substring(idx);
|
|
139
|
+
pathname = raw.substring(0, idx);
|
|
140
|
+
if (search.length > 1) {
|
|
141
|
+
query = qs.parse(search.substring(1));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return req._parsedUrl = { pathname, search, query, raw };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function onError(err, req, res) {
|
|
150
|
+
let code = typeof err.status === 'number' && err.status;
|
|
151
|
+
code = res.statusCode = (code && code >= 100 ? code : 500);
|
|
152
|
+
if (typeof err === 'string' || Buffer.isBuffer(err)) res.end(err);
|
|
153
|
+
else res.end(err.message || http.STATUS_CODES[code]);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const mount = fn => fn instanceof Polka ? fn.attach : fn;
|
|
157
|
+
|
|
158
|
+
class Polka extends Trouter {
|
|
159
|
+
constructor(opts={}) {
|
|
160
|
+
super();
|
|
161
|
+
this.parse = parse;
|
|
162
|
+
this.server = opts.server;
|
|
163
|
+
this.handler = this.handler.bind(this);
|
|
164
|
+
this.onError = opts.onError || onError; // catch-all handler
|
|
165
|
+
this.onNoMatch = opts.onNoMatch || this.onError.bind(null, { status: 404 });
|
|
166
|
+
this.attach = (req, res) => setImmediate(this.handler, req, res);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
use(base, ...fns) {
|
|
170
|
+
if (base === '/') {
|
|
171
|
+
super.use(base, fns.map(mount));
|
|
172
|
+
} else if (typeof base === 'function' || base instanceof Polka) {
|
|
173
|
+
super.use('/', [base, ...fns].map(mount));
|
|
174
|
+
} else {
|
|
175
|
+
super.use(base,
|
|
176
|
+
(req, _, next) => {
|
|
177
|
+
if (typeof base === 'string') {
|
|
178
|
+
let len = base.length;
|
|
179
|
+
base.startsWith('/') || len++;
|
|
180
|
+
req.url = req.url.substring(len) || '/';
|
|
181
|
+
req.path = req.path.substring(len) || '/';
|
|
182
|
+
} else {
|
|
183
|
+
req.url = req.url.replace(base, '') || '/';
|
|
184
|
+
req.path = req.path.replace(base, '') || '/';
|
|
185
|
+
}
|
|
186
|
+
if (req.url.charAt(0) !== '/') {
|
|
187
|
+
req.url = '/' + req.url;
|
|
188
|
+
}
|
|
189
|
+
next();
|
|
190
|
+
},
|
|
191
|
+
fns.map(mount),
|
|
192
|
+
(req, _, next) => {
|
|
193
|
+
req.path = req._parsedUrl.pathname;
|
|
194
|
+
req.url = req.path + req._parsedUrl.search;
|
|
195
|
+
next();
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return this; // chainable
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
listen() {
|
|
203
|
+
(this.server = this.server || http.createServer()).on('request', this.attach);
|
|
204
|
+
this.server.listen.apply(this.server, arguments);
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
handler(req, res, next) {
|
|
209
|
+
let info = this.parse(req), path = info.pathname;
|
|
210
|
+
let obj = this.find(req.method, req.path=path);
|
|
211
|
+
|
|
212
|
+
req.url = path + info.search;
|
|
213
|
+
req.originalUrl = req.originalUrl || req.url;
|
|
214
|
+
req.query = info.query || {};
|
|
215
|
+
req.search = info.search;
|
|
216
|
+
req.params = obj.params;
|
|
217
|
+
|
|
218
|
+
if (path.length > 1 && path.indexOf('%', 1) !== -1) {
|
|
219
|
+
for (let k in req.params) {
|
|
220
|
+
try { req.params[k] = decodeURIComponent(req.params[k]); }
|
|
221
|
+
catch (e) { /* malform uri segment */ }
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let i=0, arr=obj.handlers.concat(this.onNoMatch), len=arr.length;
|
|
226
|
+
let loop = async () => res.finished || (i < len) && arr[i++](req, res, next);
|
|
227
|
+
(next = next || (err => err ? this.onError(err, req, res, next) : loop().catch(next)))(); // init
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function polka (opts) {
|
|
232
|
+
return new Polka(opts);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const path = env('SOCKET_PATH', false);
|
|
236
|
+
const host = env('HOST', '0.0.0.0');
|
|
237
|
+
const port = env('PORT', !path && '3000');
|
|
238
|
+
|
|
239
|
+
const shutdown_timeout = parseInt(env('SHUTDOWN_TIMEOUT', '30'));
|
|
240
|
+
const idle_timeout = parseInt(env('IDLE_TIMEOUT', '0'));
|
|
241
|
+
const listen_pid = parseInt(env('LISTEN_PID', '0'));
|
|
242
|
+
const listen_fds = parseInt(env('LISTEN_FDS', '0'));
|
|
243
|
+
// https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html
|
|
244
|
+
const SD_LISTEN_FDS_START = 3;
|
|
245
|
+
|
|
246
|
+
if (listen_pid !== 0 && listen_pid !== process.pid) {
|
|
247
|
+
throw new Error(`received LISTEN_PID ${listen_pid} but current process id is ${process.pid}`);
|
|
248
|
+
}
|
|
249
|
+
if (listen_fds > 1) {
|
|
250
|
+
throw new Error(
|
|
251
|
+
`only one socket is allowed for socket activation, but LISTEN_FDS was set to ${listen_fds}`
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const socket_activation = listen_pid === process.pid && listen_fds === 1;
|
|
256
|
+
|
|
257
|
+
let requests = 0;
|
|
258
|
+
/** @type {NodeJS.Timeout | void} */
|
|
259
|
+
let shutdown_timeout_id;
|
|
260
|
+
/** @type {NodeJS.Timeout | void} */
|
|
261
|
+
let idle_timeout_id;
|
|
262
|
+
|
|
263
|
+
// Initialize the HTTP server here so that we can set properties before starting to listen.
|
|
264
|
+
// Otherwise, polka delays creating the server until listen() is called. Settings these
|
|
265
|
+
// properties after the server has started listening could lead to race conditions.
|
|
266
|
+
const httpServer = http.createServer();
|
|
267
|
+
|
|
268
|
+
const keep_alive_timeout = timeout_env('KEEP_ALIVE_TIMEOUT');
|
|
269
|
+
if (keep_alive_timeout !== undefined) {
|
|
270
|
+
// Convert the keep-alive timeout from seconds to milliseconds (the unit Node.js expects).
|
|
271
|
+
httpServer.keepAliveTimeout = keep_alive_timeout * 1000;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const headers_timeout = timeout_env('HEADERS_TIMEOUT');
|
|
275
|
+
if (headers_timeout !== undefined) {
|
|
276
|
+
// Convert the headers timeout from seconds to milliseconds (the unit Node.js expects).
|
|
277
|
+
httpServer.headersTimeout = headers_timeout * 1000;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const server = polka({ server: httpServer }).use(handler);
|
|
281
|
+
|
|
282
|
+
if (socket_activation) {
|
|
283
|
+
server.listen({ fd: SD_LISTEN_FDS_START }, () => {
|
|
284
|
+
console.log(`Listening on file descriptor ${SD_LISTEN_FDS_START}`);
|
|
285
|
+
});
|
|
286
|
+
} else {
|
|
287
|
+
server.listen({ path, host, port }, () => {
|
|
288
|
+
console.log(`Listening on ${path || `http://${host}:${port}`}`);
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** @param {'SIGINT' | 'SIGTERM' | 'IDLE'} reason */
|
|
293
|
+
function graceful_shutdown(reason) {
|
|
294
|
+
if (shutdown_timeout_id) return;
|
|
295
|
+
|
|
296
|
+
// If a connection was opened with a keep-alive header close() will wait for the connection to
|
|
297
|
+
// time out rather than close it even if it is not handling any requests, so call this first
|
|
298
|
+
httpServer.closeIdleConnections();
|
|
299
|
+
|
|
300
|
+
httpServer.close((error) => {
|
|
301
|
+
// occurs if the server is already closed
|
|
302
|
+
if (error) return;
|
|
303
|
+
|
|
304
|
+
if (shutdown_timeout_id) {
|
|
305
|
+
clearTimeout(shutdown_timeout_id);
|
|
306
|
+
}
|
|
307
|
+
if (idle_timeout_id) {
|
|
308
|
+
clearTimeout(idle_timeout_id);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// @ts-expect-error custom events cannot be typed
|
|
312
|
+
process.emit('sveltekit:shutdown', reason);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
shutdown_timeout_id = setTimeout(() => httpServer.closeAllConnections(), shutdown_timeout * 1000);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
httpServer.on(
|
|
319
|
+
'request',
|
|
320
|
+
/** @param {import('node:http').IncomingMessage} req */
|
|
321
|
+
(req) => {
|
|
322
|
+
requests++;
|
|
323
|
+
|
|
324
|
+
if (socket_activation && idle_timeout_id) {
|
|
325
|
+
idle_timeout_id = clearTimeout(idle_timeout_id);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
req.on('close', () => {
|
|
329
|
+
requests--;
|
|
330
|
+
|
|
331
|
+
if (shutdown_timeout_id) {
|
|
332
|
+
// close connections as soon as they become idle, so they don't accept new requests
|
|
333
|
+
httpServer.closeIdleConnections();
|
|
334
|
+
}
|
|
335
|
+
if (requests === 0 && socket_activation && idle_timeout) {
|
|
336
|
+
idle_timeout_id = setTimeout(() => graceful_shutdown('IDLE'), idle_timeout * 1000);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
process.on('SIGTERM', graceful_shutdown);
|
|
343
|
+
process.on('SIGINT', graceful_shutdown);
|
|
344
|
+
|
|
345
|
+
export { host, path, port, server };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const index = 0;
|
|
2
|
+
let component_cache;
|
|
3
|
+
const component = async () => component_cache ??= (await import('./_layout.svelte-BO0NOSiE.js')).default;
|
|
4
|
+
const universal = {
|
|
5
|
+
"ssr": false
|
|
6
|
+
};
|
|
7
|
+
const universal_id = "src/routes/+layout.ts";
|
|
8
|
+
const imports = ["_app/immutable/nodes/0.D42BAFic.js","_app/immutable/chunks/D_beq-47.js","_app/immutable/chunks/kNaey6uv.js","_app/immutable/chunks/xihTtKlq.js","_app/immutable/chunks/-u0aF6D6.js"];
|
|
9
|
+
const stylesheets = ["_app/immutable/assets/0.4921WYCN.css"];
|
|
10
|
+
const fonts = ["_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2","_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2","_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2","_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2","_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2","_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2","_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2","_app/immutable/assets/noto-sans-cyrillic-ext-wght-normal.DSNfmdVt.woff2","_app/immutable/assets/noto-sans-cyrillic-wght-normal.B2hlT84T.woff2","_app/immutable/assets/noto-sans-devanagari-wght-normal.Cv-Vwajv.woff2","_app/immutable/assets/noto-sans-greek-ext-wght-normal.12T8GTDR.woff2","_app/immutable/assets/noto-sans-greek-wght-normal.Ymb6dZNd.woff2","_app/immutable/assets/noto-sans-vietnamese-wght-normal.DLTJy58D.woff2","_app/immutable/assets/noto-sans-latin-ext-wght-normal.W1qJv59z.woff2","_app/immutable/assets/noto-sans-latin-wght-normal.BYSzYMf3.woff2","_app/immutable/assets/geist-cyrillic-ext-wght-normal.DjL33-gN.woff2","_app/immutable/assets/geist-cyrillic-wght-normal.BEAKL7Jp.woff2","_app/immutable/assets/geist-vietnamese-wght-normal.6IgcOCM7.woff2","_app/immutable/assets/geist-latin-ext-wght-normal.DC-KSUi6.woff2","_app/immutable/assets/geist-latin-wght-normal.BgDaEnEv.woff2"];
|
|
11
|
+
|
|
12
|
+
export { component, fonts, imports, index, stylesheets, universal, universal_id };
|
|
13
|
+
//# sourceMappingURL=0-2tF2h-sW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0-2tF2h-sW.js","sources":["../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport const universal = {\n \"ssr\": false\n};\nexport const universal_id = \"src/routes/+layout.ts\";\nexport const imports = [\"_app/immutable/nodes/0.D42BAFic.js\",\"_app/immutable/chunks/D_beq-47.js\",\"_app/immutable/chunks/kNaey6uv.js\",\"_app/immutable/chunks/xihTtKlq.js\",\"_app/immutable/chunks/-u0aF6D6.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.4921WYCN.css\"];\nexport const fonts = [\"_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2\",\"_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2\",\"_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2\",\"_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2\",\"_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2\",\"_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2\",\"_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2\",\"_app/immutable/assets/noto-sans-cyrillic-ext-wght-normal.DSNfmdVt.woff2\",\"_app/immutable/assets/noto-sans-cyrillic-wght-normal.B2hlT84T.woff2\",\"_app/immutable/assets/noto-sans-devanagari-wght-normal.Cv-Vwajv.woff2\",\"_app/immutable/assets/noto-sans-greek-ext-wght-normal.12T8GTDR.woff2\",\"_app/immutable/assets/noto-sans-greek-wght-normal.Ymb6dZNd.woff2\",\"_app/immutable/assets/noto-sans-vietnamese-wght-normal.DLTJy58D.woff2\",\"_app/immutable/assets/noto-sans-latin-ext-wght-normal.W1qJv59z.woff2\",\"_app/immutable/assets/noto-sans-latin-wght-normal.BYSzYMf3.woff2\",\"_app/immutable/assets/geist-cyrillic-ext-wght-normal.DjL33-gN.woff2\",\"_app/immutable/assets/geist-cyrillic-wght-normal.BEAKL7Jp.woff2\",\"_app/immutable/assets/geist-vietnamese-wght-normal.6IgcOCM7.woff2\",\"_app/immutable/assets/geist-latin-ext-wght-normal.DC-KSUi6.woff2\",\"_app/immutable/assets/geist-latin-wght-normal.BgDaEnEv.woff2\"];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE;AAClG,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE;AACT;AACY,MAAC,YAAY,GAAG;AAChB,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChM,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG,CAAC,qEAAqE,CAAC,iEAAiE,CAAC,kEAAkE,CAAC,8DAA8D,CAAC,mEAAmE,CAAC,kEAAkE,CAAC,8DAA8D,CAAC,yEAAyE,CAAC,qEAAqE,CAAC,uEAAuE,CAAC,sEAAsE,CAAC,kEAAkE,CAAC,uEAAuE,CAAC,sEAAsE,CAAC,kEAAkE,CAAC,qEAAqE,CAAC,iEAAiE,CAAC,mEAAmE,CAAC,kEAAkE,CAAC,8DAA8D;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const index = 1;
|
|
2
|
+
let component_cache;
|
|
3
|
+
const component = async () => component_cache ??= (await import('./error.svelte-WWFmDYfs.js')).default;
|
|
4
|
+
const imports = ["_app/immutable/nodes/1.EnR_repC.js","_app/immutable/chunks/D_beq-47.js","_app/immutable/chunks/CqQuHtWb.js","_app/immutable/chunks/-u0aF6D6.js","_app/immutable/chunks/xihTtKlq.js"];
|
|
5
|
+
const stylesheets = [];
|
|
6
|
+
const fonts = [];
|
|
7
|
+
|
|
8
|
+
export { component, fonts, imports, index, stylesheets };
|
|
9
|
+
//# sourceMappingURL=1-uqT1he7Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1-uqT1he7Y.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.EnR_repC.js\",\"_app/immutable/chunks/D_beq-47.js\",\"_app/immutable/chunks/CqQuHtWb.js\",\"_app/immutable/chunks/-u0aF6D6.js\",\"_app/immutable/chunks/xihTtKlq.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE;AACpG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChM,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const index = 2;
|
|
2
|
+
let component_cache;
|
|
3
|
+
const component = async () => component_cache ??= (await import('./_page.svelte-BP2EdQl3.js')).default;
|
|
4
|
+
const imports = ["_app/immutable/nodes/2.Daii4oR8.js","_app/immutable/chunks/D_beq-47.js","_app/immutable/chunks/xihTtKlq.js"];
|
|
5
|
+
const stylesheets = [];
|
|
6
|
+
const fonts = [];
|
|
7
|
+
|
|
8
|
+
export { component, fonts, imports, index, stylesheets };
|
|
9
|
+
//# sourceMappingURL=2-WinpGkOi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-WinpGkOi.js","sources":["../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/2.Daii4oR8.js\",\"_app/immutable/chunks/D_beq-47.js\",\"_app/immutable/chunks/xihTtKlq.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE;AAChG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC;AACxH,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|