@allurereport/static-server 3.0.0-beta.10

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 ADDED
@@ -0,0 +1,47 @@
1
+ # Static Server
2
+
3
+ [<img src="https://allurereport.org/public/img/allure-report.svg" height="85px" alt="Allure Report logo" align="right" />](https://allurereport.org "Allure Report")
4
+
5
+ - Learn more about Allure Report at https://allurereport.org
6
+ - 📚 [Documentation](https://allurereport.org/docs/) – discover official documentation for Allure Report
7
+ - ❓ [Questions and Support](https://github.com/orgs/allure-framework/discussions/categories/questions-support) – get help from the team and community
8
+ - 📢 [Official announcements](https://github.com/orgs/allure-framework/discussions/categories/announcements) – be in touch with the latest updates
9
+ - 💬 [General Discussion ](https://github.com/orgs/allure-framework/discussions/categories/general-discussion) – engage in casual conversations, share insights and ideas with the community
10
+
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ Minimalistic web-server for serving Allure Reports and static files with live reload support.
16
+
17
+ ## Install
18
+
19
+ Use your favorite package manager to install the package:
20
+
21
+ ```shell
22
+ npm add @allurereport/static-server
23
+ yarn add @allurereport/static-server
24
+ pnpm add @allurereport/static-server
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ The server can be used programmatically only:
30
+
31
+ ```javascript
32
+ import { serve } from "@allurereport/static-server";
33
+
34
+ const server = await serve({
35
+ // by default uses a random available port
36
+ port: 8080,
37
+ // path to the directory with files should be served
38
+ servePath: "/path/to/your/static/files",
39
+ // enable live reload
40
+ live: true,
41
+ });
42
+
43
+ // reloads the served pages manually, even if live reload isn't enabled
44
+ await server.reload();
45
+ // stops the server
46
+ await server.stop();
47
+ ```
@@ -0,0 +1,14 @@
1
+ export type AllureStaticServer = {
2
+ url: string;
3
+ port: number;
4
+ stop: () => Promise<void>;
5
+ reload: () => Promise<void>;
6
+ open: (url: string) => Promise<void>;
7
+ };
8
+ export declare const renderDirectory: (files: string[], dirPath?: boolean) => Promise<string>;
9
+ export declare const serve: (options?: {
10
+ port?: number;
11
+ live?: boolean;
12
+ servePath?: string;
13
+ open?: boolean;
14
+ }) => Promise<AllureStaticServer>;
package/dist/index.js ADDED
@@ -0,0 +1,159 @@
1
+ import watchDirectory from "@allurereport/directory-watcher";
2
+ import * as console from "node:console";
3
+ import { createReadStream } from "node:fs";
4
+ import { readFile, readdir, stat } from "node:fs/promises";
5
+ import { createServer } from "node:http";
6
+ import { basename, extname, join, resolve } from "node:path";
7
+ import { cwd } from "node:process";
8
+ import openUrl from "open";
9
+ import { TYPES_BY_EXTENSION, identity, injectLiveReloadScript } from "./utils.js";
10
+ export const renderDirectory = async (files, dirPath) => {
11
+ const links = [];
12
+ for (const file of files) {
13
+ const stats = await stat(file);
14
+ if (stats.isDirectory()) {
15
+ links.push(`<a href="./${basename(file)}/">${basename(file)}/</a>`);
16
+ }
17
+ else {
18
+ links.push(`<a href="./${basename(file)}">${basename(file)}</a>`);
19
+ }
20
+ }
21
+ return `
22
+ <!DOCTYPE html>
23
+ <html lang="en">
24
+ <head>
25
+ <title>Allure Server</title>
26
+ <meta charset="UTF-8" />
27
+ </head>
28
+ <body>
29
+ <p>Allure Static Server</p>
30
+ <ul>
31
+ ${dirPath ? '<li><a href="../">../</a></li>' : ""}
32
+ ${links.map((link) => `<li>${link}</li>`).join("")}
33
+ </ul>
34
+ </body>
35
+ </html>
36
+ `;
37
+ };
38
+ export const serve = async (options) => {
39
+ const { port, live = false, servePath = cwd(), open = false } = options ?? {};
40
+ const pathToServe = resolve(cwd(), servePath);
41
+ const clients = new Set();
42
+ const server = createServer(async (req, res) => {
43
+ const hostHeaderIdx = req.rawHeaders.findIndex((header) => header === "Host") + 1;
44
+ const host = req.rawHeaders[hostHeaderIdx];
45
+ const { pathname, search } = new URL(`http://${host}${req.url}`);
46
+ const query = new URLSearchParams(search);
47
+ if (pathname === "/__live_reload") {
48
+ res.writeHead(200, {
49
+ "Content-Type": "text/event-stream",
50
+ "Cache-Control": "no-cache",
51
+ "Connection": "keep-alive",
52
+ });
53
+ clients.add(res);
54
+ req.on("close", () => {
55
+ clients.delete(res);
56
+ });
57
+ return;
58
+ }
59
+ let fsPath = join(pathToServe, pathname.replace(/\?.*$/, ""));
60
+ let stats;
61
+ try {
62
+ stats = await stat(fsPath);
63
+ }
64
+ catch (err) {
65
+ if (err.code === "ENOENT") {
66
+ res.writeHead(404);
67
+ }
68
+ else {
69
+ res.writeHead(500);
70
+ }
71
+ return res.end();
72
+ }
73
+ if (stats.isDirectory() && !pathname.endsWith("/")) {
74
+ res.writeHead(301, {
75
+ Location: `${pathname}/`,
76
+ });
77
+ return res.end();
78
+ }
79
+ if (stats.isDirectory()) {
80
+ const files = await readdir(fsPath);
81
+ if (files.includes("index.html")) {
82
+ fsPath = join(fsPath, "index.html");
83
+ stats = await stat(fsPath);
84
+ }
85
+ else {
86
+ const html = await renderDirectory(files.map((file) => resolve(fsPath, file)), pathname !== "/");
87
+ const htmlContent = injectLiveReloadScript(html);
88
+ const byteLength = Buffer.byteLength(htmlContent);
89
+ res.writeHead(200, {
90
+ "Content-Type": "text/html",
91
+ "Content-Length": byteLength,
92
+ });
93
+ res.write(htmlContent);
94
+ return res.end();
95
+ }
96
+ }
97
+ const fileExtension = extname(fsPath);
98
+ const contentType = TYPES_BY_EXTENSION[fileExtension] ?? "application/octet-stream";
99
+ if (contentType === "text/html" && !query.has("attachment")) {
100
+ const html = await readFile(fsPath, "utf-8");
101
+ const htmlContent = injectLiveReloadScript(html);
102
+ const byteLength = Buffer.byteLength(htmlContent);
103
+ res.writeHead(200, {
104
+ "Content-Type": contentType,
105
+ "Content-Length": byteLength,
106
+ });
107
+ res.write(htmlContent);
108
+ return res.end();
109
+ }
110
+ res.writeHead(200, {
111
+ "Content-Type": contentType,
112
+ "Content-Length": stats.size,
113
+ });
114
+ createReadStream(fsPath)
115
+ .pipe(res)
116
+ .on("close", () => res.end());
117
+ });
118
+ const triggerReload = () => {
119
+ clients.forEach((client) => {
120
+ client.write("data: reload\n\n");
121
+ });
122
+ };
123
+ const serverPort = await new Promise((res) => {
124
+ server.listen(port, () => {
125
+ const address = server.address();
126
+ if (!address || typeof address === "string") {
127
+ throw new Error("could not start a server: invalid server address is returned");
128
+ }
129
+ res(address.port);
130
+ });
131
+ });
132
+ const unwatch = live
133
+ ? watchDirectory(pathToServe, triggerReload, {
134
+ ignoreInitial: true,
135
+ })
136
+ : identity;
137
+ console.info(`Allure is running on http://localhost:${serverPort}`);
138
+ if (open) {
139
+ openUrl(`http://localhost:${serverPort}`);
140
+ }
141
+ return {
142
+ url: `http://localhost:${serverPort}`,
143
+ port: serverPort,
144
+ reload: async () => {
145
+ triggerReload();
146
+ },
147
+ open: async (url) => {
148
+ if (url.startsWith("/")) {
149
+ await openUrl(new URL(url, `http://localhost:${serverPort}`).toString());
150
+ return;
151
+ }
152
+ await openUrl(url);
153
+ },
154
+ stop: async () => {
155
+ server.unref();
156
+ await unwatch();
157
+ },
158
+ };
159
+ };
@@ -0,0 +1,4 @@
1
+ export declare const EXTENSIONS_BY_TYPE: Record<string, string>;
2
+ export declare const TYPES_BY_EXTENSION: Record<string, string>;
3
+ export declare const identity: <T>(value?: T) => T | undefined;
4
+ export declare const injectLiveReloadScript: (html: string) => string;
package/dist/utils.js ADDED
@@ -0,0 +1,915 @@
1
+ import { ALLURE_LIVE_RELOAD_HASH_STORAGE_KEY } from "@allurereport/web-commons";
2
+ export const EXTENSIONS_BY_TYPE = {
3
+ "application/andrew-inset": ".ez",
4
+ "application/applixware": ".aw",
5
+ "application/atom+xml": ".atom",
6
+ "application/atomcat+xml": ".atomcat",
7
+ "application/atomsvc+xml": ".atomsvc",
8
+ "application/bizagi-modeler": ".bpm",
9
+ "application/cbor": ".cbor",
10
+ "application/ccxml+xml": ".ccxml",
11
+ "application/coreldraw": ".cdr",
12
+ "application/cu-seeme": ".cu",
13
+ "application/dash+xml": ".mpd",
14
+ "application/davmount+xml": ".davmount",
15
+ "application/dif+xml": ".dif",
16
+ "application/dita+xml; format=map": ".ditamap",
17
+ "application/dita+xml; format=topic": ".dita",
18
+ "application/dita+xml; format=val": ".ditaval",
19
+ "application/ecmascript": ".ecma",
20
+ "application/emma+xml": ".emma",
21
+ "application/envi.hdr": ".hdr",
22
+ "application/epub+zip": ".epub",
23
+ "application/fits": ".fits",
24
+ "application/font-tdpfr": ".pfr",
25
+ "application/gzip": ".gz",
26
+ "application/hyperstudio": ".stk",
27
+ "application/illustrator": ".ai",
28
+ "application/java-archive": ".jar",
29
+ "application/java-serialized-object": ".ser",
30
+ "application/java-vm": ".class",
31
+ "application/javascript": ".js",
32
+ "application/json": ".json",
33
+ "application/lost+xml": ".lostxml",
34
+ "application/mac-binhex40": ".hqx",
35
+ "application/mac-compactpro": ".cpt",
36
+ "application/manifest+json": ".webmanifest",
37
+ "application/marc": ".mrc",
38
+ "application/mathematica": ".ma",
39
+ "application/mathml+xml": ".mathml",
40
+ "application/mbox": ".mbox",
41
+ "application/mediaservercontrol+xml": ".mscml",
42
+ "application/mp4": ".mp4s",
43
+ "application/msword": ".doc",
44
+ "application/mxf": ".mxf",
45
+ "application/octet-stream": ".bin",
46
+ "application/oda": ".oda",
47
+ "application/oebps-package+xml": ".opf",
48
+ "application/ogg": ".ogx",
49
+ "application/onenote": ".onetmp",
50
+ "application/onenote; format=one": ".one",
51
+ "application/onenote; format=onetoc2": ".onetoc",
52
+ "application/onenote; format=package": ".onepkg",
53
+ "application/patch-ops-error+xml": ".xer",
54
+ "application/pdf": ".pdf",
55
+ "application/pgp-encrypted": ".pgp",
56
+ "application/pgp-signature": ".asc",
57
+ "application/pics-rules": ".prf",
58
+ "application/pkcs7-mime": ".p7m",
59
+ "application/pkcs7-signature": ".p7s",
60
+ "application/pkcs10": ".p10",
61
+ "application/pkix-cert": ".cer",
62
+ "application/pkix-crl": ".crl",
63
+ "application/pkix-pkipath": ".pkipath",
64
+ "application/pkixcmp": ".pki",
65
+ "application/pls+xml": ".pls",
66
+ "application/postscript": ".ps",
67
+ "application/prs.cww": ".cww",
68
+ "application/rdf+xml": ".rdf",
69
+ "application/reginfo+xml": ".rif",
70
+ "application/relax-ng-compact-syntax": ".rnc",
71
+ "application/resource-lists+xml": ".rl",
72
+ "application/resource-lists-diff+xml": ".rld",
73
+ "application/rls-services+xml": ".rs",
74
+ "application/rsd+xml": ".rsd",
75
+ "application/rss+xml": ".rss",
76
+ "application/rtf": ".rtf",
77
+ "application/sbml+xml": ".sbml",
78
+ "application/scvp-cv-request": ".scq",
79
+ "application/scvp-cv-response": ".scs",
80
+ "application/scvp-vp-request": ".spq",
81
+ "application/scvp-vp-response": ".spp",
82
+ "application/sdp": ".sdp",
83
+ "application/sereal": ".srl",
84
+ "application/set-payment-initiation": ".setpay",
85
+ "application/set-registration-initiation": ".setreg",
86
+ "application/shf+xml": ".shf",
87
+ "application/sldworks": ".sldprt",
88
+ "application/smil+xml": ".smi",
89
+ "application/sparql-query": ".rq",
90
+ "application/sparql-results+xml": ".srx",
91
+ "application/srgs": ".gram",
92
+ "application/srgs+xml": ".grxml",
93
+ "application/ssml+xml": ".ssml",
94
+ "application/timestamped-data": ".tsd",
95
+ "application/vnd.3gpp.pic-bw-large": ".plb",
96
+ "application/vnd.3gpp.pic-bw-small": ".psb",
97
+ "application/vnd.3gpp.pic-bw-var": ".pvb",
98
+ "application/vnd.3gpp2.tcap": ".tcap",
99
+ "application/vnd.3m.post-it-notes": ".pwn",
100
+ "application/vnd.accpac.simply.aso": ".aso",
101
+ "application/vnd.accpac.simply.imp": ".imp",
102
+ "application/vnd.acucobol": ".acu",
103
+ "application/vnd.acucorp": ".atc",
104
+ "application/vnd.adobe.aftereffects.project": ".aep",
105
+ "application/vnd.adobe.aftereffects.template": ".aet",
106
+ "application/vnd.adobe.air-application-installer-package+zip": ".air",
107
+ "application/vnd.adobe.indesign-idml-package": ".idml",
108
+ "application/vnd.adobe.xdp+xml": ".xdp",
109
+ "application/vnd.adobe.xfdf": ".xfdf",
110
+ "application/vnd.airzip.filesecure.azf": ".azf",
111
+ "application/vnd.airzip.filesecure.azs": ".azs",
112
+ "application/vnd.allure.image.diff": ".imagediff",
113
+ "application/vnd.allure.metadata+json": ".metadata",
114
+ "application/vnd.amazon.ebook": ".azw",
115
+ "application/vnd.americandynamics.acc": ".acc",
116
+ "application/vnd.amiga.ami": ".ami",
117
+ "application/vnd.android.package-archive": ".apk",
118
+ "application/vnd.anser-web-certificate-issue-initiation": ".cii",
119
+ "application/vnd.anser-web-funds-transfer-initiation": ".fti",
120
+ "application/vnd.antix.game-component": ".atx",
121
+ "application/vnd.apple.installer+xml": ".mpkg",
122
+ "application/vnd.apple.keynote": ".key",
123
+ "application/vnd.apple.mpegurl": ".m3u8",
124
+ "application/vnd.apple.numbers": ".numbers",
125
+ "application/vnd.apple.pages": ".pages",
126
+ "application/vnd.arastra.swi": ".swi",
127
+ "application/vnd.blueice.multipass": ".mpm",
128
+ "application/vnd.bmi": ".bmi",
129
+ "application/vnd.businessobjects": ".rep",
130
+ "application/vnd.chemdraw+xml": ".cdxml",
131
+ "application/vnd.chipnuts.karaoke-mmd": ".mmd",
132
+ "application/vnd.cinderella": ".cdy",
133
+ "application/vnd.claymore": ".cla",
134
+ "application/vnd.clonk.c4group": ".c4g",
135
+ "application/vnd.commonspace": ".csp",
136
+ "application/vnd.contact.cmsg": ".cdbcmsg",
137
+ "application/vnd.cosmocaller": ".cmc",
138
+ "application/vnd.crick.clicker": ".clkx",
139
+ "application/vnd.crick.clicker.keyboard": ".clkk",
140
+ "application/vnd.crick.clicker.palette": ".clkp",
141
+ "application/vnd.crick.clicker.template": ".clkt",
142
+ "application/vnd.crick.clicker.wordbank": ".clkw",
143
+ "application/vnd.criticaltools.wbs+xml": ".wbs",
144
+ "application/vnd.ctc-posml": ".pml",
145
+ "application/vnd.cups-ppd": ".ppd",
146
+ "application/vnd.curl.car": ".car",
147
+ "application/vnd.curl.pcurl": ".pcurl",
148
+ "application/vnd.data-vision.rdz": ".rdz",
149
+ "application/vnd.denovo.fcselayout-link": ".fe_launch",
150
+ "application/vnd.dna": ".dna",
151
+ "application/vnd.dolby.mlp": ".mlp",
152
+ "application/vnd.dpgraph": ".dpg",
153
+ "application/vnd.dreamfactory": ".dfac",
154
+ "application/vnd.dynageo": ".geo",
155
+ "application/vnd.ecowin.chart": ".mag",
156
+ "application/vnd.enliven": ".nml",
157
+ "application/vnd.epson.esf": ".esf",
158
+ "application/vnd.epson.msf": ".msf",
159
+ "application/vnd.epson.quickanime": ".qam",
160
+ "application/vnd.epson.salt": ".slt",
161
+ "application/vnd.epson.ssf": ".ssf",
162
+ "application/vnd.eszigno3+xml": ".es3",
163
+ "application/vnd.etsi.asic-e+zip": ".asice",
164
+ "application/vnd.etsi.asic-s+zip": ".asics",
165
+ "application/vnd.ezpix-album": ".ez2",
166
+ "application/vnd.ezpix-package": ".ez3",
167
+ "application/vnd.fdf": ".fdf",
168
+ "application/vnd.fdsn.mseed": ".mseed",
169
+ "application/vnd.fdsn.seed": ".seed",
170
+ "application/vnd.flographit": ".gph",
171
+ "application/vnd.fluxtime.clip": ".ftc",
172
+ "application/vnd.framemaker": ".fm",
173
+ "application/vnd.frogans.fnc": ".fnc",
174
+ "application/vnd.frogans.ltf": ".ltf",
175
+ "application/vnd.fsc.weblaunch": ".fsc",
176
+ "application/vnd.fujitsu.oasys": ".oas",
177
+ "application/vnd.fujitsu.oasys2": ".oa2",
178
+ "application/vnd.fujitsu.oasys3": ".oa3",
179
+ "application/vnd.fujitsu.oasysgp": ".fg5",
180
+ "application/vnd.fujitsu.oasysprs": ".bh2",
181
+ "application/vnd.fujixerox.ddd": ".ddd",
182
+ "application/vnd.fujixerox.docuworks": ".xdw",
183
+ "application/vnd.fujixerox.docuworks.binder": ".xbd",
184
+ "application/vnd.fuzzysheet": ".fzs",
185
+ "application/vnd.genomatix.tuxedo": ".txd",
186
+ "application/vnd.geogebra.file": ".ggb",
187
+ "application/vnd.geogebra.tool": ".ggt",
188
+ "application/vnd.geometry-explorer": ".gex",
189
+ "application/vnd.gmx": ".gmx",
190
+ "application/vnd.google-earth.kml+xml": ".kml",
191
+ "application/vnd.google-earth.kmz": ".kmz",
192
+ "application/vnd.grafeq": ".gqf",
193
+ "application/vnd.groove-account": ".gac",
194
+ "application/vnd.groove-help": ".ghf",
195
+ "application/vnd.groove-identity-message": ".gim",
196
+ "application/vnd.groove-injector": ".grv",
197
+ "application/vnd.groove-tool-message": ".gtm",
198
+ "application/vnd.groove-tool-template": ".tpl",
199
+ "application/vnd.groove-vcard": ".vcg",
200
+ "application/vnd.handheld-entertainment+xml": ".zmm",
201
+ "application/vnd.hbci": ".hbci",
202
+ "application/vnd.hhe.lesson-player": ".les",
203
+ "application/vnd.hp-hpgl": ".hpgl",
204
+ "application/vnd.hp-hpid": ".hpid",
205
+ "application/vnd.hp-hps": ".hps",
206
+ "application/vnd.hp-jlyt": ".jlt",
207
+ "application/vnd.hp-pcl": ".pcl",
208
+ "application/vnd.hp-pclxl": ".pclxl",
209
+ "application/vnd.hydrostatix.sof-data": ".sfd-hdstx",
210
+ "application/vnd.hzn-3d-crossword": ".x3d",
211
+ "application/vnd.ibm.minipay": ".mpy",
212
+ "application/vnd.ibm.modcap": ".afp",
213
+ "application/vnd.ibm.rights-management": ".irm",
214
+ "application/vnd.ibm.secure-container": ".sc",
215
+ "application/vnd.iccprofile": ".icc",
216
+ "application/vnd.igloader": ".igl",
217
+ "application/vnd.immervision-ivp": ".ivp",
218
+ "application/vnd.immervision-ivu": ".ivu",
219
+ "application/vnd.intercon.formnet": ".xpw",
220
+ "application/vnd.intu.qbo": ".qbo",
221
+ "application/vnd.intu.qfx": ".qfx",
222
+ "application/vnd.iptc.g2.newsmessage+xml": ".nar",
223
+ "application/vnd.ipunplugged.rcprofile": ".rcprofile",
224
+ "application/vnd.irepository.package+xml": ".irp",
225
+ "application/vnd.is-xpr": ".xpr",
226
+ "application/vnd.jam": ".jam",
227
+ "application/vnd.java.hprof": ".hprof",
228
+ "application/vnd.java.hprof.text": ".hprof.txt",
229
+ "application/vnd.jcp.javame.midlet-rms": ".rms",
230
+ "application/vnd.jisp": ".jisp",
231
+ "application/vnd.joost.joda-archive": ".joda",
232
+ "application/vnd.kahootz": ".ktz",
233
+ "application/vnd.kde.karbon": ".karbon",
234
+ "application/vnd.kde.kchart": ".chrt",
235
+ "application/vnd.kde.kformula": ".kfo",
236
+ "application/vnd.kde.kivio": ".flw",
237
+ "application/vnd.kde.kontour": ".kon",
238
+ "application/vnd.kde.kpresenter": ".kpr",
239
+ "application/vnd.kde.kspread": ".ksp",
240
+ "application/vnd.kde.kword": ".kwd",
241
+ "application/vnd.kenameaapp": ".htke",
242
+ "application/vnd.kidspiration": ".kia",
243
+ "application/vnd.kinar": ".kne",
244
+ "application/vnd.koan": ".skp",
245
+ "application/vnd.kodak-descriptor": ".sse",
246
+ "application/vnd.llamagraphics.life-balance.desktop": ".lbd",
247
+ "application/vnd.llamagraphics.life-balance.exchange+xml": ".lbe",
248
+ "application/vnd.lotus-1-2-3": ".wk1",
249
+ "application/vnd.lotus-1-2-3; version=2": ".wk1",
250
+ "application/vnd.lotus-1-2-3; version=3": ".wk3",
251
+ "application/vnd.lotus-1-2-3; version=4": ".wk4",
252
+ "application/vnd.lotus-1-2-3; version=97+9.x": ".123",
253
+ "application/vnd.lotus-approach": ".apr",
254
+ "application/vnd.lotus-freelance": ".pre",
255
+ "application/vnd.lotus-notes": ".nsf",
256
+ "application/vnd.lotus-organizer": ".org",
257
+ "application/vnd.lotus-wordpro": ".lwp",
258
+ "application/vnd.macports.portpkg": ".portpkg",
259
+ "application/vnd.mcd": ".mcd",
260
+ "application/vnd.medcalcdata": ".mc1",
261
+ "application/vnd.mediastation.cdkey": ".cdkey",
262
+ "application/vnd.mfer": ".mwf",
263
+ "application/vnd.mfmp": ".mfm",
264
+ "application/vnd.micrografx.flo": ".flo",
265
+ "application/vnd.micrografx.igx": ".igx",
266
+ "application/vnd.mif": ".mif",
267
+ "application/vnd.mindjet.mindmanager": ".mmp",
268
+ "application/vnd.mobius.daf": ".daf",
269
+ "application/vnd.mobius.dis": ".dis",
270
+ "application/vnd.mobius.mbk": ".mbk",
271
+ "application/vnd.mobius.mqy": ".mqy",
272
+ "application/vnd.mobius.msl": ".msl",
273
+ "application/vnd.mobius.plc": ".plc",
274
+ "application/vnd.mobius.txf": ".txf",
275
+ "application/vnd.mophun.application": ".mpn",
276
+ "application/vnd.mophun.certificate": ".mpc",
277
+ "application/vnd.mozilla.xul+xml": ".xul",
278
+ "application/vnd.ms-artgalry": ".cil",
279
+ "application/vnd.ms-cab-compressed": ".cab",
280
+ "application/vnd.ms-excel": ".xls",
281
+ "application/vnd.ms-excel.addin.macroenabled.12": ".xlam",
282
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": ".xlsb",
283
+ "application/vnd.ms-excel.sheet.macroenabled.12": ".xlsm",
284
+ "application/vnd.ms-excel.template.macroenabled.12": ".xltm",
285
+ "application/vnd.ms-fontobject": ".eot",
286
+ "application/vnd.ms-htmlhelp": ".chm",
287
+ "application/vnd.ms-ims": ".ims",
288
+ "application/vnd.ms-lrm": ".lrm",
289
+ "application/vnd.ms-outlook": ".msg",
290
+ "application/vnd.ms-outlook-pst": ".pst",
291
+ "application/vnd.ms-pki.seccat": ".cat",
292
+ "application/vnd.ms-pki.stl": ".stl",
293
+ "application/vnd.ms-powerpoint": ".ppt",
294
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": ".ppam",
295
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": ".pptm",
296
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": ".sldm",
297
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ".ppsm",
298
+ "application/vnd.ms-powerpoint.template.macroenabled.12": ".potm",
299
+ "application/vnd.ms-project": ".mpp",
300
+ "application/vnd.ms-visio.drawing": ".vsdx",
301
+ "application/vnd.ms-visio.drawing.macroenabled.12": ".vsdm",
302
+ "application/vnd.ms-visio.stencil": ".vssx",
303
+ "application/vnd.ms-visio.stencil.macroenabled.12": ".vssm",
304
+ "application/vnd.ms-visio.template": ".vstx",
305
+ "application/vnd.ms-visio.template.macroenabled.12": ".vstm",
306
+ "application/vnd.ms-word.document.macroenabled.12": ".docm",
307
+ "application/vnd.ms-word.template.macroenabled.12": ".dotm",
308
+ "application/vnd.ms-works": ".wps",
309
+ "application/vnd.ms-wpl": ".wpl",
310
+ "application/vnd.ms-xpsdocument": ".xps",
311
+ "application/vnd.mseq": ".mseq",
312
+ "application/vnd.musician": ".mus",
313
+ "application/vnd.muvee.style": ".msty",
314
+ "application/vnd.neurolanguage.nlu": ".nlu",
315
+ "application/vnd.noblenet-directory": ".nnd",
316
+ "application/vnd.noblenet-sealer": ".nns",
317
+ "application/vnd.noblenet-web": ".nnw",
318
+ "application/vnd.nokia.n-gage.data": ".ngdat",
319
+ "application/vnd.nokia.n-gage.symbian.install": ".n-gage",
320
+ "application/vnd.nokia.radio-preset": ".rpst",
321
+ "application/vnd.nokia.radio-presets": ".rpss",
322
+ "application/vnd.novadigm.edm": ".edm",
323
+ "application/vnd.novadigm.edx": ".edx",
324
+ "application/vnd.novadigm.ext": ".ext",
325
+ "application/vnd.oasis.opendocument.base": ".odb",
326
+ "application/vnd.oasis.opendocument.chart": ".odc",
327
+ "application/vnd.oasis.opendocument.chart-template": ".otc",
328
+ "application/vnd.oasis.opendocument.flat.presentation": ".fodp",
329
+ "application/vnd.oasis.opendocument.flat.spreadsheet": ".fods",
330
+ "application/vnd.oasis.opendocument.flat.text": ".fodt",
331
+ "application/vnd.oasis.opendocument.formula": ".odf",
332
+ "application/vnd.oasis.opendocument.formula-template": ".odft",
333
+ "application/vnd.oasis.opendocument.graphics": ".odg",
334
+ "application/vnd.oasis.opendocument.graphics-template": ".otg",
335
+ "application/vnd.oasis.opendocument.image": ".odi",
336
+ "application/vnd.oasis.opendocument.image-template": ".oti",
337
+ "application/vnd.oasis.opendocument.presentation": ".odp",
338
+ "application/vnd.oasis.opendocument.presentation-template": ".otp",
339
+ "application/vnd.oasis.opendocument.spreadsheet": ".ods",
340
+ "application/vnd.oasis.opendocument.spreadsheet-template": ".ots",
341
+ "application/vnd.oasis.opendocument.text": ".odt",
342
+ "application/vnd.oasis.opendocument.text-master": ".otm",
343
+ "application/vnd.oasis.opendocument.text-template": ".ott",
344
+ "application/vnd.oasis.opendocument.text-web": ".oth",
345
+ "application/vnd.olpc-sugar": ".xo",
346
+ "application/vnd.oma.dd2+xml": ".dd2",
347
+ "application/vnd.openofficeorg.autotext": ".bau",
348
+ "application/vnd.openofficeorg.extension": ".oxt",
349
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
350
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": ".sldx",
351
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ".ppsx",
352
+ "application/vnd.openxmlformats-officedocument.presentationml.template": ".potx",
353
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
354
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ".xltx",
355
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
356
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ".dotx",
357
+ "application/vnd.osgi.dp": ".dp",
358
+ "application/vnd.palm": ".pqa",
359
+ "application/vnd.pg.format": ".str",
360
+ "application/vnd.pg.osasli": ".ei6",
361
+ "application/vnd.picsel": ".efif",
362
+ "application/vnd.pocketlearn": ".plf",
363
+ "application/vnd.powerbuilder6": ".pbd",
364
+ "application/vnd.previewsystems.box": ".box",
365
+ "application/vnd.proteus.magazine": ".mgz",
366
+ "application/vnd.publishare-delta-tree": ".qps",
367
+ "application/vnd.pvi.ptid1": ".ptid",
368
+ "application/vnd.quark.quarkxpress": ".qxd",
369
+ "application/vnd.recordare.musicxml": ".mxl",
370
+ "application/vnd.recordare.musicxml+xml": ".musicxml",
371
+ "application/vnd.rim.cod": ".cod",
372
+ "application/vnd.rn-realmedia": ".rm",
373
+ "application/vnd.route66.link66+xml": ".link66",
374
+ "application/vnd.seemail": ".see",
375
+ "application/vnd.sema": ".sema",
376
+ "application/vnd.semd": ".semd",
377
+ "application/vnd.semf": ".semf",
378
+ "application/vnd.shana.informed.formdata": ".ifm",
379
+ "application/vnd.shana.informed.formtemplate": ".itp",
380
+ "application/vnd.shana.informed.interchange": ".iif",
381
+ "application/vnd.shana.informed.package": ".ipk",
382
+ "application/vnd.simtech-mindmapper": ".twd",
383
+ "application/vnd.smaf": ".mmf",
384
+ "application/vnd.smart.teacher": ".teacher",
385
+ "application/vnd.solent.sdkm+xml": ".sdkm",
386
+ "application/vnd.spotfire.dxp": ".dxp",
387
+ "application/vnd.spotfire.sfs": ".sfs",
388
+ "application/vnd.stardivision.calc": ".sdc",
389
+ "application/vnd.stardivision.draw": ".sda",
390
+ "application/vnd.stardivision.impress": ".sdd",
391
+ "application/vnd.stardivision.math": ".smf",
392
+ "application/vnd.stardivision.writer": ".sdw",
393
+ "application/vnd.stardivision.writer-global": ".sgl",
394
+ "application/vnd.sun.xml.calc": ".sxc",
395
+ "application/vnd.sun.xml.calc.template": ".stc",
396
+ "application/vnd.sun.xml.draw": ".sxd",
397
+ "application/vnd.sun.xml.draw.template": ".std",
398
+ "application/vnd.sun.xml.impress": ".sxi",
399
+ "application/vnd.sun.xml.impress.template": ".sti",
400
+ "application/vnd.sun.xml.math": ".sxm",
401
+ "application/vnd.sun.xml.writer": ".sxw",
402
+ "application/vnd.sun.xml.writer.global": ".sxg",
403
+ "application/vnd.sun.xml.writer.template": ".stw",
404
+ "application/vnd.sus-calendar": ".sus",
405
+ "application/vnd.svd": ".svd",
406
+ "application/vnd.symbian.install": ".sis",
407
+ "application/vnd.syncml+xml": ".xsm",
408
+ "application/vnd.syncml.dm+wbxml": ".bdm",
409
+ "application/vnd.syncml.dm+xml": ".xdm",
410
+ "application/vnd.tao.intent-module-archive": ".tao",
411
+ "application/vnd.tcpdump.pcap": ".pcap",
412
+ "application/vnd.tmobile-livetv": ".tmo",
413
+ "application/vnd.trid.tpt": ".tpt",
414
+ "application/vnd.triscape.mxs": ".mxs",
415
+ "application/vnd.trueapp": ".tra",
416
+ "application/vnd.ufdl": ".ufd",
417
+ "application/vnd.uiq.theme": ".utz",
418
+ "application/vnd.umajin": ".umj",
419
+ "application/vnd.unity": ".unityweb",
420
+ "application/vnd.uoml+xml": ".uoml",
421
+ "application/vnd.vcx": ".vcx",
422
+ "application/vnd.visio": ".vsd",
423
+ "application/vnd.visionary": ".vis",
424
+ "application/vnd.vsf": ".vsf",
425
+ "application/vnd.wap.wbxml": ".wbxml",
426
+ "application/vnd.wap.wmlc": ".wmlc",
427
+ "application/vnd.wap.wmlscriptc": ".wmlsc",
428
+ "application/vnd.webturbo": ".wtb",
429
+ "application/vnd.wolfram.wl": ".wl",
430
+ "application/vnd.wordperfect": ".wpd",
431
+ "application/vnd.wqd": ".wqd",
432
+ "application/vnd.wt.stf": ".stf",
433
+ "application/vnd.xara": ".xar",
434
+ "application/vnd.xfdl": ".xfdl",
435
+ "application/vnd.yamaha.hv-dic": ".hvd",
436
+ "application/vnd.yamaha.hv-script": ".hvs",
437
+ "application/vnd.yamaha.hv-voice": ".hvp",
438
+ "application/vnd.yamaha.openscoreformat": ".osf",
439
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": ".osfpvg",
440
+ "application/vnd.yamaha.smaf-audio": ".saf",
441
+ "application/vnd.yamaha.smaf-phrase": ".spf",
442
+ "application/vnd.yellowriver-custom-menu": ".cmp",
443
+ "application/vnd.zul": ".zir",
444
+ "application/vnd.zzazz.deck+xml": ".zaz",
445
+ "application/voicexml+xml": ".vxml",
446
+ "application/warc": ".warc",
447
+ "application/wasm": ".wasm",
448
+ "application/winhlp": ".hlp",
449
+ "application/wsdl+xml": ".wsdl",
450
+ "application/wspolicy+xml": ".wspolicy",
451
+ "application/x-7z-compressed": ".7z",
452
+ "application/x-abiword": ".abw",
453
+ "application/x-ace-compressed": ".ace",
454
+ "application/x-adobe-indesign": ".indd",
455
+ "application/x-adobe-indesign-interchange": ".inx",
456
+ "application/x-apple-diskimage": ".dmg",
457
+ "application/x-appleworks": ".cwk",
458
+ "application/x-archive": ".ar",
459
+ "application/x-arj": ".arj",
460
+ "application/x-authorware-bin": ".aab",
461
+ "application/x-authorware-map": ".aam",
462
+ "application/x-authorware-seg": ".aas",
463
+ "application/x-axcrypt": ".axx",
464
+ "application/x-bat": ".bat",
465
+ "application/x-bcpio": ".bcpio",
466
+ "application/x-bibtex-text-file": ".bib",
467
+ "application/x-bittorrent": ".torrent",
468
+ "application/x-brotli": ".br",
469
+ "application/x-bzip": ".bz",
470
+ "application/x-bzip2": ".bz2",
471
+ "application/x-cdlink": ".vcd",
472
+ "application/x-chat": ".chat",
473
+ "application/x-chess-pgn": ".pgn",
474
+ "application/x-chrome-package": ".crx",
475
+ "application/x-compress": ".z",
476
+ "application/x-corelpresentations": ".shw",
477
+ "application/x-cpio": ".cpio",
478
+ "application/x-csh": ".csh",
479
+ "application/x-dbf": ".dbf",
480
+ "application/x-debian-package": ".deb",
481
+ "application/x-dex": ".dex",
482
+ "application/x-director": ".dir",
483
+ "application/x-doom": ".wad",
484
+ "application/x-dosexec": ".exe",
485
+ "application/x-dtbncx+xml": ".ncx",
486
+ "application/x-dtbook+xml": ".dtb",
487
+ "application/x-dtbresource+xml": ".res",
488
+ "application/x-dvi": ".dvi",
489
+ "application/x-elc": ".elc",
490
+ "application/x-endnote-refer": ".enw",
491
+ "application/x-erdas-hfa": ".hfa",
492
+ "application/x-esri-layer": ".lyr",
493
+ "application/x-fictionbook+xml": ".fb2",
494
+ "application/x-filemaker": ".fp7",
495
+ "application/x-font-adobe-metric": ".afm",
496
+ "application/x-font-bdf": ".bdf",
497
+ "application/x-font-ghostscript": ".gsf",
498
+ "application/x-font-linux-psf": ".psf",
499
+ "application/x-font-otf": ".otf",
500
+ "application/x-font-pcf": ".pcf",
501
+ "application/x-font-printer-metric": ".pfm",
502
+ "application/x-font-snf": ".snf",
503
+ "application/x-font-ttf": ".ttf",
504
+ "application/x-font-type1": ".pfa",
505
+ "application/x-futuresplash": ".spl",
506
+ "application/x-gnucash": ".gnucash",
507
+ "application/x-gnumeric": ".gnumeric",
508
+ "application/x-grib": ".grb",
509
+ "application/x-gtar": ".gtar",
510
+ "application/x-hdf": ".hdf",
511
+ "application/x-ibooks+zip": ".ibooks",
512
+ "application/x-internet-archive": ".arc",
513
+ "application/x-iso9660-image": ".iso",
514
+ "application/x-itunes-ipa": ".ipa",
515
+ "application/x-java-jnilib": ".jnilib",
516
+ "application/x-java-jnlp-file": ".jnlp",
517
+ "application/x-java-pack200": ".pack",
518
+ "application/x-killustrator": ".kil",
519
+ "application/x-latex": ".latex",
520
+ "application/x-lz4": ".lz4",
521
+ "application/x-lzip": ".lz",
522
+ "application/x-lzma": ".lzma",
523
+ "application/x-matlab-data": ".mat",
524
+ "application/x-memgraph": ".memgraph",
525
+ "application/x-mobipocket-ebook": ".prc",
526
+ "application/x-ms-application": ".application",
527
+ "application/x-ms-asx": ".asx",
528
+ "application/x-ms-installer": ".msi",
529
+ "application/x-ms-wmd": ".wmd",
530
+ "application/x-ms-wmz": ".wmz",
531
+ "application/x-ms-xbap": ".xbap",
532
+ "application/x-msaccess": ".mdb",
533
+ "application/x-msbinder": ".obd",
534
+ "application/x-mscardfile": ".crd",
535
+ "application/x-msclip": ".clp",
536
+ "application/x-msdownload": ".dll",
537
+ "application/x-msmediaview": ".mvb",
538
+ "application/x-msmoney": ".mny",
539
+ "application/x-mspublisher": ".pub",
540
+ "application/x-msschedule": ".scd",
541
+ "application/x-msterminal": ".trm",
542
+ "application/x-mswrite": ".wri",
543
+ "application/x-mysql-misam-compressed-index": ".MYI",
544
+ "application/x-mysql-misam-data": ".MYD",
545
+ "application/x-nesrom": ".nes",
546
+ "application/x-netcdf": ".nc",
547
+ "application/x-parquet": ".parquet",
548
+ "application/x-pkcs7-certificates": ".p7b",
549
+ "application/x-pkcs7-certreqresp": ".p7r",
550
+ "application/x-pkcs12": ".p12",
551
+ "application/x-project": ".mpx",
552
+ "application/x-prt": ".prt",
553
+ "application/x-quattro-pro": ".wq1",
554
+ "application/x-quattro-pro; version=1+5": ".wb1",
555
+ "application/x-quattro-pro; version=1-4": ".wq1",
556
+ "application/x-quattro-pro; version=5": ".wq2",
557
+ "application/x-quattro-pro; version=6": ".wb2",
558
+ "application/x-rar-compressed": ".rar",
559
+ "application/x-roxio-toast": ".toast",
560
+ "application/x-rpm": ".rpm",
561
+ "application/x-sas": ".sas",
562
+ "application/x-sas-access": ".sa7",
563
+ "application/x-sas-audit": ".st7",
564
+ "application/x-sas-backup": ".sas7bbak",
565
+ "application/x-sas-catalog": ".sc7",
566
+ "application/x-sas-data": ".sd7",
567
+ "application/x-sas-data-index": ".si7",
568
+ "application/x-sas-data-v6": ".sd2",
569
+ "application/x-sas-dmdb": ".s7m",
570
+ "application/x-sas-fdb": ".sf7",
571
+ "application/x-sas-itemstor": ".sr7",
572
+ "application/x-sas-mddb": ".sm7",
573
+ "application/x-sas-program-data": ".ss7",
574
+ "application/x-sas-putility": ".sp7",
575
+ "application/x-sas-transport": ".stx",
576
+ "application/x-sas-utility": ".su7",
577
+ "application/x-sas-view": ".sv7",
578
+ "application/x-sas-xport": ".xpt",
579
+ "application/x-sfdu": ".sfdu",
580
+ "application/x-sh": ".sh",
581
+ "application/x-shapefile": ".shp",
582
+ "application/x-shar": ".shar",
583
+ "application/x-shockwave-flash": ".swf",
584
+ "application/x-silverlight-app": ".xap",
585
+ "application/x-snappy-framed": ".sz",
586
+ "application/x-staroffice-template": ".vor",
587
+ "application/x-stata-do": ".do",
588
+ "application/x-stata-dta": ".dta",
589
+ "application/x-stuffit": ".sit",
590
+ "application/x-stuffitx": ".sitx",
591
+ "application/x-sv4cpio": ".sv4cpio",
592
+ "application/x-sv4crc": ".sv4crc",
593
+ "application/x-tar": ".tar",
594
+ "application/x-tex": ".tex",
595
+ "application/x-tex-tfm": ".tfm",
596
+ "application/x-texinfo": ".texinfo",
597
+ "application/x-tika-java-enterprise-archive": ".ear",
598
+ "application/x-tika-java-web-archive": ".war",
599
+ "application/x-tika-msworks-spreadsheet": ".xlr",
600
+ "application/x-tmx": ".tmx",
601
+ "application/x-uc2-compressed": ".uc2",
602
+ "application/x-ustar": ".ustar",
603
+ "application/x-vmdk": ".vmdk",
604
+ "application/x-wais-source": ".src",
605
+ "application/x-webarchive": ".webarchive",
606
+ "application/x-x509-cert": ".crt",
607
+ "application/x-x509-cert; format=der": ".der",
608
+ "application/x-x509-cert; format=pem": ".pem",
609
+ "application/x-xfig": ".fig",
610
+ "application/x-xliff+xml": ".xlf",
611
+ "application/x-xliff+zip": ".xlz",
612
+ "application/x-xmind": ".xmind",
613
+ "application/x-xpinstall": ".xpi",
614
+ "application/x-xz": ".xz",
615
+ "application/x-zoo": ".zoo",
616
+ "application/xenc+xml": ".xenc",
617
+ "application/xhtml+xml": ".xhtml",
618
+ "application/xml": ".xml",
619
+ "application/xml-dtd": ".dtd",
620
+ "application/xop+xml": ".xop",
621
+ "application/xquery": ".xq",
622
+ "application/xslfo+xml": ".xslfo",
623
+ "application/xslt+xml": ".xslt",
624
+ "application/xspf+xml": ".xspf",
625
+ "application/xv+xml": ".mxml",
626
+ "application/zip": ".zip",
627
+ "application/zstd": ".zst",
628
+ "audio/ac3": ".ac3",
629
+ "audio/adpcm": ".adp",
630
+ "audio/amr": ".amr",
631
+ "audio/basic": ".au",
632
+ "audio/midi": ".mid",
633
+ "audio/mp4": ".mp4a",
634
+ "audio/mpeg": ".mpga",
635
+ "audio/ogg": ".oga",
636
+ "audio/opus": ".opus",
637
+ "audio/speex": ".spx",
638
+ "audio/vnd.adobe.soundbooth": ".asnd",
639
+ "audio/vnd.digital-winds": ".eol",
640
+ "audio/vnd.dts": ".dts",
641
+ "audio/vnd.dts.hd": ".dtshd",
642
+ "audio/vnd.lucent.voice": ".lvp",
643
+ "audio/vnd.ms-playready.media.pya": ".pya",
644
+ "audio/vnd.nuera.ecelp4800": ".ecelp4800",
645
+ "audio/vnd.nuera.ecelp7470": ".ecelp7470",
646
+ "audio/vnd.nuera.ecelp9600": ".ecelp9600",
647
+ "audio/vnd.wave": ".wav",
648
+ "audio/vorbis": ".ogg",
649
+ "audio/x-aac": ".aac",
650
+ "audio/x-aiff": ".aif",
651
+ "audio/x-caf": ".caf",
652
+ "audio/x-flac": ".flac",
653
+ "audio/x-matroska": ".mka",
654
+ "audio/x-mod": ".mod",
655
+ "audio/x-mpegurl": ".m3u",
656
+ "audio/x-ms-wax": ".wax",
657
+ "audio/x-ms-wma": ".wma",
658
+ "audio/x-pn-realaudio": ".ram",
659
+ "audio/x-pn-realaudio-plugin": ".rmp",
660
+ "chemical/x-cdx": ".cdx",
661
+ "chemical/x-cif": ".cif",
662
+ "chemical/x-cmdf": ".cmdf",
663
+ "chemical/x-cml": ".cml",
664
+ "chemical/x-csml": ".csml",
665
+ "chemical/x-pdb": ".pdb",
666
+ "chemical/x-xyz": ".xyz",
667
+ "image/aces": ".exr",
668
+ "image/avif": ".avif",
669
+ "image/bmp": ".bmp",
670
+ "image/cgm": ".cgm",
671
+ "image/emf": ".emf",
672
+ "image/g3fax": ".g3",
673
+ "image/gif": ".gif",
674
+ "image/heic": ".heic",
675
+ "image/heif": ".heif",
676
+ "image/icns": ".icns",
677
+ "image/ief": ".ief",
678
+ "image/jp2": ".jp2",
679
+ "image/jpeg": ".jpg",
680
+ "image/jpm": ".jpm",
681
+ "image/jpx": ".jpf",
682
+ "image/jxl": ".jxl",
683
+ "image/nitf": ".ntf",
684
+ "image/png": ".png",
685
+ "image/prs.btif": ".btif",
686
+ "image/svg+xml": ".svg",
687
+ "image/tiff": ".tiff",
688
+ "image/vnd.adobe.photoshop": ".psd",
689
+ "image/vnd.adobe.premiere": ".ppj",
690
+ "image/vnd.dgn": ".dgn",
691
+ "image/vnd.djvu": ".djvu",
692
+ "image/vnd.dwg": ".dwg",
693
+ "image/vnd.dxb": ".dxb",
694
+ "image/vnd.dxf": ".dxf",
695
+ "image/vnd.fastbidsheet": ".fbs",
696
+ "image/vnd.fpx": ".fpx",
697
+ "image/vnd.fst": ".fst",
698
+ "image/vnd.fujixerox.edmics-mmr": ".mmr",
699
+ "image/vnd.fujixerox.edmics-rlc": ".rlc",
700
+ "image/vnd.microsoft.icon": ".ico",
701
+ "image/vnd.ms-modi": ".mdi",
702
+ "image/vnd.net-fpx": ".npx",
703
+ "image/vnd.wap.wbmp": ".wbmp",
704
+ "image/vnd.xiff": ".xif",
705
+ "image/vnd.zbrush.dcx": ".dcx",
706
+ "image/vnd.zbrush.pcx": ".pcx",
707
+ "image/webp": ".webp",
708
+ "image/wmf": ".wmf",
709
+ "image/x-bpg": ".bpg",
710
+ "image/x-cmu-raster": ".ras",
711
+ "image/x-cmx": ".cmx",
712
+ "image/x-dpx": ".dpx",
713
+ "image/x-emf-compressed": ".emz",
714
+ "image/x-freehand": ".fh",
715
+ "image/x-jbig2": ".jb2",
716
+ "image/x-jp2-codestream": ".j2c",
717
+ "image/x-pict": ".pic",
718
+ "image/x-portable-anymap": ".pnm",
719
+ "image/x-portable-bitmap": ".pbm",
720
+ "image/x-portable-graymap": ".pgm",
721
+ "image/x-portable-pixmap": ".ppm",
722
+ "image/x-raw-adobe": ".dng",
723
+ "image/x-raw-canon": ".crw",
724
+ "image/x-raw-casio": ".bay",
725
+ "image/x-raw-epson": ".erf",
726
+ "image/x-raw-fuji": ".raf",
727
+ "image/x-raw-hasselblad": ".3fr",
728
+ "image/x-raw-imacon": ".fff",
729
+ "image/x-raw-kodak": ".k25",
730
+ "image/x-raw-leaf": ".mos",
731
+ "image/x-raw-logitech": ".pxn",
732
+ "image/x-raw-mamiya": ".mef",
733
+ "image/x-raw-minolta": ".mrw",
734
+ "image/x-raw-nikon": ".nef",
735
+ "image/x-raw-olympus": ".orf",
736
+ "image/x-raw-panasonic": ".raw",
737
+ "image/x-raw-pentax": ".ptx",
738
+ "image/x-raw-phaseone": ".iiq",
739
+ "image/x-raw-rawzor": ".rwz",
740
+ "image/x-raw-red": ".r3d",
741
+ "image/x-raw-sigma": ".x3f",
742
+ "image/x-raw-sony": ".arw",
743
+ "image/x-rgb": ".rgb",
744
+ "image/x-tga": ".tga",
745
+ "image/x-xbitmap": ".xbm",
746
+ "image/x-xcf": ".xcf",
747
+ "image/x-xpixmap": ".xpm",
748
+ "image/x-xwindowdump": ".xwd",
749
+ "message/rfc822": ".eml",
750
+ "message/x-emlx": ".emlx",
751
+ "model/e57": ".e57",
752
+ "model/iges": ".igs",
753
+ "model/mesh": ".msh",
754
+ "model/vnd.dwf": ".dwf",
755
+ "model/vnd.dwfx+xps": ".dwfx",
756
+ "model/vnd.gdl": ".gdl",
757
+ "model/vnd.gtw": ".gtw",
758
+ "model/vnd.mts": ".mts",
759
+ "model/vnd.vtu": ".vtu",
760
+ "model/vrml": ".wrl",
761
+ "multipart/related": ".mht",
762
+ "text/asp": ".asp",
763
+ "text/aspdotnet": ".aspx",
764
+ "text/calendar": ".ics",
765
+ "text/css": ".css",
766
+ "text/csv": ".csv",
767
+ "text/html": ".html",
768
+ "text/iso19139+xml": ".iso19139",
769
+ "text/plain": ".txt",
770
+ "text/prs.lines.tag": ".dsc",
771
+ "text/richtext": ".rtx",
772
+ "text/sgml": ".sgml",
773
+ "text/tab-separated-values": ".tsv",
774
+ "text/troff": ".t",
775
+ "text/uri-list": ".uri",
776
+ "text/vnd.curl": ".curl",
777
+ "text/vnd.curl.dcurl": ".dcurl",
778
+ "text/vnd.curl.mcurl": ".mcurl",
779
+ "text/vnd.curl.scurl": ".scurl",
780
+ "text/vnd.fly": ".fly",
781
+ "text/vnd.fmi.flexstor": ".flx",
782
+ "text/vnd.graphviz": ".gv",
783
+ "text/vnd.in3d.3dml": ".3dml",
784
+ "text/vnd.in3d.spot": ".spot",
785
+ "text/vnd.iptc.anpa": ".anpa",
786
+ "text/vnd.sun.j2me.app-descriptor": ".jad",
787
+ "text/vnd.wap.wml": ".wml",
788
+ "text/vnd.wap.wmlscript": ".wmls",
789
+ "text/vtt": ".vtt",
790
+ "text/x-actionscript": ".as",
791
+ "text/x-ada": ".ada",
792
+ "text/x-applescript": ".applescript",
793
+ "text/x-asciidoc": ".asciidoc",
794
+ "text/x-aspectj": ".aj",
795
+ "text/x-assembly": ".s",
796
+ "text/x-awk": ".awk",
797
+ "text/x-basic": ".bas",
798
+ "text/x-c++hdr": ".hpp",
799
+ "text/x-c++src": ".cpp",
800
+ "text/x-cgi": ".cgi",
801
+ "text/x-chdr": ".h",
802
+ "text/x-clojure": ".clj",
803
+ "text/x-cobol": ".cbl",
804
+ "text/x-coffeescript": ".coffee",
805
+ "text/x-coldfusion": ".cfm",
806
+ "text/x-common-lisp": ".cl",
807
+ "text/x-config": ".config",
808
+ "text/x-csharp": ".cs",
809
+ "text/x-csrc": ".c",
810
+ "text/x-d": ".d",
811
+ "text/x-diff": ".diff",
812
+ "text/x-eiffel": ".e",
813
+ "text/x-emacs-lisp": ".el",
814
+ "text/x-erlang": ".erl",
815
+ "text/x-expect": ".exp",
816
+ "text/x-forth": ".4th",
817
+ "text/x-fortran": ".f",
818
+ "text/x-go": ".go",
819
+ "text/x-groovy": ".groovy",
820
+ "text/x-haml": ".haml",
821
+ "text/x-haskell": ".hs",
822
+ "text/x-haxe": ".hx",
823
+ "text/x-idl": ".idl",
824
+ "text/x-ini": ".ini",
825
+ "text/x-java-properties": ".properties",
826
+ "text/x-java-source": ".java",
827
+ "text/x-jsp": ".jsp",
828
+ "text/x-less": ".less",
829
+ "text/x-lex": ".l",
830
+ "text/x-log": ".log",
831
+ "text/x-lua": ".lua",
832
+ "text/x-ml": ".ml",
833
+ "text/x-modula": ".m3",
834
+ "text/x-objcsrc": ".m",
835
+ "text/x-ocaml": ".ocaml",
836
+ "text/x-pascal": ".p",
837
+ "text/x-perl": ".pl",
838
+ "text/x-php": ".php",
839
+ "text/x-prolog": ".pro",
840
+ "text/x-python": ".py",
841
+ "text/x-rexx": ".rexx",
842
+ "text/x-rsrc": ".r",
843
+ "text/x-rst": ".rest",
844
+ "text/x-ruby": ".rb",
845
+ "text/x-scala": ".scala",
846
+ "text/x-scheme": ".scm",
847
+ "text/x-sed": ".sed",
848
+ "text/x-setext": ".etx",
849
+ "text/x-sql": ".sql",
850
+ "text/x-stsrc": ".st",
851
+ "text/x-tcl": ".itk",
852
+ "text/x-uuencode": ".uu",
853
+ "text/x-vbasic": ".cls",
854
+ "text/x-vbdotnet": ".vb",
855
+ "text/x-vbscript": ".vbs",
856
+ "text/x-vcalendar": ".vcs",
857
+ "text/x-vcard": ".vcf",
858
+ "text/x-verilog": ".v",
859
+ "text/x-vhdl": ".vhd",
860
+ "text/x-web-markdown": ".md",
861
+ "text/x-yacc": ".y",
862
+ "text/x-yaml": ".yaml",
863
+ "video/3gpp": ".3gp",
864
+ "video/3gpp2": ".3g2",
865
+ "video/h261": ".h261",
866
+ "video/h263": ".h263",
867
+ "video/h264": ".h264",
868
+ "video/iso.segment": ".m4s",
869
+ "video/jpeg": ".jpgv",
870
+ "video/mj2": ".mj2",
871
+ "video/mp4": ".mp4",
872
+ "video/mpeg": ".mpeg",
873
+ "video/ogg": ".ogv",
874
+ "video/quicktime": ".qt",
875
+ "video/vnd.fvt": ".fvt",
876
+ "video/vnd.mpegurl": ".mxu",
877
+ "video/vnd.ms-playready.media.pyv": ".pyv",
878
+ "video/vnd.vivo": ".viv",
879
+ "video/webm": ".webm",
880
+ "video/x-dirac": ".drc",
881
+ "video/x-f4v": ".f4v",
882
+ "video/x-flc": ".flc",
883
+ "video/x-fli": ".fli",
884
+ "video/x-flv": ".flv",
885
+ "video/x-jng": ".jng",
886
+ "video/x-m4v": ".m4v",
887
+ "video/x-matroska": ".mkv",
888
+ "video/x-mng": ".mng",
889
+ "video/x-ms-asf": ".asf",
890
+ "video/x-ms-wm": ".wm",
891
+ "video/x-ms-wmv": ".wmv",
892
+ "video/x-ms-wmx": ".wmx",
893
+ "video/x-ms-wvx": ".wvx",
894
+ "video/x-msvideo": ".avi",
895
+ "video/x-ogm": ".ogm",
896
+ "video/x-sgi-movie": ".movie",
897
+ "x-conference/x-cooltalk": ".ice",
898
+ };
899
+ export const TYPES_BY_EXTENSION = Object.fromEntries(Object.entries(EXTENSIONS_BY_TYPE).map(([type, extension]) => [extension, type]));
900
+ export const identity = (value) => value;
901
+ export const injectLiveReloadScript = (html) => {
902
+ const liveReloadScript = `
903
+ <script>
904
+ const eventSource = new EventSource("/__live_reload");
905
+
906
+ eventSource.onmessage = () => {
907
+ const newHash = Math.random().toString(36).slice(2, 10);
908
+
909
+ window.localStorage.setItem("${ALLURE_LIVE_RELOAD_HASH_STORAGE_KEY}", newHash);
910
+ window.location.reload();
911
+ };
912
+ </script>
913
+ `;
914
+ return html.replace("</body>", `${liveReloadScript}</body>`);
915
+ };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@allurereport/static-server",
3
+ "version": "3.0.0-beta.10",
4
+ "description": "Minimalistic web-server for serving static files",
5
+ "keywords": [
6
+ "allure",
7
+ "testing",
8
+ "web",
9
+ "http",
10
+ "server"
11
+ ],
12
+ "repository": "https://github.com/allure-framework/allure3",
13
+ "license": "Apache-2.0",
14
+ "author": "Qameta Software",
15
+ "type": "module",
16
+ "exports": {
17
+ ".": "./dist/index.js"
18
+ },
19
+ "module": "dist/index.js",
20
+ "types": "dist/index.d.ts",
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "run clean && tsc --project ./tsconfig.json",
26
+ "clean": "rimraf ./dist",
27
+ "pretest": "rimraf ./out",
28
+ "test": "run-p 'test:*'",
29
+ "test:unit": "vitest run",
30
+ "eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
31
+ "eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
32
+ "test:e2e": "playwright test"
33
+ },
34
+ "dependencies": {
35
+ "@allurereport/directory-watcher": "3.0.0-beta.10",
36
+ "@allurereport/web-commons": "3.0.0-beta.10",
37
+ "open": "^10.1.0"
38
+ },
39
+ "devDependencies": {
40
+ "@playwright/test": "^1.48.2",
41
+ "@stylistic/eslint-plugin": "^2.6.1",
42
+ "@types/eslint": "^8.56.11",
43
+ "@types/node": "^20.17.9",
44
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
45
+ "@typescript-eslint/parser": "^8.0.0",
46
+ "@vitest/runner": "^2.1.8",
47
+ "@vitest/snapshot": "^2.1.8",
48
+ "allure-js-commons": "^3.0.9",
49
+ "allure-playwright": "^3.0.9",
50
+ "allure-vitest": "^3.0.9",
51
+ "axios": "^1.7.7",
52
+ "eslint": "^8.57.0",
53
+ "eslint-config-prettier": "^9.1.0",
54
+ "eslint-plugin-import": "^2.29.1",
55
+ "eslint-plugin-jsdoc": "^50.0.0",
56
+ "eslint-plugin-n": "^17.10.1",
57
+ "eslint-plugin-no-null": "^1.0.2",
58
+ "eslint-plugin-prefer-arrow": "^1.2.3",
59
+ "get-port": "^7.1.0",
60
+ "npm-run-all2": "^7.0.1",
61
+ "rimraf": "^6.0.1",
62
+ "typescript": "^5.6.3",
63
+ "vitest": "^2.1.8"
64
+ }
65
+ }