-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtypes.ts
More file actions
99 lines (92 loc) · 2.56 KB
/
Copy pathtypes.ts
File metadata and controls
99 lines (92 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
export enum ServiceType {
ZIPLINE = "zipline",
NEST = "nest",
EZHOST = "ezhost",
ENCRYPTINGHOST = "encryptinghost",
S3 = "s3",
CATBOX = "catbox",
ZEROX0 = "0x0",
LITTERBOX = "litterbox",
SHAREX = "sharex",
GOFILE = "gofile",
TMPFILES = "tmpfiles",
BUZZHEAVIER = "buzzheavier",
TEMPSH = "tempsh",
FILEBIN = "filebin",
PIXELVAULT = "pixelvault",
PIXELDRAIN = "pixeldrain",
WEBDAV = "webdav"
}
export const serviceLabels: Record<ServiceType, string> = {
[ServiceType.ZIPLINE]: "Zipline",
[ServiceType.NEST]: "Nest",
[ServiceType.EZHOST]: "E-Z Host",
[ServiceType.ENCRYPTINGHOST]: "Encrypting.host",
[ServiceType.S3]: "S3-Compatible",
[ServiceType.CATBOX]: "Catbox",
[ServiceType.ZEROX0]: "0x0.st",
[ServiceType.LITTERBOX]: "Litterbox",
[ServiceType.SHAREX]: "ShareX/Custom Uploader",
[ServiceType.GOFILE]: "GoFile",
[ServiceType.TMPFILES]: "tmpfiles.org",
[ServiceType.BUZZHEAVIER]: "buzzheavier.com",
[ServiceType.TEMPSH]: "temp.sh",
[ServiceType.FILEBIN]: "filebin.net",
[ServiceType.PIXELVAULT]: "PixelVault",
[ServiceType.PIXELDRAIN]: "PixelDrain",
[ServiceType.WEBDAV]: "WebDAV"
};
export const fallbackServiceOrder: ServiceType[] = [
// No account / API key required (tried first — they work anonymously)
ServiceType.CATBOX,
ServiceType.LITTERBOX,
ServiceType.ZEROX0,
ServiceType.TMPFILES,
ServiceType.GOFILE,
ServiceType.BUZZHEAVIER,
ServiceType.TEMPSH,
ServiceType.FILEBIN,
ServiceType.PIXELDRAIN,
// Require a token / API key / credentials
ServiceType.ZIPLINE,
ServiceType.EZHOST,
ServiceType.NEST,
ServiceType.ENCRYPTINGHOST,
ServiceType.S3,
ServiceType.PIXELVAULT,
ServiceType.WEBDAV,
ServiceType.SHAREX
];
export interface UploadResponse {
files: {
id: string;
type: string;
url: string;
}[];
}
export interface NestUploadResponse {
fileURL: string;
}
export interface NativeUploadResult {
success: boolean;
url?: string;
error?: string;
}
export interface ShareXUploaderConfig {
Version?: string;
Name?: string;
DestinationType?: string;
RequestMethod?: string;
RequestURL?: string;
Headers?: Record<string, string | number | boolean>;
Body?: string;
FileFormName?: string;
Arguments?: Record<string, string | number | boolean>;
URL?: string;
ErrorMessage?: string;
}