@caleb-collar/steamcmd 1.0.0-alpha.1 → 1.1.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.
@@ -0,0 +1,128 @@
1
+ /**
2
+ * @module steamcmd/install
3
+ * @description Spawns SteamCMD processes to install applications and workshop items
4
+ * @private
5
+ */
6
+ import { EventEmitter } from 'node:events';
7
+ /**
8
+ * Progress information for install operations
9
+ */
10
+ export interface InstallProgress {
11
+ /** Current phase of the operation */
12
+ phase: string;
13
+ /** Percentage complete (0-100) */
14
+ percent: number;
15
+ /** Number of bytes downloaded so far */
16
+ bytesDownloaded: number;
17
+ /** Total bytes to download (0 if unknown) */
18
+ totalBytes: number;
19
+ }
20
+ /**
21
+ * Valid platform values for SteamCMD
22
+ */
23
+ export type SteamPlatform = 'windows' | 'macos' | 'linux';
24
+ /**
25
+ * Options for install operations
26
+ */
27
+ export interface InstallOptions {
28
+ /** Steam application ID to install */
29
+ applicationId?: number | string;
30
+ /** Workshop item ID to install (requires applicationId) */
31
+ workshopId?: number | string;
32
+ /** Installation directory path */
33
+ path?: string;
34
+ /** Steam username for authentication */
35
+ username?: string;
36
+ /** Steam password for authentication */
37
+ password?: string;
38
+ /** Steam Guard code for two-factor authentication */
39
+ steamGuardCode?: string;
40
+ /** Target platform for download */
41
+ platform?: SteamPlatform;
42
+ /** Progress callback */
43
+ onProgress?: (progress: InstallProgress) => void;
44
+ /** Output callback */
45
+ onOutput?: (data: string, type: 'stdout' | 'stderr') => void;
46
+ }
47
+ /**
48
+ * Callback function type for install operations
49
+ */
50
+ export type InstallCallback = (error: Error | null) => void;
51
+ /**
52
+ * Custom error class for installation failures
53
+ */
54
+ export declare class InstallError extends Error {
55
+ name: "InstallError";
56
+ code: string;
57
+ exitCode?: number;
58
+ stdout?: string;
59
+ stderr?: string;
60
+ constructor(message: string, code: string, exitCode?: number);
61
+ }
62
+ /**
63
+ * EventEmitter for install operations with progress events
64
+ */
65
+ export interface InstallEmitter extends EventEmitter {
66
+ on(event: 'progress', listener: (progress: InstallProgress) => void): this;
67
+ on(event: 'output', listener: (data: string, type: 'stdout' | 'stderr') => void): this;
68
+ on(event: 'complete', listener: () => void): this;
69
+ on(event: 'error', listener: (error: InstallError) => void): this;
70
+ once(event: 'progress', listener: (progress: InstallProgress) => void): this;
71
+ once(event: 'output', listener: (data: string, type: 'stdout' | 'stderr') => void): this;
72
+ once(event: 'complete', listener: () => void): this;
73
+ once(event: 'error', listener: (error: InstallError) => void): this;
74
+ emit(event: 'progress', progress: InstallProgress): boolean;
75
+ emit(event: 'output', data: string, type: 'stdout' | 'stderr'): boolean;
76
+ emit(event: 'complete'): boolean;
77
+ emit(event: 'error', error: InstallError): boolean;
78
+ }
79
+ /**
80
+ * Validate installation options
81
+ * @param options Installation options
82
+ * @throws {InstallError} If options are invalid
83
+ */
84
+ export declare function validateOptions(options: unknown): void;
85
+ /**
86
+ * Build SteamCMD command line arguments
87
+ * @param options Installation options
88
+ * @returns Array of command line arguments
89
+ */
90
+ export declare function createArguments(options: InstallOptions): string[];
91
+ /**
92
+ * Parse SteamCMD output for progress information
93
+ * @param data Raw output from SteamCMD
94
+ * @returns Parsed progress info or null if not progress data
95
+ */
96
+ export declare function parseProgress(data: string | Buffer): InstallProgress | null;
97
+ /**
98
+ * Run SteamCMD with the given options
99
+ * @param steamCmdPath Path to SteamCMD executable
100
+ * @param options Installation options
101
+ * @param callback Optional callback. If omitted, returns a Promise.
102
+ * @returns Promise if no callback provided
103
+ *
104
+ * @example
105
+ * // With progress callback
106
+ * await install(execPath, {
107
+ * applicationId: 740,
108
+ * onProgress: (p) => console.log(`${p.phase}: ${p.percent}%`),
109
+ * onOutput: (data, type) => console.log(`[${type}] ${data}`)
110
+ * });
111
+ */
112
+ export declare function install(steamCmdPath: string, options: InstallOptions, callback?: InstallCallback): Promise<void> | void;
113
+ /**
114
+ * Run SteamCMD with EventEmitter-based progress
115
+ * @param steamCmdPath Path to SteamCMD executable
116
+ * @param options Installation options
117
+ * @returns Emitter that fires 'progress', 'output', 'error', and 'complete' events
118
+ *
119
+ * @example
120
+ * const emitter = installWithProgress(execPath, { applicationId: 740 });
121
+ * emitter.on('progress', (p) => console.log(`${p.percent}%`));
122
+ * emitter.on('output', (data, type) => console.log(`[${type}] ${data}`));
123
+ * emitter.on('complete', () => console.log('Done!'));
124
+ * emitter.on('error', (err) => console.error(err));
125
+ */
126
+ export declare function installWithProgress(steamCmdPath: string, options: InstallOptions): InstallEmitter;
127
+ export default install;
128
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,eAAe,EAAE,MAAM,CAAA;IACvB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAEzD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC/B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,wBAAwB;IAC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@ -0,0 +1,297 @@
1
+ "use strict";
2
+ /**
3
+ * @module steamcmd/install
4
+ * @description Spawns SteamCMD processes to install applications and workshop items
5
+ * @private
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.InstallError = void 0;
12
+ exports.validateOptions = validateOptions;
13
+ exports.createArguments = createArguments;
14
+ exports.parseProgress = parseProgress;
15
+ exports.install = install;
16
+ exports.installWithProgress = installWithProgress;
17
+ const node_child_process_1 = __importDefault(require("node:child_process"));
18
+ const node_events_1 = require("node:events");
19
+ /**
20
+ * Custom error class for installation failures
21
+ */
22
+ class InstallError extends Error {
23
+ name = 'InstallError';
24
+ code;
25
+ exitCode;
26
+ stdout;
27
+ stderr;
28
+ constructor(message, code, exitCode) {
29
+ super(message);
30
+ this.code = code;
31
+ this.exitCode = exitCode;
32
+ }
33
+ }
34
+ exports.InstallError = InstallError;
35
+ const VALID_PLATFORMS = ['windows', 'macos', 'linux'];
36
+ /**
37
+ * Validate installation options
38
+ * @param options Installation options
39
+ * @throws {InstallError} If options are invalid
40
+ */
41
+ function validateOptions(options) {
42
+ if (!options || typeof options !== 'object') {
43
+ throw new InstallError('Options must be an object', 'INVALID_OPTIONS');
44
+ }
45
+ const opts = options;
46
+ if (opts['applicationId'] !== undefined) {
47
+ const appId = Number(opts['applicationId']);
48
+ if (Number.isNaN(appId) || appId <= 0 || !Number.isInteger(appId)) {
49
+ throw new InstallError('applicationId must be a positive integer', 'INVALID_APP_ID');
50
+ }
51
+ }
52
+ if (opts['workshopId'] !== undefined) {
53
+ if (!opts['applicationId']) {
54
+ throw new InstallError('workshopId requires applicationId to be specified', 'MISSING_APP_ID');
55
+ }
56
+ const workshopId = Number(opts['workshopId']);
57
+ if (Number.isNaN(workshopId) ||
58
+ workshopId <= 0 ||
59
+ !Number.isInteger(workshopId)) {
60
+ throw new InstallError('workshopId must be a positive integer', 'INVALID_WORKSHOP_ID');
61
+ }
62
+ }
63
+ if (opts['platform'] !== undefined) {
64
+ if (!VALID_PLATFORMS.includes(opts['platform'])) {
65
+ throw new InstallError(`platform must be one of: ${VALID_PLATFORMS.join(', ')}`, 'INVALID_PLATFORM');
66
+ }
67
+ }
68
+ if (opts['password'] && !opts['username']) {
69
+ throw new InstallError('password requires username to be specified', 'MISSING_USERNAME');
70
+ }
71
+ if (opts['steamGuardCode'] && !opts['username']) {
72
+ throw new InstallError('steamGuardCode requires username to be specified', 'MISSING_USERNAME');
73
+ }
74
+ }
75
+ /**
76
+ * Build SteamCMD command line arguments
77
+ * @param options Installation options
78
+ * @returns Array of command line arguments
79
+ */
80
+ function createArguments(options) {
81
+ const args = [];
82
+ // Force platform type for download
83
+ if (options.platform) {
84
+ args.push(`+@sSteamCmdForcePlatformType ${options.platform}`);
85
+ }
86
+ // Use supplied password
87
+ args.push('+@NoPromptForPassword 1');
88
+ // Quit on fail
89
+ args.push('+@ShutdownOnFailedCommand 1');
90
+ if (options.steamGuardCode) {
91
+ args.push(`+set_steam_guard_code ${options.steamGuardCode}`);
92
+ }
93
+ // Authentication
94
+ if (options.username && options.password) {
95
+ args.push(`+login ${options.username} ${options.password}`);
96
+ }
97
+ else if (options.username) {
98
+ args.push(`+login ${options.username}`);
99
+ }
100
+ else {
101
+ args.push('+login anonymous');
102
+ }
103
+ // Installation directory
104
+ if (options.path) {
105
+ args.push(`+force_install_dir "${options.path}"`);
106
+ }
107
+ // App id to install and/or validate
108
+ if (options.applicationId && !options.workshopId) {
109
+ args.push(`+app_update ${options.applicationId} validate`);
110
+ }
111
+ // Workshop id to install and/or validate
112
+ if (options.applicationId && options.workshopId) {
113
+ args.push('+workshop_download_item ' +
114
+ options.applicationId +
115
+ ' ' +
116
+ options.workshopId);
117
+ }
118
+ // Quit when done
119
+ args.push('+quit');
120
+ return args;
121
+ }
122
+ /**
123
+ * Parse SteamCMD output for progress information
124
+ * @param data Raw output from SteamCMD
125
+ * @returns Parsed progress info or null if not progress data
126
+ */
127
+ function parseProgress(data) {
128
+ const str = data.toString();
129
+ // Match update/download progress: "Update state (0x61) downloading, progress: 45.23 (1234567890 / 2732853760)"
130
+ const updateMatch = str.match(/Update state \(0x[\da-f]+\) (\w+), progress: ([\d.]+) \((\d+) \/ (\d+)\)/i);
131
+ if (updateMatch) {
132
+ return {
133
+ phase: updateMatch[1].toLowerCase(),
134
+ percent: Math.round(parseFloat(updateMatch[2])),
135
+ bytesDownloaded: parseInt(updateMatch[3], 10),
136
+ totalBytes: parseInt(updateMatch[4], 10),
137
+ };
138
+ }
139
+ // Match validation progress: "Validating: 45%"
140
+ const validateMatch = str.match(/Validating[^\d]*(\d+)%/i);
141
+ if (validateMatch) {
142
+ return {
143
+ phase: 'validating',
144
+ percent: parseInt(validateMatch[1], 10),
145
+ bytesDownloaded: 0,
146
+ totalBytes: 0,
147
+ };
148
+ }
149
+ // Match download progress: "[#### ] 45%"
150
+ const percentMatch = str.match(/\[(#+\s*)\]\s*(\d+)%/i);
151
+ if (percentMatch) {
152
+ return {
153
+ phase: 'downloading',
154
+ percent: parseInt(percentMatch[2], 10),
155
+ bytesDownloaded: 0,
156
+ totalBytes: 0,
157
+ };
158
+ }
159
+ return null;
160
+ }
161
+ /**
162
+ * Run SteamCMD with the given options
163
+ * @param steamCmdPath Path to SteamCMD executable
164
+ * @param options Installation options
165
+ * @param callback Optional callback. If omitted, returns a Promise.
166
+ * @returns Promise if no callback provided
167
+ *
168
+ * @example
169
+ * // With progress callback
170
+ * await install(execPath, {
171
+ * applicationId: 740,
172
+ * onProgress: (p) => console.log(`${p.phase}: ${p.percent}%`),
173
+ * onOutput: (data, type) => console.log(`[${type}] ${data}`)
174
+ * });
175
+ */
176
+ function install(steamCmdPath, options, callback) {
177
+ // Support Promise-based usage
178
+ if (typeof callback !== 'function') {
179
+ return new Promise((resolve, reject) => {
180
+ install(steamCmdPath, options, (err) => {
181
+ if (err)
182
+ reject(err);
183
+ else
184
+ resolve();
185
+ });
186
+ });
187
+ }
188
+ // Validate options
189
+ try {
190
+ validateOptions(options);
191
+ }
192
+ catch (err) {
193
+ callback(err);
194
+ return;
195
+ }
196
+ // Validate steamCmdPath
197
+ if (!steamCmdPath || typeof steamCmdPath !== 'string') {
198
+ callback(new InstallError('steamCmdPath must be a non-empty string', 'INVALID_PATH'));
199
+ return;
200
+ }
201
+ const onProgress = typeof options.onProgress === 'function' ? options.onProgress : () => { };
202
+ const onOutput = typeof options.onOutput === 'function' ? options.onOutput : null;
203
+ const proc = node_child_process_1.default.execFile(steamCmdPath, createArguments(options));
204
+ let stdoutData = '';
205
+ let stderrData = '';
206
+ onProgress({
207
+ phase: 'starting',
208
+ percent: 0,
209
+ bytesDownloaded: 0,
210
+ totalBytes: 0,
211
+ });
212
+ proc.stdout?.on('data', (data) => {
213
+ const str = data.toString();
214
+ stdoutData += str;
215
+ if (onOutput) {
216
+ onOutput(str, 'stdout');
217
+ }
218
+ else {
219
+ console.log(`stdout: ${str}`);
220
+ }
221
+ // Parse progress from output
222
+ const progress = parseProgress(data);
223
+ if (progress) {
224
+ onProgress(progress);
225
+ }
226
+ });
227
+ proc.stderr?.on('data', (data) => {
228
+ const str = data.toString();
229
+ stderrData += str;
230
+ if (onOutput) {
231
+ onOutput(str, 'stderr');
232
+ }
233
+ else {
234
+ console.log(`stderr: ${str}`);
235
+ }
236
+ });
237
+ proc.on('error', (err) => {
238
+ callback(new InstallError(`Failed to spawn SteamCMD: ${err.message}`, 'SPAWN_ERROR'));
239
+ });
240
+ proc.on('close', (code) => {
241
+ if (onOutput) {
242
+ onOutput(`Process exited with code ${code}\n`, 'stdout');
243
+ }
244
+ else {
245
+ console.log(`child process exited with code ${code}`);
246
+ }
247
+ if (code && code > 0) {
248
+ const err = new InstallError(`SteamCMD exited with code ${code}`, 'EXIT_ERROR', code);
249
+ err.stdout = stdoutData;
250
+ err.stderr = stderrData;
251
+ callback(err);
252
+ }
253
+ else {
254
+ onProgress({
255
+ phase: 'complete',
256
+ percent: 100,
257
+ bytesDownloaded: 0,
258
+ totalBytes: 0,
259
+ });
260
+ callback(null);
261
+ }
262
+ });
263
+ }
264
+ /**
265
+ * Run SteamCMD with EventEmitter-based progress
266
+ * @param steamCmdPath Path to SteamCMD executable
267
+ * @param options Installation options
268
+ * @returns Emitter that fires 'progress', 'output', 'error', and 'complete' events
269
+ *
270
+ * @example
271
+ * const emitter = installWithProgress(execPath, { applicationId: 740 });
272
+ * emitter.on('progress', (p) => console.log(`${p.percent}%`));
273
+ * emitter.on('output', (data, type) => console.log(`[${type}] ${data}`));
274
+ * emitter.on('complete', () => console.log('Done!'));
275
+ * emitter.on('error', (err) => console.error(err));
276
+ */
277
+ function installWithProgress(steamCmdPath, options) {
278
+ const emitter = new node_events_1.EventEmitter();
279
+ // Run install in next tick to allow event binding
280
+ process.nextTick(() => {
281
+ install(steamCmdPath, {
282
+ ...options,
283
+ onProgress: (progress) => emitter.emit('progress', progress),
284
+ onOutput: (data, type) => emitter.emit('output', data, type),
285
+ }, (err) => {
286
+ if (err) {
287
+ emitter.emit('error', err);
288
+ }
289
+ else {
290
+ emitter.emit('complete');
291
+ }
292
+ });
293
+ });
294
+ return emitter;
295
+ }
296
+ exports.default = install;
297
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAqGH,0CA2DC;AAOD,0CAmDC;AAOD,sCAuCC;AAiBD,0BAgHC;AAeD,kDA0BC;AAhbD,4EAA6C;AAC7C,6CAA0C;AAkD1C;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,GAAG,cAAuB,CAAA;IAC9B,IAAI,CAAQ;IACZ,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,MAAM,CAAS;IAEf,YAAY,OAAe,EAAE,IAAY,EAAE,QAAiB;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAA;Q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