@mintlify/common 1.0.552 → 1.0.553
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.
|
@@ -2,4 +2,19 @@ export type PotentialFileCategory = 'page' | 'snippet' | 'mintConfig' | 'potenti
|
|
|
2
2
|
export type FileCategory = Omit<PotentialFileCategory, 'potentialYamlOpenApiSpec' | 'potentialJsonOpenApiSpec'> | 'openApi' | null;
|
|
3
3
|
export declare const generatedStaticFiles: readonly ["llms.txt", "robots.txt", "sitemap.xml", "llms-full.txt"];
|
|
4
4
|
export type GeneratedStaticFile = (typeof generatedStaticFiles)[number];
|
|
5
|
+
export declare const IMAGE_FORMATS: string[];
|
|
6
|
+
export declare const VIDEO_FORMATS: string[];
|
|
7
|
+
export declare const AUDIO_FORMATS: string[];
|
|
8
|
+
export declare const DOCUMENT_FORMATS: string[];
|
|
9
|
+
export declare const DATA_FORMATS: string[];
|
|
10
|
+
export declare const FONT_FORMATS: string[];
|
|
11
|
+
export declare const COMPRESSED_FORMATS: string[];
|
|
12
|
+
export declare function isGatedFormat(params: {
|
|
13
|
+
filePath: string;
|
|
14
|
+
ext?: undefined;
|
|
15
|
+
}): boolean;
|
|
16
|
+
export declare function isGatedFormat(params: {
|
|
17
|
+
filePath?: undefined;
|
|
18
|
+
ext: string;
|
|
19
|
+
}): boolean;
|
|
5
20
|
export declare const getFileCategory: (filePath: string) => PotentialFileCategory;
|
package/dist/getFileCategory.js
CHANGED
|
@@ -7,8 +7,7 @@ export const generatedStaticFiles = [
|
|
|
7
7
|
'sitemap.xml',
|
|
8
8
|
'llms-full.txt',
|
|
9
9
|
];
|
|
10
|
-
const
|
|
11
|
-
// Image formats
|
|
10
|
+
export const IMAGE_FORMATS = [
|
|
12
11
|
'.jpeg',
|
|
13
12
|
'.jpg',
|
|
14
13
|
'.jfif',
|
|
@@ -25,7 +24,8 @@ const supportedStaticFileExtensions = [
|
|
|
25
24
|
'.bmp',
|
|
26
25
|
'.tiff',
|
|
27
26
|
'.tif',
|
|
28
|
-
|
|
27
|
+
];
|
|
28
|
+
export const VIDEO_FORMATS = [
|
|
29
29
|
'.mp4',
|
|
30
30
|
'.webm',
|
|
31
31
|
'.ogg',
|
|
@@ -35,15 +35,9 @@ const supportedStaticFileExtensions = [
|
|
|
35
35
|
'.flv',
|
|
36
36
|
'.mkv',
|
|
37
37
|
'.m4v',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
'.flac',
|
|
42
|
-
'.aac',
|
|
43
|
-
'.ogg',
|
|
44
|
-
'.wma',
|
|
45
|
-
'.m4a',
|
|
46
|
-
// Document formats
|
|
38
|
+
];
|
|
39
|
+
export const AUDIO_FORMATS = ['.mp3', '.wav', '.flac', '.aac', '.ogg', '.wma', '.m4a'];
|
|
40
|
+
export const DOCUMENT_FORMATS = [
|
|
47
41
|
'.pdf',
|
|
48
42
|
'.txt',
|
|
49
43
|
'.doc',
|
|
@@ -56,17 +50,29 @@ const supportedStaticFileExtensions = [
|
|
|
56
50
|
'.odt',
|
|
57
51
|
'.ods',
|
|
58
52
|
'.odp',
|
|
59
|
-
// Data formats
|
|
60
|
-
'.csv',
|
|
61
|
-
'.tsv',
|
|
62
|
-
'.xml',
|
|
63
|
-
// Font formats
|
|
64
|
-
'.woff',
|
|
65
|
-
'.woff2',
|
|
66
|
-
'.ttf',
|
|
67
|
-
'.eot',
|
|
68
|
-
'.otf',
|
|
69
53
|
];
|
|
54
|
+
export const DATA_FORMATS = ['.csv', '.tsv', '.xml'];
|
|
55
|
+
export const FONT_FORMATS = ['.woff', '.woff2', '.ttf', '.eot', '.otf'];
|
|
56
|
+
export const COMPRESSED_FORMATS = ['.zip', '.rar', '.7z', '.tar', '.gz', '.bz2'];
|
|
57
|
+
const supportedStaticFileExtensions = [
|
|
58
|
+
...IMAGE_FORMATS,
|
|
59
|
+
...VIDEO_FORMATS,
|
|
60
|
+
...AUDIO_FORMATS,
|
|
61
|
+
...DOCUMENT_FORMATS,
|
|
62
|
+
...DATA_FORMATS,
|
|
63
|
+
...FONT_FORMATS,
|
|
64
|
+
// TODO (Ricardo): Add `COMPRESSED_FORMATS` once the server respects isGatedFormat
|
|
65
|
+
];
|
|
66
|
+
const gatedStaticAssetExtensions = [...DOCUMENT_FORMATS, ...DATA_FORMATS, ...COMPRESSED_FORMATS];
|
|
67
|
+
export function isGatedFormat({ filePath, ext }) {
|
|
68
|
+
if (ext == undefined) {
|
|
69
|
+
ext = filePath.split('.').at(-1);
|
|
70
|
+
if (!ext)
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
ext = ext.startsWith('.') ? ext : `.${ext}`;
|
|
74
|
+
return gatedStaticAssetExtensions.includes(ext.toLowerCase());
|
|
75
|
+
}
|
|
70
76
|
export const getFileCategory = (filePath) => {
|
|
71
77
|
filePath = filePath.toLowerCase();
|
|
72
78
|
const parsed = parse(filePath);
|