ezpm2gui 1.0.0 → 1.2.0

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.
Files changed (58) hide show
  1. package/README.md +202 -14
  2. package/bin/ezpm2gui.js +40 -44
  3. package/bin/ezpm2gui.ts +51 -0
  4. package/bin/generate-ecosystem.js +24 -22
  5. package/bin/generate-ecosystem.ts +56 -0
  6. package/dist/server/config/project-configs.json +236 -0
  7. package/dist/server/index.js +64 -19
  8. package/dist/server/logs/deployment.log +12 -0
  9. package/dist/server/routes/clusterManagement.d.ts +3 -0
  10. package/dist/server/routes/clusterManagement.js +152 -0
  11. package/dist/server/routes/deployApplication.d.ts +3 -0
  12. package/dist/server/routes/deployApplication.js +310 -0
  13. package/dist/server/routes/logStreaming.d.ts +5 -0
  14. package/dist/server/routes/logStreaming.js +276 -0
  15. package/dist/server/routes/modules.d.ts +3 -0
  16. package/dist/server/routes/modules.js +106 -0
  17. package/dist/server/routes/processConfig.d.ts +3 -0
  18. package/dist/server/routes/processConfig.js +118 -0
  19. package/dist/server/routes/remoteConnections.d.ts +3 -0
  20. package/dist/server/routes/remoteConnections.js +634 -0
  21. package/dist/server/services/ProjectSetupService.d.ts +72 -0
  22. package/dist/server/services/ProjectSetupService.js +327 -0
  23. package/dist/server/utils/dialog.d.ts +1 -0
  24. package/dist/server/utils/dialog.js +16 -0
  25. package/dist/server/utils/encryption.d.ts +12 -0
  26. package/dist/server/utils/encryption.js +72 -0
  27. package/dist/server/utils/pm2-connection.d.ts +16 -0
  28. package/dist/server/utils/pm2-connection.js +141 -0
  29. package/dist/server/utils/remote-connection.d.ts +152 -0
  30. package/dist/server/utils/remote-connection.js +590 -0
  31. package/dist/server/utils/upload.d.ts +3 -0
  32. package/dist/server/utils/upload.js +39 -0
  33. package/package.json +65 -49
  34. package/src/client/build/asset-manifest.json +6 -6
  35. package/src/client/build/favicon.ico +2 -0
  36. package/src/client/build/index.html +1 -1
  37. package/src/client/build/logo192.svg +7 -0
  38. package/src/client/build/logo512.svg +7 -0
  39. package/src/client/build/manifest.json +5 -6
  40. package/src/client/build/static/css/main.672b8f26.css +2 -0
  41. package/src/client/build/static/css/main.672b8f26.css.map +1 -0
  42. package/src/client/build/static/js/main.31323a04.js +156 -0
  43. package/src/client/build/static/js/{main.dde30e92.js.LICENSE.txt → main.31323a04.js.LICENSE.txt} +19 -0
  44. package/src/client/build/static/js/main.31323a04.js.map +1 -0
  45. package/ .npmignore +0 -39
  46. package/install.bat +0 -22
  47. package/install.sh +0 -23
  48. package/src/client/build/static/css/main.c1cbda3a.css +0 -2
  49. package/src/client/build/static/css/main.c1cbda3a.css.map +0 -1
  50. package/src/client/build/static/js/main.dde30e92.js +0 -3
  51. package/src/client/build/static/js/main.dde30e92.js.map +0 -1
  52. package/src/client/package-lock.json +0 -16192
  53. package/src/client/package.json +0 -39
  54. package/src/client/public/index.html +0 -20
  55. package/src/client/public/manifest.json +0 -25
  56. package/src/index.ts +0 -24
  57. package/src/server/index.ts +0 -240
  58. package/tsconfig.json +0 -18
