@take-out/better-auth-utils 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createAuthClient.cjs +140 -89
- package/dist/cjs/createAuthClient.native.js +185 -141
- package/dist/cjs/createAuthClient.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/server.cjs +57 -42
- package/dist/cjs/server.native.js +137 -92
- package/dist/cjs/server.native.js.map +1 -1
- package/dist/esm/createAuthClient.mjs +126 -77
- package/dist/esm/createAuthClient.mjs.map +1 -1
- package/dist/esm/createAuthClient.native.js +171 -129
- package/dist/esm/createAuthClient.native.js.map +1 -1
- package/dist/esm/server.mjs +45 -32
- package/dist/esm/server.mjs.map +1 -1
- package/dist/esm/server.native.js +125 -82
- package/dist/esm/server.native.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/server.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var server_exports = {};
|
|
22
24
|
__export(server_exports, {
|
|
@@ -31,33 +33,43 @@ var import_jose = require("jose");
|
|
|
31
33
|
class NotAuthenticatedError extends Error {}
|
|
32
34
|
class InvalidTokenError extends Error {}
|
|
33
35
|
async function getAuthDataFromRequest(authServer, req, tokenOptions) {
|
|
34
|
-
const authHeader = req.headers.get("authorization")
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const authHeader = req.headers.get("authorization");
|
|
37
|
+
const cookie = authHeader?.split("Bearer ")[1];
|
|
38
|
+
const newHeaders = new Headers(req.headers);
|
|
39
|
+
if (cookie) {
|
|
40
|
+
newHeaders.set("Cookie", cookie);
|
|
41
|
+
}
|
|
38
42
|
try {
|
|
39
43
|
const session = await authServer.api.getSession({
|
|
40
44
|
headers: newHeaders
|
|
41
45
|
});
|
|
42
|
-
if (session?.user)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
if (session?.user) {
|
|
47
|
+
return {
|
|
48
|
+
id: session.user.id,
|
|
49
|
+
email: session.user.email || void 0,
|
|
50
|
+
role: session.user.role === "admin" ? "admin" : void 0
|
|
51
|
+
};
|
|
52
|
+
}
|
|
47
53
|
} catch (err) {
|
|
48
|
-
console.warn(
|
|
54
|
+
console.warn(`Error validating session`, err);
|
|
49
55
|
}
|
|
50
56
|
const jwtToken = authHeader?.replace("Bearer ", "");
|
|
51
|
-
if (jwtToken)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
if (jwtToken) {
|
|
58
|
+
try {
|
|
59
|
+
const payload = await validateToken(jwtToken, tokenOptions);
|
|
60
|
+
const userId = payload?.id || payload?.sub;
|
|
61
|
+
if (userId) {
|
|
62
|
+
return {
|
|
63
|
+
id: userId,
|
|
64
|
+
email: payload.email,
|
|
65
|
+
role: payload.role === "admin" ? "admin" : void 0
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
if (!(err instanceof InvalidTokenError)) {
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
61
73
|
}
|
|
62
74
|
return null;
|
|
63
75
|
}
|
|
@@ -67,18 +79,20 @@ async function validateToken(token, options) {
|
|
|
67
79
|
forceIssuer = process.env.FORCE_ISSUER || "",
|
|
68
80
|
jwksPath = "/api/auth/jwks"
|
|
69
81
|
} = options || {};
|
|
70
|
-
if (!baseUrl)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
if (!baseUrl) {
|
|
83
|
+
throw new Error(`No baseURL!`);
|
|
84
|
+
}
|
|
85
|
+
const normalizedBaseUrl = removeTrailingSlash(baseUrl);
|
|
86
|
+
const url = `${forceIssuer || normalizedBaseUrl}${jwksPath}`;
|
|
87
|
+
const JWKS = (0, import_jose.createRemoteJWKSet)(new URL(url));
|
|
74
88
|
try {
|
|
75
89
|
const verifyOptions = forceIssuer ? {} : {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
90
|
+
issuer: normalizedBaseUrl,
|
|
91
|
+
audience: normalizedBaseUrl
|
|
92
|
+
};
|
|
93
|
+
const {
|
|
94
|
+
payload
|
|
95
|
+
} = await (0, import_jose.jwtVerify)(token, JWKS, verifyOptions);
|
|
82
96
|
return payload;
|
|
83
97
|
} catch (error) {
|
|
84
98
|
throw new InvalidTokenError(`${error}`);
|
|
@@ -86,9 +100,10 @@ async function validateToken(token, options) {
|
|
|
86
100
|
}
|
|
87
101
|
async function isValidJWT(token, options) {
|
|
88
102
|
try {
|
|
89
|
-
|
|
103
|
+
await validateToken(token, options);
|
|
104
|
+
return true;
|
|
90
105
|
} catch {
|
|
91
|
-
return
|
|
106
|
+
return false;
|
|
92
107
|
}
|
|
93
108
|
}
|
|
94
109
|
function removeTrailingSlash(str) {
|
|
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var server_exports = {};
|
|
24
26
|
__export(server_exports, {
|
|
@@ -31,134 +33,174 @@ __export(server_exports, {
|
|
|
31
33
|
module.exports = __toCommonJS(server_exports);
|
|
32
34
|
var import_jose = require("jose");
|
|
33
35
|
function _assert_this_initialized(self) {
|
|
34
|
-
if (self === void 0)
|
|
36
|
+
if (self === void 0) {
|
|
37
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
38
|
+
}
|
|
35
39
|
return self;
|
|
36
40
|
}
|
|
37
41
|
function _call_super(_this, derived, args) {
|
|
38
|
-
|
|
42
|
+
derived = _get_prototype_of(derived);
|
|
43
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
39
44
|
}
|
|
40
45
|
function _class_call_check(instance, Constructor) {
|
|
41
|
-
if (!(instance instanceof Constructor))
|
|
46
|
+
if (!(instance instanceof Constructor)) {
|
|
47
|
+
throw new TypeError("Cannot call a class as a function");
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
function _construct(Parent, args, Class) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
if (_is_native_reflect_construct()) {
|
|
52
|
+
_construct = Reflect.construct;
|
|
53
|
+
} else {
|
|
54
|
+
_construct = function construct(Parent2, args2, Class2) {
|
|
55
|
+
var a = [null];
|
|
56
|
+
a.push.apply(a, args2);
|
|
57
|
+
var Constructor = Function.bind.apply(Parent2, a);
|
|
58
|
+
var instance = new Constructor();
|
|
59
|
+
if (Class2) _set_prototype_of(instance, Class2.prototype);
|
|
60
|
+
return instance;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return _construct.apply(null, arguments);
|
|
51
64
|
}
|
|
52
65
|
function _get_prototype_of(o) {
|
|
53
|
-
|
|
66
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
|
|
54
67
|
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
55
|
-
}
|
|
68
|
+
};
|
|
69
|
+
return _get_prototype_of(o);
|
|
56
70
|
}
|
|
57
71
|
function _inherits(subClass, superClass) {
|
|
58
|
-
if (typeof superClass
|
|
72
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
73
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
74
|
+
}
|
|
59
75
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
60
76
|
constructor: {
|
|
61
77
|
value: subClass,
|
|
62
|
-
writable:
|
|
63
|
-
configurable:
|
|
78
|
+
writable: true,
|
|
79
|
+
configurable: true
|
|
64
80
|
}
|
|
65
|
-
})
|
|
81
|
+
});
|
|
82
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
66
83
|
}
|
|
67
84
|
function _instanceof(left, right) {
|
|
68
|
-
|
|
85
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
86
|
+
return !!right[Symbol.hasInstance](left);
|
|
87
|
+
} else {
|
|
88
|
+
return left instanceof right;
|
|
89
|
+
}
|
|
69
90
|
}
|
|
70
91
|
function _is_native_function(fn) {
|
|
71
92
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
72
93
|
}
|
|
73
94
|
function _possible_constructor_return(self, call) {
|
|
74
|
-
|
|
95
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
96
|
+
return call;
|
|
97
|
+
}
|
|
98
|
+
return _assert_this_initialized(self);
|
|
75
99
|
}
|
|
76
100
|
function _set_prototype_of(o, p) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
|
|
102
|
+
o2.__proto__ = p2;
|
|
103
|
+
return o2;
|
|
104
|
+
};
|
|
105
|
+
return _set_prototype_of(o, p);
|
|
80
106
|
}
|
|
81
107
|
function _type_of(obj) {
|
|
82
108
|
"@swc/helpers - typeof";
|
|
83
109
|
|
|
84
|
-
return obj && typeof Symbol
|
|
110
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
85
111
|
}
|
|
86
112
|
function _wrap_native_super(Class) {
|
|
87
|
-
var _cache = typeof Map
|
|
88
|
-
|
|
113
|
+
var _cache = typeof Map === "function" ? /* @__PURE__ */new Map() : void 0;
|
|
114
|
+
_wrap_native_super = function wrapNativeSuper(Class2) {
|
|
89
115
|
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
90
|
-
if (typeof Class2
|
|
91
|
-
|
|
116
|
+
if (typeof Class2 !== "function") {
|
|
117
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
118
|
+
}
|
|
119
|
+
if (typeof _cache !== "undefined") {
|
|
92
120
|
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
93
121
|
_cache.set(Class2, Wrapper);
|
|
94
122
|
}
|
|
95
123
|
function Wrapper() {
|
|
96
124
|
return _construct(Class2, arguments, _get_prototype_of(this).constructor);
|
|
97
125
|
}
|
|
98
|
-
|
|
126
|
+
Wrapper.prototype = Object.create(Class2.prototype, {
|
|
99
127
|
constructor: {
|
|
100
128
|
value: Wrapper,
|
|
101
|
-
enumerable:
|
|
102
|
-
writable:
|
|
103
|
-
configurable:
|
|
129
|
+
enumerable: false,
|
|
130
|
+
writable: true,
|
|
131
|
+
configurable: true
|
|
104
132
|
}
|
|
105
|
-
})
|
|
106
|
-
|
|
133
|
+
});
|
|
134
|
+
return _set_prototype_of(Wrapper, Class2);
|
|
135
|
+
};
|
|
136
|
+
return _wrap_native_super(Class);
|
|
107
137
|
}
|
|
108
138
|
function _is_native_reflect_construct() {
|
|
109
139
|
try {
|
|
110
140
|
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
111
|
-
} catch {}
|
|
141
|
+
} catch (_) {}
|
|
112
142
|
return (_is_native_reflect_construct = function () {
|
|
113
143
|
return !!result;
|
|
114
144
|
})();
|
|
115
145
|
}
|
|
116
146
|
var NotAuthenticatedError = /* @__PURE__ */function (Error1) {
|
|
117
|
-
|
|
147
|
+
"use strict";
|
|
118
148
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
149
|
+
_inherits(NotAuthenticatedError2, Error1);
|
|
150
|
+
function NotAuthenticatedError2() {
|
|
151
|
+
_class_call_check(this, NotAuthenticatedError2);
|
|
152
|
+
return _call_super(this, NotAuthenticatedError2, arguments);
|
|
153
|
+
}
|
|
154
|
+
return NotAuthenticatedError2;
|
|
155
|
+
}(_wrap_native_super(Error));
|
|
156
|
+
var InvalidTokenError = /* @__PURE__ */function (Error1) {
|
|
157
|
+
"use strict";
|
|
127
158
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
159
|
+
_inherits(InvalidTokenError2, Error1);
|
|
160
|
+
function InvalidTokenError2() {
|
|
161
|
+
_class_call_check(this, InvalidTokenError2);
|
|
162
|
+
return _call_super(this, InvalidTokenError2, arguments);
|
|
163
|
+
}
|
|
164
|
+
return InvalidTokenError2;
|
|
165
|
+
}(_wrap_native_super(Error));
|
|
134
166
|
async function getAuthDataFromRequest(authServer, req, tokenOptions) {
|
|
135
|
-
var authHeader = req.headers.get("authorization")
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
167
|
+
var authHeader = req.headers.get("authorization");
|
|
168
|
+
var cookie = authHeader === null || authHeader === void 0 ? void 0 : authHeader.split("Bearer ")[1];
|
|
169
|
+
var newHeaders = new Headers(req.headers);
|
|
170
|
+
if (cookie) {
|
|
171
|
+
newHeaders.set("Cookie", cookie);
|
|
172
|
+
}
|
|
139
173
|
try {
|
|
140
174
|
var session = await authServer.api.getSession({
|
|
141
175
|
headers: newHeaders
|
|
142
176
|
});
|
|
143
|
-
if (session
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
177
|
+
if (session === null || session === void 0 ? void 0 : session.user) {
|
|
178
|
+
return {
|
|
179
|
+
id: session.user.id,
|
|
180
|
+
email: session.user.email || void 0,
|
|
181
|
+
role: session.user.role === "admin" ? "admin" : void 0
|
|
182
|
+
};
|
|
183
|
+
}
|
|
148
184
|
} catch (err) {
|
|
149
|
-
console.warn(
|
|
185
|
+
console.warn(`Error validating session`, err);
|
|
150
186
|
}
|
|
151
|
-
var jwtToken = authHeader
|
|
152
|
-
if (jwtToken)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
187
|
+
var jwtToken = authHeader === null || authHeader === void 0 ? void 0 : authHeader.replace("Bearer ", "");
|
|
188
|
+
if (jwtToken) {
|
|
189
|
+
try {
|
|
190
|
+
var payload = await validateToken(jwtToken, tokenOptions);
|
|
191
|
+
var userId = (payload === null || payload === void 0 ? void 0 : payload.id) || (payload === null || payload === void 0 ? void 0 : payload.sub);
|
|
192
|
+
if (userId) {
|
|
193
|
+
return {
|
|
194
|
+
id: userId,
|
|
195
|
+
email: payload.email,
|
|
196
|
+
role: payload.role === "admin" ? "admin" : void 0
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
} catch (err) {
|
|
200
|
+
if (!_instanceof(err, InvalidTokenError)) {
|
|
201
|
+
throw err;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
162
204
|
}
|
|
163
205
|
return null;
|
|
164
206
|
}
|
|
@@ -168,18 +210,20 @@ async function validateToken(token, options) {
|
|
|
168
210
|
forceIssuer = process.env.FORCE_ISSUER || "",
|
|
169
211
|
jwksPath = "/api/auth/jwks"
|
|
170
212
|
} = options || {};
|
|
171
|
-
if (!baseUrl)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
213
|
+
if (!baseUrl) {
|
|
214
|
+
throw new Error(`No baseURL!`);
|
|
215
|
+
}
|
|
216
|
+
var normalizedBaseUrl = removeTrailingSlash(baseUrl);
|
|
217
|
+
var url = `${forceIssuer || normalizedBaseUrl}${jwksPath}`;
|
|
218
|
+
var JWKS = (0, import_jose.createRemoteJWKSet)(new URL(url));
|
|
175
219
|
try {
|
|
176
220
|
var verifyOptions = forceIssuer ? {} : {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
221
|
+
issuer: normalizedBaseUrl,
|
|
222
|
+
audience: normalizedBaseUrl
|
|
223
|
+
};
|
|
224
|
+
var {
|
|
225
|
+
payload
|
|
226
|
+
} = await (0, import_jose.jwtVerify)(token, JWKS, verifyOptions);
|
|
183
227
|
return payload;
|
|
184
228
|
} catch (error) {
|
|
185
229
|
throw new InvalidTokenError(`${error}`);
|
|
@@ -187,9 +231,10 @@ async function validateToken(token, options) {
|
|
|
187
231
|
}
|
|
188
232
|
async function isValidJWT(token, options) {
|
|
189
233
|
try {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
234
|
+
await validateToken(token, options);
|
|
235
|
+
return true;
|
|
236
|
+
} catch (e) {
|
|
237
|
+
return false;
|
|
193
238
|
}
|
|
194
239
|
}
|
|
195
240
|
function removeTrailingSlash(str) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","server_exports","__export","InvalidTokenError","NotAuthenticatedError","getAuthDataFromRequest","isValidJWT","validateToken","module","exports","import_jose","require","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_construct","Parent","Class","Parent2","args2","Class2","a","push","Function","bind","_set_prototype_of","prototype","arguments","o","Object","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","writable","configurable","_instanceof","left","right","Symbol","hasInstance","_is_native_function","fn","toString","call","indexOf","_type_of","p","p2","obj"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","server_exports","__export","InvalidTokenError","NotAuthenticatedError","getAuthDataFromRequest","isValidJWT","validateToken","module","exports","import_jose","require","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_construct","Parent","Class","Parent2","args2","Class2","a","push","Function","bind","_set_prototype_of","prototype","arguments","o","Object","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","writable","configurable","_instanceof","left","right","Symbol","hasInstance","_is_native_function","fn","toString","call","indexOf","_type_of","p","p2","obj"],"sources":["../../src/server.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,qBAAA,EAAAA,CAAA,KAAAA,qBAAA;EAAAC,sBAAA,EAAAA,CAAA,KAAAA,sBAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAA;AAAA;AAMAC,MAAA,CAAAC,OAAA,GAAAb,YAA+D,CAAAK,cAAA;AAiBxD,IAAAS,WAAM,GAAAC,OAAA;AAAqC,SAAAC,yBAAAC,IAAA;EAC3C,IAAMA,IAAA;IAAiC,UAAAC,cAAA;EAiB9C;EAQE,OAAMD,IAAA;AACN;AAEA,SAAME,YAAaC,KAAI,EAAAC,OAAQ,EAAIC,IAAA;EACnCD,OAAI,GAAAE,iBAAQ,CAAAF,OAAA;EACV,OAAAG,4BAA+B,CAAAJ,KAAA,EAAAK,4BAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,OAAA,EAAAC,IAAA,QAAAC,iBAAA,CAAAH,KAAA,EAAAQ,WAAA,IAAAP,OAAA,CAAAQ,KAAA,CAAAT,KAAA,EAAAE,IAAA;AAAA;AAIjC,SAAIQ,kBAAAC,QAAA,EAAAC,WAAA;EACF,MAAAD,QAAM,YAAgBC,WAAW,GAAI;IACrC,M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