@pelican.ts/sdk 0.2.4 → 0.2.5

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <img src=".github/logo.png" width="420" />
3
3
  </h1>
4
4
 
5
- # Pelican.ts Typescript Client for Pelican panel
5
+ # Pelican.ts Typescript client for Pelican panel
6
6
 
7
7
  ## Installation
8
8
  ```shell
package/dist/index.d.mts CHANGED
@@ -15,7 +15,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
15
15
  type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
16
16
  type Nullable<T> = T | null;
17
17
 
18
- type User$1 = {
18
+ type User = {
19
19
  uuid: string;
20
20
  username: string;
21
21
  email: string;
@@ -48,7 +48,7 @@ type Permission = {
48
48
  declare class Account {
49
49
  private readonly r;
50
50
  constructor(requester: AxiosInstance);
51
- info: () => Promise<User$1>;
51
+ info: () => Promise<User>;
52
52
  updateEmail: (newEmail: string, password: string) => Promise<void>;
53
53
  updatePassword: (newPassword: string) => Promise<void>;
54
54
  apiKeys: {
@@ -140,7 +140,7 @@ type FeatureLimits = {
140
140
  backups: number;
141
141
  };
142
142
 
143
- type Allocation$1 = {
143
+ type ServerAllocation = {
144
144
  id: number;
145
145
  ip: string;
146
146
  alias: Nullable<string>;
@@ -149,7 +149,7 @@ type Allocation$1 = {
149
149
  is_default: boolean;
150
150
  };
151
151
 
152
- type Server$1 = {
152
+ type Server = {
153
153
  server_owner: boolean;
154
154
  identifier: string;
155
155
  internal_id?: number;
@@ -173,7 +173,7 @@ type Server$1 = {
173
173
  is_installing: boolean;
174
174
  is_transferring: boolean;
175
175
  relationships: {
176
- allocations: GenericListResponse<GenericResponse<Allocation$1, "allocation">>;
176
+ allocations: GenericListResponse<GenericResponse<ServerAllocation, "allocation">>;
177
177
  variables: GenericListResponse<GenericResponse<EggVariable, "egg_variable">>;
178
178
  egg?: GenericResponse<{
179
179
  uuid: string;
@@ -347,10 +347,10 @@ declare class ServerAllocations {
347
347
  private readonly r;
348
348
  private readonly id;
349
349
  constructor(requester: AxiosInstance, id: string);
350
- list: () => Promise<Allocation$1[]>;
351
- autoAssign: () => Promise<Allocation$1>;
352
- setNotes: (alloc_id: number, notes: string) => Promise<Allocation$1>;
353
- setPrimary: (alloc_id: number) => Promise<Allocation$1>;
350
+ list: () => Promise<ServerAllocation[]>;
351
+ autoAssign: () => Promise<ServerAllocation>;
352
+ setNotes: (alloc_id: number, notes: string) => Promise<ServerAllocation>;
353
+ setPrimary: (alloc_id: number) => Promise<ServerAllocation>;
354
354
  unassign: (alloc_id: number) => Promise<void>;
355
355
  }
356
356
 
@@ -365,7 +365,7 @@ declare class ServerUsers {
365
365
  delete: (user_id: number) => Promise<void>;
366
366
  }
367
367
 
368
- type Backup = {
368
+ type ServerBackup = {
369
369
  uuid: string;
370
370
  is_successful: boolean;
371
371
  is_locked: boolean;
@@ -381,13 +381,13 @@ declare class ServerBackups {
381
381
  private readonly r;
382
382
  private readonly id;
383
383
  constructor(requester: AxiosInstance, id: string);
384
- list: (page?: number) => Promise<Backup[]>;
384
+ list: (page?: number) => Promise<ServerBackup[]>;
385
385
  create: (args: {
386
386
  name?: string;
387
387
  is_locked: boolean;
388
388
  ignored_files: string[];
389
- }) => Promise<Backup>;
390
- info: (backup_uuid: string) => Promise<Backup>;
389
+ }) => Promise<ServerBackup>;
390
+ info: (backup_uuid: string) => Promise<ServerBackup>;
391
391
  downloadGetUrl: (backup_uuid: string) => Promise<string>;
392
392
  download: (backup_uuid: string) => Promise<ArrayBuffer>;
393
393
  delete: (backup_uuid: string) => Promise<void>;
@@ -545,7 +545,7 @@ declare class ServerClient {
545
545
  variables: ServerStartup;
546
546
  settings: ServerSettings;
547
547
  constructor(requester: AxiosInstance, id: string);
548
- info: (include?: ("egg" | "subusers")[]) => Promise<Server$1>;
548
+ info: (include?: ("egg" | "subusers")[]) => Promise<Server>;
549
549
  websocket: (stripColors?: boolean) => ServerWebsocket;
550
550
  resources: () => Promise<ServerStats>;
551
551
  command: (command: string) => Promise<void>;
@@ -557,7 +557,7 @@ declare class Client$1 {
557
557
  private readonly r;
558
558
  constructor(requester: AxiosInstance);
559
559
  listPermissions: () => Promise<Record<string, Permission>>;
560
- listServers: (type?: "accessible" | "mine" | "admin" | "admin-all", page?: number, per_page?: number, include?: ("egg" | "subusers")[]) => Promise<Server$1[]>;
560
+ listServers: (type?: "accessible" | "mine" | "admin" | "admin-all", page?: number, per_page?: number, include?: ("egg" | "subusers")[]) => Promise<Server[]>;
561
561
  server: (uuid: string) => ServerClient;
562
562
  }
563
563
 
@@ -571,7 +571,7 @@ type Container = {
571
571
  network_mode: string;
572
572
  };
573
573
 
574
- type Server = {
574
+ type ApplicationServer = {
575
575
  id: number;
576
576
  external_id: Nullable<string>;
577
577
  uuid: string;
@@ -591,7 +591,7 @@ type Server = {
591
591
  updated_at: Nullable<string>;
592
592
  };
593
593
 
594
- type User = {
594
+ type ApplicationUser = {
595
595
  id: number;
596
596
  external_id: Nullable<string>;
597
597
  uuid: string;
@@ -604,22 +604,22 @@ type User = {
604
604
  created_at: string;
605
605
  updated_at: Nullable<string>;
606
606
  relationships?: {
607
- servers: GenericListResponse<GenericResponse<Server>>;
607
+ servers: GenericListResponse<GenericResponse<ApplicationServer>>;
608
608
  };
609
609
  };
610
610
 
611
611
  declare class Users {
612
612
  private readonly r;
613
613
  constructor(requester: AxiosInstance);
614
- list: (opts: ListType, page?: number) => Promise<User[]>;
614
+ list: (opts: ListType, page?: number) => Promise<ApplicationUser[]>;
615
615
  info: (id: number, { include }: {
616
616
  include?: ("servers")[];
617
- }) => Promise<User>;
617
+ }) => Promise<ApplicationUser>;
618
618
  infoByExternal: (external_id: string, { include }: {
619
619
  include?: ("servers")[];
620
- }) => Promise<User>;
621
- create: (user: z.infer<typeof CreateSchema>) => Promise<User>;
622
- update: (id: number, user: z.infer<typeof CreateSchema>) => Promise<User>;
620
+ }) => Promise<ApplicationUser>;
621
+ create: (user: z.infer<typeof CreateSchema>) => Promise<ApplicationUser>;
622
+ update: (id: number, user: z.infer<typeof CreateSchema>) => Promise<ApplicationUser>;
623
623
  delete: (id: number) => Promise<void>;
624
624
  addRoles: (id: number, roles: number[]) => Promise<void>;
625
625
  removeRoles: (id: number, roles: number[]) => Promise<void>;
@@ -1238,7 +1238,7 @@ type Node = {
1238
1238
  relationships?: {
1239
1239
  allocations?: GenericListResponse<GenericResponse<Allocation, "allocation">>;
1240
1240
  location?: GenericResponse<Location, "location">;
1241
- servers?: GenericListResponse<GenericResponse<Server, "server">>;
1241
+ servers?: GenericListResponse<GenericResponse<ApplicationServer, "server">>;
1242
1242
  };
1243
1243
  };
1244
1244
  type NodeConfiguration = {
@@ -1277,7 +1277,7 @@ type Allocation = {
1277
1277
  type AllocationRel = Allocation & {
1278
1278
  relationships?: {
1279
1279
  node?: GenericResponse<Node, "node">;
1280
- server?: GenericResponse<Server, "server">;
1280
+ server?: GenericResponse<ApplicationServer, "server">;
1281
1281
  };
1282
1282
  };
1283
1283
 
@@ -1350,7 +1350,7 @@ declare class Servers {
1350
1350
  private readonly id;
1351
1351
  databases: ServersDatabases;
1352
1352
  constructor(r: AxiosInstance, server_id: number);
1353
- info: (include?: ("egg" | "subusers")[]) => Promise<Server>;
1353
+ info: (include?: ("egg" | "subusers")[]) => Promise<ApplicationServer>;
1354
1354
  delete: (force?: boolean) => Promise<void>;
1355
1355
  updateDetails: (opts: z.infer<typeof UpdateDetailsSchema>) => Promise<void>;
1356
1356
  updateBuild: (opts: z.infer<typeof UpdateBuildSchema>) => Promise<void>;
@@ -1486,9 +1486,9 @@ declare class Client {
1486
1486
  databaseHosts: DatabaseHosts;
1487
1487
  roles: Roles;
1488
1488
  constructor(requester: AxiosInstance);
1489
- listServers: (search?: string, page?: number) => Promise<Server[]>;
1490
- createServer: (opts: z.infer<typeof CreateServerSchema>) => Promise<Server>;
1491
- getServerByExternalId: (external_id: string, include?: ("egg" | "subusers")[]) => Promise<Server>;
1489
+ listServers: (search?: string, page?: number) => Promise<ApplicationServer[]>;
1490
+ createServer: (opts: z.infer<typeof CreateServerSchema>) => Promise<ApplicationServer>;
1491
+ getServerByExternalId: (external_id: string, include?: ("egg" | "subusers")[]) => Promise<ApplicationServer>;
1492
1492
  servers: (server_id: number) => Servers;
1493
1493
  }
1494
1494
 
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
15
15
  type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
16
16
  type Nullable<T> = T | null;
17
17
 
18
- type User$1 = {
18
+ type User = {
19
19
  uuid: string;
20
20
  username: string;
21
21
  email: string;
@@ -48,7 +48,7 @@ type Permission = {
48
48
  declare class Account {
49
49
  private readonly r;
50
50
  constructor(requester: AxiosInstance);
51
- info: () => Promise<User$1>;
51
+ info: () => Promise<User>;
52
52
  updateEmail: (newEmail: string, password: string) => Promise<void>;
53
53
  updatePassword: (newPassword: string) => Promise<void>;
54
54
  apiKeys: {
@@ -140,7 +140,7 @@ type FeatureLimits = {
140
140
  backups: number;
141
141
  };
142
142
 
143
- type Allocation$1 = {
143
+ type ServerAllocation = {
144
144
  id: number;
145
145
  ip: string;
146
146
  alias: Nullable<string>;
@@ -149,7 +149,7 @@ type Allocation$1 = {
149
149
  is_default: boolean;
150
150
  };
151
151
 
152
- type Server$1 = {
152
+ type Server = {
153
153
  server_owner: boolean;
154
154
  identifier: string;
155
155
  internal_id?: number;
@@ -173,7 +173,7 @@ type Server$1 = {
173
173
  is_installing: boolean;
174
174
  is_transferring: boolean;
175
175
  relationships: {
176
- allocations: GenericListResponse<GenericResponse<Allocation$1, "allocation">>;
176
+ allocations: GenericListResponse<GenericResponse<ServerAllocation, "allocation">>;
177
177
  variables: GenericListResponse<GenericResponse<EggVariable, "egg_variable">>;
178
178
  egg?: GenericResponse<{
179
179
  uuid: string;
@@ -347,10 +347,10 @@ declare class ServerAllocations {
347
347
  private readonly r;
348
348
  private readonly id;
349
349
  constructor(requester: AxiosInstance, id: string);
350
- list: () => Promise<Allocation$1[]>;
351
- autoAssign: () => Promise<Allocation$1>;
352
- setNotes: (alloc_id: number, notes: string) => Promise<Allocation$1>;
353
- setPrimary: (alloc_id: number) => Promise<Allocation$1>;
350
+ list: () => Promise<ServerAllocation[]>;
351
+ autoAssign: () => Promise<ServerAllocation>;
352
+ setNotes: (alloc_id: number, notes: string) => Promise<ServerAllocation>;
353
+ setPrimary: (alloc_id: number) => Promise<ServerAllocation>;
354
354
  unassign: (alloc_id: number) => Promise<void>;
355
355
  }
356
356
 
@@ -365,7 +365,7 @@ declare class ServerUsers {
365
365
  delete: (user_id: number) => Promise<void>;
366
366
  }
367
367
 
368
- type Backup = {
368
+ type ServerBackup = {
369
369
  uuid: string;
370
370
  is_successful: boolean;
371
371
  is_locked: boolean;
@@ -381,13 +381,13 @@ declare class ServerBackups {
381
381
  private readonly r;
382
382
  private readonly id;
383
383
  constructor(requester: AxiosInstance, id: string);
384
- list: (page?: number) => Promise<Backup[]>;
384
+ list: (page?: number) => Promise<ServerBackup[]>;
385
385
  create: (args: {
386
386
  name?: string;
387
387
  is_locked: boolean;
388
388
  ignored_files: string[];
389
- }) => Promise<Backup>;
390
- info: (backup_uuid: string) => Promise<Backup>;
389
+ }) => Promise<ServerBackup>;
390
+ info: (backup_uuid: string) => Promise<ServerBackup>;
391
391
  downloadGetUrl: (backup_uuid: string) => Promise<string>;
392
392
  download: (backup_uuid: string) => Promise<ArrayBuffer>;
393
393
  delete: (backup_uuid: string) => Promise<void>;
@@ -545,7 +545,7 @@ declare class ServerClient {
545
545
  variables: ServerStartup;
546
546
  settings: ServerSettings;
547
547
  constructor(requester: AxiosInstance, id: string);
548
- info: (include?: ("egg" | "subusers")[]) => Promise<Server$1>;
548
+ info: (include?: ("egg" | "subusers")[]) => Promise<Server>;
549
549
  websocket: (stripColors?: boolean) => ServerWebsocket;
550
550
  resources: () => Promise<ServerStats>;
551
551
  command: (command: string) => Promise<void>;
@@ -557,7 +557,7 @@ declare class Client$1 {
557
557
  private readonly r;
558
558
  constructor(requester: AxiosInstance);
559
559
  listPermissions: () => Promise<Record<string, Permission>>;
560
- listServers: (type?: "accessible" | "mine" | "admin" | "admin-all", page?: number, per_page?: number, include?: ("egg" | "subusers")[]) => Promise<Server$1[]>;
560
+ listServers: (type?: "accessible" | "mine" | "admin" | "admin-all", page?: number, per_page?: number, include?: ("egg" | "subusers")[]) => Promise<Server[]>;
561
561
  server: (uuid: string) => ServerClient;
562
562
  }
563
563
 
@@ -571,7 +571,7 @@ type Container = {
571
571
  network_mode: string;
572
572
  };
573
573
 
574
- type Server = {
574
+ type ApplicationServer = {
575
575
  id: number;
576
576
  external_id: Nullable<string>;
577
577
  uuid: string;
@@ -591,7 +591,7 @@ type Server = {
591
591
  updated_at: Nullable<string>;
592
592
  };
593
593
 
594
- type User = {
594
+ type ApplicationUser = {
595
595
  id: number;
596
596
  external_id: Nullable<string>;
597
597
  uuid: string;
@@ -604,22 +604,22 @@ type User = {
604
604
  created_at: string;
605
605
  updated_at: Nullable<string>;
606
606
  relationships?: {
607
- servers: GenericListResponse<GenericResponse<Server>>;
607
+ servers: GenericListResponse<GenericResponse<ApplicationServer>>;
608
608
  };
609
609
  };
610
610
 
611
611
  declare class Users {
612
612
  private readonly r;
613
613
  constructor(requester: AxiosInstance);
614
- list: (opts: ListType, page?: number) => Promise<User[]>;
614
+ list: (opts: ListType, page?: number) => Promise<ApplicationUser[]>;
615
615
  info: (id: number, { include }: {
616
616
  include?: ("servers")[];
617
- }) => Promise<User>;
617
+ }) => Promise<ApplicationUser>;
618
618
  infoByExternal: (external_id: string, { include }: {
619
619
  include?: ("servers")[];
620
- }) => Promise<User>;
621
- create: (user: z.infer<typeof CreateSchema>) => Promise<User>;
622
- update: (id: number, user: z.infer<typeof CreateSchema>) => Promise<User>;
620
+ }) => Promise<ApplicationUser>;
621
+ create: (user: z.infer<typeof CreateSchema>) => Promise<ApplicationUser>;
622
+ update: (id: number, user: z.infer<typeof CreateSchema>) => Promise<ApplicationUser>;
623
623
  delete: (id: number) => Promise<void>;
624
624
  addRoles: (id: number, roles: number[]) => Promise<void>;
625
625
  removeRoles: (id: number, roles: number[]) => Promise<void>;
@@ -1238,7 +1238,7 @@ type Node = {
1238
1238
  relationships?: {
1239
1239
  allocations?: GenericListResponse<GenericResponse<Allocation, "allocation">>;
1240
1240
  location?: GenericResponse<Location, "location">;
1241
- servers?: GenericListResponse<GenericResponse<Server, "server">>;
1241
+ servers?: GenericListResponse<GenericResponse<ApplicationServer, "server">>;
1242
1242
  };
1243
1243
  };
1244
1244
  type NodeConfiguration = {
@@ -1277,7 +1277,7 @@ type Allocation = {
1277
1277
  type AllocationRel = Allocation & {
1278
1278
  relationships?: {
1279
1279
  node?: GenericResponse<Node, "node">;
1280
- server?: GenericResponse<Server, "server">;
1280
+ server?: GenericResponse<ApplicationServer, "server">;
1281
1281
  };
1282
1282
  };
1283
1283
 
@@ -1350,7 +1350,7 @@ declare class Servers {
1350
1350
  private readonly id;
1351
1351
  databases: ServersDatabases;
1352
1352
  constructor(r: AxiosInstance, server_id: number);
1353
- info: (include?: ("egg" | "subusers")[]) => Promise<Server>;
1353
+ info: (include?: ("egg" | "subusers")[]) => Promise<ApplicationServer>;
1354
1354
  delete: (force?: boolean) => Promise<void>;
1355
1355
  updateDetails: (opts: z.infer<typeof UpdateDetailsSchema>) => Promise<void>;
1356
1356
  updateBuild: (opts: z.infer<typeof UpdateBuildSchema>) => Promise<void>;
@@ -1486,9 +1486,9 @@ declare class Client {
1486
1486
  databaseHosts: DatabaseHosts;
1487
1487
  roles: Roles;
1488
1488
  constructor(requester: AxiosInstance);
1489
- listServers: (search?: string, page?: number) => Promise<Server[]>;
1490
- createServer: (opts: z.infer<typeof CreateServerSchema>) => Promise<Server>;
1491
- getServerByExternalId: (external_id: string, include?: ("egg" | "subusers")[]) => Promise<Server>;
1489
+ listServers: (search?: string, page?: number) => Promise<ApplicationServer[]>;
1490
+ createServer: (opts: z.infer<typeof CreateServerSchema>) => Promise<ApplicationServer>;
1491
+ getServerByExternalId: (external_id: string, include?: ("egg" | "subusers")[]) => Promise<ApplicationServer>;
1492
1492
  servers: (server_id: number) => Servers;
1493
1493
  }
1494
1494