prostgles-types 4.0.113 → 4.0.115

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/lib/files.ts CHANGED
@@ -1,84 +1,96 @@
1
1
  import { FieldFilter } from ".";
2
2
 
3
3
  export const CONTENT_TYPE_TO_EXT = {
4
- "text/html": ["html", "htm", "shtml"],
5
- "text/css": ["css"],
6
- "text/csv": ["csv"],
7
- "text/tsv": ["tsv"],
8
- "text/xml": ["xml"],
9
- "text/mathml": ["mml"],
10
- "text/plain": ["txt"],
11
- "text/vnd.sun.j2me.app-descriptor": ["jad"],
12
- "text/vnd.wap.wml": ["wml"],
13
- "text/x-component": ["htc"],
14
- "image/gif": ["gif"],
15
- "image/jpeg": ["jpeg", "jpg"],
16
- "image/png": ["png"],
17
- "image/tiff": ["tif", "tiff"],
18
- "image/vnd.wap.wbmp": ["wbmp"],
19
- "image/x-icon": ["ico"],
20
- "image/x-jng": ["jng"],
21
- "image/x-ms-bmp": ["bmp"],
22
- "image/svg+xml": ["svg"],
23
- "image/webp": ["webp"],
24
- "application/sql": ["sql"],
25
- "application/x-javascript": ["js"],
26
- "application/atom+xml": ["atom"],
27
- "application/rss+xml": ["rss"],
28
- "application/java-archive": ["jar", "war", "ear"],
29
- "application/mac-binhex40": ["hqx"],
30
- "application/msword": ["doc", "docx"],
31
- "application/pdf": ["pdf"],
32
- "application/postscript": ["ps", "eps", "ai"],
33
- "application/rtf": ["rtf"],
34
- "application/vnd.ms-excel": ["xls", "xlsx"],
35
- "application/vnd.ms-powerpoint": ["ppt", "pptx"],
36
- "application/vnd.wap.wmlc": ["wmlc"],
37
- "application/vnd.google-earth.kml+xml": ["kml"],
38
- "application/vnd.google-earth.kmz": ["kmz"],
39
- "application/x-7z-compressed": ["7z"],
40
- "application/x-cocoa": ["cco"],
41
- "application/x-java-archive-diff": ["jardiff"],
42
- "application/x-java-jnlp-file": ["jnlp"],
43
- "application/x-makeself": ["run"],
44
- "application/x-perl": ["pl", "pm"],
45
- "application/x-pilot": ["prc", "pdb"],
46
- "application/x-rar-compressed": ["rar"],
47
- "application/x-redhat-package-manager": ["rpm"],
48
- "application/x-sea": ["sea"],
49
- "application/x-shockwave-flash": ["swf"],
50
- "application/x-stuffit": ["sit"],
51
- "application/x-tcl": ["tcl", "tk"],
52
- "application/x-x509-ca-cert": ["der", "pem", "crt"],
53
- "application/x-xpinstall": ["xpi"],
54
- "application/xhtml+xml": ["xhtml"],
55
- "application/zip": ["zip"],
56
- "application/octet-stream": ["bin", "exe", "dll", "deb", "dmg", "eot", "iso", "img", "msi", "msp", "msm"],
57
- "audio/midi": ["mid", "midi", "kar"],
58
- "audio/mpeg": ["mp3"],
59
- "audio/ogg": ["ogg"],
60
- "audio/x-realaudio": ["ra"],
61
- "video/3gpp": ["3gpp", "3gp"],
62
- "video/mpeg": ["mpeg", "mpg"],
63
- "video/quicktime": ["mov"],
64
- "video/x-flv": ["flv"],
65
- "video/x-mng": ["mng"],
66
- "video/x-ms-asf": ["asx", "asf"],
67
- "video/x-ms-wmv": ["wmv"],
68
- "video/x-msvideo": ["avi"],
69
- "video/mp4": ["m4v", "mp4"],
70
- "video/webm": ["webm"],
4
+ "text/html": ["html", "htm", "shtml"],
5
+ "text/css": ["css"],
6
+ "text/csv": ["csv"],
7
+ "text/tsv": ["tsv"],
8
+ "text/xml": ["xml"],
9
+ "text/mathml": ["mml"],
10
+ "text/plain": ["txt"],
11
+ "text/vnd.sun.j2me.app-descriptor": ["jad"],
12
+ "text/vnd.wap.wml": ["wml"],
13
+ "text/x-component": ["htc"],
14
+ "image/gif": ["gif"],
15
+ "image/jpeg": ["jpeg", "jpg"],
16
+ "image/png": ["png"],
17
+ "image/tiff": ["tif", "tiff"],
18
+ "image/vnd.wap.wbmp": ["wbmp"],
19
+ "image/x-icon": ["ico"],
20
+ "image/x-jng": ["jng"],
21
+ "image/x-ms-bmp": ["bmp"],
22
+ "image/svg+xml": ["svg"],
23
+ "image/webp": ["webp"],
24
+ "application/sql": ["sql"],
25
+ "application/x-javascript": ["js"],
26
+ "application/atom+xml": ["atom"],
27
+ "application/rss+xml": ["rss"],
28
+ "application/java-archive": ["jar", "war", "ear"],
29
+ "application/mac-binhex40": ["hqx"],
30
+ "application/msword": ["doc", "docx"],
31
+ "application/pdf": ["pdf"],
32
+ "application/postscript": ["ps", "eps", "ai"],
33
+ "application/rtf": ["rtf"],
34
+ "application/vnd.ms-excel": ["xls", "xlsx"],
35
+ "application/vnd.ms-powerpoint": ["ppt", "pptx"],
36
+ "application/vnd.wap.wmlc": ["wmlc"],
37
+ "application/vnd.google-earth.kml+xml": ["kml"],
38
+ "application/vnd.google-earth.kmz": ["kmz"],
39
+ "application/x-7z-compressed": ["7z"],
40
+ "application/x-cocoa": ["cco"],
41
+ "application/x-java-archive-diff": ["jardiff"],
42
+ "application/x-java-jnlp-file": ["jnlp"],
43
+ "application/x-makeself": ["run"],
44
+ "application/x-perl": ["pl", "pm"],
45
+ "application/x-pilot": ["prc", "pdb"],
46
+ "application/x-rar-compressed": ["rar"],
47
+ "application/x-redhat-package-manager": ["rpm"],
48
+ "application/x-sea": ["sea"],
49
+ "application/x-shockwave-flash": ["swf"],
50
+ "application/x-stuffit": ["sit"],
51
+ "application/x-tcl": ["tcl", "tk"],
52
+ "application/x-x509-ca-cert": ["der", "pem", "crt"],
53
+ "application/x-xpinstall": ["xpi"],
54
+ "application/xhtml+xml": ["xhtml"],
55
+ "application/zip": ["zip"],
56
+ "application/octet-stream": [
57
+ "bin",
58
+ "exe",
59
+ "dll",
60
+ "deb",
61
+ "dmg",
62
+ "eot",
63
+ "iso",
64
+ "img",
65
+ "msi",
66
+ "msp",
67
+ "msm",
68
+ ],
69
+ "audio/midi": ["mid", "midi", "kar"],
70
+ "audio/mpeg": ["mp3"],
71
+ "audio/ogg": ["ogg"],
72
+ "audio/x-realaudio": ["ra"],
73
+ "video/3gpp": ["3gpp", "3gp"],
74
+ "video/mpeg": ["mpeg", "mpg"],
75
+ "video/quicktime": ["mov"],
76
+ "video/x-flv": ["flv"],
77
+ "video/x-mng": ["mng"],
78
+ "video/x-ms-asf": ["asx", "asf"],
79
+ "video/x-ms-wmv": ["wmv"],
80
+ "video/x-msvideo": ["avi"],
81
+ "video/mp4": ["m4v", "mp4"],
82
+ "video/webm": ["webm"],
71
83
  } as const;
