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/.vscode/settings.json +10 -1
- package/dist/auth.d.ts +21 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/files.d.ts +5 -5
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +13 -1
- package/dist/files.js.map +1 -1
- package/dist/filters.d.ts +82 -14
- package/dist/filters.d.ts.map +1 -1
- package/dist/filters.js +90 -45
- package/dist/filters.js.map +1 -1
- package/dist/index.d.ts +335 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +124 -59
- package/dist/index.js.map +1 -1
- package/dist/insertUpdateUtils.d.ts.map +1 -1
- package/dist/insertUpdateUtils.js +2 -0
- package/dist/insertUpdateUtils.js.map +1 -1
- package/dist/jsonb.d.ts +33 -10
- package/dist/jsonb.d.ts.map +1 -1
- package/dist/jsonb.js +50 -38
- package/dist/jsonb.js.map +1 -1
- package/dist/md5.d.ts.map +1 -1
- package/dist/md5.js +52 -19
- package/dist/md5.js.map +1 -1
- package/dist/replication.d.ts +47 -0
- package/dist/replication.d.ts.map +1 -1
- package/dist/util.d.ts +47 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +122 -65
- package/dist/util.js.map +1 -1
- package/lib/auth.ts +11 -13
- package/lib/files.ts +87 -75
- package/lib/filters.ts +228 -193
- package/lib/index.ts +604 -466
- package/lib/insertUpdateUtils.ts +10 -10
- package/lib/jsonb.ts +242 -205
- package/lib/md5.ts +31 -28
- package/lib/replication.ts +39 -33
- package/lib/util.ts +217 -175
- package/package.json +2 -1
- package/tsconfig.json +1 -1
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":
|
|
5
|
-
"text/css":
|
|
6
|
-
"text/csv":
|
|
7
|
-
"text/tsv":
|
|
8
|
-
"text/xml":
|
|
9
|
-
"text/mathml":
|
|
10
|
-
"text/plain":
|
|
11
|
-
"text/vnd.sun.j2me.app-descriptor":
|
|
12
|
-
"text/vnd.wap.wml":
|
|
13
|
-
"text/x-component":
|
|
14
|
-
"image/gif":
|
|
15
|
-
"image/jpeg":
|
|
16
|
-
"image/png":
|
|
17
|
-
"image/tiff":
|
|
18
|
-
"image/vnd.wap.wbmp":
|
|
19
|
-
"image/x-icon":
|
|
20
|
-
"image/x-jng":
|
|
21
|
-
"image/x-ms-bmp":
|
|
22
|
-
"image/svg+xml":
|
|
23
|
-
"image/webp":
|
|
24
|
-
"application/sql":
|
|
25
|
-
"application/x-javascript":
|
|
26
|
-
"application/atom+xml":
|
|
27
|
-
"application/rss+xml":
|
|
28
|
-
"application/java-archive":
|
|
29
|
-
"application/mac-binhex40":
|
|
30
|
-
"application/msword":
|
|
31
|
-
"application/pdf":
|
|
32
|
-
"application/postscript":
|
|
33
|
-
"application/rtf":
|
|
34
|
-
"application/vnd.ms-excel":
|
|
35
|
-
"application/vnd.ms-powerpoint":
|
|
36
|
-
"application/vnd.wap.wmlc":
|
|
37
|
-
"application/vnd.google-earth.kml+xml":
|
|
38
|
-
"application/vnd.google-earth.kmz":
|
|
39
|
-
"application/x-7z-compressed":
|
|
40
|
-
"application/x-cocoa":
|
|
41
|
-
"application/x-java-archive-diff":
|
|
42
|
-
"application/x-java-jnlp-file":
|
|
43
|
-
"application/x-makeself":
|
|
44
|
-
"application/x-perl":
|
|
45
|
-
"application/x-pilot":
|
|
46
|
-
"application/x-rar-compressed":
|
|
47
|
-
"application/x-redhat-package-manager":
|
|
48
|
-
"application/x-sea":
|
|
49
|
-
"application/x-shockwave-flash":
|
|
50
|
-
"application/x-stuffit":
|
|
51
|
-
"application/x-tcl":
|
|
52
|
-
"application/x-x509-ca-cert":
|
|
53
|
-
"application/x-xpinstall":
|
|
54
|
-
"application/xhtml+xml":
|
|
55
|
-
"application/zip":
|
|
56
|
-
"application/octet-stream":
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
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<{
|
|
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
|
+
};
|