vpsgui 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.
package/dist/config.js ADDED
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CONFIG_VERSION = void 0;
37
+ exports.configDir = configDir;
38
+ exports.configPath = configPath;
39
+ exports.readConfig = readConfig;
40
+ exports.writeConfig = writeConfig;
41
+ exports.resolveProfileName = resolveProfileName;
42
+ exports.loadCredentials = loadCredentials;
43
+ exports.normaliseUrl = normaliseUrl;
44
+ const fs_1 = require("fs");
45
+ const os = __importStar(require("os"));
46
+ const path = __importStar(require("path"));
47
+ /**
48
+ * On-disk credentials for the CLI.
49
+ *
50
+ * The format is shared verbatim with the Python SDK, because `npm i -g vpsgui`
51
+ * and `pip install vpsgui` both put a `vpsgui` executable on PATH and only one
52
+ * of them can win. Sharing the file means it does not matter which one does:
53
+ * whichever binary runs, `vpsgui login` and every other command see the same
54
+ * profiles. Any change here has to land in sdk/python/vpsgui/config.py too.
55
+ */
56
+ exports.CONFIG_VERSION = 1;
57
+ function configDir() {
58
+ // VPSGUI_CONFIG_DIR exists so CI and tests never touch a real operator's
59
+ // credentials.
60
+ return process.env.VPSGUI_CONFIG_DIR || path.join(os.homedir(), '.vpsgui');
61
+ }
62
+ function configPath() {
63
+ return path.join(configDir(), 'config.json');
64
+ }
65
+ function empty() {
66
+ return { version: exports.CONFIG_VERSION, current: 'default', profiles: {} };
67
+ }
68
+ async function readConfig() {
69
+ let raw;
70
+ try {
71
+ raw = await fs_1.promises.readFile(configPath(), 'utf8');
72
+ }
73
+ catch (e) {
74
+ // A missing file is the normal state before the first login.
75
+ if (e.code === 'ENOENT')
76
+ return empty();
77
+ throw e;
78
+ }
79
+ let parsed;
80
+ try {
81
+ parsed = JSON.parse(raw);
82
+ }
83
+ catch {
84
+ throw new Error(`${configPath()} is not valid JSON. Fix or delete it, then run: vpsgui login`);
85
+ }
86
+ const cfg = parsed;
87
+ return {
88
+ version: typeof cfg.version === 'number' ? cfg.version : exports.CONFIG_VERSION,
89
+ current: typeof cfg.current === 'string' ? cfg.current : 'default',
90
+ profiles: cfg.profiles && typeof cfg.profiles === 'object' ? cfg.profiles : {},
91
+ };
92
+ }
93
+ /**
94
+ * Write the config with owner-only permissions.
95
+ *
96
+ * The mode is set on the temp file before any token reaches the disk; creating
97
+ * it 0644 and chmod-ing afterwards would leave a window where any local user
98
+ * could read the token.
99
+ */
100
+ async function writeConfig(config) {
101
+ const dir = configDir();
102
+ await fs_1.promises.mkdir(dir, { recursive: true, mode: 0o700 });
103
+ const tmp = path.join(dir, `.config.json.${process.pid}.tmp`);
104
+ await fs_1.promises.writeFile(tmp, JSON.stringify(config, null, 2) + '\n', { mode: 0o600 });
105
+ await fs_1.promises.rename(tmp, configPath());
106
+ // rename preserves the temp file's mode, but an existing config.json created
107
+ // by an older version may still be 0644.
108
+ try {
109
+ await fs_1.promises.chmod(configPath(), 0o600);
110
+ }
111
+ catch {
112
+ // Windows and some network filesystems do not implement POSIX modes.
113
+ }
114
+ }
115
+ /**
116
+ * The profile to use, honouring `--profile`, then VPSGUI_PROFILE, then the
117
+ * `current` recorded at the last login.
118
+ */
119
+ function resolveProfileName(config, explicit) {
120
+ return explicit || process.env.VPSGUI_PROFILE || config.current || 'default';
121
+ }
122
+ /**
123
+ * Credentials for a command, or null when there is no usable source.
124
+ *
125
+ * The environment wins over the config file so CI can run without a login step,
126
+ * and so an operator can override a saved profile for one command.
127
+ */
128
+ async function loadCredentials(explicitProfile) {
129
+ const envUrl = process.env.VPSGUI_API_URL;
130
+ const envToken = process.env.VPSGUI_AGENT_TOKEN;
131
+ if (envUrl && envToken) {
132
+ return { url: envUrl, token: envToken, source: 'environment' };
133
+ }
134
+ const config = await readConfig();
135
+ const name = resolveProfileName(config, explicitProfile);
136
+ const profile = config.profiles[name];
137
+ if (!profile || !profile.url || !profile.token)
138
+ return null;
139
+ return { url: profile.url, token: profile.token, source: `profile "${name}"` };
140
+ }
141
+ /**
142
+ * Turn what an operator types into an API root.
143
+ *
144
+ * People paste the address bar - "vps.example.com", "http://1.2.3.4:46509",
145
+ * "https://host/api/v1/" - and every one of those should work rather than
146
+ * producing a 404 they have to debug.
147
+ */
148
+ function normaliseUrl(input) {
149
+ let url = input.trim();
150
+ if (!url)
151
+ throw new Error('Enter the agent URL.');
152
+ if (!/^https?:\/\//i.test(url)) {
153
+ // Bare IPs and localhost are almost always a plain-HTTP agent on the LAN;
154
+ // a hostname typed without a scheme is almost always a public HTTPS one.
155
+ const host = url.split('/')[0].split(':')[0];
156
+ const isLocal = host === 'localhost' || host === '127.0.0.1' || /^\d+\.\d+\.\d+\.\d+$/.test(host);
157
+ url = (isLocal ? 'http://' : 'https://') + url;
158
+ }
159
+ url = url.replace(/\/+$/, '');
160
+ if (!/\/api\/v1$/.test(url))
161
+ url += '/api/v1';
162
+ return url;
163
+ }
164
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,8BAIC;AAED,gCAEC;AAMD,gCAuBC;AASD,kCAeC;AAMD,gDAEC;AAQD,0CAeC;AASD,oCAgBC;AAtJD,2BAAoC;AACpC,uCAAyB;AACzB,2CAA6B;AAE7B;;;;;;;;GAQG;AAEU,QAAA,cAAc,GAAG,CAAC,CAAC;AAmBhC,SAAgB,SAAS;IACvB,yEAAyE;IACzE,eAAe;IACf,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AAC7E,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,EAAE,OAAO,EAAE,sBAAc,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACvE,CAAC;AAEM,KAAK,UAAU,UAAU;IAC9B,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,6DAA6D;QAC7D,IAAK,CAA2B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,EAAE,CAAC;QACnE,MAA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;IACvB,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAElD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,0EAA0E;QAC1E,yEAAyE;QACzE,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,OAAO,GACX,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,WAAW,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpF,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC;IACjD,CAAC;IAED,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,GAAG,IAAI,SAAS,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { VpsguiClient, VpsguiError } from './client';
2
+ export type { VpsguiClientConfig, AgentInfo, CommandResult, MutationResult, TelemetryPoint, ProcessItem, NodeSpec, TopologyLayer, HealthCheck, ContainerItem, DockerImageItem, FileItem, FileReadResult, FirewallRule, FirewallRuleInput, SecretItem, AuditLogEvent, SystemUser, NetworkInterfaceInfo, IpInfoResult, StoragePartition, BackupItem, Deployment, DatabaseInstance, ProxyRule, CatalogItem, AutomationWorkflow, QueueJob, PackagesResult, } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EACV,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,QAAQ,EACR,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,cAAc,GACf,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VpsguiError = exports.VpsguiClient = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "VpsguiClient", { enumerable: true, get: function () { return client_1.VpsguiClient; } });
6
+ Object.defineProperty(exports, "VpsguiError", { enumerable: true, get: function () { return client_1.VpsguiError; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqD;AAA5C,sGAAA,YAAY,OAAA;AAAE,qGAAA,WAAW,OAAA"}
@@ -0,0 +1,391 @@
1
+ /**
2
+ * Types for the VPSGUI agent REST API.
3
+ *
4
+ * These mirror what the agent actually returns. Fields the agent cannot determine are `null` rather
5
+ * than absent or invented - for example `smartHealth` (needs smartctl), per-process `cpuPercent` on
6
+ * Windows, and `city`/`region` from ipinfo's country-level /lite tier.
7
+ */
8
+ export interface VpsguiClientConfig {
9
+ /** e.g. `https://vps.example.com/api/v1` */
10
+ baseUrl: string;
11
+ /** Agent token. Required for every endpoint except `health()`. */
12
+ token?: string;
13
+ /** Default per-request timeout in ms (default 15000). */
14
+ timeout?: number;
15
+ }
16
+ export interface AgentInfo {
17
+ version: string;
18
+ shellEnabled: boolean;
19
+ fileRoots: string[];
20
+ platform: string;
21
+ unimplementedFeatures: string[];
22
+ /** Whether an ipinfo.io token is configured. Never the token itself. */
23
+ ipinfoConfigured?: boolean;
24
+ }
25
+ /** Result of a command the agent ran. `success` is false when the command exited non-zero. */
26
+ export interface CommandResult {
27
+ success: boolean;
28
+ output: string;
29
+ action?: string;
30
+ }
31
+ export interface MutationResult {
32
+ success: boolean;
33
+ path?: string;
34
+ error?: string;
35
+ }
36
+ export interface TelemetryPoint {
37
+ timestamp: string;
38
+ cpuPercent: number;
39
+ ramPercent: number;
40
+ swapPercent: number;
41
+ diskPercent: number;
42
+ netRxKbps: number;
43
+ netTxKbps: number;
44
+ iowaitPercent: number;
45
+ /** null when the host exposes no thermal zone. */
46
+ tempC: number | null;
47
+ powerWatts: number | null;
48
+ cpuCores: number;
49
+ cpuModel: string;
50
+ memoryTotalBytes: number;
51
+ memoryUsedBytes: number;
52
+ memoryFreeBytes: number;
53
+ swapTotalBytes: number;
54
+ diskTotalBytes: number;
55
+ diskUsedBytes: number;
56
+ loadAverage: number[];
57
+ uptimeSeconds: number;
58
+ osName: string;
59
+ osPlatform: string;
60
+ osArch: string;
61
+ hostname: string;
62
+ }
63
+ export interface ProcessItem {
64
+ pid: number;
65
+ user: string;
66
+ /** null on Windows - tasklist reports no per-process CPU. */
67
+ cpuPercent: number | null;
68
+ memoryPercent: number;
69
+ memoryMb: number;
70
+ command: string;
71
+ threads: number | null;
72
+ state: string;
73
+ }
74
+ export interface NodeSpec {
75
+ id: string;
76
+ name: string;
77
+ status: string;
78
+ agentStatus: string;
79
+ agentVersion: string;
80
+ location: {
81
+ city: string | null;
82
+ country: string | null;
83
+ countryCode: string | null;
84
+ flagIcon: string;
85
+ provider: string | null;
86
+ };
87
+ hardware: {
88
+ cpuCores: number;
89
+ cpuModel: string;
90
+ ramGb: number;
91
+ swapGb: number;
92
+ diskGb: number;
93
+ diskType: string | null;
94
+ architecture: string;
95
+ };
96
+ os: {
97
+ name: string;
98
+ family: string;
99
+ version: string;
100
+ kernel: string;
101
+ uptimeSeconds: number;
102
+ };
103
+ network: {
104
+ ipAddress: string;
105
+ /** null - the agent cannot know its own NAT address; resolve it client-side. */
106
+ publicIp: string | null;
107
+ hostname: string;
108
+ sshPort: number;
109
+ };
110
+ tags: string[];
111
+ isFavorite: boolean;
112
+ createdAt: string;
113
+ updatedAt: string;
114
+ }
115
+ export interface TopologyLayer {
116
+ level: string;
117
+ items: Array<{
118
+ id: string;
119
+ title: string;
120
+ type: string;
121
+ status: string;
122
+ desc: string;
123
+ }>;
124
+ }
125
+ export interface HealthCheck {
126
+ id: string;
127
+ category: string;
128
+ name: string;
129
+ target: string;
130
+ status: 'green' | 'yellow' | 'red';
131
+ latencyMs: number;
132
+ message: string;
133
+ lastCheck: string;
134
+ }
135
+ export interface ContainerItem {
136
+ id: string;
137
+ name: string;
138
+ image: string;
139
+ state: string;
140
+ status: string;
141
+ ports: Array<{
142
+ publicPort: number;
143
+ privatePort: number;
144
+ type: string;
145
+ }>;
146
+ cpuPercent: number;
147
+ memoryUsageMb: number;
148
+ created: string | null;
149
+ }
150
+ export interface DockerImageItem {
151
+ id: string;
152
+ repository: string;
153
+ tag: string;
154
+ size: string;
155
+ sizeMb: number;
156
+ digest: string | null;
157
+ created: string | null;
158
+ }
159
+ export interface FileItem {
160
+ name: string;
161
+ path: string;
162
+ type: 'file' | 'directory' | 'symlink';
163
+ isDirectory: boolean;
164
+ size: number;
165
+ sizeBytes: number;
166
+ permissions: string;
167
+ owner: string;
168
+ group: string;
169
+ extension?: string;
170
+ modifiedAt: string | null;
171
+ /** False when the agent's credential deny list blocks this path. */
172
+ readable: boolean;
173
+ }
174
+ export interface FileReadResult {
175
+ path: string;
176
+ content: string;
177
+ /** True when the file exceeded the read cap; saving it back would truncate the original. */
178
+ truncated: boolean;
179
+ sizeBytes: number;
180
+ editable: boolean;
181
+ }
182
+ export interface FirewallRule {
183
+ id: string;
184
+ nodeId: string;
185
+ action: 'allow' | 'deny' | 'reject' | 'limit';
186
+ direction: 'inbound' | 'outbound';
187
+ protocol: string;
188
+ port: string;
189
+ sourceIp: string;
190
+ comment: string;
191
+ status: 'active' | 'disabled';
192
+ }
193
+ export interface FirewallRuleInput {
194
+ action: 'allow' | 'deny' | 'reject' | 'limit' | 'delete';
195
+ /** A single port, an inclusive range (`6000:6010`), or a comma list (`80,443`). */
196
+ port?: string;
197
+ protocol?: 'tcp' | 'udp' | 'any';
198
+ source?: string;
199
+ /** Required for `delete` - ufw removes rules by their number in `ufw status numbered`. */
200
+ ruleNumber?: number;
201
+ }
202
+ export interface SecretItem {
203
+ id: string;
204
+ name: string;
205
+ type: string;
206
+ environment: string;
207
+ /** Always a fixed mask; the list endpoint never returns values. */
208
+ maskedValue: string;
209
+ updatedBy: string;
210
+ updatedAt?: string;
211
+ }
212
+ export interface AuditLogEvent {
213
+ id: string;
214
+ timestamp: string;
215
+ actor: {
216
+ name: string;
217
+ email: string;
218
+ avatarUrl: string;
219
+ };
220
+ action: string;
221
+ category: string;
222
+ target: string;
223
+ ipAddress: string;
224
+ status: 'success' | 'warning' | 'failure';
225
+ details?: string;
226
+ }
227
+ export interface SystemUser {
228
+ id: string;
229
+ username: string;
230
+ uid: number;
231
+ gid: number;
232
+ fullName: string;
233
+ home: string;
234
+ shell: string;
235
+ /** UID below 1000 and not root - a service account rather than a person. */
236
+ isSystem: boolean;
237
+ canLogin: boolean;
238
+ groups: string[];
239
+ lastLogin: string | null;
240
+ }
241
+ export interface NetworkInterfaceInfo {
242
+ name: string;
243
+ mac: string;
244
+ ipv4: string;
245
+ ipv6: string;
246
+ type: 'ethernet' | 'wireless' | 'virtual' | 'loopback';
247
+ rxBytes: number;
248
+ txBytes: number;
249
+ rxSpeedMbps: number;
250
+ txSpeedMbps: number;
251
+ status: 'up' | 'down';
252
+ }
253
+ export interface IpInfoResult {
254
+ ip: string | null;
255
+ /** null only when the provider genuinely reported nothing (e.g. a bogon address). */
256
+ city: string | null;
257
+ region: string | null;
258
+ /** Display name, resolved from the two-letter code ipinfo returns. */
259
+ country: string | null;
260
+ countryCode: string | null;
261
+ continent?: string | null;
262
+ /** Operator name, split out of ipinfo's combined "AS15169 Google LLC" field. */
263
+ org: string | null;
264
+ asn: string | null;
265
+ latitude?: number | null;
266
+ longitude?: number | null;
267
+ timezone?: string | null;
268
+ postal?: string | null;
269
+ /** Reverse DNS, when the provider reports it. */
270
+ hostname?: string | null;
271
+ /** Which provider answered, or null when none did. */
272
+ source: string | null;
273
+ }
274
+ export interface StoragePartition {
275
+ device: string;
276
+ mountPoint: string;
277
+ fsType: string;
278
+ totalGb: number;
279
+ usedGb: number;
280
+ freeGb: number;
281
+ totalBytes: number;
282
+ usedBytes: number;
283
+ freeBytes: number;
284
+ usagePercent: number;
285
+ /** null - SMART needs smartctl and raw device access, which the agent does not use. */
286
+ smartHealth: 'passed' | 'warning' | 'failing' | null;
287
+ }
288
+ export interface BackupItem {
289
+ id: string;
290
+ name: string;
291
+ path: string;
292
+ sizeBytes: number;
293
+ size: string;
294
+ target: string;
295
+ date: string;
296
+ status: string;
297
+ }
298
+ export interface Deployment {
299
+ id: string;
300
+ path: string;
301
+ app: string;
302
+ branch: string;
303
+ commit: string;
304
+ message: string;
305
+ committedAt: string | null;
306
+ remote: string;
307
+ dirtyCount: number;
308
+ ahead: number;
309
+ behind: number;
310
+ status: 'clean' | 'modified' | 'behind';
311
+ }
312
+ export interface DatabaseInstance {
313
+ name: string;
314
+ engine: string;
315
+ port: number;
316
+ /** null - reporting these would require credentials the agent does not hold. */
317
+ size: string | null;
318
+ tables: number | null;
319
+ keys: number | null;
320
+ status: string;
321
+ }
322
+ export interface ProxyRule {
323
+ id: string;
324
+ domain: string;
325
+ upstream: string;
326
+ ssl: string;
327
+ /** Certificate notAfter as ISO-8601, or '' when the vhost has no certificate. */
328
+ expires: string;
329
+ status: string;
330
+ }
331
+ export interface CatalogItem {
332
+ id: string;
333
+ name: string;
334
+ category: string;
335
+ version: string;
336
+ description: string;
337
+ iconName: string;
338
+ publisher: string;
339
+ official: boolean;
340
+ /** null - the agent queries no registry, so popularity metrics are not available. */
341
+ downloadsCount: number | null;
342
+ rating: number | null;
343
+ tags: string[];
344
+ image?: string;
345
+ /** Ready-to-run command for catalog entries that are not a single container. */
346
+ installCommand?: string;
347
+ defaultPorts?: number[];
348
+ defaultEnv?: Record<string, string>;
349
+ }
350
+ export interface AutomationWorkflow {
351
+ id: string;
352
+ name: string;
353
+ description: string;
354
+ status: string;
355
+ triggerType: string;
356
+ schedule?: string;
357
+ stepsCount: number;
358
+ /** The full cron command, suitable for running on demand. */
359
+ command?: string;
360
+ source?: string;
361
+ steps: unknown[];
362
+ }
363
+ export interface QueueJob {
364
+ id: string;
365
+ title: string;
366
+ nodeName: string;
367
+ type: string;
368
+ status: string;
369
+ progressPercent: number;
370
+ startedAt: string;
371
+ logs?: string[];
372
+ }
373
+ export interface PackagesResult {
374
+ packages: Array<{
375
+ name: string;
376
+ category: string;
377
+ installed: boolean;
378
+ /** null when the binary is present but reported no parseable version. */
379
+ version: string | null;
380
+ description: string;
381
+ }>;
382
+ languages: Array<{
383
+ name: string;
384
+ category: string;
385
+ installed: boolean;
386
+ version: string | null;
387
+ binary: string;
388
+ description: string;
389
+ }>;
390
+ }
391
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;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AAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,yEAAyE;QACzE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,SAAS,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ"}
package/dist/types.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Types for the VPSGUI agent REST API.
4
+ *
5
+ * These mirror what the agent actually returns. Fields the agent cannot determine are `null` rather
6
+ * than absent or invented - for example `smartHealth` (needs smartctl), per-process `cpuPercent` on
7
+ * Windows, and `city`/`region` from ipinfo's country-level /lite tier.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "vpsgui",
3
+ "version": "1.2.0",
4
+ "description": "Official CLI and Node.js/TypeScript SDK for the VPSGUI agent - sign in to a host, read telemetry, run commands, and drive Docker, files, firewall, secrets and backups.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "publishConfig": {},
19
+ "scripts": {
20
+ "build": "tsc && node -e \"require('fs').chmodSync('dist/cli.js', 0o755)\"",
21
+ "prepublishOnly": "npm run build",
22
+ "publish:npm": "npm publish --registry=https://registry.npmjs.org --access public",
23
+ "publish:github": "npm publish"
24
+ },
25
+ "keywords": [
26
+ "vpsgui",
27
+ "vps",
28
+ "server",
29
+ "infrastructure",
30
+ "docker",
31
+ "linux",
32
+ "monitoring",
33
+ "telemetry",
34
+ "devops",
35
+ "sdk",
36
+ "api-client",
37
+ "cli",
38
+ "command-line",
39
+ "terminal",
40
+ "ssh"
41
+ ],
42
+ "author": "NotGamerPratham <https://notgamerpratham.com>",
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/NotGamerPratham/vpsgui.git",
47
+ "directory": "sdk/node"
48
+ },
49
+ "homepage": "https://github.com/NotGamerPratham/vpsgui",
50
+ "bugs": {
51
+ "url": "https://github.com/NotGamerPratham/vpsgui/issues"
52
+ },
53
+ "engines": {
54
+ "node": ">=18.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^20.19.0",
58
+ "typescript": "^5.5.0"
59
+ },
60
+ "bin": {
61
+ "vpsgui": "./dist/cli.js"
62
+ }
63
+ }