72
84
 
73
85
  export type ALLOWED_CONTENT_TYPE = keyof typeof CONTENT_TYPE_TO_EXT;
74
86
  export type ALLOWED_EXTENSION = (typeof CONTENT_TYPE_TO_EXT)[ALLOWED_CONTENT_TYPE][number];
75
87
 
76
- export type FileType =
77
- | { acceptedContent: FieldFilter<{ "image": 1; "audio": 1; "video": 1; "text": 1; "application": 1; }> }
78
- | { acceptedContentType: FieldFilter<typeof CONTENT_TYPE_TO_EXT>; }
79
- | { acceptedFileTypes: FieldFilter<Record<ALLOWED_EXTENSION, 1>>; }
80
- | never;
88
+ export type FileType =
89
+ | { acceptedContent: FieldFilter<{ image: 1; audio: 1; video: 1; text: 1; application: 1 }> }
90
+ | { acceptedContentType: FieldFilter<typeof CONTENT_TYPE_TO_EXT> }
91
+ | { acceptedFileTypes: FieldFilter<Record<ALLOWED_EXTENSION, 1>> }
92
+ | never;
81
93
 
82
- export type FileColumnConfig = FileType & {
83
- maxFileSizeMB?: number;
84
- };
94
+ export type FileColumnConfig = FileType & {
95
+ maxFileSizeMB?: number;
96
+ };