@pelican.ts/sdk 0.4.13 → 0.4.15
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/CHANGELOG.md +127 -0
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/index.d.mts +139 -139
- package/dist/index.d.ts +139 -139
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types.d.ts +258 -258
- package/package.json +1 -1
- package/.husky/pre-commit +0 -2
- package/scripts/create-types.ts +0 -24
- package/src/api/application/client.ts +0 -70
- package/src/api/application/database_hosts.ts +0 -65
- package/src/api/application/eggs.ts +0 -43
- package/src/api/application/mounts.ts +0 -109
- package/src/api/application/nodes.ts +0 -126
- package/src/api/application/nodes_allocations.ts +0 -47
- package/src/api/application/roles.ts +0 -39
- package/src/api/application/servers.ts +0 -145
- package/src/api/application/servers_databases.ts +0 -53
- package/src/api/application/types/container.ts +0 -9
- package/src/api/application/types/database_host.ts +0 -11
- package/src/api/application/types/egg.ts +0 -65
- package/src/api/application/types/index.ts +0 -10
- package/src/api/application/types/location.ts +0 -7
- package/src/api/application/types/mount.ts +0 -12
- package/src/api/application/types/node.ts +0 -58
- package/src/api/application/types/role.ts +0 -6
- package/src/api/application/types/server.ts +0 -24
- package/src/api/application/types/server_allocation.ts +0 -20
- package/src/api/application/types/user.ts +0 -34
- package/src/api/application/users.ts +0 -146
- package/src/api/base/request.ts +0 -44
- package/src/api/base/types.ts +0 -40
- package/src/api/client/account.ts +0 -77
- package/src/api/client/client.ts +0 -56
- package/src/api/client/server.ts +0 -74
- package/src/api/client/server_activity.ts +0 -25
- package/src/api/client/server_allocations.ts +0 -50
- package/src/api/client/server_backups.ts +0 -82
- package/src/api/client/server_databases.ts +0 -51
- package/src/api/client/server_files.ts +0 -145
- package/src/api/client/server_schedules.ts +0 -130
- package/src/api/client/server_settings.ts +0 -36
- package/src/api/client/server_startup.ts +0 -41
- package/src/api/client/server_users.ts +0 -55
- package/src/api/client/server_websocket.ts +0 -570
- package/src/api/client/types/index.ts +0 -5
- package/src/api/client/types/server.ts +0 -72
- package/src/api/client/types/server_allocation.ts +0 -10
- package/src/api/client/types/server_subuser.ts +0 -55
- package/src/api/client/types/user.ts +0 -31
- package/src/api/client/types/websocket.ts +0 -138
- package/src/api/common/types/egg.ts +0 -9
- package/src/api/common/types/enums.ts +0 -21
- package/src/api/common/types/index.ts +0 -9
- package/src/api/common/types/server_backup.ts +0 -13
- package/src/api/common/types/server_database.ts +0 -13
- package/src/api/common/types/server_files.ts +0 -11
- package/src/api/common/types/server_limits.ts +0 -18
- package/src/api/common/types/server_power.ts +0 -1
- package/src/api/common/types/server_schedule.ts +0 -37
- package/src/api/common/types/server_startup.ts +0 -11
- package/src/api/index.ts +0 -17
- package/src/humane/Account.ts +0 -60
- package/src/humane/Client.ts +0 -44
- package/src/humane/Server.ts +0 -206
- package/src/humane/ServerAllocation.ts +0 -41
- package/src/humane/ServerBackup.ts +0 -44
- package/src/humane/ServerDatabase.ts +0 -37
- package/src/humane/ServerFile.ts +0 -91
- package/src/humane/ServerSchedule.ts +0 -160
- package/src/humane/ServerUser.ts +0 -44
- package/src/index.ts +0 -21
- package/src/types.ts +0 -3
- package/src/utils/sized.ts +0 -13
- package/src/utils/transform.ts +0 -21
- package/src/utils/types.ts +0 -10
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {Nullable} from "@/utils/types"
|
|
2
|
-
|
|
3
|
-
export type User = {
|
|
4
|
-
uuid: string
|
|
5
|
-
username: string
|
|
6
|
-
email: string
|
|
7
|
-
language: string
|
|
8
|
-
image: string
|
|
9
|
-
admin: boolean
|
|
10
|
-
root_admin: boolean
|
|
11
|
-
"2fa_enabled": boolean
|
|
12
|
-
created_at: string
|
|
13
|
-
updated_at: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type APIKey = {
|
|
17
|
-
identifier: string
|
|
18
|
-
description: string
|
|
19
|
-
allowed_ips: string[]
|
|
20
|
-
last_used_at: Nullable<string>
|
|
21
|
-
created_at: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type SSHKey = {
|
|
25
|
-
name: string
|
|
26
|
-
fingerprint: string
|
|
27
|
-
pubic_key: string
|
|
28
|
-
created_at: string
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type Permission = {description: string; keys: Record<string, string>}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @author BothimTV
|
|
3
|
-
* @license MIT
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type ServerStatus = "starting" | "stopping" | "online" | "offline"
|
|
7
|
-
|
|
8
|
-
export enum SERVER_SIGNAL {
|
|
9
|
-
START = "start",
|
|
10
|
-
STOP = "stop",
|
|
11
|
-
RESTART = "restart",
|
|
12
|
-
KILL = "kill"
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type WebsocketEvent =
|
|
16
|
-
| AuthSuccessWsEvent
|
|
17
|
-
| StatusWsEvent
|
|
18
|
-
| ConsoleLogWsEvent
|
|
19
|
-
| StatsWsEvent
|
|
20
|
-
| TokenExpiringWsEvent
|
|
21
|
-
| TokenExpiredWsEvent
|
|
22
|
-
| DaemonErrorEvent
|
|
23
|
-
| DaemonMessageEvent
|
|
24
|
-
| InstallOutputEvent
|
|
25
|
-
| InstallStartedEvent
|
|
26
|
-
| InstallCompletedEvent
|
|
27
|
-
| TransferLogsEvent
|
|
28
|
-
| TransferStatusEvent
|
|
29
|
-
| BackupCompletedEvent
|
|
30
|
-
| BackupRestoreCompletedEvent
|
|
31
|
-
| JwtErrorEvent
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Source: https://github.com/pterodactyl/panel/blob/1.0-develop/resources/scripts/components/server/events.ts
|
|
35
|
-
*/
|
|
36
|
-
export enum SOCKET_EVENT {
|
|
37
|
-
AUTH_SUCCESS = "auth success",
|
|
38
|
-
DAEMON_MESSAGE = "daemon message",
|
|
39
|
-
DAEMON_ERROR = "daemon error",
|
|
40
|
-
INSTALL_OUTPUT = "install output",
|
|
41
|
-
INSTALL_STARTED = "install started",
|
|
42
|
-
INSTALL_COMPLETED = "install completed",
|
|
43
|
-
CONSOLE_OUTPUT = "console output",
|
|
44
|
-
STATUS = "status",
|
|
45
|
-
STATS = "stats",
|
|
46
|
-
TRANSFER_LOGS = "transfer logs",
|
|
47
|
-
TRANSFER_STATUS = "transfer status",
|
|
48
|
-
BACKUP_COMPLETED = "backup completed",
|
|
49
|
-
BACKUP_RESTORE_COMPLETED = "backup restore completed",
|
|
50
|
-
TOKEN_EXPIRING = "token expiring",
|
|
51
|
-
TOKEN_EXPIRED = "token expired",
|
|
52
|
-
JWT_ERROR = "jwt error"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type InstallOutputEvent = {
|
|
56
|
-
event: SOCKET_EVENT.INSTALL_OUTPUT
|
|
57
|
-
args: [string]
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type InstallStartedEvent = {event: SOCKET_EVENT.INSTALL_STARTED}
|
|
61
|
-
|
|
62
|
-
export type InstallCompletedEvent = {event: SOCKET_EVENT.INSTALL_COMPLETED}
|
|
63
|
-
|
|
64
|
-
export type TransferLogsEvent = {
|
|
65
|
-
event: SOCKET_EVENT.TRANSFER_LOGS
|
|
66
|
-
args: [string]
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type TransferStatusEvent = {
|
|
70
|
-
event: SOCKET_EVENT.TRANSFER_STATUS
|
|
71
|
-
args: [string]
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export type BackupCompletedEvent = {
|
|
75
|
-
event: SOCKET_EVENT.BACKUP_COMPLETED
|
|
76
|
-
args: [string]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export type BackupCompletedJson = {
|
|
80
|
-
checksum: string
|
|
81
|
-
checksum_type: "sha1"
|
|
82
|
-
file_size: number
|
|
83
|
-
is_successful: boolean
|
|
84
|
-
uuid: string
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export type BackupRestoreCompletedEvent = {
|
|
88
|
-
event: SOCKET_EVENT.BACKUP_RESTORE_COMPLETED
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export type AuthSuccessWsEvent = {event: SOCKET_EVENT.AUTH_SUCCESS}
|
|
92
|
-
|
|
93
|
-
export type StatusWsEvent = {event: SOCKET_EVENT.STATUS; args: [PowerState]}
|
|
94
|
-
|
|
95
|
-
export type PowerState = "starting" | "stopping" | "running" | "offline"
|
|
96
|
-
|
|
97
|
-
export type ConsoleLogWsEvent = {
|
|
98
|
-
event: SOCKET_EVENT.CONSOLE_OUTPUT
|
|
99
|
-
args: [string]
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type StatsWsEvent = {event: SOCKET_EVENT.STATS; args: [string]}
|
|
103
|
-
|
|
104
|
-
export type StatsWsJson = {
|
|
105
|
-
memory_bytes: number
|
|
106
|
-
memory_limit_bytes: number
|
|
107
|
-
cpu_absolute: number
|
|
108
|
-
network: {rx_bytes: number; tx_bytes: number}
|
|
109
|
-
state: PowerState
|
|
110
|
-
uptime: number
|
|
111
|
-
disk_bytes: number
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export type TokenExpiringWsEvent = {event: SOCKET_EVENT.TOKEN_EXPIRING}
|
|
115
|
-
|
|
116
|
-
export type TokenExpiredWsEvent = {event: SOCKET_EVENT.TOKEN_EXPIRED}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Example:
|
|
120
|
-
* {"event":"daemon message","args":["(restoring): file1.yml"]}
|
|
121
|
-
* {"event":"daemon message","args":["(restoring): file2"]}
|
|
122
|
-
* {"event":"daemon message","args":["(restoring): file3.jar"]}
|
|
123
|
-
* {"event":"daemon message","args":["(restoring): file5.tar.gz"]}
|
|
124
|
-
* {"event":"daemon message","args":["Completed server restoration from local backup."]}
|
|
125
|
-
*/
|
|
126
|
-
export type DaemonMessageEvent = {
|
|
127
|
-
event: SOCKET_EVENT.DAEMON_MESSAGE
|
|
128
|
-
args: [string]
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export type DaemonErrorEvent = {
|
|
132
|
-
event: SOCKET_EVENT.DAEMON_ERROR
|
|
133
|
-
args: [string]
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export type JwtErrorEvent = {event: SOCKET_EVENT.JWT_ERROR; args: [string]}
|
|
137
|
-
|
|
138
|
-
export {ServerWebsocket} from "@/api/client/server_websocket"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import z from "zod"
|
|
2
|
-
|
|
3
|
-
export const languagesSchema = z.enum([
|
|
4
|
-
"af", "ak", "am", "ar", "as", "az", "be", "bg", "bm", "bn", "bo", "br", "bs", "ca", "ce", "cs", "cv", "cy",
|
|
5
|
-
"da", "de", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fo", "fr", "fy", "ga", "gd",
|
|
6
|
-
"gl", "gu", "gv", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "ja", "jv", "ka",
|
|
7
|
-
"ki", "kk", "kl", "km", "kn", "ko", "ks", "ku", "kw", "ky", "lb", "lg", "ln", "lo", "lt", "lu", "lv", "mg",
|
|
8
|
-
"mi", "mk", "ml", "mn", "mr", "ms", "mt", "my", "nb", "nd", "ne", "nl", "nn", "no", "om", "or", "os", "pa",
|
|
9
|
-
"pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sn",
|
|
10
|
-
"so", "sq", "sr", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "to", "tr", "tt", "ug", "uk", "ur",
|
|
11
|
-
"uz", "vi", "wo", "xh", "yi", "yo", "zh", "zu"
|
|
12
|
-
])
|
|
13
|
-
|
|
14
|
-
export type LanguagesType = z.infer<typeof languagesSchema>
|
|
15
|
-
|
|
16
|
-
// Questionable choices at their finest
|
|
17
|
-
export const timezonesSchema = z.enum([
|
|
18
|
-
"Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Ciudad_Juarez", "America/Costa_Rica", "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Nuuk", "America/Ojinaga", "America/Panama", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Atyrau", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Chita", "Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kathmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Riyadh", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ulaanbaatar", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faroe", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/Perth", "Australia/Sydney", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Busingen", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kirov", "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Saratov", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Ulyanovsk", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zurich", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Kanton", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Wake", "Pacific/Wallis", "UTC"
|
|
19
|
-
])
|
|
20
|
-
|
|
21
|
-
export type TimezonesType = z.infer<typeof timezonesSchema>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./server_power"
|
|
2
|
-
export * from "./server_database"
|
|
3
|
-
export * from "./server_limits"
|
|
4
|
-
export * from "./server_startup"
|
|
5
|
-
export * from "./server_backup"
|
|
6
|
-
export * from "./egg"
|
|
7
|
-
export * from "./server_files"
|
|
8
|
-
export * from "./enums"
|
|
9
|
-
export * from "./server_schedule"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {Nullable} from "@/utils/types"
|
|
2
|
-
|
|
3
|
-
export type ServerBackup = {
|
|
4
|
-
uuid: string
|
|
5
|
-
is_successful: boolean
|
|
6
|
-
is_locked: boolean
|
|
7
|
-
name: string
|
|
8
|
-
ignored_files: string[]
|
|
9
|
-
checksum: Nullable<string>
|
|
10
|
-
bytes: number
|
|
11
|
-
created_at: string
|
|
12
|
-
completed_at: Nullable<string>
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {GenericResponse} from "@/api/base/types"
|
|
2
|
-
|
|
3
|
-
export type ServerDatabase = {
|
|
4
|
-
id: string
|
|
5
|
-
host: {address: string; port: number}
|
|
6
|
-
name: string
|
|
7
|
-
username: string
|
|
8
|
-
connections_from: string
|
|
9
|
-
max_connections: number
|
|
10
|
-
relationships?: {
|
|
11
|
-
password: GenericResponse<{password: string}, "database_password">
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {Nullable} from "@/utils/types"
|
|
2
|
-
|
|
3
|
-
export type ServerLimits = {
|
|
4
|
-
memory: number
|
|
5
|
-
swap: number
|
|
6
|
-
disk: number
|
|
7
|
-
io: number
|
|
8
|
-
cpu: number
|
|
9
|
-
threads: Nullable<number | string>
|
|
10
|
-
oom_disabled: boolean
|
|
11
|
-
oom_killer: boolean
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type FeatureLimits = {
|
|
15
|
-
databases: number
|
|
16
|
-
allocations: number
|
|
17
|
-
backups: number
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ServerSignalOption = "start" | "stop" | "restart" | "kill"
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {GenericListResponse, GenericResponse} from "@/api/base/types"
|
|
2
|
-
import {Nullable} from "@/utils/types"
|
|
3
|
-
|
|
4
|
-
export type Schedule = {
|
|
5
|
-
id: number
|
|
6
|
-
name: string
|
|
7
|
-
cron: {
|
|
8
|
-
day_of_week: string
|
|
9
|
-
day_of_month: string
|
|
10
|
-
hour: string
|
|
11
|
-
minute: string
|
|
12
|
-
}
|
|
13
|
-
is_active: boolean
|
|
14
|
-
is_processing: boolean
|
|
15
|
-
only_when_online: boolean
|
|
16
|
-
last_run_at: Nullable<string>
|
|
17
|
-
next_run_at: string
|
|
18
|
-
created_at: string
|
|
19
|
-
updated_at: string
|
|
20
|
-
relationships: {
|
|
21
|
-
tasks: GenericListResponse<
|
|
22
|
-
GenericResponse<ScheduleTask, "schedule_task">
|
|
23
|
-
>
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type ScheduleTask = {
|
|
28
|
-
id: number
|
|
29
|
-
sequence_id: number
|
|
30
|
-
action: "command" | "power" | "backup" | "delete_files"
|
|
31
|
-
payload: string
|
|
32
|
-
time_offset: number
|
|
33
|
-
is_queued: boolean
|
|
34
|
-
continue_on_failure: boolean
|
|
35
|
-
created_at: string
|
|
36
|
-
updated_at: Nullable<string>
|
|
37
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type StartupParams = {
|
|
2
|
-
name: string
|
|
3
|
-
description: string
|
|
4
|
-
env_variables: string
|
|
5
|
-
default_value: string
|
|
6
|
-
server_value: string
|
|
7
|
-
is_editable: boolean
|
|
8
|
-
rules: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type StartupMeta = {startup_command: string; raw_startup_command: string}
|
package/src/api/index.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {Client as UserClient} from "@/api/client/client"
|
|
2
|
-
import {Client as AppClient} from "@/api/application/client"
|
|
3
|
-
import {Agent} from "@/api/base/request"
|
|
4
|
-
|
|
5
|
-
export class PelicanAPIClient extends UserClient {
|
|
6
|
-
constructor(url: string, token: string, suffix: string = "/api") {
|
|
7
|
-
const ax = new Agent(url, token, "client", suffix)
|
|
8
|
-
super(ax.requester)
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class PelicanAPIApplication extends AppClient {
|
|
13
|
-
constructor(url: string, token: string, suffix: string = "/api") {
|
|
14
|
-
const ax = new Agent(url, token, "application", suffix)
|
|
15
|
-
super(ax.requester)
|
|
16
|
-
}
|
|
17
|
-
}
|
package/src/humane/Account.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type {Client} from "@/api/client/client"
|
|
2
|
-
import type {User} from "@/api/client/types/user"
|
|
3
|
-
|
|
4
|
-
export class Account {
|
|
5
|
-
private readonly client: Client
|
|
6
|
-
readonly uuid: string
|
|
7
|
-
readonly username: string
|
|
8
|
-
private $email: string
|
|
9
|
-
get email() {
|
|
10
|
-
return this.$email
|
|
11
|
-
}
|
|
12
|
-
readonly language: string
|
|
13
|
-
readonly image: string
|
|
14
|
-
readonly admin: boolean
|
|
15
|
-
readonly root_admin: boolean
|
|
16
|
-
private $has2faEnabled: boolean
|
|
17
|
-
get has2faEnabled() {
|
|
18
|
-
return this.$has2faEnabled
|
|
19
|
-
}
|
|
20
|
-
readonly createdAt: Date
|
|
21
|
-
readonly updatedAt: Date
|
|
22
|
-
|
|
23
|
-
constructor(client: Client, user: User) {
|
|
24
|
-
this.client = client
|
|
25
|
-
this.uuid = user.uuid
|
|
26
|
-
this.username = user.username
|
|
27
|
-
this.$email = user.email
|
|
28
|
-
this.language = user.language
|
|
29
|
-
this.image = user.image
|
|
30
|
-
this.admin = user.admin
|
|
31
|
-
this.root_admin = user.root_admin
|
|
32
|
-
this.$has2faEnabled = user["2fa_enabled"]
|
|
33
|
-
this.createdAt = new Date(user.created_at)
|
|
34
|
-
this.updatedAt = new Date(user.updated_at)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
updateEmail = async (newEmail: string, password: string) => {
|
|
38
|
-
await this.client.account.updateEmail(newEmail, password)
|
|
39
|
-
this.$email = newEmail
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
updatePassword = async (newPassword: string) =>
|
|
43
|
-
this.client.account.updatePassword(newPassword)
|
|
44
|
-
|
|
45
|
-
listApiKeys = async () => this.client.account.apiKeys.list()
|
|
46
|
-
|
|
47
|
-
createApiKey = async (description: string, allowed_ips?: string[]) =>
|
|
48
|
-
this.client.account.apiKeys.create(description, allowed_ips)
|
|
49
|
-
|
|
50
|
-
deleteApiKey = async (identifier: string) =>
|
|
51
|
-
this.client.account.apiKeys.delete(identifier)
|
|
52
|
-
|
|
53
|
-
listSshKeys = async () => this.client.account.sshKeys.list()
|
|
54
|
-
|
|
55
|
-
createSshKey = async (name: string, public_key: string) =>
|
|
56
|
-
this.client.account.sshKeys.create(name, public_key)
|
|
57
|
-
|
|
58
|
-
deleteSshKey = async (fingerprint: string) =>
|
|
59
|
-
this.client.account.sshKeys.delete(fingerprint)
|
|
60
|
-
}
|
package/src/humane/Client.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type {Client as ClientT} from "@/api/client/client"
|
|
2
|
-
import {Account} from "@/humane/Account"
|
|
3
|
-
import {Server} from "@/humane/Server"
|
|
4
|
-
|
|
5
|
-
export class Client {
|
|
6
|
-
private readonly client: ClientT
|
|
7
|
-
|
|
8
|
-
constructor(client: ClientT) {
|
|
9
|
-
this.client = client
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
get $client(): ClientT {
|
|
13
|
-
return this.client
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
getAccount = async () => {
|
|
17
|
-
const user = await this.client.account.info()
|
|
18
|
-
return new Account(this.client, user)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
listPermissions = async () => this.client.listPermissions()
|
|
22
|
-
|
|
23
|
-
listServers = async (
|
|
24
|
-
opts: {
|
|
25
|
-
type?: "accessible" | "mine" | "admin" | "admin-all"
|
|
26
|
-
page?: number
|
|
27
|
-
per_page?: number
|
|
28
|
-
include?: ("egg" | "subusers")[]
|
|
29
|
-
} = {type: "accessible", page: 1, per_page: 50}
|
|
30
|
-
) => {
|
|
31
|
-
const data = await this.client.listServers(
|
|
32
|
-
opts.type,
|
|
33
|
-
opts.page,
|
|
34
|
-
opts.per_page,
|
|
35
|
-
opts.include
|
|
36
|
-
)
|
|
37
|
-
return data.map(d => new Server(this.client.server(d.uuid), d))
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
getServer = async (uuid: string, include?: ("egg" | "subusers")[]) => {
|
|
41
|
-
const server = await this.client.server(uuid).info(include)
|
|
42
|
-
return new Server(this.client.server(uuid), server)
|
|
43
|
-
}
|
|
44
|
-
}
|