@pelican.ts/sdk 0.3.4-next.4 → 0.4.1

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.
@@ -0,0 +1,44 @@
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
+ }
@@ -0,0 +1,206 @@
1
+ import type { ServerClient } from "@/api/client/server"
2
+ import type { ServerBackups } from "@/api/client/server_backups"
3
+ import type { ServerFiles } from "@/api/client/server_files"
4
+ import type { ServerSchedules } from "@/api/client/server_schedules"
5
+ import type { Server as ServerT } from "@/api/client/types/server"
6
+ import { ServerAllocation } from "@/humane/ServerAllocation"
7
+ import { ServerBackup } from "@/humane/ServerBackup"
8
+ import { ServerDatabase } from "@/humane/ServerDatabase"
9
+ import { ServerFile } from "@/humane/ServerFile"
10
+ import { ServerSchedule } from "@/humane/ServerSchedule"
11
+ import { ServerUser } from "@/humane/ServerUser"
12
+ import type {
13
+ EggVariable,
14
+ FeatureLimits,
15
+ ServerLimits,
16
+ SubuserPermission,
17
+ } from "@/types"
18
+ import type { Nullable } from "@/utils/types"
19
+
20
+ export class Server {
21
+ private readonly client: ServerClient
22
+
23
+ readonly ownsServer: boolean
24
+ readonly identifier: string
25
+ readonly internalId?: number
26
+ readonly uuid: string
27
+ private $name: string
28
+ get name() {
29
+ return this.$name
30
+ }
31
+ readonly node: string
32
+ readonly isNodeUnderMaintenance: boolean
33
+ readonly sftp: {
34
+ ip: string
35
+ alias: Nullable<string>
36
+ port: number
37
+ }
38
+ private $description: string
39
+ get description() {
40
+ return this.$description
41
+ }
42
+ readonly limits: ServerLimits
43
+ readonly invocation: string
44
+ private $dockerImage: string
45
+ get dockerImage() {
46
+ return this.$dockerImage
47
+ }
48
+ readonly eggFeatures: Nullable<string[]>
49
+ readonly featureLimits: FeatureLimits
50
+ readonly status: unknown
51
+ readonly isSuspended: boolean
52
+ readonly isInstalling: boolean
53
+ readonly isTransferring: boolean
54
+ readonly allocations: ServerAllocation[]
55
+ readonly variables: EggVariable[]
56
+ readonly egg?: {
57
+ uuid: string
58
+ name: string
59
+ }
60
+ readonly subusers?: ServerUser[]
61
+
62
+ constructor(client: ServerClient, server: ServerT) {
63
+ this.client = client
64
+ this.ownsServer = server.server_owner
65
+ this.identifier = server.identifier
66
+ this.internalId = server.internal_id
67
+ this.uuid = server.uuid
68
+ this.$name = server.name
69
+ this.node = server.node
70
+ this.isNodeUnderMaintenance = server.is_node_under_maintenance
71
+ this.sftp = server.sftp_details
72
+ this.$description = server.description
73
+ this.limits = server.limits
74
+ this.invocation = server.invocation
75
+ this.$dockerImage = server.docker_image
76
+ this.eggFeatures = server.egg_features
77
+ this.featureLimits = server.feature_limits
78
+ this.status = server.status
79
+ this.isSuspended = server.is_suspended
80
+ this.isInstalling = server.is_installing
81
+ this.isTransferring = server.is_transferring
82
+ this.allocations = server.relationships.allocations.data.map(
83
+ (d) => new ServerAllocation(this.client, d.attributes),
84
+ )
85
+ this.variables = server.relationships.variables.data.map(
86
+ (d) => d.attributes,
87
+ )
88
+ this.egg = server.relationships.egg?.attributes
89
+ this.subusers = server.relationships.subusers?.data.map(
90
+ (d) => new ServerUser(this.client, d.attributes),
91
+ )
92
+ }
93
+
94
+ rename = async (name: string) => {
95
+ await this.client.settings.rename(name)
96
+ this.$name = name
97
+ }
98
+
99
+ updateDescription = async (description: string) => {
100
+ await this.client.settings.updateDescription(description)
101
+ this.$description = description
102
+ }
103
+
104
+ reinstall = async () => this.client.settings.reinstall()
105
+
106
+ changeDockerImage = async (image: string) => {
107
+ await this.client.settings.changeDockerImage(image)
108
+ this.$dockerImage = image
109
+ }
110
+
111
+ getActivityLogs = async (
112
+ opts: { page?: number; per_page?: number } = { page: 1, per_page: 50 },
113
+ ) => this.client.activity.list(opts.page, opts.per_page)
114
+
115
+ websocket = (stripColors: boolean = false) =>
116
+ this.client.websocket(stripColors)
117
+
118
+ getServerStats = async () => this.client.resources()
119
+
120
+ runCommand = async (command: string) => this.client.command(command)
121
+
122
+ sendPowerSignal = async (signal: "start" | "stop" | "restart" | "kill") =>
123
+ this.client.power(signal)
124
+
125
+ getDatabases = async (
126
+ opts: { include?: "password"[]; page?: number } = {
127
+ include: [],
128
+ page: 1,
129
+ },
130
+ ) => {
131
+ const data = await this.client.databases.list(opts.include, opts.page)
132
+ return data.map((d) => new ServerDatabase(this.client, d))
133
+ }
134
+
135
+ createDatabase = async (database: string, remote: string) => {
136
+ const data = await this.client.databases.create(database, remote)
137
+ return new ServerDatabase(this.client, data)
138
+ }
139
+
140
+ getSchedules = async () => {
141
+ const data = await this.client.schedules.list()
142
+ return data.map((d) => new ServerSchedule(this.client, d))
143
+ }
144
+
145
+ createSchedule = async (...opts: Parameters<ServerSchedules["create"]>) => {
146
+ const data = await this.client.schedules.create(...opts)
147
+ return new ServerSchedule(this.client, data)
148
+ }
149
+
150
+ getBackups = async (page: number = 1) => {
151
+ const data = await this.client.backups.list(page)
152
+ return data.map((d) => new ServerBackup(this.client, d))
153
+ }
154
+
155
+ createBackup = async (...args: Parameters<ServerBackups["create"]>) => {
156
+ const data = await this.client.backups.create(...args)
157
+ return new ServerBackup(this.client, data)
158
+ }
159
+
160
+ getAllocations = async () => {
161
+ const data = await this.client.allocations.list()
162
+ return data.map((d) => new ServerAllocation(this.client, d))
163
+ }
164
+
165
+ createAllocation = async () => {
166
+ const data = await this.client.allocations.autoAssign()
167
+ return new ServerAllocation(this.client, data)
168
+ }
169
+
170
+ getFiles = async (path?: string) => {
171
+ const data = await this.client.files.list(path)
172
+ return data.map((d) => new ServerFile(this.client, d))
173
+ }
174
+
175
+ createFolder = async (...opts: Parameters<ServerFiles["createFolder"]>) =>
176
+ this.client.files.createFolder(...opts)
177
+
178
+ uploadFile = async (...opts: Parameters<ServerFiles["upload"]>) =>
179
+ this.client.files.upload(...opts)
180
+
181
+ uploadFileGetUrl = async (
182
+ ...opts: Parameters<ServerFiles["uploadGetUrl"]>
183
+ ) => this.client.files.uploadGetUrl(...opts)
184
+
185
+ pullFileFromRemote = async (
186
+ ...opts: Parameters<ServerFiles["pullFromRemote"]>
187
+ ) => this.client.files.pullFromRemote(...opts)
188
+
189
+ getUsers = async () => {
190
+ const data = await this.client.users.list()
191
+ return data.map((d) => new ServerUser(this.client, d))
192
+ }
193
+
194
+ createUser = async (
195
+ email: string,
196
+ permissions: SubuserPermission[] | string[],
197
+ ) => {
198
+ const data = await this.client.users.create(email, permissions)
199
+ return new ServerUser(this.client, data)
200
+ }
201
+
202
+ getStartupInfo = async () => this.client.startup.list()
203
+
204
+ setStartupVariable = async (key: string, value: string) =>
205
+ this.client.startup.set(key, value)
206
+ }
@@ -0,0 +1,41 @@
1
+ import type { ServerClient } from "@/api/client/server"
2
+ import type { ServerAllocation as ServerAllocationT } from "@/api/client/types/server_allocation"
3
+ import type { Nullable } from "@/utils/types"
4
+
5
+ export class ServerAllocation {
6
+ private readonly client: ServerClient
7
+ readonly alias: Nullable<string>
8
+ readonly id: number
9
+ readonly ip: string
10
+ private $isDefault: boolean
11
+ get isDefault() {
12
+ return this.$isDefault
13
+ }
14
+ private $notes: Nullable<string>
15
+ get notes() {
16
+ return this.$notes
17
+ }
18
+ readonly port: number
19
+
20
+ constructor(client: ServerClient, alloc: ServerAllocationT) {
21
+ this.client = client
22
+ this.alias = alloc.alias
23
+ this.id = alloc.id
24
+ this.ip = alloc.ip
25
+ this.$isDefault = alloc.is_default
26
+ this.$notes = alloc.notes
27
+ this.port = alloc.port
28
+ }
29
+
30
+ setNotes = async (notes: string) => {
31
+ const data = await this.client.allocations.setNotes(this.id, notes)
32
+ this.$notes = data.notes
33
+ }
34
+
35
+ makeDefault = async () => {
36
+ const data = await this.client.allocations.setPrimary(this.id)
37
+ this.$isDefault = data.is_default
38
+ }
39
+
40
+ unassign = async () => this.client.allocations.unassign(this.id)
41
+ }
@@ -0,0 +1,37 @@
1
+ import type { ServerClient } from "@/api/client/server"
2
+ import type { ServerBackup as ServerBackupT } from "@/api/common/types/server_backup"
3
+ import type { Nullable } from "@/utils/types"
4
+
5
+ export class ServerBackup {
6
+ private readonly client: ServerClient
7
+ readonly bytes: number
8
+ readonly checksum: Nullable<string>
9
+ readonly completedAt: Nullable<Date>
10
+ readonly createdAt: Date
11
+ readonly ignoredFiles: string[]
12
+ readonly isLocked: boolean
13
+ readonly isSuccessful: boolean
14
+ readonly name: string
15
+ readonly uuid: string
16
+
17
+ constructor(client: ServerClient, backup: ServerBackupT) {
18
+ this.client = client
19
+ this.bytes = backup.bytes
20
+ this.checksum = backup.checksum
21
+ this.completedAt = backup.completed_at
22
+ ? new Date(backup.completed_at)
23
+ : null
24
+ this.createdAt = new Date(backup.created_at)
25
+ this.ignoredFiles = backup.ignored_files
26
+ this.isLocked = backup.is_locked
27
+ this.isSuccessful = backup.is_successful
28
+ this.name = backup.name
29
+ this.uuid = backup.uuid
30
+ }
31
+
32
+ downloadGetUrl = async () => this.client.backups.downloadGetUrl(this.uuid)
33
+
34
+ download = async () => this.client.backups.download(this.uuid)
35
+
36
+ delete = async () => this.client.backups.delete(this.uuid)
37
+ }
@@ -0,0 +1,37 @@
1
+ import type { ServerClient } from "@/api/client/server"
2
+ import type { ServerDatabase as ServerDatabaseT } from "@/api/common/types/server_database"
3
+ // TODO: Check for validity
4
+
5
+ export class ServerDatabase {
6
+ private readonly client: ServerClient
7
+ readonly allowConnectionsFrom: string
8
+ readonly host: string
9
+ readonly port: number
10
+ readonly id: string
11
+ readonly maxConnections: number
12
+ readonly name: string
13
+ private $password?: string
14
+ get password() {
15
+ return this.$password
16
+ }
17
+ readonly username: string
18
+
19
+ constructor(client: ServerClient, database: ServerDatabaseT) {
20
+ this.client = client
21
+ this.allowConnectionsFrom = database.connections_from
22
+ this.host = database.host.address
23
+ this.port = database.host.port
24
+ this.id = database.id
25
+ this.maxConnections = database.max_connections
26
+ this.name = database.name
27
+ this.$password = database.relationships?.password.attributes.password
28
+ this.username = database.username
29
+ }
30
+
31
+ rotatePassword = async () => {
32
+ const data = await this.client.databases.rotatePassword(this.id)
33
+ this.$password = data.relationships?.password.attributes.password
34
+ }
35
+
36
+ delete = async () => this.client.databases.delete(this.id)
37
+ }
@@ -0,0 +1,88 @@
1
+ import path from "node:path"
2
+ import type { ServerClient } from "@/api/client/server"
3
+ import type { FileObject } from "@/api/common/types/server_files"
4
+
5
+ export class ServerFile {
6
+ private readonly client: ServerClient
7
+ private readonly dir: string
8
+ private readonly path: string
9
+ readonly createdAt: Date
10
+ readonly isFile: boolean
11
+ readonly isSymlink: boolean
12
+ readonly mimetype: string
13
+ readonly mode: string
14
+ readonly modeBits: string
15
+ readonly modifiedAt: Date
16
+ readonly name: string
17
+ readonly size: number
18
+
19
+ constructor(client: ServerClient, file: FileObject, dir: string = "/") {
20
+ this.client = client
21
+ this.dir = dir
22
+ this.createdAt = new Date(file.created_at)
23
+ this.isFile = file.is_file
24
+ this.isSymlink = file.is_symlink
25
+ this.mimetype = file.mimetype
26
+ this.mode = file.mode
27
+ this.modeBits = file.mode_bits
28
+ this.modifiedAt = new Date(file.modified_at)
29
+ this.name = file.name
30
+ this.size = file.size
31
+ this.path = path.join(dir, this.name)
32
+ }
33
+
34
+ get isArchive() {
35
+ // Maybe mimetype is better
36
+ return [
37
+ "zip",
38
+ "tgz",
39
+ "tar.gz",
40
+ "txz",
41
+ "tar.xz",
42
+ "tbz2",
43
+ "tar.bz2",
44
+ ].some((ext) => this.name.endsWith(`.${ext}`))
45
+ }
46
+
47
+ /**
48
+ * Return the contents of a file. To read binary file (non-editable) use {@link download} instead
49
+ */
50
+ contents = async () => this.client.files.contents(this.path)
51
+
52
+ downloadGetUrl = async () => this.client.files.downloadGetUrl(this.path)
53
+
54
+ download = async () => this.client.files.download(this.path)
55
+
56
+ rename = async (newName: string) =>
57
+ this.client.files.rename(this.dir, [{ from: this.name, to: newName }])
58
+
59
+ copy = async () => this.client.files.copy(this.path)
60
+
61
+ write = async (content: string) =>
62
+ this.client.files.write(this.path, content)
63
+
64
+ compress = async (
65
+ archive_name?: string,
66
+ extension?:
67
+ | "zip"
68
+ | "tgz"
69
+ | "tar.gz"
70
+ | "txz"
71
+ | "tar.xz"
72
+ | "tbz2"
73
+ | "tar.bz2",
74
+ ) =>
75
+ this.client.files.compress(
76
+ this.dir,
77
+ [this.name],
78
+ archive_name,
79
+ extension,
80
+ )
81
+
82
+ decompress = async () => this.client.files.decompress(this.dir, this.name)
83
+
84
+ delete = async () => this.client.files.delete(this.dir, [this.name])
85
+
86
+ chmod = async (mode: number) =>
87
+ this.client.files.chmod(this.dir, [{ file: this.name, mode }])
88
+ }
@@ -0,0 +1,160 @@
1
+ import type { ServerClient } from "@/api/client/server"
2
+ import type { Schedule, ScheduleTask } from "@/api/common/types/server_schedule"
3
+ import type { Nullable, PartialBy } from "@/utils/types"
4
+
5
+ export class ServerSchedule {
6
+ private readonly client: ServerClient
7
+ readonly createdAt: Date
8
+ private $cron: {
9
+ day_of_week: string
10
+ day_of_month: string
11
+ hour: string
12
+ minute: string
13
+ }
14
+ get cron() {
15
+ return { ...this.$cron }
16
+ }
17
+ readonly id: number
18
+ private $isActive: boolean
19
+ get isActive() {
20
+ return this.$isActive
21
+ }
22
+ private $isProcessing: boolean
23
+ get isProcessing() {
24
+ return this.$isProcessing
25
+ }
26
+ readonly lastRunAt: Nullable<Date>
27
+ private $name: string
28
+ get name() {
29
+ return this.$name
30
+ }
31
+ readonly nextRunAt: Date
32
+ private $onlyWhenOnline: boolean
33
+ get onlyWhenOnline() {
34
+ return this.$onlyWhenOnline
35
+ }
36
+ readonly tasks: ServerScheduleTask[]
37
+ private $updatedAt: Date
38
+ get updatedAt() {
39
+ return this.$updatedAt
40
+ }
41
+
42
+ constructor(client: ServerClient, schedule: Schedule) {
43
+ this.client = client
44
+ this.createdAt = new Date(schedule.created_at)
45
+ this.$cron = schedule.cron
46
+ this.id = schedule.id
47
+ this.$isActive = schedule.is_active
48
+ this.$isProcessing = schedule.is_processing
49
+ this.lastRunAt = schedule.last_run_at
50
+ ? new Date(schedule.last_run_at)
51
+ : null
52
+ this.$name = schedule.name
53
+ this.nextRunAt = new Date(schedule.next_run_at)
54
+ this.$onlyWhenOnline = schedule.only_when_online
55
+ this.tasks = schedule.relationships.tasks.data.map(
56
+ (d) => new ServerScheduleTask(this.client, this.id, d.attributes),
57
+ )
58
+ this.$updatedAt = new Date(schedule.updated_at)
59
+ }
60
+
61
+ update = async (opts: {
62
+ name: string
63
+ is_active?: boolean
64
+ only_when_online?: boolean
65
+ minute: string
66
+ hour: string
67
+ day_of_week: string
68
+ month: string
69
+ day_of_month: string
70
+ }) => {
71
+ const data = await this.client.schedules.control(this.id).update(opts)
72
+ this.$name = data.name
73
+ this.$isActive = data.is_active
74
+ this.$isProcessing = data.is_processing
75
+ this.$onlyWhenOnline = data.only_when_online
76
+ this.$cron = data.cron
77
+ this.$updatedAt = new Date(data.updated_at)
78
+ }
79
+
80
+ delete = async () => this.client.schedules.control(this.id).delete()
81
+
82
+ execute = async () => this.client.schedules.control(this.id).execute()
83
+ }
84
+
85
+ export class ServerScheduleTask {
86
+ private readonly client: ServerClient
87
+ private readonly scheduleId: number
88
+ private $action: "command" | "power" | "backup" | "delete_files"
89
+ get action() {
90
+ return this.$action
91
+ }
92
+ private $continueOnFailure: boolean
93
+ get continueOnFailure() {
94
+ return this.$continueOnFailure
95
+ }
96
+ readonly createdAt: Date
97
+ readonly id: number
98
+ private $isQueued: boolean
99
+ get isQueued() {
100
+ return this.$isQueued
101
+ }
102
+ private $payload: string
103
+ get payload() {
104
+ return this.$payload
105
+ }
106
+ private $sequenceId: number
107
+ get sequenceId() {
108
+ return this.$sequenceId
109
+ }
110
+ private $timeOffset: number
111
+ get timeOffset() {
112
+ return this.$timeOffset
113
+ }
114
+ private $updatedAt: Nullable<Date>
115
+ get updatedAt() {
116
+ return this.$updatedAt
117
+ }
118
+
119
+ constructor(client: ServerClient, scheduleId: number, task: ScheduleTask) {
120
+ this.client = client
121
+ this.scheduleId = scheduleId
122
+ this.$action = task.action
123
+ this.$continueOnFailure = task.continue_on_failure
124
+ this.createdAt = new Date(task.created_at)
125
+ this.id = task.id
126
+ this.$isQueued = task.is_queued
127
+ this.$payload = task.payload
128
+ this.$sequenceId = task.sequence_id
129
+ this.$timeOffset = task.time_offset
130
+ this.$updatedAt = task.updated_at ? new Date(task.updated_at) : null
131
+ }
132
+
133
+ delete = async () =>
134
+ this.client.schedules.control(this.scheduleId).tasks.delete(this.id)
135
+
136
+ update = async (
137
+ opts: PartialBy<
138
+ Pick<
139
+ ScheduleTask,
140
+ | "action"
141
+ | "payload"
142
+ | "time_offset"
143
+ | "sequence_id"
144
+ | "continue_on_failure"
145
+ >,
146
+ "payload" | "sequence_id" | "continue_on_failure"
147
+ >,
148
+ ) => {
149
+ const data = await this.client.schedules
150
+ .control(this.scheduleId)
151
+ .tasks.update(this.id, opts)
152
+ this.$action = data.action
153
+ this.$continueOnFailure = data.continue_on_failure
154
+ this.$isQueued = data.is_queued
155
+ this.$payload = data.payload
156
+ this.$sequenceId = data.sequence_id
157
+ this.$timeOffset = data.time_offset
158
+ this.$updatedAt = data.updated_at ? new Date(data.updated_at) : null
159
+ }
160
+ }
@@ -0,0 +1,44 @@
1
+ import type { ServerClient } from "@/api/client/server"
2
+ import type {
3
+ ServerSubuser,
4
+ SubuserPermission,
5
+ } from "@/api/client/types/server_subuser"
6
+
7
+ export class ServerUser {
8
+ private readonly client: ServerClient
9
+
10
+ readonly uuid: string
11
+ readonly username: string
12
+ readonly email: string
13
+ readonly language: string
14
+ readonly image: string
15
+ readonly admin: boolean
16
+ readonly root_admin: boolean
17
+ readonly has2faEnabled: boolean
18
+ readonly createdAt: Date
19
+ private $permissions: SubuserPermission[] | string[]
20
+ get permissions() {
21
+ return this.$permissions
22
+ }
23
+
24
+ constructor(client: ServerClient, user: ServerSubuser) {
25
+ this.client = client
26
+ this.uuid = user.uuid
27
+ this.username = user.username
28
+ this.email = user.email
29
+ this.language = user.language
30
+ this.image = user.image
31
+ this.admin = user.admin
32
+ this.root_admin = user.root_admin
33
+ this.has2faEnabled = user["2fa_enabled"]
34
+ this.createdAt = new Date(user.created_at)
35
+ this.$permissions = user.permissions
36
+ }
37
+
38
+ update = async (permissions: SubuserPermission[] | string[]) => {
39
+ const data = await this.client.users.update(this.uuid, permissions)
40
+ this.$permissions = data.permissions
41
+ }
42
+
43
+ delete = async () => this.client.users.delete(this.uuid)
44
+ }
package/src/index.ts CHANGED
@@ -1,17 +1,21 @@
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";
1
+ import { PelicanAPIClient } from "@/api"
2
+ import { Client as UserClient } from "@/humane/Client"
4
3
 
5
- export class PelicanClient 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
- }
4
+ export const createPelicanClient = (
5
+ url: string,
6
+ token: string,
7
+ suffix: string = "/api",
8
+ ) => {
9
+ const client = new PelicanAPIClient(url, token, suffix)
10
+ return new UserClient(client)
10
11
  }
11
12
 
12
- export class PelicanApplication 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
- }
13
+ export {Client} from "@/humane/Client"
14
+ export {Account} from "@/humane/Account"
15
+ export {Server} from "@/humane/Server"
16
+ export {ServerAllocation} from "@/humane/ServerAllocation"
17
+ export {ServerBackup} from "@/humane/ServerBackup"
18
+ export {ServerDatabase} from "@/humane/ServerDatabase"
19
+ export {ServerFile} from "@/humane/ServerFile"
20
+ export {ServerSchedule} from "@/humane/ServerSchedule"
21
+ export {ServerUser} from "@/humane/ServerUser"