@@ -0,0 +1,152 @@
1
+ import { EventEmitter } from 'events';
2
+ /**
3
+ * Interface for remote server connection configuration
4
+ */
5
+ export interface RemoteConnectionConfig {
6
+ host: string;
7
+ port: number;
8
+ username: string;
9
+ password?: string;
10
+ privateKey?: string;
11
+ passphrase?: string;
12
+ name?: string;
13
+ useSudo?: boolean;
14
+ }
15
+ /**
16
+ * Type for remote command execution results
17
+ */
18
+ export interface CommandResult {
19
+ stdout: string;
20
+ stderr: string;
21
+ code: number | null;
22
+ }
23
+ /**
24
+ * Class to manage SSH connections to remote servers
25
+ */
26
+ export declare class RemoteConnection extends EventEmitter {
27
+ private client;
28
+ private config;
29
+ private _isConnected;
30
+ isPM2Installed: boolean;
31
+ name: string;
32
+ host: string;
33
+ port: number;
34
+ username: string;
35
+ get hasPassword(): boolean;
36
+ get hasPrivateKey(): boolean;
37
+ get hasPassphrase(): boolean;
38
+ get secureConfig(): RemoteConnectionConfig;
39
+ getFullConfig(): RemoteConnectionConfig;
40
+ constructor(config: RemoteConnectionConfig);
41
+ /**
42
+ * Check if the connection is active
43
+ */
44
+ isConnected(): boolean;
45
+ /**
46
+ * Connect to the remote server
47
+ */ connect(): Promise<void>;
48
+ /**
49
+ * Disconnect from the remote server
50
+ */
51
+ disconnect(): Promise<void>; /**
52
+ * Execute a command on the remote server
53
+ * @param command The command to execute
54
+ * @param forceSudo Whether to force using sudo for this specific command
55
+ */
56
+ executeCommand(command: string, forceSudo?: boolean): Promise<CommandResult>;
57
+ /**
58
+ * Check if PM2 is installed on the remote server
59
+ */
60
+ checkPM2Installation(): Promise<boolean>;
61
+ /**
62
+ * Get PM2 processes from the remote server
63
+ */
64
+ getPM2Processes(): Promise<any[]>;
65
+ /**
66
+ * Format memory size to human readable format
67
+ */
68
+ private formatMemory;
69
+ /**
70
+ * Format uptime to human readable format
71
+ */ private formatUptime;
72
+ /**
73
+ * Start a PM2 process
74
+ */
75
+ startPM2Process(processName: string): Promise<CommandResult>;
76
+ /**
77
+ * Stop a PM2 process
78
+ */
79
+ stopPM2Process(processName: string): Promise<CommandResult>;
80
+ /**
81
+ * Restart a PM2 process
82
+ */
83
+ restartPM2Process(processName: string): Promise<CommandResult>;
84
+ /**
85
+ * Delete a PM2 process
86
+ */
87
+ deletePM2Process(processName: string): Promise<CommandResult>;
88
+ /**
89
+ * Get system information from the remote server
90
+ */
91
+ getSystemInfo(): Promise<any>;
92
+ /**
93
+ * Get logs for a PM2 process
94
+ */
95
+ getPM2Logs(processName: string, lines?: number): Promise<CommandResult>; /**
96
+ * Create a streaming log connection for a command
97
+ */
98
+ createLogStream(command: string, useSudo?: boolean): Promise<EventEmitter>;
99
+ }
100
+ /**
101
+ * Interface for saved connection configuration
102
+ */
103
+ export interface SavedConnectionConfig extends RemoteConnectionConfig {
104
+ id: string;
105
+ }
106
+ /**
107
+ * Connection manager to handle multiple remote connections
108
+ */
109
+ export declare class RemoteConnectionManager {
110
+ private connections;
111
+ private configFilePath;
112
+ constructor();
113
+ /**
114
+ * Create a new remote connection
115
+ * @param config Connection configuration
116
+ * @returns The connection ID
117
+ */
118
+ createConnection(config: RemoteConnectionConfig): string;
119
+ /**
120
+ * Get a connection by ID
121
+ * @param connectionId The connection ID
122
+ */
123
+ getConnection(connectionId: string): RemoteConnection | undefined;
124
+ /**
125
+ * Close a connection by ID (disconnect but keep the configuration)
126
+ * @param connectionId The connection ID
127
+ */
128
+ closeConnection(connectionId: string): Promise<boolean>;
129
+ /**
130
+ * Close all connections
131
+ */ closeAllConnections(): Promise<void>;
132
+ /**
133
+ * Get all connections
134
+ * @returns Map of all connections
135
+ */
136
+ getAllConnections(): Map<string, RemoteConnection>;
137
+ /**
138
+ * Delete a connection by ID
139
+ * @param connectionId The connection ID
140
+ * @returns True if the connection was deleted, false if it didn't exist
141
+ */
142
+ deleteConnection(connectionId: string): boolean;
143
+ /**
144
+ * Load connection configurations from disk
145
+ */
146
+ private loadConnectionsFromDisk;
147
+ /**
148
+ * Save connection configurations to disk
149
+ */
150
+ private saveConnectionsToDisk;
151
+ }
152
+ export declare const remoteConnectionManager: RemoteConnectionManager;