@pelican.ts/sdk 0.3.3-next.6 → 0.3.4-next.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.
package/dist/index.d.mts CHANGED
@@ -11,7 +11,6 @@ type ExactlyOneKey<K extends keyof any, V, KK extends keyof any = K> = {
11
11
  [Q in keyof O]: O[Q];
12
12
  } : never;
13
13
  }[K];
14
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
15
14
  type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
16
15
  type Nullable<T> = T | null;
17
16
 
@@ -1511,7 +1510,7 @@ type Egg = {
1511
1510
  description: string;
1512
1511
  features: string[];
1513
1512
  tags: string[];
1514
- docker_image: string;
1513
+ docker_image: Nullable<string>;
1515
1514
  docker_images: Record<string, string>;
1516
1515
  config: {
1517
1516
  files: Record<string, FileConfig>;
@@ -1537,6 +1536,38 @@ type FileConfig = {
1537
1536
  parser: string;
1538
1537
  find: Record<string, string>;
1539
1538
  };
1539
+ type ApplicationEggVariable = Omit<EggVariable, "server_value" | "is_editable" | "rules"> & {
1540
+ rules: string[];
1541
+ sort: number;
1542
+ user_viewable: boolean;
1543
+ user_editable: boolean;
1544
+ };
1545
+ type ExportedEgg = {
1546
+ meta: {
1547
+ version: "PLCN_v3";
1548
+ update_url: Nullable<string>;
1549
+ };
1550
+ exported_at: string;
1551
+ name: number;
1552
+ author: string;
1553
+ description: string;
1554
+ uuid: string;
1555
+ image: Nullable<string>;
1556
+ docker_images: Record<string, string>;
1557
+ features: string[];
1558
+ tags: string[];
1559
+ file_denylist: string[];
1560
+ startup_commands: Record<string, string>;
1561
+ config: Omit<Egg["config"], "extends" | "file_denylist">;
1562
+ scripts: {
1563
+ installation: {
1564
+ script: string;
1565
+ container: string;
1566
+ entrypoint: string;
1567
+ };
1568
+ };
1569
+ variables: ApplicationEggVariable[];
1570
+ };
1540
1571
 
1541
1572
  declare class Eggs {
1542
1573
  private readonly r;
@@ -1544,6 +1575,7 @@ declare class Eggs {
1544
1575
  list: () => Promise<Egg[]>;
1545
1576
  info: (id: number) => Promise<Egg>;
1546
1577
  export: (id: number, format: "json" | "yaml") => Promise<string>;
1578
+ infoExportable: (id: number) => Promise<ExportedEgg>;
1547
1579
  }
1548
1580
 
1549
1581
  type Mount = {
package/dist/index.d.ts CHANGED
@@ -11,7 +11,6 @@ type ExactlyOneKey<K extends keyof any, V, KK extends keyof any = K> = {
11
11
  [Q in keyof O]: O[Q];
12
12
  } : never;
13
13
  }[K];
14
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
15
14
  type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
16
15
  type Nullable<T> = T | null;
17
16
 
@@ -1511,7 +1510,7 @@ type Egg = {
1511
1510
  description: string;
1512
1511
  features: string[];
1513
1512
  tags: string[];
1514
- docker_image: string;
1513
+ docker_image: Nullable<string>;
1515
1514
  docker_images: Record<string, string>;
1516
1515
  config: {
1517
1516
  files: Record<string, FileConfig>;
@@ -1537,6 +1536,38 @@ type FileConfig = {
1537
1536
  parser: string;
1538
1537
  find: Record<string, string>;
1539
1538
  };
1539
+ type ApplicationEggVariable = Omit<EggVariable, "server_value" | "is_editable" | "rules"> & {
1540
+ rules: string[];
1541
+ sort: number;
1542
+ user_viewable: boolean;
1543
+ user_editable: boolean;
1544
+ };
1545
+ type ExportedEgg = {
1546
+ meta: {
1547
+ version: "PLCN_v3";
1548
+ update_url: Nullable<string>;
1549
+ };
1550
+ exported_at: string;
1551
+ name: number;
1552
+ author: string;
1553
+ description: string;
1554
+ uuid: string;
1555
+ image: Nullable<string>;
1556
+ docker_images: Record<string, string>;
1557
+ features: string[];
1558
+ tags: string[];
1559
+ file_denylist: string[];
1560
+ startup_commands: Record<string, string>;
1561
+ config: Omit<Egg["config"], "extends" | "file_denylist">;
1562
+ scripts: {
1563
+ installation: {
1564
+ script: string;
1565
+ container: string;
1566
+ entrypoint: string;
1567
+ };
1568
+ };
1569
+ variables: ApplicationEggVariable[];
1570
+ };
1540
1571
 
1541
1572
  declare class Eggs {
1542
1573
  private readonly r;
@@ -1544,6 +1575,7 @@ declare class Eggs {
1544
1575
  list: () => Promise<Egg[]>;
1545
1576
  info: (id: number) => Promise<Egg>;
1546
1577
  export: (id: number, format: "json" | "yaml") => Promise<string>;
1578
+ infoExportable: (id: number) => Promise<ExportedEgg>;
1547
1579
  }
1548
1580
 
1549
1581
  type Mount = {
package/dist/index.js CHANGED
@@ -1919,6 +1919,10 @@ var Eggs = class {
1919
1919
  });
1920
1920
  return data;
1921
1921
  };
1922
+ infoExportable = async (id) => {
1923
+ const { data } = await this.r.get(`/eggs/${id}/export`);
1924
+ return data;
1925
+ };
1922
1926
  };
1923
1927
 
1924
1928
  // src/api/application/mounts.ts
package/dist/index.mjs CHANGED
@@ -1882,6 +1882,10 @@ var Eggs = class {
1882
1882
  });
1883
1883
  return data;
1884
1884
  };
1885
+ infoExportable = async (id) => {
1886
+ const { data } = await this.r.get(`/eggs/${id}/export`);
1887
+ return data;
1888
+ };
1885
1889
  };
1886
1890
 
1887
1891
  // src/api/application/mounts.ts
package/dist/types.d.ts CHANGED
@@ -849,7 +849,7 @@ type Egg = {
849
849
  description: string;
850
850
  features: string[];
851
851
  tags: string[];
852
- docker_image: string;
852
+ docker_image: Nullable<string>;
853
853
  docker_images: Record<string, string>;
854
854
  config: {
855
855
  files: Record<string, FileConfig>;
@@ -875,6 +875,38 @@ type FileConfig = {
875
875
  parser: string;
876
876
  find: Record<string, string>;
877
877
  };
878
+ type ApplicationEggVariable = Omit<EggVariable, "server_value" | "is_editable" | "rules"> & {
879
+ rules: string[];
880
+ sort: number;
881
+ user_viewable: boolean;
882
+ user_editable: boolean;
883
+ };
884
+ type ExportedEgg = {
885
+ meta: {
886
+ version: "PLCN_v3";
887
+ update_url: Nullable<string>;
888
+ };
889
+ exported_at: string;
890
+ name: number;
891
+ author: string;
892
+ description: string;
893
+ uuid: string;
894
+ image: Nullable<string>;
895
+ docker_images: Record<string, string>;
896
+ features: string[];
897
+ tags: string[];
898
+ file_denylist: string[];
899
+ startup_commands: Record<string, string>;
900
+ config: Omit<Egg["config"], "extends" | "file_denylist">;
901
+ scripts: {
902
+ installation: {
903
+ script: string;
904
+ container: string;
905
+ entrypoint: string;
906
+ };
907
+ };
908
+ variables: ApplicationEggVariable[];
909
+ };
878
910
 
879
911
  type ApplicationUser = {
880
912
  id: number;
@@ -1132,4 +1164,4 @@ type Permission = {
1132
1164
  keys: Record<string, string>;
1133
1165
  };
1134
1166
 
1135
- export { type APIKey, type Allocation, type AllocationRel, type ApplicationServer, type ApplicationUser, type ApplicationUserApiKey, type AuthSuccessWsEvent, type BackupCompletedEvent, type BackupCompletedJson, type BackupRestoreCompletedEvent, type ConsoleLogWsEvent, type Container, type DaemonErrorEvent, type DaemonMessageEvent, type DatabaseHost, type Egg, type EggVariable, type FeatureLimits, type FileObject, type InstallCompletedEvent, type InstallOutputEvent, type InstallStartedEvent, type JwtErrorEvent, type LanguagesType, type Location, type Mount, type Node, type NodeConfiguration, type Permission, type PowerState, type Role, SERVER_SIGNAL, SOCKET_EVENT, type SSHKey, type Schedule, type ScheduleTask, type Server, type ServerActivityLog, type ServerAllocation, type ServerBackup, type ServerDatabase, type ServerLimits, type ServerSignalOption, type ServerStats, type ServerStatus, type ServerSubuser, type StartupMeta, type StartupParams, type StatsWsEvent, type StatsWsJson, type StatusWsEvent, type SubuserPermission, type TimezonesType, type TokenExpiredWsEvent, type TokenExpiringWsEvent, type TransferLogsEvent, type TransferStatusEvent, type User, type WebsocketEvent, languagesSchema, timezonesSchema };
1167
+ export { type APIKey, type Allocation, type AllocationRel, type ApplicationEggVariable, type ApplicationServer, type ApplicationUser, type ApplicationUserApiKey, type AuthSuccessWsEvent, type BackupCompletedEvent, type BackupCompletedJson, type BackupRestoreCompletedEvent, type ConsoleLogWsEvent, type Container, type DaemonErrorEvent, type DaemonMessageEvent, type DatabaseHost, type Egg, type EggVariable, type ExportedEgg, type FeatureLimits, type FileObject, type InstallCompletedEvent, type InstallOutputEvent, type InstallStartedEvent, type JwtErrorEvent, type LanguagesType, type Location, type Mount, type Node, type NodeConfiguration, type Permission, type PowerState, type Role, SERVER_SIGNAL, SOCKET_EVENT, type SSHKey, type Schedule, type ScheduleTask, type Server, type ServerActivityLog, type ServerAllocation, type ServerBackup, type ServerDatabase, type ServerLimits, type ServerSignalOption, type ServerStats, type ServerStatus, type ServerSubuser, type StartupMeta, type StartupParams, type StatsWsEvent, type StatsWsJson, type StatusWsEvent, type SubuserPermission, type TimezonesType, type TokenExpiredWsEvent, type TokenExpiringWsEvent, type TransferLogsEvent, type TransferStatusEvent, type User, type WebsocketEvent, languagesSchema, timezonesSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pelican.ts/sdk",
3
- "version": "0.3.3-next.6",
3
+ "version": "0.3.4-next.1",
4
4
  "description": "Pelican panel SDK for TypeScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,6 +1,6 @@
1
1
  import {AxiosInstance} from "axios";
2
2
  import {GenericListResponse, GenericResponse} from "@/api/base/types";
3
- import {Egg} from "@/api/application/types/egg";
3
+ import {Egg, ExportedEgg} from "@/api/application/types/egg";
4
4
 
5
5
  // TODO: API is incomplete
6
6
 
@@ -28,4 +28,9 @@ export class Eggs {
28
28
  })
29
29
  return data
30
30
  }
31
+
32
+ infoExportable = async (id: number): Promise<ExportedEgg> => {
33
+ const {data} = await this.r.get<ExportedEgg>(`/eggs/${id}/export`)
34
+ return data
35
+ }
31
36
  }
@@ -1,4 +1,5 @@
1
1
  import {Nullable} from "@/utils/types";
2
+ import {EggVariable} from "@/api/common/types";
2
3
 
3
4
  export type Egg = {
4
5
  id: number,
@@ -8,7 +9,7 @@ export type Egg = {
8
9
  description: string,
9
10
  features: string[],
10
11
  tags: string[],
11
- docker_image: string,
12
+ docker_image: Nullable<string>,
12
13
  docker_images: Record<string, string>,
13
14
  config: {
14
15
  files: Record<string, FileConfig>
@@ -34,4 +35,38 @@ export type Egg = {
34
35
  type FileConfig = {
35
36
  parser: string,
36
37
  find: Record<string, string>
38
+ }
39
+
40
+ export type ApplicationEggVariable = Omit<EggVariable, "server_value" | "is_editable" | "rules"> & {
41
+ rules: string[],
42
+ sort: number,
43
+ user_viewable: boolean,
44
+ user_editable: boolean,
45
+ }
46
+
47
+ export type ExportedEgg = {
48
+ meta: {
49
+ version: "PLCN_v3",
50
+ update_url: Nullable<string>
51
+ },
52
+ exported_at: string,
53
+ name: number,
54
+ author: string,
55
+ description: string,
56
+ uuid: string,
57
+ image: Nullable<string>
58
+ docker_images: Record<string, string>,
59
+ features: string[],
60
+ tags: string[],
61
+ file_denylist: string[],
62
+ startup_commands: Record<string, string>,
63
+ config: Omit<Egg["config"], "extends" | "file_denylist">
64
+ scripts: {
65
+ installation: {
66
+ script: string,
67
+ container: string,
68
+ entrypoint: string
69
+ }
70
+ },
71
+ variables: ApplicationEggVariable[]
37
72
  }
@@ -5,7 +5,6 @@ export type ExactlyOneKey<K extends keyof any, V, KK extends keyof any = K> =
5
5
  { [Q in keyof O]: O[Q] } : never
6
6
  }[K];
7
7
 
8
- export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
9
8
  export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
10
9
 
11
10