@putkoff/abstract-utilities 1.0.70 → 1.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +247 -341
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server.js +342 -0
- package/dist/cjs/server.js.map +1 -0
- package/dist/esm/index.js +508 -1156
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server.js +305 -0
- package/dist/esm/server.js.map +1 -0
- package/dist/types/functions/auth_utils/imports.d.ts +0 -0
- package/dist/types/functions/auth_utils/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/token_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/imports.d.ts +0 -0
- package/dist/types/functions/config_utils/index.d.ts +0 -0
- package/dist/types/functions/config_utils/src/config_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/src/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/constants.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/imports.d.ts +0 -0
- package/dist/types/functions/env_utils/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/window_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/imports.d.ts +0 -0
- package/dist/types/functions/fetch_utils/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/fetch_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/url_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/index.d.ts +0 -0
- package/dist/types/functions/math_utils/constants.d.ts +0 -0
- package/dist/types/functions/math_utils/conversions.d.ts +0 -0
- package/dist/types/functions/math_utils/index.d.ts +0 -0
- package/dist/types/functions/math_utils/safe_math.d.ts +0 -0
- package/dist/types/functions/math_utils/scaleInterfaces.d.ts +0 -0
- package/dist/types/functions/path_utils/imports.d.ts +0 -0
- package/dist/types/functions/path_utils/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/base_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/function_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/misc_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/path_utils.d.ts +0 -0
- package/dist/types/functions/path_utils/src/paths.d.ts +0 -0
- package/dist/types/functions/path_utils/src/src_dirs.d.ts +0 -0
- package/dist/types/functions/read_utils/imports.d.ts +0 -0
- package/dist/types/functions/read_utils/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/index.d.ts +3 -1
- package/dist/types/functions/read_utils/src/readJsonFile.browser.d.ts +1 -0
- package/dist/types/functions/read_utils/src/readJsonFile.d.ts +2 -0
- package/dist/types/functions/read_utils/src/readJsonFile.node.d.ts +1 -0
- package/dist/types/functions/rndm_utils/imports.d.ts +0 -0
- package/dist/types/functions/rndm_utils/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/safe_utils/imports.d.ts +0 -0
- package/dist/types/functions/safe_utils/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_document.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_globals.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_storage.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_window.d.ts +0 -0
- package/dist/types/functions/string_utils/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/string_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/clean_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/ensure_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/src/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/json_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/list_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/mime_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/type_utils.d.ts +0 -0
- package/dist/types/functions/variable_utils/imports.d.ts +0 -0
- package/dist/types/functions/variable_utils/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/variable_utils.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/types/index.d.ts +0 -0
- package/dist/types/types/src/Files.d.ts +0 -0
- package/dist/types/types/src/index.d.ts +0 -0
- package/dist/types/types/src/login.d.ts +0 -0
- package/dist/types/types/src/logout.d.ts +0 -0
- package/dist/types/types/src/utils.d.ts +0 -0
- package/dist/types/utils/imports.d.ts +0 -0
- package/dist/types/utils/index.d.ts +0 -0
- package/dist/types/utils/src/Input.d.ts +0 -0
- package/dist/types/utils/src/config.d.ts +0 -0
- package/dist/types/utils/src/index.d.ts +0 -0
- package/package.json +2 -17
- package/dist/index.d.ts +0 -813
- package/dist/types/functions/read_utils/src/utils.d.ts +0 -8
- package/dist/types/functions/ui_utils/imports.d.ts +0 -4
- package/dist/types/functions/ui_utils/index.d.ts +0 -1
- package/dist/types/functions/ui_utils/src/button.d.ts +0 -5
- package/dist/types/functions/ui_utils/src/checkbox.d.ts +0 -4
- package/dist/types/functions/ui_utils/src/index.d.ts +0 -4
- package/dist/types/functions/ui_utils/src/input.d.ts +0 -5
- package/dist/types/functions/ui_utils/src/spinner.d.ts +0 -1
- package/dist/types/types/src/ChangePassword.d.ts +0 -16
- package/dist/types/ui/Navbar/DropDowns/DropDownElements.d.ts +0 -8
- package/dist/types/ui/Navbar/DropDowns/ForumsDropdown.d.ts +0 -2
- package/dist/types/ui/Navbar/DropDowns/index.d.ts +0 -3
- package/dist/types/ui/Navbar/NavBar.d.ts +0 -8
- package/dist/types/ui/Navbar/index.d.ts +0 -3
- package/dist/types/ui/index.d.ts +0 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('server-only');
|
|
4
|
+
var fs = require('node:fs');
|
|
5
|
+
var fsp = require('node:fs/promises');
|
|
6
|
+
var path = require('node:path');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
26
|
+
var fsp__namespace = /*#__PURE__*/_interopNamespaceDefault(fsp);
|
|
27
|
+
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
28
|
+
|
|
29
|
+
// mediaTypes.ts
|
|
30
|
+
/** ---- Data: large but explicit, mirrors your Python mapping ---- */
|
|
31
|
+
const MIME_TYPES = {
|
|
32
|
+
image: {
|
|
33
|
+
".jpg": "image/jpeg",
|
|
34
|
+
".jpeg": "image/jpeg",
|
|
35
|
+
".png": "image/png",
|
|
36
|
+
".gif": "image/gif",
|
|
37
|
+
".bmp": "image/bmp",
|
|
38
|
+
".tiff": "image/tiff",
|
|
39
|
+
".webp": "image/webp",
|
|
40
|
+
".svg": "image/svg+xml",
|
|
41
|
+
".ico": "image/vnd.microsoft.icon",
|
|
42
|
+
".heic": "image/heic",
|
|
43
|
+
".psd": "image/vnd.adobe.photoshop",
|
|
44
|
+
".raw": "image/x-raw",
|
|
45
|
+
},
|
|
46
|
+
video: {
|
|
47
|
+
".mp4": "video/mp4",
|
|
48
|
+
".webm": "video/webm",
|
|
49
|
+
".ogg": "video/ogg",
|
|
50
|
+
".mov": "video/quicktime",
|
|
51
|
+
".avi": "video/x-msvideo",
|
|
52
|
+
".mkv": "video/x-matroska",
|
|
53
|
+
".flv": "video/x-flv",
|
|
54
|
+
".wmv": "video/x-ms-wmv",
|
|
55
|
+
".3gp": "video/3gpp",
|
|
56
|
+
".ts": "video/mp2t",
|
|
57
|
+
".mpeg": "video/mpeg",
|
|
58
|
+
".mpg": "video/mpg",
|
|
59
|
+
},
|
|
60
|
+
audio: {
|
|
61
|
+
".mp3": "audio/mpeg",
|
|
62
|
+
".wav": "audio/wav",
|
|
63
|
+
".flac": "audio/flac",
|
|
64
|
+
".aac": "audio/aac",
|
|
65
|
+
".ogg": "audio/ogg",
|
|
66
|
+
".m4a": "audio/mp4",
|
|
67
|
+
".opus": "audio/opus",
|
|
68
|
+
},
|
|
69
|
+
document: {
|
|
70
|
+
".pdf": "application/pdf",
|
|
71
|
+
".doc": "application/msword",
|
|
72
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
73
|
+
".odt": "application/vnd.oasis.opendocument.text",
|
|
74
|
+
".txt": "text/plain",
|
|
75
|
+
".rtf": "application/rtf",
|
|
76
|
+
".md": "text/markdown",
|
|
77
|
+
".markdown": "text/markdown",
|
|
78
|
+
".tex": "application/x-tex",
|
|
79
|
+
".log": "text/plain",
|
|
80
|
+
".json": "application/json",
|
|
81
|
+
".xml": "application/xml",
|
|
82
|
+
".yaml": "application/x-yaml",
|
|
83
|
+
".yml": "application/x-yaml",
|
|
84
|
+
".ini": "text/plain",
|
|
85
|
+
".cfg": "text/plain",
|
|
86
|
+
".toml": "application/toml",
|
|
87
|
+
".csv": "text/csv",
|
|
88
|
+
".tsv": "text/tab-separated-values",
|
|
89
|
+
},
|
|
90
|
+
presentation: {
|
|
91
|
+
".ppt": "application/vnd.ms-powerpoint",
|
|
92
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
93
|
+
".odp": "application/vnd.oasis.opendocument.presentation",
|
|
94
|
+
},
|
|
95
|
+
spreadsheet: {
|
|
96
|
+
".xls": "application/vnd.ms-excel",
|
|
97
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
98
|
+
".ods": "application/vnd.oasis.opendocument.spreadsheet",
|
|
99
|
+
".csv": "text/csv",
|
|
100
|
+
".tsv": "text/tab-separated-values",
|
|
101
|
+
},
|
|
102
|
+
code: {
|
|
103
|
+
".py": "text/x-python",
|
|
104
|
+
".java": "text/x-java-source",
|
|
105
|
+
".c": "text/x-c",
|
|
106
|
+
".cpp": "text/x-c++",
|
|
107
|
+
".h": "text/x-c",
|
|
108
|
+
".hpp": "text/x-c++",
|
|
109
|
+
".js": "application/javascript",
|
|
110
|
+
".cjs": "application/javascript",
|
|
111
|
+
".mjs": "application/javascript",
|
|
112
|
+
".jsx": "application/javascript",
|
|
113
|
+
".ts": "application/typescript",
|
|
114
|
+
".tsx": "application/typescript",
|
|
115
|
+
".rb": "text/x-ruby",
|
|
116
|
+
".php": "application/x-php",
|
|
117
|
+
".go": "text/x-go",
|
|
118
|
+
".rs": "text/rust",
|
|
119
|
+
".swift": "text/x-swift",
|
|
120
|
+
".kt": "text/x-kotlin",
|
|
121
|
+
".sh": "application/x-shellscript",
|
|
122
|
+
".bash": "application/x-shellscript",
|
|
123
|
+
".ps1": "application/x-powershell",
|
|
124
|
+
".sql": "application/sql",
|
|
125
|
+
".yml": "application/x-yaml",
|
|
126
|
+
".coffee": "text/coffeescript",
|
|
127
|
+
".lua": "text/x-lua",
|
|
128
|
+
},
|
|
129
|
+
archive: {
|
|
130
|
+
".zip": "application/zip",
|
|
131
|
+
".tar": "application/x-tar",
|
|
132
|
+
".gz": "application/gzip",
|
|
133
|
+
".tgz": "application/gzip",
|
|
134
|
+
".bz2": "application/x-bzip2",
|
|
135
|
+
".xz": "application/x-xz",
|
|
136
|
+
".rar": "application/vnd.rar",
|
|
137
|
+
".7z": "application/x-7z-compressed",
|
|
138
|
+
".iso": "application/x-iso9660-image",
|
|
139
|
+
".dmg": "application/x-apple-diskimage",
|
|
140
|
+
".jar": "application/java-archive",
|
|
141
|
+
".war": "application/java-archive",
|
|
142
|
+
".whl": "application/python-wheel",
|
|
143
|
+
".egg": "application/python-egg",
|
|
144
|
+
},
|
|
145
|
+
font: {
|
|
146
|
+
".ttf": "font/ttf",
|
|
147
|
+
".otf": "font/otf",
|
|
148
|
+
".woff": "font/woff",
|
|
149
|
+
".woff2": "font/woff2",
|
|
150
|
+
".eot": "application/vnd.ms-fontobject",
|
|
151
|
+
},
|
|
152
|
+
executable: {
|
|
153
|
+
".exe": "application/vnd.microsoft.portable-executable",
|
|
154
|
+
".dll": "application/vnd.microsoft.portable-executable",
|
|
155
|
+
".bin": "application/octet-stream",
|
|
156
|
+
".deb": "application/vnd.debian.binary-package",
|
|
157
|
+
".rpm": "application/x-rpm",
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
/** Mirror of MEDIA_TYPES in Python: category -> Set of extensions */
|
|
161
|
+
const MEDIA_TYPES = Object.fromEntries(Object.entries(MIME_TYPES).map(([cat, mapping]) => [
|
|
162
|
+
cat,
|
|
163
|
+
new Set(Object.keys(mapping)),
|
|
164
|
+
]));
|
|
165
|
+
/** ---- Helpers ---- */
|
|
166
|
+
function toCategorySet(categories) {
|
|
167
|
+
const allCats = new Set(Object.keys(MIME_TYPES));
|
|
168
|
+
if (!categories) {
|
|
169
|
+
// all categories
|
|
170
|
+
return new Set(allCats);
|
|
171
|
+
}
|
|
172
|
+
const out = new Set();
|
|
173
|
+
for (const c of categories) {
|
|
174
|
+
const key = String(c);
|
|
175
|
+
if (allCats.has(key))
|
|
176
|
+
out.add(key);
|
|
177
|
+
}
|
|
178
|
+
return out.size ? out : new Set(allCats);
|
|
179
|
+
}
|
|
180
|
+
function normalizeCategories(categories, opts) {
|
|
181
|
+
const selected = categories ?? opts?.media_types ?? null;
|
|
182
|
+
return toCategorySet(selected);
|
|
183
|
+
}
|
|
184
|
+
function extOf(input) {
|
|
185
|
+
// Behaves like pathlib.Path(...).suffix.lower(): last extension only; lowercased.
|
|
186
|
+
let ext = path__namespace.extname(input || "");
|
|
187
|
+
if (!ext && input && input.startsWith(".")) {
|
|
188
|
+
// user passed ".jpg" directly
|
|
189
|
+
ext = input;
|
|
190
|
+
}
|
|
191
|
+
return (ext || "").toLowerCase();
|
|
192
|
+
}
|
|
193
|
+
function unionExts(categories) {
|
|
194
|
+
const out = new Set();
|
|
195
|
+
for (const c of categories) {
|
|
196
|
+
const set = MEDIA_TYPES[c];
|
|
197
|
+
for (const e of set)
|
|
198
|
+
out.add(e);
|
|
199
|
+
}
|
|
200
|
+
return out;
|
|
201
|
+
}
|
|
202
|
+
/** ---- API (Python parity) ---- */
|
|
203
|
+
/**
|
|
204
|
+
* Return a sub-map of MEDIA_TYPES for the given categories.
|
|
205
|
+
* If categories is falsy, returns all categories.
|
|
206
|
+
*/
|
|
207
|
+
function getMediaMap(categories, opts) {
|
|
208
|
+
const cats = normalizeCategories(categories, opts);
|
|
209
|
+
const result = {};
|
|
210
|
+
for (const c of cats)
|
|
211
|
+
result[c] = new Set(MEDIA_TYPES[c]);
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Return a flat, sorted list of all extensions for the given categories.
|
|
216
|
+
*/
|
|
217
|
+
function getMediaExts(categories, opts) {
|
|
218
|
+
const cats = normalizeCategories(categories, opts);
|
|
219
|
+
return Array.from(unionExts(cats)).sort();
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Given a file path or extension, return its media category (e.g. "image") or null.
|
|
223
|
+
* Mirrors Python's confirm_type.
|
|
224
|
+
*/
|
|
225
|
+
function confirmType(pathOrExt, categories, opts) {
|
|
226
|
+
const cats = normalizeCategories(categories, opts);
|
|
227
|
+
const ext = extOf(pathOrExt);
|
|
228
|
+
// Preserve object insertion order like Python dict iteration
|
|
229
|
+
for (const [category, exts] of Object.entries(MEDIA_TYPES)) {
|
|
230
|
+
if (!cats.has(category))
|
|
231
|
+
continue;
|
|
232
|
+
if (ext && exts.has(ext))
|
|
233
|
+
return category;
|
|
234
|
+
}
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* True if the given file path or extension belongs to one of the categories.
|
|
239
|
+
*/
|
|
240
|
+
function isMediaType(pathOrExt, categories, opts) {
|
|
241
|
+
return confirmType(pathOrExt, categories, opts) !== null;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Look up the MIME type by extension; fall back to 'application/octet-stream'.
|
|
245
|
+
*/
|
|
246
|
+
function getMimeType(pathOrExt) {
|
|
247
|
+
const ext = extOf(pathOrExt);
|
|
248
|
+
for (const mapping of Object.values(MIME_TYPES)) {
|
|
249
|
+
if (ext && mapping[ext]) {
|
|
250
|
+
return mapping[ext];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return "application/octet-stream";
|
|
254
|
+
}
|
|
255
|
+
function getAllFileTypesSync(directory, categories, opts) {
|
|
256
|
+
// 🧩 Skip entirely if fs isn't available
|
|
257
|
+
if (!fs__namespace || !path__namespace)
|
|
258
|
+
return [];
|
|
259
|
+
try {
|
|
260
|
+
const stat = fs__namespace.statSync(directory);
|
|
261
|
+
if (!stat.isDirectory())
|
|
262
|
+
return [];
|
|
263
|
+
const cats = normalizeCategories(categories, opts);
|
|
264
|
+
const wanted = unionExts(cats);
|
|
265
|
+
const results = [];
|
|
266
|
+
function walkSync(dir) {
|
|
267
|
+
const entries = fs__namespace.readdirSync(dir, { withFileTypes: true });
|
|
268
|
+
for (const ent of entries) {
|
|
269
|
+
const full = path__namespace.join(dir, ent.name);
|
|
270
|
+
if (ent.isDirectory()) {
|
|
271
|
+
walkSync(full);
|
|
272
|
+
}
|
|
273
|
+
else if (ent.isFile()) {
|
|
274
|
+
const ext = path__namespace.extname(ent.name).toLowerCase();
|
|
275
|
+
if (wanted.has(ext))
|
|
276
|
+
results.push(full);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
walkSync(directory);
|
|
281
|
+
return results;
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
async function getAllFileTypes(directory, categories, opts) {
|
|
288
|
+
// 🧩 Skip entirely if fsp isn't available
|
|
289
|
+
if (!fsp__namespace || !path__namespace)
|
|
290
|
+
return [];
|
|
291
|
+
try {
|
|
292
|
+
const stat = await fsp__namespace.stat(directory);
|
|
293
|
+
if (!stat.isDirectory())
|
|
294
|
+
return [];
|
|
295
|
+
const cats = normalizeCategories(categories, opts);
|
|
296
|
+
const wanted = unionExts(cats);
|
|
297
|
+
const results = [];
|
|
298
|
+
async function walkAsync(dir) {
|
|
299
|
+
const entries = await fsp__namespace.readdir(dir, { withFileTypes: true });
|
|
300
|
+
for (const ent of entries) {
|
|
301
|
+
const full = path__namespace.join(dir, ent.name);
|
|
302
|
+
if (ent.isDirectory()) {
|
|
303
|
+
await walkAsync(full);
|
|
304
|
+
}
|
|
305
|
+
else if (ent.isFile()) {
|
|
306
|
+
const ext = path__namespace.extname(ent.name).toLowerCase();
|
|
307
|
+
if (wanted.has(ext))
|
|
308
|
+
results.push(full);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
await walkAsync(directory);
|
|
313
|
+
return results;
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/** Optional convenience re-exports that mirror your Python names */
|
|
320
|
+
const get_all_file_types = getAllFileTypes;
|
|
321
|
+
const get_media_map = getMediaMap;
|
|
322
|
+
const get_media_exts = getMediaExts;
|
|
323
|
+
const confirm_type = confirmType;
|
|
324
|
+
const is_media_type = isMediaType;
|
|
325
|
+
const get_mime_type = getMimeType;
|
|
326
|
+
|
|
327
|
+
exports.MEDIA_TYPES = MEDIA_TYPES;
|
|
328
|
+
exports.MIME_TYPES = MIME_TYPES;
|
|
329
|
+
exports.confirmType = confirmType;
|
|
330
|
+
exports.confirm_type = confirm_type;
|
|
331
|
+
exports.getAllFileTypes = getAllFileTypes;
|
|
332
|
+
exports.getAllFileTypesSync = getAllFileTypesSync;
|
|
333
|
+
exports.getMediaExts = getMediaExts;
|
|
334
|
+
exports.getMediaMap = getMediaMap;
|
|
335
|
+
exports.getMimeType = getMimeType;
|
|
336
|
+
exports.get_all_file_types = get_all_file_types;
|
|
337
|
+
exports.get_media_exts = get_media_exts;
|
|
338
|
+
exports.get_media_map = get_media_map;
|
|
339
|
+
exports.get_mime_type = get_mime_type;
|
|
340
|
+
exports.isMediaType = isMediaType;
|
|
341
|
+
exports.is_media_type = is_media_type;
|
|
342
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sources":["../../src/server/src/mime_utils.ts"],"sourcesContent":["// mediaTypes.ts\nimport * as fs from \"node:fs\";\nimport * as fsp from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\n/** ---- Types ---- */\nexport type MimeByExt = Record<string, string>;\nexport type MediaMap = Record<string, MimeByExt>;\nexport type MediaCategory = keyof typeof MIME_TYPES;\n\nexport interface MediaOptions {\n /** Alias to mirror the Python **kwargs['media_types'] behavior */\n media_types?: Iterable<string> | string[] | null;\n}\n\n/** ---- Data: large but explicit, mirrors your Python mapping ---- */\nexport const MIME_TYPES = {\n image: {\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".png\": \"image/png\",\n \".gif\": \"image/gif\",\n \".bmp\": \"image/bmp\",\n \".tiff\": \"image/tiff\",\n \".webp\": \"image/webp\",\n \".svg\": \"image/svg+xml\",\n \".ico\": \"image/vnd.microsoft.icon\",\n \".heic\": \"image/heic\",\n \".psd\": \"image/vnd.adobe.photoshop\",\n \".raw\": \"image/x-raw\",\n },\n video: {\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".ogg\": \"video/ogg\",\n \".mov\": \"video/quicktime\",\n \".avi\": \"video/x-msvideo\",\n \".mkv\": \"video/x-matroska\",\n \".flv\": \"video/x-flv\",\n \".wmv\": \"video/x-ms-wmv\",\n \".3gp\": \"video/3gpp\",\n \".ts\": \"video/mp2t\",\n \".mpeg\": \"video/mpeg\",\n \".mpg\": \"video/mpg\",\n },\n audio: {\n \".mp3\": \"audio/mpeg\",\n \".wav\": \"audio/wav\",\n \".flac\": \"audio/flac\",\n \".aac\": \"audio/aac\",\n \".ogg\": \"audio/ogg\",\n \".m4a\": \"audio/mp4\",\n \".opus\": \"audio/opus\",\n },\n document: {\n \".pdf\": \"application/pdf\",\n \".doc\": \"application/msword\",\n \".docx\":\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \".odt\": \"application/vnd.oasis.opendocument.text\",\n \".txt\": \"text/plain\",\n \".rtf\": \"application/rtf\",\n \".md\": \"text/markdown\",\n \".markdown\": \"text/markdown\",\n \".tex\": \"application/x-tex\",\n \".log\": \"text/plain\",\n \".json\": \"application/json\",\n \".xml\": \"application/xml\",\n \".yaml\": \"application/x-yaml\",\n \".yml\": \"application/x-yaml\",\n \".ini\": \"text/plain\",\n \".cfg\": \"text/plain\",\n \".toml\": \"application/toml\",\n \".csv\": \"text/csv\",\n \".tsv\": \"text/tab-separated-values\",\n },\n presentation: {\n \".ppt\": \"application/vnd.ms-powerpoint\",\n \".pptx\":\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \".odp\": \"application/vnd.oasis.opendocument.presentation\",\n },\n spreadsheet: {\n \".xls\": \"application/vnd.ms-excel\",\n \".xlsx\":\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \".ods\": \"application/vnd.oasis.opendocument.spreadsheet\",\n \".csv\": \"text/csv\",\n \".tsv\": \"text/tab-separated-values\",\n },\n code: {\n \".py\": \"text/x-python\",\n \".java\": \"text/x-java-source\",\n \".c\": \"text/x-c\",\n \".cpp\": \"text/x-c++\",\n \".h\": \"text/x-c\",\n \".hpp\": \"text/x-c++\",\n \".js\": \"application/javascript\",\n \".cjs\": \"application/javascript\",\n \".mjs\": \"application/javascript\",\n \".jsx\": \"application/javascript\",\n \".ts\": \"application/typescript\",\n \".tsx\": \"application/typescript\",\n \".rb\": \"text/x-ruby\",\n \".php\": \"application/x-php\",\n \".go\": \"text/x-go\",\n \".rs\": \"text/rust\",\n \".swift\": \"text/x-swift\",\n \".kt\": \"text/x-kotlin\",\n \".sh\": \"application/x-shellscript\",\n \".bash\": \"application/x-shellscript\",\n \".ps1\": \"application/x-powershell\",\n \".sql\": \"application/sql\",\n \".yml\": \"application/x-yaml\",\n \".coffee\": \"text/coffeescript\",\n \".lua\": \"text/x-lua\",\n },\n archive: {\n \".zip\": \"application/zip\",\n \".tar\": \"application/x-tar\",\n \".gz\": \"application/gzip\",\n \".tgz\": \"application/gzip\",\n \".bz2\": \"application/x-bzip2\",\n \".xz\": \"application/x-xz\",\n \".rar\": \"application/vnd.rar\",\n \".7z\": \"application/x-7z-compressed\",\n \".iso\": \"application/x-iso9660-image\",\n \".dmg\": \"application/x-apple-diskimage\",\n \".jar\": \"application/java-archive\",\n \".war\": \"application/java-archive\",\n \".whl\": \"application/python-wheel\",\n \".egg\": \"application/python-egg\",\n },\n font: {\n \".ttf\": \"font/ttf\",\n \".otf\": \"font/otf\",\n \".woff\": \"font/woff\",\n \".woff2\": \"font/woff2\",\n \".eot\": \"application/vnd.ms-fontobject\",\n },\n executable: {\n \".exe\": \"application/vnd.microsoft.portable-executable\",\n \".dll\": \"application/vnd.microsoft.portable-executable\",\n \".bin\": \"application/octet-stream\",\n \".deb\": \"application/vnd.debian.binary-package\",\n \".rpm\": \"application/x-rpm\",\n },\n} as const;\n\n/** Mirror of MEDIA_TYPES in Python: category -> Set of extensions */\nexport const MEDIA_TYPES: Record<MediaCategory, Set<string>> = Object.fromEntries(\n Object.entries(MIME_TYPES).map(([cat, mapping]) => [\n cat,\n new Set(Object.keys(mapping)),\n ])\n) as Record<MediaCategory, Set<string>>;\n\n/** ---- Helpers ---- */\nfunction toCategorySet(\n categories?: Iterable<string> | string[] | null,\n): Set<MediaCategory> {\n const allCats = new Set(Object.keys(MIME_TYPES)) as Set<string>;\n if (!categories) {\n // all categories\n return new Set(allCats) as Set<MediaCategory>;\n }\n const out = new Set<MediaCategory>();\n for (const c of categories as Iterable<string>) {\n const key = String(c) as MediaCategory;\n if (allCats.has(key)) out.add(key);\n }\n return out.size ? out : (new Set(allCats) as Set<MediaCategory>);\n}\n\nfunction normalizeCategories<T extends MediaOptions | undefined>(\n categories?: Iterable<string> | string[] | null,\n opts?: T,\n): Set<MediaCategory> {\n const selected = categories ?? opts?.media_types ?? null;\n return toCategorySet(selected);\n}\n\nfunction extOf(input: string): string {\n // Behaves like pathlib.Path(...).suffix.lower(): last extension only; lowercased.\n let ext = path.extname(input || \"\");\n if (!ext && input && input.startsWith(\".\")) {\n // user passed \".jpg\" directly\n ext = input;\n }\n return (ext || \"\").toLowerCase();\n}\n\nfunction unionExts(categories: Set<MediaCategory>): Set<string> {\n const out = new Set<string>();\n for (const c of categories) {\n const set = MEDIA_TYPES[c];\n for (const e of set) out.add(e);\n }\n return out;\n}\n\n/** ---- API (Python parity) ---- */\n\n/**\n * Return a sub-map of MEDIA_TYPES for the given categories.\n * If categories is falsy, returns all categories.\n */\nexport function getMediaMap(\n categories?: Iterable<string> | string[] | null,\n opts?: MediaOptions,\n): Partial<Record<MediaCategory, Set<string>>> {\n const cats = normalizeCategories(categories, opts);\n const result: Partial<Record<MediaCategory, Set<string>>> = {};\n for (const c of cats) result[c] = new Set(MEDIA_TYPES[c]);\n return result;\n}\n\n/**\n * Return a flat, sorted list of all extensions for the given categories.\n */\nexport function getMediaExts(\n categories?: Iterable<string> | string[] | null,\n opts?: MediaOptions,\n): string[] {\n const cats = normalizeCategories(categories, opts);\n return Array.from(unionExts(cats)).sort();\n}\n\n/**\n * Given a file path or extension, return its media category (e.g. \"image\") or null.\n * Mirrors Python's confirm_type.\n */\nexport function confirmType(\n pathOrExt: string,\n categories?: Iterable<string> | string[] | null,\n opts?: MediaOptions,\n): MediaCategory | null {\n const cats = normalizeCategories(categories, opts);\n const ext = extOf(pathOrExt);\n // Preserve object insertion order like Python dict iteration\n for (const [category, exts] of Object.entries(MEDIA_TYPES) as [\n MediaCategory,\n Set<string>,\n ][]) {\n if (!cats.has(category)) continue;\n if (ext && exts.has(ext)) return category;\n }\n return null;\n}\n\n/**\n * True if the given file path or extension belongs to one of the categories.\n */\nexport function isMediaType(\n pathOrExt: string,\n categories?: Iterable<string> | string[] | null,\n opts?: MediaOptions,\n): boolean {\n return confirmType(pathOrExt, categories, opts) !== null;\n}\n\n/**\n * Look up the MIME type by extension; fall back to 'application/octet-stream'.\n */\nexport function getMimeType(pathOrExt: string): string {\n const ext = extOf(pathOrExt);\n for (const mapping of Object.values(MIME_TYPES)) {\n if (ext && mapping[ext as keyof typeof mapping]) {\n return mapping[ext as keyof typeof mapping] as string;\n }\n }\n return \"application/octet-stream\";\n}\n\nexport function getAllFileTypesSync(\n directory: string,\n categories?: Iterable<string> | string[] | null,\n opts?: MediaOptions,\n): string[] {\n // 🧩 Skip entirely if fs isn't available\n if (!fs || !path) return [];\n\n try {\n const stat = fs.statSync(directory);\n if (!stat.isDirectory()) return [];\n\n const cats = normalizeCategories(categories, opts);\n const wanted = unionExts(cats);\n const results: string[] = [];\n\n function walkSync(dir: string) {\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const ent of entries) {\n const full = path.join(dir, ent.name);\n if (ent.isDirectory()) {\n walkSync(full);\n } else if (ent.isFile()) {\n const ext = path.extname(ent.name).toLowerCase();\n if (wanted.has(ext)) results.push(full);\n }\n }\n }\n\n walkSync(directory);\n return results;\n } catch {\n return [];\n }\n}\n\nexport async function getAllFileTypes(\n directory: string,\n categories?: Iterable<string> | string[] | null,\n opts?: MediaOptions,\n): Promise<string[]> {\n // 🧩 Skip entirely if fsp isn't available\n if (!fsp || !path) return [];\n\n try {\n const stat = await fsp.stat(directory);\n if (!stat.isDirectory()) return [];\n\n const cats = normalizeCategories(categories, opts);\n const wanted = unionExts(cats);\n const results: string[] = [];\n\n async function walkAsync(dir: string): Promise<void> {\n const entries = await fsp.readdir(dir, { withFileTypes: true });\n for (const ent of entries) {\n const full = path.join(dir, ent.name);\n if (ent.isDirectory()) {\n await walkAsync(full);\n } else if (ent.isFile()) {\n const ext = path.extname(ent.name).toLowerCase();\n if (wanted.has(ext)) results.push(full);\n }\n }\n }\n\n await walkAsync(directory);\n return results;\n } catch {\n return [];\n }\n}\n\n\n/** Optional convenience re-exports that mirror your Python names */\nexport const get_all_file_types = getAllFileTypes;\nexport const get_media_map = getMediaMap;\nexport const get_media_exts = getMediaExts;\nexport const confirm_type = confirmType;\nexport const is_media_type = isMediaType;\nexport const get_mime_type = getMimeType;\n"],"names":["path","fs","fsp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAeA;AACO,MAAM,UAAU,GAAG;AACxB,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,YAAY;AACpB,QAAA,OAAO,EAAE,YAAY;AACrB,QAAA,MAAM,EAAE,WAAW;AACnB,QAAA,MAAM,EAAE,WAAW;AACnB,QAAA,MAAM,EAAE,WAAW;AACnB,QAAA,OAAO,EAAE,YAAY;AACrB,QAAA,OAAO,EAAE,YAAY;AACrB,QAAA,MAAM,EAAE,eAAe;AACvB,QAAA,MAAM,EAAE,0BAA0B;AAClC,QAAA,OAAO,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