ortoni-report 2.0.6 → 2.0.7
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/changelog.md +16 -0
- package/dist/ortoni-report.d.ts +16 -4
- package/dist/ortoni-report.js +427 -240
- package/dist/ortoni-report.mjs +427 -240
- package/dist/style/main.css +92 -94
- package/dist/views/head.hbs +11 -0
- package/dist/views/main.hbs +482 -454
- package/dist/views/navbar.hbs +1 -1
- package/dist/views/project.hbs +1 -3
- package/dist/views/testIcons.hbs +1 -151
- package/dist/views/testStatus.hbs +1 -1
- package/package.json +4 -1
- package/readme.md +23 -20
- package/dist/types/reporterConfig.js +0 -2
- package/dist/types/testResults.js +0 -2
- package/dist/utils/expressServer.js +0 -33
- package/dist/utils/utils.js +0 -85
- package/dist/utils/webSocketHelper.js +0 -93
package/dist/ortoni-report.js
CHANGED
|
@@ -1197,13 +1197,13 @@ var require_ast = __commonJS({
|
|
|
1197
1197
|
helperExpression: function helperExpression(node) {
|
|
1198
1198
|
return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash);
|
|
1199
1199
|
},
|
|
1200
|
-
scopedId: function scopedId(
|
|
1201
|
-
return /^\.|this\b/.test(
|
|
1200
|
+
scopedId: function scopedId(path8) {
|
|
1201
|
+
return /^\.|this\b/.test(path8.original);
|
|
1202
1202
|
},
|
|
1203
1203
|
// an ID is simple if it only has one part, and that part is not
|
|
1204
1204
|
// `..` or `this`.
|
|
1205
|
-
simpleId: function simpleId(
|
|
1206
|
-
return
|
|
1205
|
+
simpleId: function simpleId(path8) {
|
|
1206
|
+
return path8.parts.length === 1 && !AST.helpers.scopedId(path8) && !path8.depth;
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
1209
|
};
|
|
@@ -2228,11 +2228,11 @@ var require_helpers2 = __commonJS({
|
|
|
2228
2228
|
}
|
|
2229
2229
|
var _exception = require_exception();
|
|
2230
2230
|
var _exception2 = _interopRequireDefault(_exception);
|
|
2231
|
-
function validateClose(
|
|
2231
|
+
function validateClose(open2, close) {
|
|
2232
2232
|
close = close.path ? close.path.original : close;
|
|
2233
|
-
if (
|
|
2234
|
-
var errorNode = { loc:
|
|
2235
|
-
throw new _exception2["default"](
|
|
2233
|
+
if (open2.path.original !== close) {
|
|
2234
|
+
var errorNode = { loc: open2.path.loc };
|
|
2235
|
+
throw new _exception2["default"](open2.path.original + " doesn't match " + close, errorNode);
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
2238
|
function SourceLocation(source, locInfo) {
|
|
@@ -2253,9 +2253,9 @@ var require_helpers2 = __commonJS({
|
|
|
2253
2253
|
return token;
|
|
2254
2254
|
}
|
|
2255
2255
|
}
|
|
2256
|
-
function stripFlags(
|
|
2256
|
+
function stripFlags(open2, close) {
|
|
2257
2257
|
return {
|
|
2258
|
-
open:
|
|
2258
|
+
open: open2.charAt(2) === "~",
|
|
2259
2259
|
close: close.charAt(close.length - 3) === "~"
|
|
2260
2260
|
};
|
|
2261
2261
|
}
|
|
@@ -2287,12 +2287,12 @@ var require_helpers2 = __commonJS({
|
|
|
2287
2287
|
loc
|
|
2288
2288
|
};
|
|
2289
2289
|
}
|
|
2290
|
-
function prepareMustache(
|
|
2291
|
-
var escapeFlag =
|
|
2292
|
-
var decorator = /\*/.test(
|
|
2290
|
+
function prepareMustache(path8, params, hash, open2, strip, locInfo) {
|
|
2291
|
+
var escapeFlag = open2.charAt(3) || open2.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&";
|
|
2292
|
+
var decorator = /\*/.test(open2);
|
|
2293
2293
|
return {
|
|
2294
2294
|
type: decorator ? "Decorator" : "MustacheStatement",
|
|
2295
|
-
path:
|
|
2295
|
+
path: path8,
|
|
2296
2296
|
params,
|
|
2297
2297
|
hash,
|
|
2298
2298
|
escaped,
|
|
@@ -2380,15 +2380,15 @@ var require_helpers2 = __commonJS({
|
|
|
2380
2380
|
loc
|
|
2381
2381
|
};
|
|
2382
2382
|
}
|
|
2383
|
-
function preparePartialBlock(
|
|
2384
|
-
validateClose(
|
|
2383
|
+
function preparePartialBlock(open2, program, close, locInfo) {
|
|
2384
|
+
validateClose(open2, close);
|
|
2385
2385
|
return {
|
|
2386
2386
|
type: "PartialBlockStatement",
|
|
2387
|
-
name:
|
|
2388
|
-
params:
|
|
2389
|
-
hash:
|
|
2387
|
+
name: open2.path,
|
|
2388
|
+
params: open2.params,
|
|
2389
|
+
hash: open2.hash,
|
|
2390
2390
|
program,
|
|
2391
|
-
openStrip:
|
|
2391
|
+
openStrip: open2.strip,
|
|
2392
2392
|
closeStrip: close && close.strip,
|
|
2393
2393
|
loc: this.locInfo(locInfo)
|
|
2394
2394
|
};
|
|
@@ -2563,9 +2563,9 @@ var require_compiler = __commonJS({
|
|
|
2563
2563
|
},
|
|
2564
2564
|
DecoratorBlock: function DecoratorBlock(decorator) {
|
|
2565
2565
|
var program = decorator.program && this.compileProgram(decorator.program);
|
|
2566
|
-
var params = this.setupFullMustacheParams(decorator, program, void 0),
|
|
2566
|
+
var params = this.setupFullMustacheParams(decorator, program, void 0), path8 = decorator.path;
|
|
2567
2567
|
this.useDecorators = true;
|
|
2568
|
-
this.opcode("registerDecorator", params.length,
|
|
2568
|
+
this.opcode("registerDecorator", params.length, path8.original);
|
|
2569
2569
|
},
|
|
2570
2570
|
PartialStatement: function PartialStatement(partial) {
|
|
2571
2571
|
this.usePartial = true;
|
|
@@ -2629,46 +2629,46 @@ var require_compiler = __commonJS({
|
|
|
2629
2629
|
}
|
|
2630
2630
|
},
|
|
2631
2631
|
ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
|
|
2632
|
-
var
|
|
2633
|
-
this.opcode("getContext",
|
|
2632
|
+
var path8 = sexpr.path, name = path8.parts[0], isBlock = program != null || inverse != null;
|
|
2633
|
+
this.opcode("getContext", path8.depth);
|
|
2634
2634
|
this.opcode("pushProgram", program);
|
|
2635
2635
|
this.opcode("pushProgram", inverse);
|
|
2636
|
-
|
|
2637
|
-
this.accept(
|
|
2636
|
+
path8.strict = true;
|
|
2637
|
+
this.accept(path8);
|
|
2638
2638
|
this.opcode("invokeAmbiguous", name, isBlock);
|
|
2639
2639
|
},
|
|
2640
2640
|
simpleSexpr: function simpleSexpr(sexpr) {
|
|
2641
|
-
var
|
|
2642
|
-
|
|
2643
|
-
this.accept(
|
|
2641
|
+
var path8 = sexpr.path;
|
|
2642
|
+
path8.strict = true;
|
|
2643
|
+
this.accept(path8);
|
|
2644
2644
|
this.opcode("resolvePossibleLambda");
|
|
2645
2645
|
},
|
|
2646
2646
|
helperSexpr: function helperSexpr(sexpr, program, inverse) {
|
|
2647
|
-
var params = this.setupFullMustacheParams(sexpr, program, inverse),
|
|
2647
|
+
var params = this.setupFullMustacheParams(sexpr, program, inverse), path8 = sexpr.path, name = path8.parts[0];
|
|
2648
2648
|
if (this.options.knownHelpers[name]) {
|
|
2649
2649
|
this.opcode("invokeKnownHelper", params.length, name);
|
|
2650
2650
|
} else if (this.options.knownHelpersOnly) {
|
|
2651
2651
|
throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
|
|
2652
2652
|
} else {
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
this.accept(
|
|
2656
|
-
this.opcode("invokeHelper", params.length,
|
|
2653
|
+
path8.strict = true;
|
|
2654
|
+
path8.falsy = true;
|
|
2655
|
+
this.accept(path8);
|
|
2656
|
+
this.opcode("invokeHelper", params.length, path8.original, _ast2["default"].helpers.simpleId(path8));
|
|
2657
2657
|
}
|
|
2658
2658
|
},
|
|
2659
|
-
PathExpression: function PathExpression(
|
|
2660
|
-
this.addDepth(
|
|
2661
|
-
this.opcode("getContext",
|
|
2662
|
-
var name =
|
|
2659
|
+
PathExpression: function PathExpression(path8) {
|
|
2660
|
+
this.addDepth(path8.depth);
|
|
2661
|
+
this.opcode("getContext", path8.depth);
|
|
2662
|
+
var name = path8.parts[0], scoped = _ast2["default"].helpers.scopedId(path8), blockParamId = !path8.depth && !scoped && this.blockParamIndex(name);
|
|
2663
2663
|
if (blockParamId) {
|
|
2664
|
-
this.opcode("lookupBlockParam", blockParamId,
|
|
2664
|
+
this.opcode("lookupBlockParam", blockParamId, path8.parts);
|
|
2665
2665
|
} else if (!name) {
|
|
2666
2666
|
this.opcode("pushContext");
|
|
2667
|
-
} else if (
|
|
2667
|
+
} else if (path8.data) {
|
|
2668
2668
|
this.options.data = true;
|
|
2669
|
-
this.opcode("lookupData",
|
|
2669
|
+
this.opcode("lookupData", path8.depth, path8.parts, path8.strict);
|
|
2670
2670
|
} else {
|
|
2671
|
-
this.opcode("lookupOnContext",
|
|
2671
|
+
this.opcode("lookupOnContext", path8.parts, path8.falsy, path8.strict, scoped);
|
|
2672
2672
|
}
|
|
2673
2673
|
},
|
|
2674
2674
|
StringLiteral: function StringLiteral(string) {
|
|
@@ -3019,16 +3019,16 @@ var require_util = __commonJS({
|
|
|
3019
3019
|
}
|
|
3020
3020
|
exports.urlGenerate = urlGenerate;
|
|
3021
3021
|
function normalize(aPath) {
|
|
3022
|
-
var
|
|
3022
|
+
var path8 = aPath;
|
|
3023
3023
|
var url = urlParse(aPath);
|
|
3024
3024
|
if (url) {
|
|
3025
3025
|
if (!url.path) {
|
|
3026
3026
|
return aPath;
|
|
3027
3027
|
}
|
|
3028
|
-
|
|
3028
|
+
path8 = url.path;
|
|
3029
3029
|
}
|
|
3030
|
-
var isAbsolute = exports.isAbsolute(
|
|
3031
|
-
var parts =
|
|
3030
|
+
var isAbsolute = exports.isAbsolute(path8);
|
|
3031
|
+
var parts = path8.split(/\/+/);
|
|
3032
3032
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
3033
3033
|
part = parts[i];
|
|
3034
3034
|
if (part === ".") {
|
|
@@ -3045,15 +3045,15 @@ var require_util = __commonJS({
|
|
|
3045
3045
|
}
|
|
3046
3046
|
}
|
|
3047
3047
|
}
|
|
3048
|
-
|
|
3049
|
-
if (
|
|
3050
|
-
|
|
3048
|
+
path8 = parts.join("/");
|
|
3049
|
+
if (path8 === "") {
|
|
3050
|
+
path8 = isAbsolute ? "/" : ".";
|
|
3051
3051
|
}
|
|
3052
3052
|
if (url) {
|
|
3053
|
-
url.path =
|
|
3053
|
+
url.path = path8;
|
|
3054
3054
|
return urlGenerate(url);
|
|
3055
3055
|
}
|
|
3056
|
-
return
|
|
3056
|
+
return path8;
|
|
3057
3057
|
}
|
|
3058
3058
|
exports.normalize = normalize;
|
|
3059
3059
|
function join(aRoot, aPath) {
|
|
@@ -5835,8 +5835,8 @@ var require_printer = __commonJS({
|
|
|
5835
5835
|
return this.accept(sexpr.path) + " " + params + hash;
|
|
5836
5836
|
};
|
|
5837
5837
|
PrintVisitor.prototype.PathExpression = function(id) {
|
|
5838
|
-
var
|
|
5839
|
-
return (id.data ? "@" : "") + "PATH:" +
|
|
5838
|
+
var path8 = id.parts.join("/");
|
|
5839
|
+
return (id.data ? "@" : "") + "PATH:" + path8;
|
|
5840
5840
|
};
|
|
5841
5841
|
PrintVisitor.prototype.StringLiteral = function(string) {
|
|
5842
5842
|
return '"' + string.value + '"';
|
|
@@ -20771,11 +20771,11 @@ var require_mime_types = __commonJS({
|
|
|
20771
20771
|
}
|
|
20772
20772
|
return exts[0];
|
|
20773
20773
|
}
|
|
20774
|
-
function lookup(
|
|
20775
|
-
if (!
|
|
20774
|
+
function lookup(path8) {
|
|
20775
|
+
if (!path8 || typeof path8 !== "string") {
|
|
20776
20776
|
return false;
|
|
20777
20777
|
}
|
|
20778
|
-
var extension2 = extname("x." +
|
|
20778
|
+
var extension2 = extname("x." + path8).toLowerCase().substr(1);
|
|
20779
20779
|
if (!extension2) {
|
|
20780
20780
|
return false;
|
|
20781
20781
|
}
|
|
@@ -23934,7 +23934,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
23934
23934
|
"node_modules/path-to-regexp/index.js"(exports, module2) {
|
|
23935
23935
|
module2.exports = pathToRegexp;
|
|
23936
23936
|
var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
|
|
23937
|
-
function pathToRegexp(
|
|
23937
|
+
function pathToRegexp(path8, keys, options) {
|
|
23938
23938
|
options = options || {};
|
|
23939
23939
|
keys = keys || [];
|
|
23940
23940
|
var strict = options.strict;
|
|
@@ -23948,8 +23948,8 @@ var require_path_to_regexp = __commonJS({
|
|
|
23948
23948
|
var pos = 0;
|
|
23949
23949
|
var backtrack = "";
|
|
23950
23950
|
var m;
|
|
23951
|
-
if (
|
|
23952
|
-
while (m = MATCHING_GROUP_REGEXP.exec(
|
|
23951
|
+
if (path8 instanceof RegExp) {
|
|
23952
|
+
while (m = MATCHING_GROUP_REGEXP.exec(path8.source)) {
|
|
23953
23953
|
if (m[0][0] === "\\")
|
|
23954
23954
|
continue;
|
|
23955
23955
|
keys.push({
|
|
@@ -23958,15 +23958,15 @@ var require_path_to_regexp = __commonJS({
|
|
|
23958
23958
|
offset: m.index
|
|
23959
23959
|
});
|
|
23960
23960
|
}
|
|
23961
|
-
return
|
|
23961
|
+
return path8;
|
|
23962
23962
|
}
|
|
23963
|
-
if (Array.isArray(
|
|
23964
|
-
|
|
23963
|
+
if (Array.isArray(path8)) {
|
|
23964
|
+
path8 = path8.map(function(value) {
|
|
23965
23965
|
return pathToRegexp(value, keys, options).source;
|
|
23966
23966
|
});
|
|
23967
|
-
return new RegExp(
|
|
23967
|
+
return new RegExp(path8.join("|"), flags);
|
|
23968
23968
|
}
|
|
23969
|
-
|
|
23969
|
+
path8 = path8.replace(
|
|
23970
23970
|
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
|
|
23971
23971
|
function(match, slash, format, key, capture, star, optional, offset) {
|
|
23972
23972
|
pos = offset + match.length;
|
|
@@ -23979,7 +23979,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
23979
23979
|
extraOffset += 1;
|
|
23980
23980
|
return "\\.";
|
|
23981
23981
|
}
|
|
23982
|
-
backtrack = slash || format ? "" :
|
|
23982
|
+
backtrack = slash || format ? "" : path8.slice(pos, offset);
|
|
23983
23983
|
if (match === "*") {
|
|
23984
23984
|
extraOffset += 3;
|
|
23985
23985
|
return "(.*)";
|
|
@@ -24005,7 +24005,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
24005
24005
|
return result;
|
|
24006
24006
|
}
|
|
24007
24007
|
);
|
|
24008
|
-
while (m = MATCHING_GROUP_REGEXP.exec(
|
|
24008
|
+
while (m = MATCHING_GROUP_REGEXP.exec(path8)) {
|
|
24009
24009
|
if (m[0][0] === "\\")
|
|
24010
24010
|
continue;
|
|
24011
24011
|
if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {
|
|
@@ -24018,13 +24018,13 @@ var require_path_to_regexp = __commonJS({
|
|
|
24018
24018
|
}
|
|
24019
24019
|
i++;
|
|
24020
24020
|
}
|
|
24021
|
-
|
|
24021
|
+
path8 += strict ? "" : path8[path8.length - 1] === "/" ? "?" : "/?";
|
|
24022
24022
|
if (end) {
|
|
24023
|
-
|
|
24024
|
-
} else if (
|
|
24025
|
-
|
|
24023
|
+
path8 += "$";
|
|
24024
|
+
} else if (path8[path8.length - 1] !== "/") {
|
|
24025
|
+
path8 += lookahead ? "(?=/|$)" : "(?:/|$)";
|
|
24026
24026
|
}
|
|
24027
|
-
return new RegExp("^" +
|
|
24027
|
+
return new RegExp("^" + path8, flags);
|
|
24028
24028
|
}
|
|
24029
24029
|
}
|
|
24030
24030
|
});
|
|
@@ -24037,19 +24037,19 @@ var require_layer = __commonJS({
|
|
|
24037
24037
|
var debug = require_src()("express:router:layer");
|
|
24038
24038
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
24039
24039
|
module2.exports = Layer;
|
|
24040
|
-
function Layer(
|
|
24040
|
+
function Layer(path8, options, fn) {
|
|
24041
24041
|
if (!(this instanceof Layer)) {
|
|
24042
|
-
return new Layer(
|
|
24042
|
+
return new Layer(path8, options, fn);
|
|
24043
24043
|
}
|
|
24044
|
-
debug("new %o",
|
|
24044
|
+
debug("new %o", path8);
|
|
24045
24045
|
var opts = options || {};
|
|
24046
24046
|
this.handle = fn;
|
|
24047
24047
|
this.name = fn.name || "<anonymous>";
|
|
24048
24048
|
this.params = void 0;
|
|
24049
24049
|
this.path = void 0;
|
|
24050
|
-
this.regexp = pathRegexp(
|
|
24051
|
-
this.regexp.fast_star =
|
|
24052
|
-
this.regexp.fast_slash =
|
|
24050
|
+
this.regexp = pathRegexp(path8, this.keys = [], opts);
|
|
24051
|
+
this.regexp.fast_star = path8 === "*";
|
|
24052
|
+
this.regexp.fast_slash = path8 === "/" && opts.end === false;
|
|
24053
24053
|
}
|
|
24054
24054
|
Layer.prototype.handle_error = function handle_error(error, req, res, next) {
|
|
24055
24055
|
var fn = this.handle;
|
|
@@ -24073,20 +24073,20 @@ var require_layer = __commonJS({
|
|
|
24073
24073
|
next(err);
|
|
24074
24074
|
}
|
|
24075
24075
|
};
|
|
24076
|
-
Layer.prototype.match = function match(
|
|
24076
|
+
Layer.prototype.match = function match(path8) {
|
|
24077
24077
|
var match2;
|
|
24078
|
-
if (
|
|
24078
|
+
if (path8 != null) {
|
|
24079
24079
|
if (this.regexp.fast_slash) {
|
|
24080
24080
|
this.params = {};
|
|
24081
24081
|
this.path = "";
|
|
24082
24082
|
return true;
|
|
24083
24083
|
}
|
|
24084
24084
|
if (this.regexp.fast_star) {
|
|
24085
|
-
this.params = { "0": decode_param(
|
|
24086
|
-
this.path =
|
|
24085
|
+
this.params = { "0": decode_param(path8) };
|
|
24086
|
+
this.path = path8;
|
|
24087
24087
|
return true;
|
|
24088
24088
|
}
|
|
24089
|
-
match2 = this.regexp.exec(
|
|
24089
|
+
match2 = this.regexp.exec(path8);
|
|
24090
24090
|
}
|
|
24091
24091
|
if (!match2) {
|
|
24092
24092
|
this.params = void 0;
|
|
@@ -24179,10 +24179,10 @@ var require_route = __commonJS({
|
|
|
24179
24179
|
var slice = Array.prototype.slice;
|
|
24180
24180
|
var toString = Object.prototype.toString;
|
|
24181
24181
|
module2.exports = Route;
|
|
24182
|
-
function Route(
|
|
24183
|
-
this.path =
|
|
24182
|
+
function Route(path8) {
|
|
24183
|
+
this.path = path8;
|
|
24184
24184
|
this.stack = [];
|
|
24185
|
-
debug("new %o",
|
|
24185
|
+
debug("new %o", path8);
|
|
24186
24186
|
this.methods = {};
|
|
24187
24187
|
}
|
|
24188
24188
|
Route.prototype._handles_method = function _handles_method(method) {
|
|
@@ -24395,8 +24395,8 @@ var require_router = __commonJS({
|
|
|
24395
24395
|
if (++sync > 100) {
|
|
24396
24396
|
return setImmediate(next, err);
|
|
24397
24397
|
}
|
|
24398
|
-
var
|
|
24399
|
-
if (
|
|
24398
|
+
var path8 = getPathname(req);
|
|
24399
|
+
if (path8 == null) {
|
|
24400
24400
|
return done(layerError);
|
|
24401
24401
|
}
|
|
24402
24402
|
var layer;
|
|
@@ -24404,7 +24404,7 @@ var require_router = __commonJS({
|
|
|
24404
24404
|
var route;
|
|
24405
24405
|
while (match !== true && idx < stack.length) {
|
|
24406
24406
|
layer = stack[idx++];
|
|
24407
|
-
match = matchLayer(layer,
|
|
24407
|
+
match = matchLayer(layer, path8);
|
|
24408
24408
|
route = layer.route;
|
|
24409
24409
|
if (typeof match !== "boolean") {
|
|
24410
24410
|
layerError = layerError || match;
|
|
@@ -24442,18 +24442,18 @@ var require_router = __commonJS({
|
|
|
24442
24442
|
} else if (route) {
|
|
24443
24443
|
layer.handle_request(req, res, next);
|
|
24444
24444
|
} else {
|
|
24445
|
-
trim_prefix(layer, layerError, layerPath,
|
|
24445
|
+
trim_prefix(layer, layerError, layerPath, path8);
|
|
24446
24446
|
}
|
|
24447
24447
|
sync = 0;
|
|
24448
24448
|
});
|
|
24449
24449
|
}
|
|
24450
|
-
function trim_prefix(layer, layerError, layerPath,
|
|
24450
|
+
function trim_prefix(layer, layerError, layerPath, path8) {
|
|
24451
24451
|
if (layerPath.length !== 0) {
|
|
24452
|
-
if (layerPath !==
|
|
24452
|
+
if (layerPath !== path8.slice(0, layerPath.length)) {
|
|
24453
24453
|
next(layerError);
|
|
24454
24454
|
return;
|
|
24455
24455
|
}
|
|
24456
|
-
var c =
|
|
24456
|
+
var c = path8[layerPath.length];
|
|
24457
24457
|
if (c && c !== "/" && c !== ".")
|
|
24458
24458
|
return next(layerError);
|
|
24459
24459
|
debug("trim prefix (%s) from url %s", layerPath, req.url);
|
|
@@ -24533,7 +24533,7 @@ var require_router = __commonJS({
|
|
|
24533
24533
|
};
|
|
24534
24534
|
proto.use = function use(fn) {
|
|
24535
24535
|
var offset = 0;
|
|
24536
|
-
var
|
|
24536
|
+
var path8 = "/";
|
|
24537
24537
|
if (typeof fn !== "function") {
|
|
24538
24538
|
var arg = fn;
|
|
24539
24539
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -24541,7 +24541,7 @@ var require_router = __commonJS({
|
|
|
24541
24541
|
}
|
|
24542
24542
|
if (typeof arg !== "function") {
|
|
24543
24543
|
offset = 1;
|
|
24544
|
-
|
|
24544
|
+
path8 = fn;
|
|
24545
24545
|
}
|
|
24546
24546
|
}
|
|
24547
24547
|
var callbacks = flatten(slice.call(arguments, offset));
|
|
@@ -24553,8 +24553,8 @@ var require_router = __commonJS({
|
|
|
24553
24553
|
if (typeof fn !== "function") {
|
|
24554
24554
|
throw new TypeError("Router.use() requires a middleware function but got a " + gettype(fn));
|
|
24555
24555
|
}
|
|
24556
|
-
debug("use %o %s",
|
|
24557
|
-
var layer = new Layer(
|
|
24556
|
+
debug("use %o %s", path8, fn.name || "<anonymous>");
|
|
24557
|
+
var layer = new Layer(path8, {
|
|
24558
24558
|
sensitive: this.caseSensitive,
|
|
24559
24559
|
strict: false,
|
|
24560
24560
|
end: false
|
|
@@ -24564,9 +24564,9 @@ var require_router = __commonJS({
|
|
|
24564
24564
|
}
|
|
24565
24565
|
return this;
|
|
24566
24566
|
};
|
|
24567
|
-
proto.route = function route(
|
|
24568
|
-
var route2 = new Route(
|
|
24569
|
-
var layer = new Layer(
|
|
24567
|
+
proto.route = function route(path8) {
|
|
24568
|
+
var route2 = new Route(path8);
|
|
24569
|
+
var layer = new Layer(path8, {
|
|
24570
24570
|
sensitive: this.caseSensitive,
|
|
24571
24571
|
strict: this.strict,
|
|
24572
24572
|
end: true
|
|
@@ -24576,8 +24576,8 @@ var require_router = __commonJS({
|
|
|
24576
24576
|
return route2;
|
|
24577
24577
|
};
|
|
24578
24578
|
methods.concat("all").forEach(function(method) {
|
|
24579
|
-
proto[method] = function(
|
|
24580
|
-
var route = this.route(
|
|
24579
|
+
proto[method] = function(path8) {
|
|
24580
|
+
var route = this.route(path8);
|
|
24581
24581
|
route[method].apply(route, slice.call(arguments, 1));
|
|
24582
24582
|
return this;
|
|
24583
24583
|
};
|
|
@@ -24613,9 +24613,9 @@ var require_router = __commonJS({
|
|
|
24613
24613
|
}
|
|
24614
24614
|
return toString.call(obj).replace(objectRegExp, "$1");
|
|
24615
24615
|
}
|
|
24616
|
-
function matchLayer(layer,
|
|
24616
|
+
function matchLayer(layer, path8) {
|
|
24617
24617
|
try {
|
|
24618
|
-
return layer.match(
|
|
24618
|
+
return layer.match(path8);
|
|
24619
24619
|
} catch (err) {
|
|
24620
24620
|
return err;
|
|
24621
24621
|
}
|
|
@@ -24734,13 +24734,13 @@ var require_view = __commonJS({
|
|
|
24734
24734
|
"node_modules/express/lib/view.js"(exports, module2) {
|
|
24735
24735
|
"use strict";
|
|
24736
24736
|
var debug = require_src()("express:view");
|
|
24737
|
-
var
|
|
24737
|
+
var path8 = require("path");
|
|
24738
24738
|
var fs4 = require("fs");
|
|
24739
|
-
var dirname =
|
|
24740
|
-
var basename =
|
|
24741
|
-
var extname =
|
|
24742
|
-
var join =
|
|
24743
|
-
var resolve =
|
|
24739
|
+
var dirname = path8.dirname;
|
|
24740
|
+
var basename = path8.basename;
|
|
24741
|
+
var extname = path8.extname;
|
|
24742
|
+
var join = path8.join;
|
|
24743
|
+
var resolve = path8.resolve;
|
|
24744
24744
|
module2.exports = View;
|
|
24745
24745
|
function View(name, options) {
|
|
24746
24746
|
var opts = options || {};
|
|
@@ -24769,17 +24769,17 @@ var require_view = __commonJS({
|
|
|
24769
24769
|
this.path = this.lookup(fileName);
|
|
24770
24770
|
}
|
|
24771
24771
|
View.prototype.lookup = function lookup(name) {
|
|
24772
|
-
var
|
|
24772
|
+
var path9;
|
|
24773
24773
|
var roots = [].concat(this.root);
|
|
24774
24774
|
debug('lookup "%s"', name);
|
|
24775
|
-
for (var i = 0; i < roots.length && !
|
|
24775
|
+
for (var i = 0; i < roots.length && !path9; i++) {
|
|
24776
24776
|
var root = roots[i];
|
|
24777
24777
|
var loc = resolve(root, name);
|
|
24778
24778
|
var dir = dirname(loc);
|
|
24779
24779
|
var file = basename(loc);
|
|
24780
|
-
|
|
24780
|
+
path9 = this.resolve(dir, file);
|
|
24781
24781
|
}
|
|
24782
|
-
return
|
|
24782
|
+
return path9;
|
|
24783
24783
|
};
|
|
24784
24784
|
View.prototype.render = function render(options, callback) {
|
|
24785
24785
|
debug('render "%s"', this.path);
|
|
@@ -24787,21 +24787,21 @@ var require_view = __commonJS({
|
|
|
24787
24787
|
};
|
|
24788
24788
|
View.prototype.resolve = function resolve2(dir, file) {
|
|
24789
24789
|
var ext = this.ext;
|
|
24790
|
-
var
|
|
24791
|
-
var stat = tryStat(
|
|
24790
|
+
var path9 = join(dir, file);
|
|
24791
|
+
var stat = tryStat(path9);
|
|
24792
24792
|
if (stat && stat.isFile()) {
|
|
24793
|
-
return
|
|
24793
|
+
return path9;
|
|
24794
24794
|
}
|
|
24795
|
-
|
|
24796
|
-
stat = tryStat(
|
|
24795
|
+
path9 = join(dir, basename(file, ext), "index" + ext);
|
|
24796
|
+
stat = tryStat(path9);
|
|
24797
24797
|
if (stat && stat.isFile()) {
|
|
24798
|
-
return
|
|
24798
|
+
return path9;
|
|
24799
24799
|
}
|
|
24800
24800
|
};
|
|
24801
|
-
function tryStat(
|
|
24802
|
-
debug('stat "%s"',
|
|
24801
|
+
function tryStat(path9) {
|
|
24802
|
+
debug('stat "%s"', path9);
|
|
24803
24803
|
try {
|
|
24804
|
-
return fs4.statSync(
|
|
24804
|
+
return fs4.statSync(path9);
|
|
24805
24805
|
} catch (e) {
|
|
24806
24806
|
return void 0;
|
|
24807
24807
|
}
|
|
@@ -25169,7 +25169,7 @@ var require_types = __commonJS({
|
|
|
25169
25169
|
// node_modules/mime/mime.js
|
|
25170
25170
|
var require_mime = __commonJS({
|
|
25171
25171
|
"node_modules/mime/mime.js"(exports, module2) {
|
|
25172
|
-
var
|
|
25172
|
+
var path8 = require("path");
|
|
25173
25173
|
var fs4 = require("fs");
|
|
25174
25174
|
function Mime() {
|
|
25175
25175
|
this.types = /* @__PURE__ */ Object.create(null);
|
|
@@ -25199,8 +25199,8 @@ var require_mime = __commonJS({
|
|
|
25199
25199
|
this.define(map);
|
|
25200
25200
|
this._loading = null;
|
|
25201
25201
|
};
|
|
25202
|
-
Mime.prototype.lookup = function(
|
|
25203
|
-
var ext =
|
|
25202
|
+
Mime.prototype.lookup = function(path9, fallback) {
|
|
25203
|
+
var ext = path9.replace(/^.*[\.\/\\]/, "").toLowerCase();
|
|
25204
25204
|
return this.types[ext] || fallback || this.default_type;
|
|
25205
25205
|
};
|
|
25206
25206
|
Mime.prototype.extension = function(mimeType) {
|
|
@@ -25434,28 +25434,28 @@ var require_send = __commonJS({
|
|
|
25434
25434
|
var ms = require_ms2();
|
|
25435
25435
|
var onFinished = require_on_finished();
|
|
25436
25436
|
var parseRange = require_range_parser();
|
|
25437
|
-
var
|
|
25437
|
+
var path8 = require("path");
|
|
25438
25438
|
var statuses = require_statuses();
|
|
25439
25439
|
var Stream = require("stream");
|
|
25440
25440
|
var util = require("util");
|
|
25441
|
-
var extname =
|
|
25442
|
-
var join =
|
|
25443
|
-
var normalize =
|
|
25444
|
-
var resolve =
|
|
25445
|
-
var sep =
|
|
25441
|
+
var extname = path8.extname;
|
|
25442
|
+
var join = path8.join;
|
|
25443
|
+
var normalize = path8.normalize;
|
|
25444
|
+
var resolve = path8.resolve;
|
|
25445
|
+
var sep = path8.sep;
|
|
25446
25446
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
25447
25447
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
25448
25448
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
25449
25449
|
module2.exports = send;
|
|
25450
25450
|
module2.exports.mime = mime;
|
|
25451
|
-
function send(req,
|
|
25452
|
-
return new SendStream(req,
|
|
25451
|
+
function send(req, path9, options) {
|
|
25452
|
+
return new SendStream(req, path9, options);
|
|
25453
25453
|
}
|
|
25454
|
-
function SendStream(req,
|
|
25454
|
+
function SendStream(req, path9, options) {
|
|
25455
25455
|
Stream.call(this);
|
|
25456
25456
|
var opts = options || {};
|
|
25457
25457
|
this.options = opts;
|
|
25458
|
-
this.path =
|
|
25458
|
+
this.path = path9;
|
|
25459
25459
|
this.req = req;
|
|
25460
25460
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
25461
25461
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -25501,8 +25501,8 @@ var require_send = __commonJS({
|
|
|
25501
25501
|
this._index = index2;
|
|
25502
25502
|
return this;
|
|
25503
25503
|
}, "send.index: pass index as option");
|
|
25504
|
-
SendStream.prototype.root = function root(
|
|
25505
|
-
this._root = resolve(String(
|
|
25504
|
+
SendStream.prototype.root = function root(path9) {
|
|
25505
|
+
this._root = resolve(String(path9));
|
|
25506
25506
|
debug("root %s", this._root);
|
|
25507
25507
|
return this;
|
|
25508
25508
|
};
|
|
@@ -25615,10 +25615,10 @@ var require_send = __commonJS({
|
|
|
25615
25615
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
25616
25616
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
25617
25617
|
};
|
|
25618
|
-
SendStream.prototype.redirect = function redirect(
|
|
25618
|
+
SendStream.prototype.redirect = function redirect(path9) {
|
|
25619
25619
|
var res = this.res;
|
|
25620
25620
|
if (hasListeners(this, "directory")) {
|
|
25621
|
-
this.emit("directory", res,
|
|
25621
|
+
this.emit("directory", res, path9);
|
|
25622
25622
|
return;
|
|
25623
25623
|
}
|
|
25624
25624
|
if (this.hasTrailingSlash()) {
|
|
@@ -25638,42 +25638,42 @@ var require_send = __commonJS({
|
|
|
25638
25638
|
SendStream.prototype.pipe = function pipe(res) {
|
|
25639
25639
|
var root = this._root;
|
|
25640
25640
|
this.res = res;
|
|
25641
|
-
var
|
|
25642
|
-
if (
|
|
25641
|
+
var path9 = decode(this.path);
|
|
25642
|
+
if (path9 === -1) {
|
|
25643
25643
|
this.error(400);
|
|
25644
25644
|
return res;
|
|
25645
25645
|
}
|
|
25646
|
-
if (~
|
|
25646
|
+
if (~path9.indexOf("\0")) {
|
|
25647
25647
|
this.error(400);
|
|
25648
25648
|
return res;
|
|
25649
25649
|
}
|
|
25650
25650
|
var parts;
|
|
25651
25651
|
if (root !== null) {
|
|
25652
|
-
if (
|
|
25653
|
-
|
|
25652
|
+
if (path9) {
|
|
25653
|
+
path9 = normalize("." + sep + path9);
|
|
25654
25654
|
}
|
|
25655
|
-
if (UP_PATH_REGEXP.test(
|
|
25656
|
-
debug('malicious path "%s"',
|
|
25655
|
+
if (UP_PATH_REGEXP.test(path9)) {
|
|
25656
|
+
debug('malicious path "%s"', path9);
|
|
25657
25657
|
this.error(403);
|
|
25658
25658
|
return res;
|
|
25659
25659
|
}
|
|
25660
|
-
parts =
|
|
25661
|
-
|
|
25660
|
+
parts = path9.split(sep);
|
|
25661
|
+
path9 = normalize(join(root, path9));
|
|
25662
25662
|
} else {
|
|
25663
|
-
if (UP_PATH_REGEXP.test(
|
|
25664
|
-
debug('malicious path "%s"',
|
|
25663
|
+
if (UP_PATH_REGEXP.test(path9)) {
|
|
25664
|
+
debug('malicious path "%s"', path9);
|
|
25665
25665
|
this.error(403);
|
|
25666
25666
|
return res;
|
|
25667
25667
|
}
|
|
25668
|
-
parts = normalize(
|
|
25669
|
-
|
|
25668
|
+
parts = normalize(path9).split(sep);
|
|
25669
|
+
path9 = resolve(path9);
|
|
25670
25670
|
}
|
|
25671
25671
|
if (containsDotFile(parts)) {
|
|
25672
25672
|
var access = this._dotfiles;
|
|
25673
25673
|
if (access === void 0) {
|
|
25674
25674
|
access = parts[parts.length - 1][0] === "." ? this._hidden ? "allow" : "ignore" : "allow";
|
|
25675
25675
|
}
|
|
25676
|
-
debug('%s dotfile "%s"', access,
|
|
25676
|
+
debug('%s dotfile "%s"', access, path9);
|
|
25677
25677
|
switch (access) {
|
|
25678
25678
|
case "allow":
|
|
25679
25679
|
break;
|
|
@@ -25687,13 +25687,13 @@ var require_send = __commonJS({
|
|
|
25687
25687
|
}
|
|
25688
25688
|
}
|
|
25689
25689
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
25690
|
-
this.sendIndex(
|
|
25690
|
+
this.sendIndex(path9);
|
|
25691
25691
|
return res;
|
|
25692
25692
|
}
|
|
25693
|
-
this.sendFile(
|
|
25693
|
+
this.sendFile(path9);
|
|
25694
25694
|
return res;
|
|
25695
25695
|
};
|
|
25696
|
-
SendStream.prototype.send = function send2(
|
|
25696
|
+
SendStream.prototype.send = function send2(path9, stat) {
|
|
25697
25697
|
var len = stat.size;
|
|
25698
25698
|
var options = this.options;
|
|
25699
25699
|
var opts = {};
|
|
@@ -25705,9 +25705,9 @@ var require_send = __commonJS({
|
|
|
25705
25705
|
this.headersAlreadySent();
|
|
25706
25706
|
return;
|
|
25707
25707
|
}
|
|
25708
|
-
debug('pipe "%s"',
|
|
25709
|
-
this.setHeader(
|
|
25710
|
-
this.type(
|
|
25708
|
+
debug('pipe "%s"', path9);
|
|
25709
|
+
this.setHeader(path9, stat);
|
|
25710
|
+
this.type(path9);
|
|
25711
25711
|
if (this.isConditionalGET()) {
|
|
25712
25712
|
if (this.isPreconditionFailure()) {
|
|
25713
25713
|
this.error(412);
|
|
@@ -25757,28 +25757,28 @@ var require_send = __commonJS({
|
|
|
25757
25757
|
res.end();
|
|
25758
25758
|
return;
|
|
25759
25759
|
}
|
|
25760
|
-
this.stream(
|
|
25760
|
+
this.stream(path9, opts);
|
|
25761
25761
|
};
|
|
25762
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
25762
|
+
SendStream.prototype.sendFile = function sendFile(path9) {
|
|
25763
25763
|
var i = 0;
|
|
25764
25764
|
var self = this;
|
|
25765
|
-
debug('stat "%s"',
|
|
25766
|
-
fs4.stat(
|
|
25767
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
25765
|
+
debug('stat "%s"', path9);
|
|
25766
|
+
fs4.stat(path9, function onstat(err, stat) {
|
|
25767
|
+
if (err && err.code === "ENOENT" && !extname(path9) && path9[path9.length - 1] !== sep) {
|
|
25768
25768
|
return next(err);
|
|
25769
25769
|
}
|
|
25770
25770
|
if (err)
|
|
25771
25771
|
return self.onStatError(err);
|
|
25772
25772
|
if (stat.isDirectory())
|
|
25773
|
-
return self.redirect(
|
|
25774
|
-
self.emit("file",
|
|
25775
|
-
self.send(
|
|
25773
|
+
return self.redirect(path9);
|
|
25774
|
+
self.emit("file", path9, stat);
|
|
25775
|
+
self.send(path9, stat);
|
|
25776
25776
|
});
|
|
25777
25777
|
function next(err) {
|
|
25778
25778
|
if (self._extensions.length <= i) {
|
|
25779
25779
|
return err ? self.onStatError(err) : self.error(404);
|
|
25780
25780
|
}
|
|
25781
|
-
var p =
|
|
25781
|
+
var p = path9 + "." + self._extensions[i++];
|
|
25782
25782
|
debug('stat "%s"', p);
|
|
25783
25783
|
fs4.stat(p, function(err2, stat) {
|
|
25784
25784
|
if (err2)
|
|
@@ -25790,7 +25790,7 @@ var require_send = __commonJS({
|
|
|
25790
25790
|
});
|
|
25791
25791
|
}
|
|
25792
25792
|
};
|
|
25793
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
25793
|
+
SendStream.prototype.sendIndex = function sendIndex(path9) {
|
|
25794
25794
|
var i = -1;
|
|
25795
25795
|
var self = this;
|
|
25796
25796
|
function next(err) {
|
|
@@ -25799,7 +25799,7 @@ var require_send = __commonJS({
|
|
|
25799
25799
|
return self.onStatError(err);
|
|
25800
25800
|
return self.error(404);
|
|
25801
25801
|
}
|
|
25802
|
-
var p = join(
|
|
25802
|
+
var p = join(path9, self._index[i]);
|
|
25803
25803
|
debug('stat "%s"', p);
|
|
25804
25804
|
fs4.stat(p, function(err2, stat) {
|
|
25805
25805
|
if (err2)
|
|
@@ -25812,10 +25812,10 @@ var require_send = __commonJS({
|
|
|
25812
25812
|
}
|
|
25813
25813
|
next();
|
|
25814
25814
|
};
|
|
25815
|
-
SendStream.prototype.stream = function stream(
|
|
25815
|
+
SendStream.prototype.stream = function stream(path9, options) {
|
|
25816
25816
|
var self = this;
|
|
25817
25817
|
var res = this.res;
|
|
25818
|
-
var stream2 = fs4.createReadStream(
|
|
25818
|
+
var stream2 = fs4.createReadStream(path9, options);
|
|
25819
25819
|
this.emit("stream", stream2);
|
|
25820
25820
|
stream2.pipe(res);
|
|
25821
25821
|
function cleanup() {
|
|
@@ -25830,11 +25830,11 @@ var require_send = __commonJS({
|
|
|
25830
25830
|
self.emit("end");
|
|
25831
25831
|
});
|
|
25832
25832
|
};
|
|
25833
|
-
SendStream.prototype.type = function type(
|
|
25833
|
+
SendStream.prototype.type = function type(path9) {
|
|
25834
25834
|
var res = this.res;
|
|
25835
25835
|
if (res.getHeader("Content-Type"))
|
|
25836
25836
|
return;
|
|
25837
|
-
var type2 = mime.lookup(
|
|
25837
|
+
var type2 = mime.lookup(path9);
|
|
25838
25838
|
if (!type2) {
|
|
25839
25839
|
debug("no content-type");
|
|
25840
25840
|
return;
|
|
@@ -25843,9 +25843,9 @@ var require_send = __commonJS({
|
|
|
25843
25843
|
debug("content-type %s", type2);
|
|
25844
25844
|
res.setHeader("Content-Type", type2 + (charset ? "; charset=" + charset : ""));
|
|
25845
25845
|
};
|
|
25846
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
25846
|
+
SendStream.prototype.setHeader = function setHeader(path9, stat) {
|
|
25847
25847
|
var res = this.res;
|
|
25848
|
-
this.emit("headers", res,
|
|
25848
|
+
this.emit("headers", res, path9, stat);
|
|
25849
25849
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
25850
25850
|
debug("accept ranges");
|
|
25851
25851
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -25904,9 +25904,9 @@ var require_send = __commonJS({
|
|
|
25904
25904
|
}
|
|
25905
25905
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
25906
25906
|
}
|
|
25907
|
-
function decode(
|
|
25907
|
+
function decode(path9) {
|
|
25908
25908
|
try {
|
|
25909
|
-
return decodeURIComponent(
|
|
25909
|
+
return decodeURIComponent(path9);
|
|
25910
25910
|
} catch (err) {
|
|
25911
25911
|
return -1;
|
|
25912
25912
|
}
|
|
@@ -26818,12 +26818,12 @@ var require_utils3 = __commonJS({
|
|
|
26818
26818
|
var querystring = require("querystring");
|
|
26819
26819
|
exports.etag = createETagGenerator({ weak: false });
|
|
26820
26820
|
exports.wetag = createETagGenerator({ weak: true });
|
|
26821
|
-
exports.isAbsolute = function(
|
|
26822
|
-
if ("/" ===
|
|
26821
|
+
exports.isAbsolute = function(path8) {
|
|
26822
|
+
if ("/" === path8[0])
|
|
26823
26823
|
return true;
|
|
26824
|
-
if (":" ===
|
|
26824
|
+
if (":" === path8[1] && ("\\" === path8[2] || "/" === path8[2]))
|
|
26825
26825
|
return true;
|
|
26826
|
-
if ("\\\\" ===
|
|
26826
|
+
if ("\\\\" === path8.substring(0, 2))
|
|
26827
26827
|
return true;
|
|
26828
26828
|
};
|
|
26829
26829
|
exports.flatten = deprecate.function(
|
|
@@ -27036,7 +27036,7 @@ var require_application = __commonJS({
|
|
|
27036
27036
|
};
|
|
27037
27037
|
app.use = function use(fn) {
|
|
27038
27038
|
var offset = 0;
|
|
27039
|
-
var
|
|
27039
|
+
var path8 = "/";
|
|
27040
27040
|
if (typeof fn !== "function") {
|
|
27041
27041
|
var arg = fn;
|
|
27042
27042
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -27044,7 +27044,7 @@ var require_application = __commonJS({
|
|
|
27044
27044
|
}
|
|
27045
27045
|
if (typeof arg !== "function") {
|
|
27046
27046
|
offset = 1;
|
|
27047
|
-
|
|
27047
|
+
path8 = fn;
|
|
27048
27048
|
}
|
|
27049
27049
|
}
|
|
27050
27050
|
var fns = flatten(slice.call(arguments, offset));
|
|
@@ -27055,12 +27055,12 @@ var require_application = __commonJS({
|
|
|
27055
27055
|
var router = this._router;
|
|
27056
27056
|
fns.forEach(function(fn2) {
|
|
27057
27057
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
27058
|
-
return router.use(
|
|
27058
|
+
return router.use(path8, fn2);
|
|
27059
27059
|
}
|
|
27060
|
-
debug(".use app under %s",
|
|
27061
|
-
fn2.mountpath =
|
|
27060
|
+
debug(".use app under %s", path8);
|
|
27061
|
+
fn2.mountpath = path8;
|
|
27062
27062
|
fn2.parent = this;
|
|
27063
|
-
router.use(
|
|
27063
|
+
router.use(path8, function mounted_app(req, res, next) {
|
|
27064
27064
|
var orig = req.app;
|
|
27065
27065
|
fn2.handle(req, res, function(err) {
|
|
27066
27066
|
setPrototypeOf(req, orig.request);
|
|
@@ -27072,9 +27072,9 @@ var require_application = __commonJS({
|
|
|
27072
27072
|
}, this);
|
|
27073
27073
|
return this;
|
|
27074
27074
|
};
|
|
27075
|
-
app.route = function route(
|
|
27075
|
+
app.route = function route(path8) {
|
|
27076
27076
|
this.lazyrouter();
|
|
27077
|
-
return this._router.route(
|
|
27077
|
+
return this._router.route(path8);
|
|
27078
27078
|
};
|
|
27079
27079
|
app.engine = function engine(ext, fn) {
|
|
27080
27080
|
if (typeof fn !== "function") {
|
|
@@ -27125,7 +27125,7 @@ var require_application = __commonJS({
|
|
|
27125
27125
|
}
|
|
27126
27126
|
return this;
|
|
27127
27127
|
};
|
|
27128
|
-
app.path = function
|
|
27128
|
+
app.path = function path8() {
|
|
27129
27129
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
27130
27130
|
};
|
|
27131
27131
|
app.enabled = function enabled(setting) {
|
|
@@ -27141,19 +27141,19 @@ var require_application = __commonJS({
|
|
|
27141
27141
|
return this.set(setting, false);
|
|
27142
27142
|
};
|
|
27143
27143
|
methods.forEach(function(method) {
|
|
27144
|
-
app[method] = function(
|
|
27144
|
+
app[method] = function(path8) {
|
|
27145
27145
|
if (method === "get" && arguments.length === 1) {
|
|
27146
|
-
return this.set(
|
|
27146
|
+
return this.set(path8);
|
|
27147
27147
|
}
|
|
27148
27148
|
this.lazyrouter();
|
|
27149
|
-
var route = this._router.route(
|
|
27149
|
+
var route = this._router.route(path8);
|
|
27150
27150
|
route[method].apply(route, slice.call(arguments, 1));
|
|
27151
27151
|
return this;
|
|
27152
27152
|
};
|
|
27153
27153
|
});
|
|
27154
|
-
app.all = function all(
|
|
27154
|
+
app.all = function all(path8) {
|
|
27155
27155
|
this.lazyrouter();
|
|
27156
|
-
var route = this._router.route(
|
|
27156
|
+
var route = this._router.route(path8);
|
|
27157
27157
|
var args = slice.call(arguments, 1);
|
|
27158
27158
|
for (var i = 0; i < methods.length; i++) {
|
|
27159
27159
|
route[methods[i]].apply(route, args);
|
|
@@ -27925,7 +27925,7 @@ var require_request = __commonJS({
|
|
|
27925
27925
|
var subdomains2 = !isIP(hostname) ? hostname.split(".").reverse() : [hostname];
|
|
27926
27926
|
return subdomains2.slice(offset);
|
|
27927
27927
|
});
|
|
27928
|
-
defineGetter(req, "path", function
|
|
27928
|
+
defineGetter(req, "path", function path8() {
|
|
27929
27929
|
return parse(this).pathname;
|
|
27930
27930
|
});
|
|
27931
27931
|
defineGetter(req, "hostname", function hostname() {
|
|
@@ -28257,7 +28257,7 @@ var require_response = __commonJS({
|
|
|
28257
28257
|
var http = require("http");
|
|
28258
28258
|
var isAbsolute = require_utils3().isAbsolute;
|
|
28259
28259
|
var onFinished = require_on_finished();
|
|
28260
|
-
var
|
|
28260
|
+
var path8 = require("path");
|
|
28261
28261
|
var statuses = require_statuses();
|
|
28262
28262
|
var merge = require_utils_merge();
|
|
28263
28263
|
var sign = require_cookie_signature().sign;
|
|
@@ -28266,9 +28266,9 @@ var require_response = __commonJS({
|
|
|
28266
28266
|
var setCharset = require_utils3().setCharset;
|
|
28267
28267
|
var cookie = require_cookie();
|
|
28268
28268
|
var send = require_send();
|
|
28269
|
-
var extname =
|
|
28269
|
+
var extname = path8.extname;
|
|
28270
28270
|
var mime = send.mime;
|
|
28271
|
-
var resolve =
|
|
28271
|
+
var resolve = path8.resolve;
|
|
28272
28272
|
var vary = require_vary();
|
|
28273
28273
|
var res = Object.create(http.ServerResponse.prototype);
|
|
28274
28274
|
module2.exports = res;
|
|
@@ -28446,26 +28446,26 @@ var require_response = __commonJS({
|
|
|
28446
28446
|
this.type("txt");
|
|
28447
28447
|
return this.send(body);
|
|
28448
28448
|
};
|
|
28449
|
-
res.sendFile = function sendFile(
|
|
28449
|
+
res.sendFile = function sendFile(path9, options, callback) {
|
|
28450
28450
|
var done = callback;
|
|
28451
28451
|
var req = this.req;
|
|
28452
28452
|
var res2 = this;
|
|
28453
28453
|
var next = req.next;
|
|
28454
28454
|
var opts = options || {};
|
|
28455
|
-
if (!
|
|
28455
|
+
if (!path9) {
|
|
28456
28456
|
throw new TypeError("path argument is required to res.sendFile");
|
|
28457
28457
|
}
|
|
28458
|
-
if (typeof
|
|
28458
|
+
if (typeof path9 !== "string") {
|
|
28459
28459
|
throw new TypeError("path must be a string to res.sendFile");
|
|
28460
28460
|
}
|
|
28461
28461
|
if (typeof options === "function") {
|
|
28462
28462
|
done = options;
|
|
28463
28463
|
opts = {};
|
|
28464
28464
|
}
|
|
28465
|
-
if (!opts.root && !isAbsolute(
|
|
28465
|
+
if (!opts.root && !isAbsolute(path9)) {
|
|
28466
28466
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
28467
28467
|
}
|
|
28468
|
-
var pathname = encodeURI(
|
|
28468
|
+
var pathname = encodeURI(path9);
|
|
28469
28469
|
var file = send(req, pathname, opts);
|
|
28470
28470
|
sendfile(res2, file, opts, function(err) {
|
|
28471
28471
|
if (done)
|
|
@@ -28477,7 +28477,7 @@ var require_response = __commonJS({
|
|
|
28477
28477
|
}
|
|
28478
28478
|
});
|
|
28479
28479
|
};
|
|
28480
|
-
res.sendfile = function(
|
|
28480
|
+
res.sendfile = function(path9, options, callback) {
|
|
28481
28481
|
var done = callback;
|
|
28482
28482
|
var req = this.req;
|
|
28483
28483
|
var res2 = this;
|
|
@@ -28487,7 +28487,7 @@ var require_response = __commonJS({
|
|
|
28487
28487
|
done = options;
|
|
28488
28488
|
opts = {};
|
|
28489
28489
|
}
|
|
28490
|
-
var file = send(req,
|
|
28490
|
+
var file = send(req, path9, opts);
|
|
28491
28491
|
sendfile(res2, file, opts, function(err) {
|
|
28492
28492
|
if (done)
|
|
28493
28493
|
return done(err);
|
|
@@ -28502,7 +28502,7 @@ var require_response = __commonJS({
|
|
|
28502
28502
|
res.sendfile,
|
|
28503
28503
|
"res.sendfile: Use res.sendFile instead"
|
|
28504
28504
|
);
|
|
28505
|
-
res.download = function download(
|
|
28505
|
+
res.download = function download(path9, filename, options, callback) {
|
|
28506
28506
|
var done = callback;
|
|
28507
28507
|
var name = filename;
|
|
28508
28508
|
var opts = options || null;
|
|
@@ -28519,7 +28519,7 @@ var require_response = __commonJS({
|
|
|
28519
28519
|
opts = filename;
|
|
28520
28520
|
}
|
|
28521
28521
|
var headers = {
|
|
28522
|
-
"Content-Disposition": contentDisposition(name ||
|
|
28522
|
+
"Content-Disposition": contentDisposition(name || path9)
|
|
28523
28523
|
};
|
|
28524
28524
|
if (opts && opts.headers) {
|
|
28525
28525
|
var keys = Object.keys(opts.headers);
|
|
@@ -28532,7 +28532,7 @@ var require_response = __commonJS({
|
|
|
28532
28532
|
}
|
|
28533
28533
|
opts = Object.create(opts);
|
|
28534
28534
|
opts.headers = headers;
|
|
28535
|
-
var fullPath = !opts.root ? resolve(
|
|
28535
|
+
var fullPath = !opts.root ? resolve(path9) : path9;
|
|
28536
28536
|
return this.sendFile(fullPath, opts, done);
|
|
28537
28537
|
};
|
|
28538
28538
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -28842,11 +28842,11 @@ var require_serve_static = __commonJS({
|
|
|
28842
28842
|
}
|
|
28843
28843
|
var forwardError = !fallthrough;
|
|
28844
28844
|
var originalUrl = parseUrl.original(req);
|
|
28845
|
-
var
|
|
28846
|
-
if (
|
|
28847
|
-
|
|
28845
|
+
var path8 = parseUrl(req).pathname;
|
|
28846
|
+
if (path8 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
28847
|
+
path8 = "";
|
|
28848
28848
|
}
|
|
28849
|
-
var stream = send(req,
|
|
28849
|
+
var stream = send(req, path8, opts);
|
|
28850
28850
|
stream.on("directory", onDirectory);
|
|
28851
28851
|
if (setHeaders) {
|
|
28852
28852
|
stream.on("headers", setHeaders);
|
|
@@ -29041,20 +29041,22 @@ var import_path3 = __toESM(require("path"));
|
|
|
29041
29041
|
function groupResults(config, results) {
|
|
29042
29042
|
if (config.showProject) {
|
|
29043
29043
|
const groupedResults = results.reduce((acc, result, index) => {
|
|
29044
|
+
const testId = `${result.filePath}:${result.projectName}:${result.title}`;
|
|
29044
29045
|
const { filePath, suite, projectName } = result;
|
|
29045
29046
|
acc[filePath] = acc[filePath] || {};
|
|
29046
29047
|
acc[filePath][suite] = acc[filePath][suite] || {};
|
|
29047
29048
|
acc[filePath][suite][projectName] = acc[filePath][suite][projectName] || [];
|
|
29048
|
-
acc[filePath][suite][projectName].push({ ...result, index });
|
|
29049
|
+
acc[filePath][suite][projectName].push({ ...result, index, testId });
|
|
29049
29050
|
return acc;
|
|
29050
29051
|
}, {});
|
|
29051
29052
|
return groupedResults;
|
|
29052
29053
|
} else {
|
|
29053
29054
|
const groupedResults = results.reduce((acc, result, index) => {
|
|
29055
|
+
const testId = `${result.filePath}:${result.projectName}:${result.title}`;
|
|
29054
29056
|
const { filePath, suite } = result;
|
|
29055
29057
|
acc[filePath] = acc[filePath] || {};
|
|
29056
29058
|
acc[filePath][suite] = acc[filePath][suite] || [];
|
|
29057
|
-
acc[filePath][suite].push({ ...result, index });
|
|
29059
|
+
acc[filePath][suite].push({ ...result, index, testId });
|
|
29058
29060
|
return acc;
|
|
29059
29061
|
}, {});
|
|
29060
29062
|
return groupedResults;
|
|
@@ -29132,23 +29134,41 @@ function escapeHtml(unsafe) {
|
|
|
29132
29134
|
return escapeMap[match] || match;
|
|
29133
29135
|
});
|
|
29134
29136
|
}
|
|
29137
|
+
function formatDateUTC(date) {
|
|
29138
|
+
return date.toISOString();
|
|
29139
|
+
}
|
|
29140
|
+
function formatDateLocal(isoString) {
|
|
29141
|
+
const date = new Date(isoString);
|
|
29142
|
+
const options = {
|
|
29143
|
+
year: "numeric",
|
|
29144
|
+
month: "short",
|
|
29145
|
+
day: "2-digit",
|
|
29146
|
+
hour: "2-digit",
|
|
29147
|
+
minute: "2-digit",
|
|
29148
|
+
// second: '2-digit',
|
|
29149
|
+
hour12: true,
|
|
29150
|
+
timeZoneName: "short"
|
|
29151
|
+
};
|
|
29152
|
+
return new Intl.DateTimeFormat(void 0, options).format(date);
|
|
29153
|
+
}
|
|
29135
29154
|
|
|
29136
29155
|
// src/helpers/HTMLGenerator.ts
|
|
29137
29156
|
var import_fs2 = __toESM(require("fs"));
|
|
29138
29157
|
var import_handlebars = __toESM(require_lib());
|
|
29139
29158
|
var HTMLGenerator = class {
|
|
29140
|
-
constructor(ortoniConfig) {
|
|
29159
|
+
constructor(ortoniConfig, dbManager) {
|
|
29141
29160
|
this.ortoniConfig = ortoniConfig;
|
|
29142
29161
|
this.registerHandlebarsHelpers();
|
|
29143
29162
|
this.registerPartials();
|
|
29163
|
+
this.dbManager = dbManager;
|
|
29144
29164
|
}
|
|
29145
|
-
generateHTML(filteredResults, totalDuration, cssContent, results, projectSet) {
|
|
29146
|
-
const data = this.prepareReportData(filteredResults, totalDuration, results, projectSet);
|
|
29165
|
+
async generateHTML(filteredResults, totalDuration, cssContent, results, projectSet) {
|
|
29166
|
+
const data = await this.prepareReportData(filteredResults, totalDuration, results, projectSet);
|
|
29147
29167
|
const templateSource = import_fs2.default.readFileSync(import_path3.default.resolve(__dirname, "views", "main.hbs"), "utf-8");
|
|
29148
29168
|
const template = import_handlebars.default.compile(templateSource);
|
|
29149
29169
|
return template({ ...data, inlineCss: cssContent });
|
|
29150
29170
|
}
|
|
29151
|
-
prepareReportData(filteredResults, totalDuration, results, projectSet) {
|
|
29171
|
+
async prepareReportData(filteredResults, totalDuration, results, projectSet) {
|
|
29152
29172
|
const totalTests = filteredResults.length;
|
|
29153
29173
|
const passedTests = results.filter((r) => r.status === "passed").length;
|
|
29154
29174
|
const flakyTests = results.filter((r) => r.flaky === "flaky").length;
|
|
@@ -29157,7 +29177,20 @@ var HTMLGenerator = class {
|
|
|
29157
29177
|
const allTags = /* @__PURE__ */ new Set();
|
|
29158
29178
|
results.forEach((result) => result.testTags.forEach((tag) => allTags.add(tag)));
|
|
29159
29179
|
const projectResults = this.calculateProjectResults(filteredResults, results, projectSet);
|
|
29180
|
+
const utcRunDate = formatDateUTC(/* @__PURE__ */ new Date());
|
|
29181
|
+
const localRunDate = formatDateLocal(utcRunDate);
|
|
29182
|
+
const testHistories = await Promise.all(results.map(async (result) => {
|
|
29183
|
+
const testId = `${result.filePath}:${result.projectName}:${result.title}`;
|
|
29184
|
+
const history = await this.dbManager.getTestHistory(testId);
|
|
29185
|
+
return {
|
|
29186
|
+
testId,
|
|
29187
|
+
history
|
|
29188
|
+
};
|
|
29189
|
+
}));
|
|
29160
29190
|
return {
|
|
29191
|
+
utcRunDate,
|
|
29192
|
+
localRunDate,
|
|
29193
|
+
testHistories,
|
|
29161
29194
|
logo: this.ortoniConfig.logo || void 0,
|
|
29162
29195
|
totalDuration,
|
|
29163
29196
|
results,
|
|
@@ -29214,9 +29247,13 @@ var HTMLGenerator = class {
|
|
|
29214
29247
|
import_handlebars.default.registerHelper("or", function(a, b) {
|
|
29215
29248
|
return a || b;
|
|
29216
29249
|
});
|
|
29250
|
+
import_handlebars.default.registerHelper("concat", function(...args) {
|
|
29251
|
+
args.pop();
|
|
29252
|
+
return args.join("");
|
|
29253
|
+
});
|
|
29217
29254
|
}
|
|
29218
29255
|
registerPartials() {
|
|
29219
|
-
["navbar", "testPanel", "summaryCard", "userInfo", "project", "testStatus", "testIcons"].forEach((partialName) => {
|
|
29256
|
+
["head", "navbar", "testPanel", "summaryCard", "userInfo", "project", "testStatus", "testIcons"].forEach((partialName) => {
|
|
29220
29257
|
import_handlebars.default.registerPartial(partialName, import_fs2.default.readFileSync(
|
|
29221
29258
|
import_path3.default.resolve(__dirname, "views", `${partialName}.hbs`),
|
|
29222
29259
|
"utf-8"
|
|
@@ -29346,7 +29383,7 @@ var TestResultProcessor = class {
|
|
|
29346
29383
|
var import_express = __toESM(require_express2());
|
|
29347
29384
|
var import_path6 = __toESM(require("path"));
|
|
29348
29385
|
var import_child_process = require("child_process");
|
|
29349
|
-
function startReportServer(reportFolder, reportFilename, port = 2004,
|
|
29386
|
+
function startReportServer(reportFolder, reportFilename, port = 2004, open2) {
|
|
29350
29387
|
const app = (0, import_express.default)();
|
|
29351
29388
|
app.use(import_express.default.static(reportFolder));
|
|
29352
29389
|
app.get("/", (_req, res) => {
|
|
@@ -29361,7 +29398,7 @@ function startReportServer(reportFolder, reportFilename, port = 2004, open) {
|
|
|
29361
29398
|
const server = app.listen(port, () => {
|
|
29362
29399
|
console.log(`Server is running at http://localhost:${port}
|
|
29363
29400
|
Press Ctrl+C to stop.`);
|
|
29364
|
-
if (
|
|
29401
|
+
if (open2 === "always" || open2 === "on-failure") {
|
|
29365
29402
|
try {
|
|
29366
29403
|
openBrowser(`http://localhost:${port}`);
|
|
29367
29404
|
} catch (error) {
|
|
@@ -29413,26 +29450,157 @@ var ServerManager = class {
|
|
|
29413
29450
|
}
|
|
29414
29451
|
};
|
|
29415
29452
|
|
|
29453
|
+
// src/helpers/databaseManager.ts
|
|
29454
|
+
var import_sqlite = require("sqlite");
|
|
29455
|
+
var import_sqlite3 = __toESM(require("sqlite3"));
|
|
29456
|
+
var DatabaseManager = class {
|
|
29457
|
+
constructor() {
|
|
29458
|
+
this.db = null;
|
|
29459
|
+
}
|
|
29460
|
+
async initialize(dbPath) {
|
|
29461
|
+
try {
|
|
29462
|
+
this.db = await (0, import_sqlite.open)({
|
|
29463
|
+
filename: dbPath,
|
|
29464
|
+
driver: import_sqlite3.default.Database
|
|
29465
|
+
});
|
|
29466
|
+
await this.createTables();
|
|
29467
|
+
} catch (error) {
|
|
29468
|
+
console.error("OrtoniReport: Error initializing database:", error);
|
|
29469
|
+
}
|
|
29470
|
+
}
|
|
29471
|
+
async createTables() {
|
|
29472
|
+
if (!this.db) {
|
|
29473
|
+
console.error("OrtoniReport: Database not initialized");
|
|
29474
|
+
return;
|
|
29475
|
+
}
|
|
29476
|
+
try {
|
|
29477
|
+
await this.db.exec(`
|
|
29478
|
+
CREATE TABLE IF NOT EXISTS test_runs (
|
|
29479
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
29480
|
+
run_date TEXT
|
|
29481
|
+
);
|
|
29482
|
+
|
|
29483
|
+
CREATE TABLE IF NOT EXISTS test_results (
|
|
29484
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
29485
|
+
run_id INTEGER,
|
|
29486
|
+
test_id TEXT,
|
|
29487
|
+
status TEXT,
|
|
29488
|
+
duration TEXT,
|
|
29489
|
+
error_message TEXT,
|
|
29490
|
+
FOREIGN KEY (run_id) REFERENCES test_runs (id)
|
|
29491
|
+
);
|
|
29492
|
+
`);
|
|
29493
|
+
} catch (error) {
|
|
29494
|
+
console.error("OrtoniReport: Error creating tables:", error);
|
|
29495
|
+
}
|
|
29496
|
+
}
|
|
29497
|
+
async saveTestRun() {
|
|
29498
|
+
if (!this.db) {
|
|
29499
|
+
console.error("OrtoniReport: Database not initialized");
|
|
29500
|
+
return null;
|
|
29501
|
+
}
|
|
29502
|
+
try {
|
|
29503
|
+
const runDate = formatDateUTC(/* @__PURE__ */ new Date());
|
|
29504
|
+
const { lastID } = await this.db.run(`
|
|
29505
|
+
INSERT INTO test_runs (run_date)
|
|
29506
|
+
VALUES (?)
|
|
29507
|
+
`, [runDate]);
|
|
29508
|
+
return lastID;
|
|
29509
|
+
} catch (error) {
|
|
29510
|
+
console.error("OrtoniReport: Error saving test run:", error);
|
|
29511
|
+
return null;
|
|
29512
|
+
}
|
|
29513
|
+
}
|
|
29514
|
+
async saveTestResults(runId, results) {
|
|
29515
|
+
if (!this.db) {
|
|
29516
|
+
console.error("OrtoniReport: Database not initialized");
|
|
29517
|
+
return;
|
|
29518
|
+
}
|
|
29519
|
+
try {
|
|
29520
|
+
const stmt = await this.db.prepare(`
|
|
29521
|
+
INSERT INTO test_results (run_id, test_id, status, duration, error_message)
|
|
29522
|
+
VALUES (?, ?, ?, ?, ?)
|
|
29523
|
+
`);
|
|
29524
|
+
for (const result of results) {
|
|
29525
|
+
await stmt.run([
|
|
29526
|
+
runId,
|
|
29527
|
+
`${result.filePath}:${result.projectName}:${result.title}`,
|
|
29528
|
+
result.status,
|
|
29529
|
+
result.duration,
|
|
29530
|
+
result.errors.join("\n")
|
|
29531
|
+
]);
|
|
29532
|
+
}
|
|
29533
|
+
await stmt.finalize();
|
|
29534
|
+
} catch (error) {
|
|
29535
|
+
console.error("OrtoniReport: Error saving test results:", error);
|
|
29536
|
+
}
|
|
29537
|
+
}
|
|
29538
|
+
async getTestHistory(testId, limit = 10) {
|
|
29539
|
+
if (!this.db) {
|
|
29540
|
+
console.error("OrtoniReport: Database not initialized");
|
|
29541
|
+
return [];
|
|
29542
|
+
}
|
|
29543
|
+
try {
|
|
29544
|
+
const results = await this.db.all(`
|
|
29545
|
+
SELECT tr.status, tr.duration, tr.error_message, trun.run_date
|
|
29546
|
+
FROM test_results tr
|
|
29547
|
+
JOIN test_runs trun ON tr.run_id = trun.id
|
|
29548
|
+
WHERE tr.test_id = ?
|
|
29549
|
+
ORDER BY trun.run_date DESC
|
|
29550
|
+
LIMIT ?
|
|
29551
|
+
`, [testId, limit]);
|
|
29552
|
+
return results.map((result) => ({
|
|
29553
|
+
...result,
|
|
29554
|
+
run_date: formatDateLocal(result.run_date)
|
|
29555
|
+
}));
|
|
29556
|
+
} catch (error) {
|
|
29557
|
+
console.error("OrtoniReport: Error getting test history:", error);
|
|
29558
|
+
return [];
|
|
29559
|
+
}
|
|
29560
|
+
}
|
|
29561
|
+
async close() {
|
|
29562
|
+
if (this.db) {
|
|
29563
|
+
try {
|
|
29564
|
+
await this.db.close();
|
|
29565
|
+
} catch (error) {
|
|
29566
|
+
console.error("OrtoniReport: Error closing database:", error);
|
|
29567
|
+
} finally {
|
|
29568
|
+
this.db = null;
|
|
29569
|
+
}
|
|
29570
|
+
}
|
|
29571
|
+
}
|
|
29572
|
+
};
|
|
29573
|
+
|
|
29416
29574
|
// src/ortoni-report.ts
|
|
29575
|
+
var import_path7 = __toESM(require("path"));
|
|
29417
29576
|
var OrtoniReport = class {
|
|
29418
29577
|
constructor(ortoniConfig = {}) {
|
|
29419
29578
|
this.ortoniConfig = ortoniConfig;
|
|
29420
|
-
// private wsHelper: WebSocketHelper;
|
|
29421
29579
|
this.results = [];
|
|
29422
29580
|
this.projectSet = /* @__PURE__ */ new Set();
|
|
29581
|
+
this.shouldGenerateReport = true;
|
|
29582
|
+
this.showConsoleLogs = true;
|
|
29583
|
+
this.reportsCount = 0;
|
|
29423
29584
|
this.folderPath = ortoniConfig.folderPath || "ortoni-report";
|
|
29424
29585
|
this.outputFilename = ensureHtmlExtension(ortoniConfig.filename || "ortoni-report.html");
|
|
29425
|
-
this.
|
|
29586
|
+
this.dbManager = new DatabaseManager();
|
|
29587
|
+
this.htmlGenerator = new HTMLGenerator(ortoniConfig, this.dbManager);
|
|
29426
29588
|
this.fileManager = new FileManager(this.folderPath);
|
|
29427
29589
|
this.serverManager = new ServerManager(ortoniConfig);
|
|
29428
29590
|
this.testResultProcessor = new TestResultProcessor("");
|
|
29591
|
+
this.showConsoleLogs = ortoniConfig.stdIO !== false;
|
|
29429
29592
|
}
|
|
29430
|
-
onBegin(config, _suite) {
|
|
29593
|
+
async onBegin(config, _suite) {
|
|
29594
|
+
this.reportsCount = config.reporter.length;
|
|
29431
29595
|
this.results = [];
|
|
29432
29596
|
this.testResultProcessor = new TestResultProcessor(config.rootDir);
|
|
29433
29597
|
this.fileManager.ensureReportDirectory();
|
|
29598
|
+
await this.dbManager.initialize(import_path7.default.join(this.folderPath, "ortoni-data-history.sqlite"));
|
|
29434
29599
|
}
|
|
29435
|
-
|
|
29600
|
+
onStdOut(chunk, _test, _result) {
|
|
29601
|
+
if (this.reportsCount == 1 && this.showConsoleLogs) {
|
|
29602
|
+
console.log(chunk.toString().trim());
|
|
29603
|
+
}
|
|
29436
29604
|
}
|
|
29437
29605
|
onTestEnd(test, result) {
|
|
29438
29606
|
try {
|
|
@@ -29442,28 +29610,47 @@ var OrtoniReport = class {
|
|
|
29442
29610
|
console.error("OrtoniReport: Error processing test end:", error);
|
|
29443
29611
|
}
|
|
29444
29612
|
}
|
|
29445
|
-
|
|
29613
|
+
printsToStdio() {
|
|
29614
|
+
return true;
|
|
29615
|
+
}
|
|
29616
|
+
onError(error) {
|
|
29617
|
+
if (error.location === void 0) {
|
|
29618
|
+
this.shouldGenerateReport = false;
|
|
29619
|
+
}
|
|
29620
|
+
}
|
|
29621
|
+
async onEnd(result) {
|
|
29446
29622
|
try {
|
|
29447
29623
|
this.overAllStatus = result.status;
|
|
29448
|
-
|
|
29449
|
-
|
|
29450
|
-
|
|
29451
|
-
|
|
29452
|
-
|
|
29624
|
+
if (this.shouldGenerateReport) {
|
|
29625
|
+
const filteredResults = this.results.filter((r) => r.status !== "skipped" && !r.isRetry);
|
|
29626
|
+
const totalDuration = msToTime(result.duration);
|
|
29627
|
+
const cssContent = this.fileManager.readCssContent();
|
|
29628
|
+
const runId = await this.dbManager.saveTestRun();
|
|
29629
|
+
if (runId !== null) {
|
|
29630
|
+
await this.dbManager.saveTestResults(runId, this.results);
|
|
29631
|
+
const html = await this.htmlGenerator.generateHTML(filteredResults, totalDuration, cssContent, this.results, this.projectSet);
|
|
29632
|
+
this.outputPath = this.fileManager.writeReportFile(this.outputFilename, html);
|
|
29633
|
+
} else {
|
|
29634
|
+
console.error("OrtoniReport: Error saving test run to database");
|
|
29635
|
+
}
|
|
29636
|
+
} else {
|
|
29637
|
+
console.error("OrtoniReport: Report generation skipped due to error in Playwright worker!");
|
|
29638
|
+
}
|
|
29453
29639
|
} catch (error) {
|
|
29454
|
-
this.
|
|
29640
|
+
this.shouldGenerateReport = false;
|
|
29455
29641
|
console.error("OrtoniReport: Error generating report:", error);
|
|
29456
29642
|
}
|
|
29457
29643
|
}
|
|
29458
29644
|
async onExit() {
|
|
29459
29645
|
try {
|
|
29460
|
-
this.
|
|
29461
|
-
if (this.
|
|
29462
|
-
|
|
29646
|
+
await this.dbManager.close();
|
|
29647
|
+
if (this.shouldGenerateReport) {
|
|
29648
|
+
this.fileManager.copyTraceViewerAssets();
|
|
29649
|
+
console.info(`Ortoni HTML report generated at ${this.outputPath}`);
|
|
29650
|
+
this.serverManager.startServer(this.folderPath, this.outputFilename, this.overAllStatus);
|
|
29651
|
+
await new Promise((_resolve) => {
|
|
29652
|
+
});
|
|
29463
29653
|
}
|
|
29464
|
-
this.serverManager.startServer(this.folderPath, this.outputFilename, this.overAllStatus);
|
|
29465
|
-
await new Promise((_resolve) => {
|
|
29466
|
-
});
|
|
29467
29654
|
} catch (error) {
|
|
29468
29655
|
console.error("OrtoniReport: Error in onExit:", error);
|
|
29469
29656
|
}
|