hostctl 0.1.32
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/LICENSE +277 -0
- package/README.md +1027 -0
- package/dist/bin/hostctl.d.ts +1 -0
- package/dist/bin/hostctl.js +4962 -0
- package/dist/bin/hostctl.js.map +1 -0
- package/dist/index.d.ts +1693 -0
- package/dist/index.js +7204 -0
- package/dist/index.js.map +1 -0
- package/package.json +124 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1693 @@
|
|
|
1
|
+
import { ParsedPath } from 'node:path';
|
|
2
|
+
import { Signal } from 'human-signals';
|
|
3
|
+
import { StringBuilder } from 'typescript-string-operations';
|
|
4
|
+
import { Readable } from 'node:stream';
|
|
5
|
+
import * as cmdr from 'commander';
|
|
6
|
+
|
|
7
|
+
declare class Identity {
|
|
8
|
+
identityFilePath: string;
|
|
9
|
+
private identity;
|
|
10
|
+
constructor({ path, identity }: {
|
|
11
|
+
path?: string;
|
|
12
|
+
identity?: string;
|
|
13
|
+
});
|
|
14
|
+
get recipient(): Promise<string>;
|
|
15
|
+
private writeTmpIdentityFile;
|
|
16
|
+
private readIdentityFromFile;
|
|
17
|
+
get privateKey(): string;
|
|
18
|
+
get publicKey(): Promise<string>;
|
|
19
|
+
decrypt(encryptedString: string): Promise<string | null>;
|
|
20
|
+
encrypt(plaintext: string): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type YamlHost = {
|
|
24
|
+
alias?: string;
|
|
25
|
+
user?: string;
|
|
26
|
+
password?: SecretRef | string;
|
|
27
|
+
'ssh-key'?: SecretRef | string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
};
|
|
30
|
+
type YamlHostsMapping = {
|
|
31
|
+
[key: string]: YamlHost;
|
|
32
|
+
};
|
|
33
|
+
type YamlSecret = {
|
|
34
|
+
ids: string | string[];
|
|
35
|
+
value: string;
|
|
36
|
+
};
|
|
37
|
+
type YamlSecretsMapping = {
|
|
38
|
+
[key: string]: YamlSecret;
|
|
39
|
+
};
|
|
40
|
+
type YamlIdsMapping = {
|
|
41
|
+
[key: string]: string | string[];
|
|
42
|
+
};
|
|
43
|
+
type YamlConfigFile = {
|
|
44
|
+
hosts?: YamlHostsMapping;
|
|
45
|
+
secrets?: YamlSecretsMapping;
|
|
46
|
+
ids?: YamlIdsMapping;
|
|
47
|
+
};
|
|
48
|
+
declare class SecretRef {
|
|
49
|
+
name: string;
|
|
50
|
+
constructor(name: string);
|
|
51
|
+
toYAML(): this;
|
|
52
|
+
}
|
|
53
|
+
declare class SecretValue {
|
|
54
|
+
private value;
|
|
55
|
+
constructor(value: string);
|
|
56
|
+
encrypt(recipients: string[]): Promise<string>;
|
|
57
|
+
decrypt(identities: Identity[]): Promise<string | undefined>;
|
|
58
|
+
isEncrypted(): boolean;
|
|
59
|
+
toYAML(): string;
|
|
60
|
+
}
|
|
61
|
+
declare class Secret implements ISecret {
|
|
62
|
+
config: ConfigFile;
|
|
63
|
+
name: string;
|
|
64
|
+
ids: RecipientGroup;
|
|
65
|
+
value: SecretValue;
|
|
66
|
+
constructor(config: ConfigFile, name: string, ids: RecipientGroup, value: SecretValue);
|
|
67
|
+
recipients(): string[];
|
|
68
|
+
ciphertext(): Promise<string>;
|
|
69
|
+
plaintext(): Promise<string | undefined>;
|
|
70
|
+
encrypt(): Promise<string>;
|
|
71
|
+
decrypt(): Promise<string | undefined>;
|
|
72
|
+
toYAML(): {
|
|
73
|
+
ids: string[];
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
declare class RecipientGroup implements IRecipientGroup {
|
|
78
|
+
config: ConfigFile;
|
|
79
|
+
publicKeys: string[];
|
|
80
|
+
idRefs: string[];
|
|
81
|
+
constructor(config: ConfigFile, publicKeys: string[], idRefs: string[]);
|
|
82
|
+
recipients(): string[];
|
|
83
|
+
walkRecipientGroups(visitFn: (rg: RecipientGroup) => void, visited?: Set<RecipientGroup>): void;
|
|
84
|
+
toYAML(): string[];
|
|
85
|
+
}
|
|
86
|
+
declare class ConfigFile implements Config {
|
|
87
|
+
path: string;
|
|
88
|
+
_hosts: Map<string, Host>;
|
|
89
|
+
_ids: Map<string, RecipientGroup>;
|
|
90
|
+
_secrets: Map<string, Secret>;
|
|
91
|
+
constructor(path: string);
|
|
92
|
+
load(): Promise<void>;
|
|
93
|
+
parse(yamlDocument: YamlConfigFile): void;
|
|
94
|
+
parseSecretValue(yamlSecretValue: SecretRef | string | undefined): SecretRef | string | undefined;
|
|
95
|
+
parseHosts(yamlHosts: YamlHostsMapping): Map<string, Host>;
|
|
96
|
+
parseIdsMap(yamlIds: YamlIdsMapping): Map<string, RecipientGroup>;
|
|
97
|
+
parseRecipients(ids: string | string[] | (string | string[])[]): RecipientGroup;
|
|
98
|
+
isValidPublicKey(str: string): boolean;
|
|
99
|
+
parseSecrets(yamlSecrets: YamlSecretsMapping): Map<string, Secret>;
|
|
100
|
+
save(destinationPath?: string): Promise<void>;
|
|
101
|
+
serializeHosts(): any;
|
|
102
|
+
serializeSecrets(): any;
|
|
103
|
+
serializeIds(): any;
|
|
104
|
+
loadPrivateKeys(): Identity[];
|
|
105
|
+
getSecret(name: string): Secret | undefined;
|
|
106
|
+
getRecipientGroups(idRefs: string[]): RecipientGroup[];
|
|
107
|
+
decryptAllIfPossible(): Promise<void>;
|
|
108
|
+
encryptAll(): Promise<void>;
|
|
109
|
+
hosts(): Host[];
|
|
110
|
+
secrets(): Map<string, Secret>;
|
|
111
|
+
ids(): Map<string, RecipientGroup>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class Host {
|
|
115
|
+
config: ConfigFile;
|
|
116
|
+
hostname: string;
|
|
117
|
+
alias?: string;
|
|
118
|
+
port: number;
|
|
119
|
+
user?: string;
|
|
120
|
+
password?: SecretRef | string;
|
|
121
|
+
sshKey?: SecretRef | string;
|
|
122
|
+
tags: string[];
|
|
123
|
+
tagSet: Set<string>;
|
|
124
|
+
constructor(config: ConfigFile, opts: {
|
|
125
|
+
hostname: string;
|
|
126
|
+
alias?: string;
|
|
127
|
+
port?: number;
|
|
128
|
+
user?: string;
|
|
129
|
+
password?: SecretRef | string;
|
|
130
|
+
sshKey?: SecretRef | string;
|
|
131
|
+
tags?: string[];
|
|
132
|
+
});
|
|
133
|
+
decryptedPassword(): Promise<string | undefined>;
|
|
134
|
+
decryptedSshKey(): Promise<string | undefined>;
|
|
135
|
+
toYAML(): {
|
|
136
|
+
alias: string | undefined;
|
|
137
|
+
user: string | undefined;
|
|
138
|
+
port: number | undefined;
|
|
139
|
+
password: string | SecretRef | undefined;
|
|
140
|
+
'ssh-key': string | SecretRef | undefined;
|
|
141
|
+
tags: string[];
|
|
142
|
+
};
|
|
143
|
+
get shortName(): string;
|
|
144
|
+
isLocal(): boolean;
|
|
145
|
+
get uri(): string;
|
|
146
|
+
writeTmpDecryptedSshKey(): Promise<string | undefined>;
|
|
147
|
+
private _plaintextSshKeyPath;
|
|
148
|
+
plaintextSshKeyPath(): Promise<string | undefined>;
|
|
149
|
+
toObject(): {
|
|
150
|
+
hostname: string;
|
|
151
|
+
port: number;
|
|
152
|
+
alias: string | undefined;
|
|
153
|
+
user: string | undefined;
|
|
154
|
+
tags: string[];
|
|
155
|
+
};
|
|
156
|
+
hasTag(tag: string): boolean;
|
|
157
|
+
hasAllTags(tags: Set<string>): boolean;
|
|
158
|
+
hasAnyTag(tags: Set<string>): boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
interface ISecret {
|
|
162
|
+
name: string;
|
|
163
|
+
recipients(): string[];
|
|
164
|
+
ciphertext(): Promise<string>;
|
|
165
|
+
plaintext(): Promise<string | undefined>;
|
|
166
|
+
}
|
|
167
|
+
interface IRecipientGroup {
|
|
168
|
+
recipients(): string[];
|
|
169
|
+
}
|
|
170
|
+
interface Config {
|
|
171
|
+
hosts(): Host[];
|
|
172
|
+
secrets(): Map<string, Secret>;
|
|
173
|
+
ids(): Map<string, RecipientGroup>;
|
|
174
|
+
getSecret(name: string): ISecret | undefined;
|
|
175
|
+
getRecipientGroups(idRefs: string[]): IRecipientGroup[];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare class Path {
|
|
179
|
+
path: string;
|
|
180
|
+
isWindowsPath: boolean;
|
|
181
|
+
static new(path: Path | string, isWindowsPath?: boolean): Path;
|
|
182
|
+
static cwd(): Path;
|
|
183
|
+
static homeDir(): Path;
|
|
184
|
+
static sep(isWindowsPath?: boolean): "\\" | "/";
|
|
185
|
+
constructor(path: string, isWindowsPath?: boolean);
|
|
186
|
+
absolute(): Path;
|
|
187
|
+
ancestors(): Path[];
|
|
188
|
+
basename(suffix?: string): Path;
|
|
189
|
+
build(path: string): Path;
|
|
190
|
+
copy(destPath: Path | string, mode?: number): Promise<Path | null>;
|
|
191
|
+
dirContains(filename: string): boolean;
|
|
192
|
+
directory(): Path;
|
|
193
|
+
directorySegments(): string[];
|
|
194
|
+
dirname(): Path;
|
|
195
|
+
equals(other: any): boolean;
|
|
196
|
+
exists(): boolean;
|
|
197
|
+
ext(): string;
|
|
198
|
+
glob(pattern: string): Path[];
|
|
199
|
+
isAbsolute(): boolean;
|
|
200
|
+
isDirectory(): boolean;
|
|
201
|
+
isFile(): boolean;
|
|
202
|
+
isPosix(): boolean;
|
|
203
|
+
isRoot(): boolean;
|
|
204
|
+
isWindows(): boolean;
|
|
205
|
+
join(...paths: string[]): Path;
|
|
206
|
+
normalize(): Path;
|
|
207
|
+
parent(count?: number): Path;
|
|
208
|
+
parse(): ParsedPath;
|
|
209
|
+
pop(count?: number): Path;
|
|
210
|
+
relative(to: string): Path;
|
|
211
|
+
resolve(...paths: string[]): Path;
|
|
212
|
+
root(): Path;
|
|
213
|
+
selfAndAncestors(): Path[];
|
|
214
|
+
split(): string[];
|
|
215
|
+
toString(): string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
type EnvVarObj = Record<string, string>;
|
|
219
|
+
declare class CommandResult {
|
|
220
|
+
stdout: string;
|
|
221
|
+
stderr: string;
|
|
222
|
+
exitCode: number;
|
|
223
|
+
signal?: Signal | undefined;
|
|
224
|
+
constructor(stdout: string, stderr: string, exitCode: number, signal?: Signal | undefined);
|
|
225
|
+
toJSON(): {
|
|
226
|
+
stdout: string;
|
|
227
|
+
stderr: string;
|
|
228
|
+
exitCode: number;
|
|
229
|
+
signal: Signal | undefined;
|
|
230
|
+
success: boolean;
|
|
231
|
+
failure: boolean;
|
|
232
|
+
};
|
|
233
|
+
get out(): string;
|
|
234
|
+
get err(): string;
|
|
235
|
+
get exit(): number;
|
|
236
|
+
get sig(): Signal | undefined;
|
|
237
|
+
get success(): boolean;
|
|
238
|
+
get failure(): boolean;
|
|
239
|
+
}
|
|
240
|
+
declare class Command {
|
|
241
|
+
static parse(commandString: string, env?: EnvVarObj): {
|
|
242
|
+
cmd: string;
|
|
243
|
+
args: string[];
|
|
244
|
+
env?: EnvVarObj;
|
|
245
|
+
};
|
|
246
|
+
cmd: string;
|
|
247
|
+
args?: string[] | undefined;
|
|
248
|
+
cwd?: string;
|
|
249
|
+
env?: Record<string, string>;
|
|
250
|
+
result?: CommandResult;
|
|
251
|
+
constructor(opts: {
|
|
252
|
+
cmd: string;
|
|
253
|
+
args?: string[];
|
|
254
|
+
cwd?: string;
|
|
255
|
+
env?: Record<string, string>;
|
|
256
|
+
result?: CommandResult;
|
|
257
|
+
});
|
|
258
|
+
isRunning(): boolean;
|
|
259
|
+
toJSON(): {
|
|
260
|
+
cmd: string;
|
|
261
|
+
args: string[] | undefined;
|
|
262
|
+
cwd: string | undefined;
|
|
263
|
+
env: Record<string, string> | undefined;
|
|
264
|
+
result: {
|
|
265
|
+
stdout: string;
|
|
266
|
+
stderr: string;
|
|
267
|
+
exitCode: number;
|
|
268
|
+
signal: Signal | undefined;
|
|
269
|
+
success: boolean;
|
|
270
|
+
failure: boolean;
|
|
271
|
+
} | undefined;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
declare class NodeRuntime {
|
|
276
|
+
tmpDir: Path;
|
|
277
|
+
static Name: string;
|
|
278
|
+
private client;
|
|
279
|
+
private alreadyInstalled;
|
|
280
|
+
private localNode;
|
|
281
|
+
private localNpm;
|
|
282
|
+
constructor(tmpDir: Path);
|
|
283
|
+
isNodeInstalledGlobally(): Promise<boolean>;
|
|
284
|
+
isNodeInstalledLocally(): Promise<boolean>;
|
|
285
|
+
isNpmInstalledGlobally(): Promise<boolean>;
|
|
286
|
+
isNpmInstalledLocally(): Promise<boolean>;
|
|
287
|
+
nodeCmd(): Promise<string>;
|
|
288
|
+
nodePath(): Promise<string | null>;
|
|
289
|
+
npmCmd(): Promise<string>;
|
|
290
|
+
npmPath(): Promise<string | null>;
|
|
291
|
+
installIfNeeded(): Promise<string | undefined>;
|
|
292
|
+
install(): Promise<string>;
|
|
293
|
+
listPackages(): Promise<string[]>;
|
|
294
|
+
downloadNodePackage(platform: string, arch: string): Promise<string>;
|
|
295
|
+
unzipPackage(packagePath: string): Promise<string>;
|
|
296
|
+
npmInstall(omitDev?: boolean, cwd?: string): Promise<CommandResult>;
|
|
297
|
+
npm(npmArgs: string, cwd?: string): Promise<CommandResult>;
|
|
298
|
+
node(nodeArgs: string, cwd?: string): Promise<CommandResult>;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* An object representing the mapping of expected output (as a regex string)
|
|
303
|
+
* to the input that should be provided in response.
|
|
304
|
+
*/
|
|
305
|
+
type InputMap = Record<string, string>;
|
|
306
|
+
declare const CHECKMARK = "\u2713";
|
|
307
|
+
declare const XMARK = "\u2717";
|
|
308
|
+
/**
|
|
309
|
+
* A collection of regular expressions to detect various sudo/doas password prompts
|
|
310
|
+
* across different operating systems.
|
|
311
|
+
*/
|
|
312
|
+
declare const SUDO_PROMPT_REGEX: {
|
|
313
|
+
/**
|
|
314
|
+
* Matches the default sudo prompt on most Linux distributions.
|
|
315
|
+
* Example: `[sudo] password for <username>:`
|
|
316
|
+
*/
|
|
317
|
+
LINUX: string;
|
|
318
|
+
/**
|
|
319
|
+
* Matches the default sudo prompt on macOS and some BSD systems.
|
|
320
|
+
* Example: `Password:`
|
|
321
|
+
*/
|
|
322
|
+
MAC_BSD: string;
|
|
323
|
+
/**
|
|
324
|
+
* Matches the default prompt for `doas` on OpenBSD.
|
|
325
|
+
* Example: `doas (username@hostname) password:`
|
|
326
|
+
*/
|
|
327
|
+
DOAS: string;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* A helper function that builds an input map to handle various sudo/doas password prompts.
|
|
331
|
+
* This is useful for building up interaction handlers for commands that require privilege escalation
|
|
332
|
+
* across different operating systems.
|
|
333
|
+
*
|
|
334
|
+
* @param password The sudo/doas password to provide.
|
|
335
|
+
* @param existingInputMap An optional existing map of interactions.
|
|
336
|
+
* @returns A new input map containing the sudo/doas prompt interactions and any existing interactions.
|
|
337
|
+
*/
|
|
338
|
+
declare function withSudo(password: string | undefined, existingInputMap?: InputMap): InputMap;
|
|
339
|
+
|
|
340
|
+
declare class InteractionHandler {
|
|
341
|
+
static with(inputs: InputMap): InteractionHandler;
|
|
342
|
+
private patternInputMappings;
|
|
343
|
+
private inputStreamForRegexMatcher;
|
|
344
|
+
private writeFn;
|
|
345
|
+
constructor(patternInputMappings?: Map<string | RegExp, string>);
|
|
346
|
+
clone(): InteractionHandler;
|
|
347
|
+
with(inputs: InputMap): InteractionHandler;
|
|
348
|
+
mapInput(inputMap: InputMap): InteractionHandler;
|
|
349
|
+
map(pattern: RegExp | string, response: string): this;
|
|
350
|
+
compositeRegex(): RegExp | undefined;
|
|
351
|
+
firstMatchingPattern(matchStr: string): string | undefined;
|
|
352
|
+
findReplacementForMatch(matchStr: string): string | undefined;
|
|
353
|
+
begin(): void;
|
|
354
|
+
handleInput(inputChunk: string): void;
|
|
355
|
+
setOutputToNewReadable(): Readable;
|
|
356
|
+
setOutputWriter(writeFn: (str: string) => void): void;
|
|
357
|
+
private emitInput;
|
|
358
|
+
end(): void;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
type LogLevel = number;
|
|
362
|
+
interface FileSystemOperations$1 {
|
|
363
|
+
read: (path: string) => Promise<string>;
|
|
364
|
+
write: (path: string, content: string, options?: {
|
|
365
|
+
mode?: string | number;
|
|
366
|
+
user?: string;
|
|
367
|
+
group?: string;
|
|
368
|
+
}) => Promise<void>;
|
|
369
|
+
exists: (path: string) => Promise<boolean>;
|
|
370
|
+
mkdir: (path: string, options?: {
|
|
371
|
+
recursive?: boolean;
|
|
372
|
+
mode?: string | number;
|
|
373
|
+
}) => Promise<void>;
|
|
374
|
+
rm: (path: string, options?: {
|
|
375
|
+
recursive?: boolean;
|
|
376
|
+
force?: boolean;
|
|
377
|
+
}) => Promise<void>;
|
|
378
|
+
}
|
|
379
|
+
interface TaskContext<TParams extends TaskParams = TaskParams> {
|
|
380
|
+
params: TParams;
|
|
381
|
+
readonly id: string;
|
|
382
|
+
readonly host?: Host;
|
|
383
|
+
readonly config: AppConfig;
|
|
384
|
+
log: (level: LogLevel, ...message: any[]) => void;
|
|
385
|
+
info: (...message: any[]) => void;
|
|
386
|
+
debug: (...message: any[]) => void;
|
|
387
|
+
warn: (...message: any[]) => void;
|
|
388
|
+
error: (...message: any[]) => void;
|
|
389
|
+
exec: (command: string | string[], options?: {
|
|
390
|
+
input?: Record<string, string>;
|
|
391
|
+
sudo?: boolean;
|
|
392
|
+
stdin?: string | Buffer;
|
|
393
|
+
env?: EnvVarObj;
|
|
394
|
+
cwd?: string;
|
|
395
|
+
user?: string;
|
|
396
|
+
pty?: boolean;
|
|
397
|
+
}) => Promise<CommandResult>;
|
|
398
|
+
ssh: <TRemoteParams extends TaskParams = {}, TRemoteReturn extends RunFnReturnValue = RunFnReturnValue>(tags: string[], remoteTaskFn: (remoteContext: TaskContext<TRemoteParams>) => Promise<TRemoteReturn>) => Promise<Record<string, TRemoteReturn | Error>>;
|
|
399
|
+
run: <TRunReturn extends RunFnReturnValue>(taskPartialFn: TaskPartialFn<TRunReturn>) => Promise<TRunReturn>;
|
|
400
|
+
getPassword: () => Promise<string | undefined>;
|
|
401
|
+
getSecret: (name: string) => Promise<string | undefined>;
|
|
402
|
+
exit: (exitCode: number, message?: string) => void;
|
|
403
|
+
inventory: (tags: string[]) => Host[];
|
|
404
|
+
file: FileSystemOperations$1;
|
|
405
|
+
}
|
|
406
|
+
type TaskPartialFn<TReturn extends RunFnReturnValue = RunFnReturnValue> = (parentInvocation: IInvocation) => Promise<TReturn>;
|
|
407
|
+
interface TaskFn<TParams extends TaskParams = TaskParams, TReturn extends RunFnReturnValue = RunFnReturnValue> {
|
|
408
|
+
(params?: TParams): TaskPartialFn<TReturn>;
|
|
409
|
+
task: Task<TParams, TReturn>;
|
|
410
|
+
}
|
|
411
|
+
declare function task<TParams extends TaskParams, TReturn extends RunFnReturnValue>(runFn: RunFn<TParams, TReturn>, options?: {
|
|
412
|
+
description?: string;
|
|
413
|
+
name?: string;
|
|
414
|
+
}): TaskFn<TParams, TReturn>;
|
|
415
|
+
interface IInvocation<TParams extends TaskParams = any> {
|
|
416
|
+
id: string;
|
|
417
|
+
runtime: IRuntime;
|
|
418
|
+
host?: Host;
|
|
419
|
+
readonly config: AppConfig;
|
|
420
|
+
log(level: LogLevel, ...message: any[]): void;
|
|
421
|
+
info(...message: any[]): void;
|
|
422
|
+
debug(...message: any[]): void;
|
|
423
|
+
warn(...message: any[]): void;
|
|
424
|
+
error(...message: any[]): void;
|
|
425
|
+
exec(command: string | string[], options?: {
|
|
426
|
+
input?: Record<string, string>;
|
|
427
|
+
sudo?: boolean;
|
|
428
|
+
stdin?: string | Buffer;
|
|
429
|
+
env?: EnvVarObj;
|
|
430
|
+
cwd?: string;
|
|
431
|
+
user?: string;
|
|
432
|
+
pty?: boolean;
|
|
433
|
+
}): Promise<CommandResult>;
|
|
434
|
+
readonly file: FileSystemOperations$1;
|
|
435
|
+
ssh<TRemoteParams extends TaskParams = {}, TRemoteReturn extends RunFnReturnValue = RunFnReturnValue>(tags: string[], remoteTaskFn: (remoteContext: TaskContext<TRemoteParams>) => Promise<TRemoteReturn>): Promise<Record<string, TRemoteReturn | Error>>;
|
|
436
|
+
run<TRunReturn extends RunFnReturnValue>(taskPartialFn: TaskPartialFn<TRunReturn>): Promise<TRunReturn>;
|
|
437
|
+
invokeChildTask<TTaskParams extends TaskParams, TTaskReturn extends RunFnReturnValue>(childTaskFn: TaskFn<TTaskParams, TTaskReturn>, params: TTaskParams): Promise<TTaskReturn>;
|
|
438
|
+
getPassword(): Promise<string | undefined>;
|
|
439
|
+
getSecret(name: string): Promise<string | undefined>;
|
|
440
|
+
exit(exitCode: number, message?: string): void;
|
|
441
|
+
inventory(tags: string[]): Host[];
|
|
442
|
+
setDescription(description: string): void;
|
|
443
|
+
setFutureResult(resultPromise: Promise<RunFnReturnValue>): void;
|
|
444
|
+
appendChildInvocation(childInvocation: IInvocation<any>): Promise<void>;
|
|
445
|
+
readonly stderr: string;
|
|
446
|
+
readonly stdout: string;
|
|
447
|
+
resultError(): Promise<Error | undefined>;
|
|
448
|
+
getDescription(): string | undefined;
|
|
449
|
+
getChildren(): ReadonlyArray<IInvocation<any>>;
|
|
450
|
+
getResultPromise(): Promise<RunFnReturnValue>;
|
|
451
|
+
}
|
|
452
|
+
declare abstract class Invocation<TParams extends TaskParams = any> implements IInvocation<TParams> {
|
|
453
|
+
runtime: IRuntime;
|
|
454
|
+
taskFnDefinition: TaskFn<TParams, any>;
|
|
455
|
+
parent?: IInvocation<any> | undefined;
|
|
456
|
+
id: string;
|
|
457
|
+
children: Array<IInvocation<any>>;
|
|
458
|
+
private childrenMutex;
|
|
459
|
+
description?: string;
|
|
460
|
+
stderrSB: StringBuilder;
|
|
461
|
+
stdoutSB: StringBuilder;
|
|
462
|
+
host?: Host;
|
|
463
|
+
result: Promise<RunFnReturnValue>;
|
|
464
|
+
resolveResult: (value: RunFnReturnValue | PromiseLike<RunFnReturnValue>) => void;
|
|
465
|
+
rejectResult: (reason?: any) => void;
|
|
466
|
+
constructor(runtime: IRuntime, taskFnDefinition: TaskFn<TParams, any>, parent?: IInvocation<any> | undefined);
|
|
467
|
+
getPassword(): Promise<string | undefined>;
|
|
468
|
+
getSecret(name: string): Promise<string | undefined>;
|
|
469
|
+
get stderr(): string;
|
|
470
|
+
get stdout(): string;
|
|
471
|
+
info(...message: any[]): void;
|
|
472
|
+
debug(...message: any[]): void;
|
|
473
|
+
warn(...message: any[]): void;
|
|
474
|
+
error(...message: any[]): void;
|
|
475
|
+
resultError(): Promise<Error | undefined>;
|
|
476
|
+
setDescription(description: string): void;
|
|
477
|
+
setFutureResult(resultPromise: Promise<RunFnReturnValue>): void;
|
|
478
|
+
getDescription(): string | undefined;
|
|
479
|
+
getChildren(): ReadonlyArray<IInvocation<any>>;
|
|
480
|
+
getResultPromise(): Promise<RunFnReturnValue>;
|
|
481
|
+
exit(exitCode: number, message?: string): void;
|
|
482
|
+
inventory(tags: string[]): Host[];
|
|
483
|
+
appendChildInvocation(childInvocation: IInvocation<any>): Promise<void>;
|
|
484
|
+
abstract readonly config: AppConfig;
|
|
485
|
+
abstract log(level: LogLevel, ...message: any[]): void;
|
|
486
|
+
abstract exec(command: string | string[], options?: {
|
|
487
|
+
input?: Record<string, string>;
|
|
488
|
+
sudo: boolean;
|
|
489
|
+
stdin?: string | Buffer;
|
|
490
|
+
env?: EnvVarObj;
|
|
491
|
+
cwd?: string;
|
|
492
|
+
user?: string;
|
|
493
|
+
pty?: boolean;
|
|
494
|
+
}): Promise<CommandResult>;
|
|
495
|
+
abstract readonly file: FileSystemOperations$1;
|
|
496
|
+
abstract ssh<TRemoteParams extends TaskParams = {}, TRemoteReturn extends RunFnReturnValue = RunFnReturnValue>(tags: string[], remoteTaskFn: (remoteContext: TaskContext<TRemoteParams>) => Promise<TRemoteReturn>): Promise<Record<string, TRemoteReturn | Error>>;
|
|
497
|
+
abstract run<TRunReturn extends RunFnReturnValue>(taskPartialFn: TaskPartialFn<TRunReturn>): Promise<TRunReturn>;
|
|
498
|
+
abstract invokeChildTask<TTaskParams extends TaskParams, TTaskReturn extends RunFnReturnValue>(childTaskFn: TaskFn<TTaskParams, TTaskReturn>, params: TTaskParams): Promise<TTaskReturn>;
|
|
499
|
+
}
|
|
500
|
+
interface IRuntime {
|
|
501
|
+
app: App;
|
|
502
|
+
config?: {
|
|
503
|
+
cwd?: string;
|
|
504
|
+
configFile?: ConfigFile;
|
|
505
|
+
};
|
|
506
|
+
interactionHandler: InteractionHandler;
|
|
507
|
+
tmpDirRootPath: Path;
|
|
508
|
+
getPassword(): Promise<string | undefined>;
|
|
509
|
+
getSecret(name: string): Promise<string | undefined>;
|
|
510
|
+
getTmpDir(): Path;
|
|
511
|
+
getTmpFile(prefix?: string, postfix?: string, dir?: Path): Path;
|
|
512
|
+
inventory(tags: string[]): Host[];
|
|
513
|
+
invokeRootTask<TParams extends TaskParams, TReturn extends RunFnReturnValue>(taskFnDefinition: TaskFn<TParams, TReturn>, params: TParams, description?: string): Promise<IInvocation<TParams>>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Generic object type for parameters and return values.
|
|
518
|
+
*/
|
|
519
|
+
type ObjectType = {
|
|
520
|
+
[key: string]: any;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Base type for task-specific parameters.
|
|
524
|
+
*/
|
|
525
|
+
type TaskParams = ObjectType;
|
|
526
|
+
/**
|
|
527
|
+
* Represents the possible return values of a task's run function.
|
|
528
|
+
*/
|
|
529
|
+
type RunFnReturnValue = ObjectType | void | undefined | null | Error;
|
|
530
|
+
/**
|
|
531
|
+
* Defines the signature of a task's main execution function.
|
|
532
|
+
* It receives a TaskContext and returns a Promise of a RunFnReturnValue.
|
|
533
|
+
*/
|
|
534
|
+
interface RunFn<TParams extends TaskParams = TaskParams, TReturn extends RunFnReturnValue = RunFnReturnValue> {
|
|
535
|
+
(context: TaskContext<TParams>): Promise<TReturn>;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Represents a task definition, including its run function and metadata.
|
|
539
|
+
* This class is instantiated by the `task` factory function.
|
|
540
|
+
*/
|
|
541
|
+
declare class Task<TParams extends TaskParams = TaskParams, TReturn extends RunFnReturnValue = RunFnReturnValue> {
|
|
542
|
+
runFn: RunFn<TParams, TReturn>;
|
|
543
|
+
taskModuleAbsolutePath?: string | undefined;
|
|
544
|
+
description?: string | undefined;
|
|
545
|
+
name?: string | undefined;
|
|
546
|
+
constructor(runFn: RunFn<TParams, TReturn>, taskModuleAbsolutePath?: string | undefined, description?: string | undefined, name?: string | undefined);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
interface FileSystemOperations {
|
|
550
|
+
read: (path: string) => Promise<string>;
|
|
551
|
+
write: (path: string, content: string, options?: {
|
|
552
|
+
mode?: string | number | undefined;
|
|
553
|
+
user?: string | undefined;
|
|
554
|
+
group?: string | undefined;
|
|
555
|
+
}) => Promise<void>;
|
|
556
|
+
exists: (path: string) => Promise<boolean>;
|
|
557
|
+
mkdir: (path: string, options?: {
|
|
558
|
+
recursive?: boolean | undefined;
|
|
559
|
+
mode?: string | number | undefined;
|
|
560
|
+
}) => Promise<void>;
|
|
561
|
+
rm: (path: string, options?: {
|
|
562
|
+
recursive?: boolean | undefined;
|
|
563
|
+
force?: boolean | undefined;
|
|
564
|
+
}) => Promise<void>;
|
|
565
|
+
}
|
|
566
|
+
declare class LocalInvocation<TParams extends TaskParams, TReturn extends RunFnReturnValue> extends Invocation<TParams> {
|
|
567
|
+
runtime: LocalRuntime;
|
|
568
|
+
taskFnDefinition: TaskFn<TParams, TReturn>;
|
|
569
|
+
readonly config: AppConfig;
|
|
570
|
+
readonly file: FileSystemOperations;
|
|
571
|
+
constructor(runtime: LocalRuntime, taskFnDefinition: TaskFn<TParams, TReturn>, params: TParams, parent?: IInvocation<any>);
|
|
572
|
+
log(level: LogLevel, ...message: any[]): void;
|
|
573
|
+
exec(command: string | string[], options?: {
|
|
574
|
+
input?: Record<string, string>;
|
|
575
|
+
sudo?: boolean;
|
|
576
|
+
stdin?: string | Buffer;
|
|
577
|
+
env?: EnvVarObj;
|
|
578
|
+
cwd?: string;
|
|
579
|
+
user?: string;
|
|
580
|
+
pty?: boolean;
|
|
581
|
+
}): Promise<CommandResult>;
|
|
582
|
+
ssh<TRemoteParams extends TaskParams = {}, TRemoteReturn extends RunFnReturnValue = RunFnReturnValue>(tags: string[], remoteTaskFn: (remoteContext: TaskContext<TRemoteParams>) => Promise<TRemoteReturn>): Promise<Record<string, TRemoteReturn | Error>>;
|
|
583
|
+
runRemoteTaskOnHost<TRemoteParams extends TaskParams, TRemoteReturn extends RunFnReturnValue>(host: Host, remoteTaskFn: RunFn<TRemoteParams, TRemoteReturn>): Promise<TRemoteReturn | Error>;
|
|
584
|
+
exit(exitCode: number, message?: string): void;
|
|
585
|
+
inventory(tags: string[]): Host[];
|
|
586
|
+
run<TRunReturn extends RunFnReturnValue>(taskPartialFn: TaskPartialFn<TRunReturn>): Promise<TRunReturn>;
|
|
587
|
+
invokeChildTask<TTaskParams extends TaskParams, TTaskReturn extends RunFnReturnValue>(childTaskFnDefinition: TaskFn<TTaskParams, TTaskReturn>, params: TTaskParams): Promise<TTaskReturn>;
|
|
588
|
+
}
|
|
589
|
+
declare class LocalRuntime implements IRuntime {
|
|
590
|
+
app: App;
|
|
591
|
+
localBundlePath: Path;
|
|
592
|
+
interactionHandler: InteractionHandler;
|
|
593
|
+
config?: {
|
|
594
|
+
cwd?: string;
|
|
595
|
+
configFile?: ConfigFile;
|
|
596
|
+
};
|
|
597
|
+
host: Host;
|
|
598
|
+
private memoizedPassword?;
|
|
599
|
+
constructor(app: App, localBundlePath: Path, interactionHandler?: InteractionHandler);
|
|
600
|
+
get tmpDirRootPath(): Path;
|
|
601
|
+
getPassword(): Promise<string | undefined>;
|
|
602
|
+
getSecret(name: string): Promise<string | undefined>;
|
|
603
|
+
getTmpDir(): Path;
|
|
604
|
+
getTmpFile(prefix?: string | undefined, postfix?: string | undefined, dir?: Path | undefined): Path;
|
|
605
|
+
inventory(tags: string[]): Host[];
|
|
606
|
+
invokeRootTask<TParams extends TaskParams, TReturn extends RunFnReturnValue>(taskFnDefinition: TaskFn<TParams, TReturn>, params: TParams, description?: string): Promise<LocalInvocation<TParams, TReturn>>;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
declare class RemoteRuntime implements IRuntime {
|
|
610
|
+
private sftpClientInstance?;
|
|
611
|
+
readonly app: App;
|
|
612
|
+
readonly host: Host;
|
|
613
|
+
readonly interactionHandler: InteractionHandler;
|
|
614
|
+
private sshSession;
|
|
615
|
+
constructor(app: App, host: Host, _localRuntime: LocalRuntime, interactionHandler?: InteractionHandler);
|
|
616
|
+
get tmpDirRootPath(): Path;
|
|
617
|
+
getPassword(): Promise<string | undefined>;
|
|
618
|
+
getSecret(name: string): Promise<string | undefined>;
|
|
619
|
+
getTmpDir(): Path;
|
|
620
|
+
getTmpFile(prefix?: string | undefined, postfix?: string | undefined, dir?: Path | undefined): Path;
|
|
621
|
+
inventory(tags: string[]): Host[];
|
|
622
|
+
connect(): Promise<boolean>;
|
|
623
|
+
getSftpClient(): Promise<any>;
|
|
624
|
+
executeCommand(command: string | string[], options?: {
|
|
625
|
+
cwd?: string;
|
|
626
|
+
stdin?: string | Buffer;
|
|
627
|
+
pty?: boolean;
|
|
628
|
+
env?: Record<string, string>;
|
|
629
|
+
interactionHandler?: InteractionHandler;
|
|
630
|
+
}): Promise<Command | Error>;
|
|
631
|
+
disconnect(): Promise<void>;
|
|
632
|
+
invokeRootTask<TParams extends TaskParams, TReturn extends RunFnReturnValue>(taskFnDefinition: TaskFn<TParams, TReturn>, params: TParams): Promise<IInvocation>;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
type AppConfig = Config;
|
|
636
|
+
|
|
637
|
+
type TaskTreeNode = {
|
|
638
|
+
id: string;
|
|
639
|
+
parentId: string | null;
|
|
640
|
+
parent: TaskTreeNode | undefined;
|
|
641
|
+
children: Set<TaskTreeNode>;
|
|
642
|
+
name: string;
|
|
643
|
+
result?: Promise<string | Error | undefined>;
|
|
644
|
+
};
|
|
645
|
+
declare class TaskTree {
|
|
646
|
+
private listr;
|
|
647
|
+
private subLists;
|
|
648
|
+
private nodes;
|
|
649
|
+
private mutex;
|
|
650
|
+
constructor();
|
|
651
|
+
clear(): void;
|
|
652
|
+
add(id: string, parentId: string | null, name: string, result?: Promise<string | Error | undefined>): Promise<TaskTreeNode>;
|
|
653
|
+
get(id: string): TaskTreeNode | undefined;
|
|
654
|
+
getWithTimeout(id: string): Promise<TaskTreeNode | undefined>;
|
|
655
|
+
run(ctx?: any): Promise<any>;
|
|
656
|
+
}
|
|
657
|
+
declare const Verbosity: {
|
|
658
|
+
ERROR: number;
|
|
659
|
+
WARN: number;
|
|
660
|
+
INFO: number;
|
|
661
|
+
DEBUG: number;
|
|
662
|
+
TRACE: number;
|
|
663
|
+
};
|
|
664
|
+
declare class App {
|
|
665
|
+
configRef?: string;
|
|
666
|
+
private _config?;
|
|
667
|
+
selectedTags: Set<string>;
|
|
668
|
+
private outputStyle;
|
|
669
|
+
private _tmpDir?;
|
|
670
|
+
private tmpFileRegistry;
|
|
671
|
+
taskTree: TaskTree;
|
|
672
|
+
verbosity: number;
|
|
673
|
+
constructor();
|
|
674
|
+
appExitCallback(): void;
|
|
675
|
+
get config(): Config;
|
|
676
|
+
get tmpDir(): Path;
|
|
677
|
+
loadConfig(configString?: string): Promise<void>;
|
|
678
|
+
log(level: LogLevel, ...args: any[]): void;
|
|
679
|
+
debug(...args: any[]): void;
|
|
680
|
+
info(...args: any[]): void;
|
|
681
|
+
warn(...args: any[]): void;
|
|
682
|
+
error(...args: any[]): void;
|
|
683
|
+
osHomeDir(): Path;
|
|
684
|
+
hostctlDir(): Path;
|
|
685
|
+
hostctlTmpDir(): Path;
|
|
686
|
+
randName(): string;
|
|
687
|
+
hostctlTmpPath(tmpName?: string): Path;
|
|
688
|
+
createNamedTmpDir(subDirName?: string): Path;
|
|
689
|
+
writeTmpFile(fileContent: string): Path;
|
|
690
|
+
shouldRunRemote(): boolean;
|
|
691
|
+
logHostCommandResult(host: Host, command: string | string[], cmdOrErr: Command | Error, isErrorResult?: boolean): void;
|
|
692
|
+
defaultSshUser(): string | undefined;
|
|
693
|
+
execute(cmd: string | string[]): Promise<boolean>;
|
|
694
|
+
runRemote(host: Host, cmd: string | string[]): Promise<Command | Error>;
|
|
695
|
+
getSecretsForHost(hostId: string): Map<string | RegExp, string>;
|
|
696
|
+
taskContextForRunFn<TParams extends TaskParams>(invocation: IInvocation<TParams>, params: TParams, hostForContext?: Host): TaskContext<TParams>;
|
|
697
|
+
setSelectedTags(selectedTags: string[]): void;
|
|
698
|
+
setOutputStyle(outputStyle: 'plain' | 'json'): void;
|
|
699
|
+
setVerbosity(level: number): void;
|
|
700
|
+
outputJson(): boolean;
|
|
701
|
+
outputPlain(): boolean;
|
|
702
|
+
querySelectedInventory(tags?: string[]): Host[];
|
|
703
|
+
selectedInventory(): Host[];
|
|
704
|
+
queryInventory(tags?: Set<string>): Host[];
|
|
705
|
+
selectInventory(hosts: Host[], tags?: Set<string>): Host[];
|
|
706
|
+
printInventoryReport(): void;
|
|
707
|
+
encryptInventoryFile(): Promise<void>;
|
|
708
|
+
decryptInventoryFile(): Promise<void>;
|
|
709
|
+
runScript(scriptRef: string, params: TaskParams): Promise<void>;
|
|
710
|
+
runScriptRemote(scriptRef: string, params: TaskParams): Promise<void>;
|
|
711
|
+
walkInvocationTreePreorder(invocation: IInvocation<any>, visitFn: (invocation: IInvocation<any>, depth: number) => Promise<void>, visited?: Set<IInvocation<any>>, depth?: number): Promise<void>;
|
|
712
|
+
reportScriptResult(invocation: LocalInvocation<any, any>, scriptResult: RunFnReturnValue | Error): Promise<void>;
|
|
713
|
+
loadScriptAsModule(scriptRef: string): Promise<any>;
|
|
714
|
+
parseParams(scriptArgs: string[]): Object;
|
|
715
|
+
bundleProject(entrypointPath: string): Promise<void>;
|
|
716
|
+
generateBundle(nodeRuntime: NodeRuntime, packageFileDir: Path): Promise<Path>;
|
|
717
|
+
pathOfPackageJsonFile(path: string): Path | null;
|
|
718
|
+
printRuntimeReport(): Promise<void>;
|
|
719
|
+
promptPassword(message?: string): Promise<string>;
|
|
720
|
+
installRuntime(): Promise<void>;
|
|
721
|
+
bootstrap(): Promise<void>;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare class Cli {
|
|
725
|
+
app: App;
|
|
726
|
+
program: cmdr.Command;
|
|
727
|
+
constructor();
|
|
728
|
+
handleBundle(path: string, options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
729
|
+
handleInventory(options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
730
|
+
handleInventoryEncrypt(options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
731
|
+
handleInventoryDecrypt(options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
732
|
+
handleInventoryList(options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
733
|
+
handleExec(commandParts: string | string[], options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
734
|
+
handleRun(packageOrBundle: string | null, scriptRef: string | undefined, scriptArgs: string[], options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
735
|
+
deriveConfigRef(suppliedConfigRef?: string): string;
|
|
736
|
+
loadApp(opts: Record<string, any>): Promise<void>;
|
|
737
|
+
run(): Promise<void>;
|
|
738
|
+
handleRuntime(options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
739
|
+
handleRuntimeInstall(options: Record<string, any>, cmd: cmdr.Command): Promise<void>;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
interface WhoamiParams {
|
|
743
|
+
}
|
|
744
|
+
interface WhoamiResult {
|
|
745
|
+
user: string;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
type EchoParams = {
|
|
749
|
+
args: string[];
|
|
750
|
+
};
|
|
751
|
+
interface EchoResult {
|
|
752
|
+
stdout: string;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
interface DirExistsParams {
|
|
756
|
+
path: string;
|
|
757
|
+
}
|
|
758
|
+
interface DirExistsResult {
|
|
759
|
+
exists: boolean;
|
|
760
|
+
}
|
|
761
|
+
declare const _default$$: TaskFn<DirExistsParams, DirExistsResult>;
|
|
762
|
+
|
|
763
|
+
interface DirCopyParams {
|
|
764
|
+
from: string;
|
|
765
|
+
to: string;
|
|
766
|
+
mode?: string;
|
|
767
|
+
owner?: string;
|
|
768
|
+
group?: string;
|
|
769
|
+
sudo?: boolean;
|
|
770
|
+
}
|
|
771
|
+
interface DirCopyResult {
|
|
772
|
+
success: boolean;
|
|
773
|
+
}
|
|
774
|
+
declare const _default$_: TaskFn<DirCopyParams, DirCopyResult>;
|
|
775
|
+
|
|
776
|
+
interface DirCreateParams {
|
|
777
|
+
path: string;
|
|
778
|
+
mode?: string;
|
|
779
|
+
owner?: string;
|
|
780
|
+
}
|
|
781
|
+
interface DirCreateResult {
|
|
782
|
+
success: boolean;
|
|
783
|
+
}
|
|
784
|
+
declare const _default$Z: TaskFn<DirCreateParams, DirCreateResult>;
|
|
785
|
+
|
|
786
|
+
declare namespace dir {
|
|
787
|
+
export { _default$_ as copy, _default$Z as create, _default$$ as exists };
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
interface ChownParams {
|
|
791
|
+
path: string;
|
|
792
|
+
owner: string;
|
|
793
|
+
group?: string;
|
|
794
|
+
recursive?: boolean;
|
|
795
|
+
sudo?: boolean;
|
|
796
|
+
}
|
|
797
|
+
interface ChownResult {
|
|
798
|
+
success: boolean;
|
|
799
|
+
error?: string;
|
|
800
|
+
}
|
|
801
|
+
declare const _default$Y: TaskFn<ChownParams, ChownResult>;
|
|
802
|
+
|
|
803
|
+
interface ChgrpParams {
|
|
804
|
+
path: string;
|
|
805
|
+
group: string;
|
|
806
|
+
recursive?: boolean;
|
|
807
|
+
sudo?: boolean;
|
|
808
|
+
}
|
|
809
|
+
interface ChgrpResult {
|
|
810
|
+
success: boolean;
|
|
811
|
+
error?: string;
|
|
812
|
+
}
|
|
813
|
+
declare const _default$X: TaskFn<ChgrpParams, ChgrpResult>;
|
|
814
|
+
|
|
815
|
+
interface ChmodParams {
|
|
816
|
+
path: string;
|
|
817
|
+
mode: string | number;
|
|
818
|
+
recursive?: boolean;
|
|
819
|
+
sudo?: boolean;
|
|
820
|
+
}
|
|
821
|
+
interface ChmodResult {
|
|
822
|
+
success: boolean;
|
|
823
|
+
error?: string;
|
|
824
|
+
}
|
|
825
|
+
declare const _default$W: TaskFn<ChmodParams, ChmodResult>;
|
|
826
|
+
|
|
827
|
+
interface FileCopyParams {
|
|
828
|
+
from: string;
|
|
829
|
+
to: string;
|
|
830
|
+
mode?: string;
|
|
831
|
+
owner?: string;
|
|
832
|
+
group?: string;
|
|
833
|
+
recursive?: boolean;
|
|
834
|
+
sudo?: boolean;
|
|
835
|
+
}
|
|
836
|
+
interface FileCopyResult {
|
|
837
|
+
success: boolean;
|
|
838
|
+
}
|
|
839
|
+
declare const _default$V: TaskFn<FileCopyParams, FileCopyResult>;
|
|
840
|
+
|
|
841
|
+
interface FileExistsParams {
|
|
842
|
+
path: string;
|
|
843
|
+
}
|
|
844
|
+
interface FileExistsResult {
|
|
845
|
+
exists: boolean;
|
|
846
|
+
}
|
|
847
|
+
declare const _default$U: TaskFn<FileExistsParams, FileExistsResult>;
|
|
848
|
+
|
|
849
|
+
interface FileTouchParams {
|
|
850
|
+
file: string;
|
|
851
|
+
mode?: string;
|
|
852
|
+
owner?: string;
|
|
853
|
+
}
|
|
854
|
+
interface FileTouchResult {
|
|
855
|
+
success: boolean;
|
|
856
|
+
}
|
|
857
|
+
declare const _default$T: TaskFn<FileTouchParams, FileTouchResult>;
|
|
858
|
+
|
|
859
|
+
interface FileDeleteParams {
|
|
860
|
+
path: string;
|
|
861
|
+
recursive?: boolean;
|
|
862
|
+
force?: boolean;
|
|
863
|
+
}
|
|
864
|
+
interface FileDeleteResult {
|
|
865
|
+
success: boolean;
|
|
866
|
+
}
|
|
867
|
+
declare const _default$S: TaskFn<FileDeleteParams, FileDeleteResult>;
|
|
868
|
+
|
|
869
|
+
interface FileLinkParams {
|
|
870
|
+
/** Path the symlink should point TO (target). */
|
|
871
|
+
target: string;
|
|
872
|
+
/** Path of the symlink itself. */
|
|
873
|
+
link: string;
|
|
874
|
+
/** Overwrite existing link/file if necessary (default true) */
|
|
875
|
+
force?: boolean;
|
|
876
|
+
/** Use sudo when creating/modifying (default false) */
|
|
877
|
+
sudo?: boolean;
|
|
878
|
+
}
|
|
879
|
+
interface FileLinkResult {
|
|
880
|
+
changed: boolean;
|
|
881
|
+
success: boolean;
|
|
882
|
+
}
|
|
883
|
+
declare const _default$R: TaskFn<FileLinkParams, FileLinkResult>;
|
|
884
|
+
|
|
885
|
+
interface FileEditParams {
|
|
886
|
+
file: string;
|
|
887
|
+
state?: 'present' | 'absent';
|
|
888
|
+
backup?: boolean;
|
|
889
|
+
sudo?: boolean;
|
|
890
|
+
append?: string;
|
|
891
|
+
line?: string;
|
|
892
|
+
regex?: string;
|
|
893
|
+
after?: string;
|
|
894
|
+
before?: string;
|
|
895
|
+
block?: string;
|
|
896
|
+
marker_begin?: string;
|
|
897
|
+
marker_end?: string;
|
|
898
|
+
}
|
|
899
|
+
interface FileEditResult {
|
|
900
|
+
changed: boolean;
|
|
901
|
+
success: boolean;
|
|
902
|
+
}
|
|
903
|
+
declare const _default$Q: TaskFn<FileEditParams, FileEditResult>;
|
|
904
|
+
|
|
905
|
+
interface FileGrepParams {
|
|
906
|
+
/** Path to the file to search */
|
|
907
|
+
file: string;
|
|
908
|
+
/** Pattern to search for (POSIX extended regex passed to grep -E) */
|
|
909
|
+
pattern: string;
|
|
910
|
+
/** If true, perform a case-insensitive match (adds -i flag). Default: false */
|
|
911
|
+
ignore_case?: boolean;
|
|
912
|
+
/** If true, show only lines that do NOT match (grep -v). Default: false */
|
|
913
|
+
invert_match?: boolean;
|
|
914
|
+
/** Match whole words only (grep -w). Default: false */
|
|
915
|
+
whole_word?: boolean;
|
|
916
|
+
/** Treat pattern as a fixed string, not regex (grep -F). Default: false */
|
|
917
|
+
fixed_string?: boolean;
|
|
918
|
+
/** Include line numbers in output (grep -n). Default: false */
|
|
919
|
+
line_numbers?: boolean;
|
|
920
|
+
/** Lines of context before each match (grep -B) */
|
|
921
|
+
before_context?: number;
|
|
922
|
+
/** Lines of context after each match (grep -A) */
|
|
923
|
+
after_context?: number;
|
|
924
|
+
/** Lines of context before & after (grep -C) */
|
|
925
|
+
context?: number;
|
|
926
|
+
/** Stop reading after NUM matching lines (grep -m) */
|
|
927
|
+
max_count?: number;
|
|
928
|
+
/** Return the matching lines in the result payload. Default: false */
|
|
929
|
+
return_lines?: boolean;
|
|
930
|
+
}
|
|
931
|
+
interface FileGrepResult {
|
|
932
|
+
/** True if one or more matches were found */
|
|
933
|
+
found: boolean;
|
|
934
|
+
/** Number of matching lines */
|
|
935
|
+
count: number;
|
|
936
|
+
/** Matching lines (included only when return_lines=true) */
|
|
937
|
+
lines?: string[];
|
|
938
|
+
}
|
|
939
|
+
declare const _default$P: TaskFn<FileGrepParams, FileGrepResult>;
|
|
940
|
+
|
|
941
|
+
type file_ChgrpParams = ChgrpParams;
|
|
942
|
+
type file_ChgrpResult = ChgrpResult;
|
|
943
|
+
type file_ChmodParams = ChmodParams;
|
|
944
|
+
type file_ChmodResult = ChmodResult;
|
|
945
|
+
type file_ChownParams = ChownParams;
|
|
946
|
+
type file_ChownResult = ChownResult;
|
|
947
|
+
type file_FileCopyParams = FileCopyParams;
|
|
948
|
+
type file_FileCopyResult = FileCopyResult;
|
|
949
|
+
type file_FileDeleteParams = FileDeleteParams;
|
|
950
|
+
type file_FileDeleteResult = FileDeleteResult;
|
|
951
|
+
type file_FileEditParams = FileEditParams;
|
|
952
|
+
type file_FileEditResult = FileEditResult;
|
|
953
|
+
type file_FileExistsParams = FileExistsParams;
|
|
954
|
+
type file_FileExistsResult = FileExistsResult;
|
|
955
|
+
type file_FileGrepParams = FileGrepParams;
|
|
956
|
+
type file_FileGrepResult = FileGrepResult;
|
|
957
|
+
type file_FileLinkParams = FileLinkParams;
|
|
958
|
+
type file_FileLinkResult = FileLinkResult;
|
|
959
|
+
type file_FileTouchParams = FileTouchParams;
|
|
960
|
+
type file_FileTouchResult = FileTouchResult;
|
|
961
|
+
declare namespace file {
|
|
962
|
+
export { type file_ChgrpParams as ChgrpParams, type file_ChgrpResult as ChgrpResult, type file_ChmodParams as ChmodParams, type file_ChmodResult as ChmodResult, type file_ChownParams as ChownParams, type file_ChownResult as ChownResult, type file_FileCopyParams as FileCopyParams, type file_FileCopyResult as FileCopyResult, type file_FileDeleteParams as FileDeleteParams, type file_FileDeleteResult as FileDeleteResult, type file_FileEditParams as FileEditParams, type file_FileEditResult as FileEditResult, type file_FileExistsParams as FileExistsParams, type file_FileExistsResult as FileExistsResult, type file_FileGrepParams as FileGrepParams, type file_FileGrepResult as FileGrepResult, type file_FileLinkParams as FileLinkParams, type file_FileLinkResult as FileLinkResult, type file_FileTouchParams as FileTouchParams, type file_FileTouchResult as FileTouchResult, _default$X as chgrp, _default$W as chmod, _default$Y as chown, _default$V as copy, _default$S as delete, _default$Q as edit, _default$U as exists, _default$P as grep, _default$R as link, _default$T as touch };
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
interface GitCloneParams {
|
|
966
|
+
repo: string;
|
|
967
|
+
dir: string;
|
|
968
|
+
}
|
|
969
|
+
interface GitCloneResult {
|
|
970
|
+
success: boolean;
|
|
971
|
+
}
|
|
972
|
+
declare const _default$O: TaskFn<GitCloneParams, GitCloneResult>;
|
|
973
|
+
|
|
974
|
+
interface GitPullParams {
|
|
975
|
+
/** The directory of the git repository on the host. */
|
|
976
|
+
directory: string;
|
|
977
|
+
/** Optional: Whether to use --rebase. Defaults to false. */
|
|
978
|
+
rebase?: boolean;
|
|
979
|
+
/** Optional: The remote to pull from. Defaults to 'origin'. */
|
|
980
|
+
remote?: string;
|
|
981
|
+
/** Optional: The branch to pull. Defaults to the current branch. */
|
|
982
|
+
branch?: string;
|
|
983
|
+
}
|
|
984
|
+
interface GitPullResult {
|
|
985
|
+
/** Indicates whether the pull operation was successful. */
|
|
986
|
+
success: boolean;
|
|
987
|
+
/** Error message if the pull operation failed. */
|
|
988
|
+
error?: string;
|
|
989
|
+
}
|
|
990
|
+
declare const _default$N: TaskFn<GitPullParams, GitPullResult>;
|
|
991
|
+
|
|
992
|
+
interface GitCheckoutParams {
|
|
993
|
+
/** The directory of the git repository on the host. */
|
|
994
|
+
directory: string;
|
|
995
|
+
/** The branch, tag, or commit hash to checkout. */
|
|
996
|
+
target: string;
|
|
997
|
+
/** Optional: If true, creates a new branch named <target> before checking out. Defaults to false. */
|
|
998
|
+
new_branch?: boolean;
|
|
999
|
+
}
|
|
1000
|
+
interface GitCheckoutResult {
|
|
1001
|
+
/** Indicates whether the checkout operation was successful. */
|
|
1002
|
+
success: boolean;
|
|
1003
|
+
/** Error message if the checkout operation failed. */
|
|
1004
|
+
error?: string;
|
|
1005
|
+
}
|
|
1006
|
+
declare const _default$M: TaskFn<GitCheckoutParams, GitCheckoutResult>;
|
|
1007
|
+
|
|
1008
|
+
type git_GitCheckoutParams = GitCheckoutParams;
|
|
1009
|
+
type git_GitCheckoutResult = GitCheckoutResult;
|
|
1010
|
+
type git_GitCloneParams = GitCloneParams;
|
|
1011
|
+
type git_GitCloneResult = GitCloneResult;
|
|
1012
|
+
type git_GitPullParams = GitPullParams;
|
|
1013
|
+
type git_GitPullResult = GitPullResult;
|
|
1014
|
+
declare namespace git {
|
|
1015
|
+
export { type git_GitCheckoutParams as GitCheckoutParams, type git_GitCheckoutResult as GitCheckoutResult, type git_GitCloneParams as GitCloneParams, type git_GitCloneResult as GitCloneResult, type git_GitPullParams as GitPullParams, type git_GitPullResult as GitPullResult, _default$M as checkout, _default$O as clone, _default$N as pull };
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
interface GroupCreateParams {
|
|
1019
|
+
group: string;
|
|
1020
|
+
/** Whether to run the command with sudo. Defaults to true. */
|
|
1021
|
+
sudo?: boolean;
|
|
1022
|
+
}
|
|
1023
|
+
interface GroupCreateResult {
|
|
1024
|
+
success: boolean;
|
|
1025
|
+
}
|
|
1026
|
+
declare const _default$L: TaskFn<GroupCreateParams, GroupCreateResult>;
|
|
1027
|
+
|
|
1028
|
+
interface GroupDeleteParams {
|
|
1029
|
+
group: string;
|
|
1030
|
+
/** Whether to run the command with sudo. Defaults to true. */
|
|
1031
|
+
sudo?: boolean;
|
|
1032
|
+
}
|
|
1033
|
+
interface GroupDeleteResult {
|
|
1034
|
+
success: boolean;
|
|
1035
|
+
error?: string;
|
|
1036
|
+
}
|
|
1037
|
+
declare const _default$K: TaskFn<GroupDeleteParams, GroupDeleteResult>;
|
|
1038
|
+
|
|
1039
|
+
interface GroupExistsParams {
|
|
1040
|
+
group: string;
|
|
1041
|
+
}
|
|
1042
|
+
interface GroupExistsResult {
|
|
1043
|
+
exists: boolean;
|
|
1044
|
+
}
|
|
1045
|
+
declare const _default$J: TaskFn<GroupExistsParams, GroupExistsResult>;
|
|
1046
|
+
|
|
1047
|
+
interface GroupInfo {
|
|
1048
|
+
name: string;
|
|
1049
|
+
gid: number;
|
|
1050
|
+
}
|
|
1051
|
+
interface GroupListParams {
|
|
1052
|
+
}
|
|
1053
|
+
interface GroupListResult {
|
|
1054
|
+
success: boolean;
|
|
1055
|
+
groups: GroupInfo[];
|
|
1056
|
+
}
|
|
1057
|
+
declare const _default$I: TaskFn<GroupListParams, GroupListResult>;
|
|
1058
|
+
|
|
1059
|
+
interface GroupModifyParams {
|
|
1060
|
+
/** The current name of the group. */
|
|
1061
|
+
group: string;
|
|
1062
|
+
/** The new name for the group. */
|
|
1063
|
+
new_name?: string;
|
|
1064
|
+
/** The new numerical value of the group's ID. */
|
|
1065
|
+
gid?: number;
|
|
1066
|
+
/** Whether to run the command with sudo. Defaults to true. */
|
|
1067
|
+
sudo?: boolean;
|
|
1068
|
+
}
|
|
1069
|
+
interface GroupModifyResult {
|
|
1070
|
+
success: boolean;
|
|
1071
|
+
changed: boolean;
|
|
1072
|
+
error?: string;
|
|
1073
|
+
}
|
|
1074
|
+
declare const _default$H: TaskFn<GroupModifyParams, GroupModifyResult>;
|
|
1075
|
+
|
|
1076
|
+
type group_GroupCreateParams = GroupCreateParams;
|
|
1077
|
+
type group_GroupCreateResult = GroupCreateResult;
|
|
1078
|
+
type group_GroupDeleteParams = GroupDeleteParams;
|
|
1079
|
+
type group_GroupDeleteResult = GroupDeleteResult;
|
|
1080
|
+
type group_GroupExistsParams = GroupExistsParams;
|
|
1081
|
+
type group_GroupExistsResult = GroupExistsResult;
|
|
1082
|
+
type group_GroupInfo = GroupInfo;
|
|
1083
|
+
type group_GroupListParams = GroupListParams;
|
|
1084
|
+
type group_GroupListResult = GroupListResult;
|
|
1085
|
+
type group_GroupModifyParams = GroupModifyParams;
|
|
1086
|
+
type group_GroupModifyResult = GroupModifyResult;
|
|
1087
|
+
declare namespace group {
|
|
1088
|
+
export { type group_GroupCreateParams as GroupCreateParams, type group_GroupCreateResult as GroupCreateResult, type group_GroupDeleteParams as GroupDeleteParams, type group_GroupDeleteResult as GroupDeleteResult, type group_GroupExistsParams as GroupExistsParams, type group_GroupExistsResult as GroupExistsResult, type group_GroupInfo as GroupInfo, type group_GroupListParams as GroupListParams, type group_GroupListResult as GroupListResult, type group_GroupModifyParams as GroupModifyParams, type group_GroupModifyResult as GroupModifyResult, _default$L as create, _default$K as delete, _default$J as exists, _default$I as list, _default$H as modify };
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
interface OSInfo {
|
|
1092
|
+
family: string;
|
|
1093
|
+
base_os: string;
|
|
1094
|
+
os: string;
|
|
1095
|
+
version: string;
|
|
1096
|
+
}
|
|
1097
|
+
interface LSBRelease {
|
|
1098
|
+
'Distributor ID': string;
|
|
1099
|
+
Description: string;
|
|
1100
|
+
Release: string;
|
|
1101
|
+
Codename: string;
|
|
1102
|
+
}
|
|
1103
|
+
interface LSCPUChild {
|
|
1104
|
+
field: string;
|
|
1105
|
+
data: string;
|
|
1106
|
+
children?: LSCPUChild[];
|
|
1107
|
+
}
|
|
1108
|
+
interface HostInfo {
|
|
1109
|
+
name: string;
|
|
1110
|
+
os: OSInfo;
|
|
1111
|
+
lsb_release: LSBRelease;
|
|
1112
|
+
lscpu: LSCPUChild[];
|
|
1113
|
+
}
|
|
1114
|
+
interface HostSummary {
|
|
1115
|
+
name: string;
|
|
1116
|
+
os: OSInfo;
|
|
1117
|
+
cpu: string;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
interface HostInfoResult {
|
|
1121
|
+
host: HostInfo;
|
|
1122
|
+
}
|
|
1123
|
+
declare const _default$G: TaskFn<ObjectType, HostInfoResult>;
|
|
1124
|
+
|
|
1125
|
+
interface HostSummaryResult {
|
|
1126
|
+
host: HostSummary;
|
|
1127
|
+
}
|
|
1128
|
+
declare const _default$F: TaskFn<ObjectType, HostSummaryResult>;
|
|
1129
|
+
|
|
1130
|
+
interface OsDetailsResult {
|
|
1131
|
+
success: boolean;
|
|
1132
|
+
error?: string;
|
|
1133
|
+
family: 'bsd' | 'darwin' | 'linux' | 'solaris' | 'windows' | 'unknown';
|
|
1134
|
+
/** The general OS type, e.g., 'debian', 'fedora', 'osx'. Derived from ID_LIKE in /etc/os-release for Linux. */
|
|
1135
|
+
os: string;
|
|
1136
|
+
/** The specific OS variant, e.g., 'ubuntu', 'arch'. Derived from ID in /etc/os-release for Linux. */
|
|
1137
|
+
variant: string;
|
|
1138
|
+
/** The OS version string. */
|
|
1139
|
+
version: string;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Determines the operating system family, specific OS, variant, and version.
|
|
1143
|
+
* @returns {OsDetailsResult}
|
|
1144
|
+
*/
|
|
1145
|
+
declare const _default$E: TaskFn<ObjectType, OsDetailsResult>;
|
|
1146
|
+
|
|
1147
|
+
interface HostnameParams {
|
|
1148
|
+
new_name?: string;
|
|
1149
|
+
}
|
|
1150
|
+
interface HostnameResult {
|
|
1151
|
+
hostname: string;
|
|
1152
|
+
updated: boolean;
|
|
1153
|
+
}
|
|
1154
|
+
declare const _default$D: TaskFn<HostnameParams, HostnameResult>;
|
|
1155
|
+
|
|
1156
|
+
type host_HostInfo = HostInfo;
|
|
1157
|
+
type host_HostInfoResult = HostInfoResult;
|
|
1158
|
+
type host_HostSummary = HostSummary;
|
|
1159
|
+
type host_HostSummaryResult = HostSummaryResult;
|
|
1160
|
+
type host_HostnameParams = HostnameParams;
|
|
1161
|
+
type host_HostnameResult = HostnameResult;
|
|
1162
|
+
type host_LSBRelease = LSBRelease;
|
|
1163
|
+
type host_LSCPUChild = LSCPUChild;
|
|
1164
|
+
type host_OSInfo = OSInfo;
|
|
1165
|
+
type host_OsDetailsResult = OsDetailsResult;
|
|
1166
|
+
declare namespace host {
|
|
1167
|
+
export { type host_HostInfo as HostInfo, type host_HostInfoResult as HostInfoResult, type host_HostSummary as HostSummary, type host_HostSummaryResult as HostSummaryResult, type host_HostnameParams as HostnameParams, type host_HostnameResult as HostnameResult, type host_LSBRelease as LSBRelease, type host_LSCPUChild as LSCPUChild, type host_OSInfo as OSInfo, type host_OsDetailsResult as OsDetailsResult, _default$D as hostname, _default$G as info, _default$E as os, _default$F as summary };
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
interface BasePkgParams {
|
|
1171
|
+
/** Package name or array of package names */
|
|
1172
|
+
package: string | string[];
|
|
1173
|
+
/** Run commands with sudo (default true) */
|
|
1174
|
+
sudo?: boolean;
|
|
1175
|
+
}
|
|
1176
|
+
interface PkgInstallParams extends BasePkgParams {
|
|
1177
|
+
}
|
|
1178
|
+
interface PkgRemoveParams extends BasePkgParams {
|
|
1179
|
+
}
|
|
1180
|
+
interface PkgInstallResult {
|
|
1181
|
+
success: boolean;
|
|
1182
|
+
error?: string;
|
|
1183
|
+
}
|
|
1184
|
+
interface PkgRemoveResult {
|
|
1185
|
+
success: boolean;
|
|
1186
|
+
error?: string;
|
|
1187
|
+
}
|
|
1188
|
+
interface PkgUpdateParams {
|
|
1189
|
+
/** Optional package name(s) to upgrade. Omit to upgrade all packages on the system */
|
|
1190
|
+
package?: string | string[];
|
|
1191
|
+
/** Run commands with sudo (default true) */
|
|
1192
|
+
sudo?: boolean;
|
|
1193
|
+
/** If true perform a full/dist upgrade when supported */
|
|
1194
|
+
fullUpgrade?: boolean;
|
|
1195
|
+
}
|
|
1196
|
+
interface PkgUpdateResult {
|
|
1197
|
+
success: boolean;
|
|
1198
|
+
error?: string;
|
|
1199
|
+
}
|
|
1200
|
+
interface PkgIsInstalledParams {
|
|
1201
|
+
package: string;
|
|
1202
|
+
}
|
|
1203
|
+
interface PkgIsInstalledResult {
|
|
1204
|
+
installed: boolean;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
declare const _default$C: TaskFn<PkgInstallParams, PkgInstallResult>;
|
|
1208
|
+
|
|
1209
|
+
declare const _default$B: TaskFn<PkgRemoveParams, PkgRemoveResult>;
|
|
1210
|
+
|
|
1211
|
+
declare const _default$A: TaskFn<PkgUpdateParams, PkgUpdateResult>;
|
|
1212
|
+
|
|
1213
|
+
interface PkgInfoParams {
|
|
1214
|
+
package: string;
|
|
1215
|
+
}
|
|
1216
|
+
interface PkgInfoResult {
|
|
1217
|
+
installed: boolean;
|
|
1218
|
+
success: boolean;
|
|
1219
|
+
error?: string;
|
|
1220
|
+
}
|
|
1221
|
+
declare const _default$z: TaskFn<PkgInfoParams, PkgInfoResult>;
|
|
1222
|
+
|
|
1223
|
+
declare const _default$y: TaskFn<PkgIsInstalledParams, PkgIsInstalledResult>;
|
|
1224
|
+
|
|
1225
|
+
type pkg_PkgInfoParams = PkgInfoParams;
|
|
1226
|
+
type pkg_PkgInfoResult = PkgInfoResult;
|
|
1227
|
+
type pkg_PkgInstallParams = PkgInstallParams;
|
|
1228
|
+
type pkg_PkgInstallResult = PkgInstallResult;
|
|
1229
|
+
type pkg_PkgIsInstalledParams = PkgIsInstalledParams;
|
|
1230
|
+
type pkg_PkgIsInstalledResult = PkgIsInstalledResult;
|
|
1231
|
+
type pkg_PkgRemoveParams = PkgRemoveParams;
|
|
1232
|
+
type pkg_PkgRemoveResult = PkgRemoveResult;
|
|
1233
|
+
type pkg_PkgUpdateParams = PkgUpdateParams;
|
|
1234
|
+
type pkg_PkgUpdateResult = PkgUpdateResult;
|
|
1235
|
+
declare namespace pkg {
|
|
1236
|
+
export { type pkg_PkgInfoParams as PkgInfoParams, type pkg_PkgInfoResult as PkgInfoResult, type pkg_PkgInstallParams as PkgInstallParams, type pkg_PkgInstallResult as PkgInstallResult, type pkg_PkgIsInstalledParams as PkgIsInstalledParams, type pkg_PkgIsInstalledResult as PkgIsInstalledResult, type pkg_PkgRemoveParams as PkgRemoveParams, type pkg_PkgRemoveResult as PkgRemoveResult, type pkg_PkgUpdateParams as PkgUpdateParams, type pkg_PkgUpdateResult as PkgUpdateResult, _default$z as info, _default$C as install, _default$y as isInstalled, _default$B as remove, _default$A as update };
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
interface K3supInstallParams {
|
|
1240
|
+
cluster?: boolean;
|
|
1241
|
+
context?: string;
|
|
1242
|
+
datastore?: string;
|
|
1243
|
+
/** Public hostname of node on which to install k3s (k3sup --host) */
|
|
1244
|
+
targetHost?: string;
|
|
1245
|
+
/** Public IP of node (k3sup --ip) */
|
|
1246
|
+
ip?: string;
|
|
1247
|
+
ipsec?: boolean;
|
|
1248
|
+
k3sChannel?: string;
|
|
1249
|
+
k3sExtraArgs?: string;
|
|
1250
|
+
k3sVersion?: string;
|
|
1251
|
+
local?: boolean;
|
|
1252
|
+
localPath?: string;
|
|
1253
|
+
merge?: boolean;
|
|
1254
|
+
noExtras?: boolean;
|
|
1255
|
+
printCommand?: boolean;
|
|
1256
|
+
printConfig?: boolean;
|
|
1257
|
+
skipInstall?: boolean;
|
|
1258
|
+
sshKey?: string;
|
|
1259
|
+
sshPort?: number;
|
|
1260
|
+
sudo?: boolean;
|
|
1261
|
+
tlsSan?: string;
|
|
1262
|
+
token?: string;
|
|
1263
|
+
/** Username for SSH login (k3sup --user) */
|
|
1264
|
+
user?: string;
|
|
1265
|
+
}
|
|
1266
|
+
interface K3supInstallResult {
|
|
1267
|
+
stdout: string;
|
|
1268
|
+
stderr: string;
|
|
1269
|
+
/** Kubeconfig content if --print-config was used */
|
|
1270
|
+
kubeconfig?: string;
|
|
1271
|
+
/** The command that would be run if --print-command was used */
|
|
1272
|
+
executedCommand?: string;
|
|
1273
|
+
}
|
|
1274
|
+
declare const _default$x: TaskFn<K3supInstallParams, K3supInstallResult>;
|
|
1275
|
+
|
|
1276
|
+
type k3s_K3supInstallParams = K3supInstallParams;
|
|
1277
|
+
type k3s_K3supInstallResult = K3supInstallResult;
|
|
1278
|
+
declare namespace k3s {
|
|
1279
|
+
export { type k3s_K3supInstallParams as K3supInstallParams, type k3s_K3supInstallResult as K3supInstallResult, _default$x as k3supInstall };
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
interface CopyIdParams {
|
|
1283
|
+
public_key: string;
|
|
1284
|
+
user?: string;
|
|
1285
|
+
}
|
|
1286
|
+
interface CopyIdResult {
|
|
1287
|
+
success: boolean;
|
|
1288
|
+
}
|
|
1289
|
+
declare const _default$w: TaskFn<CopyIdParams, CopyIdResult>;
|
|
1290
|
+
|
|
1291
|
+
declare namespace ssh {
|
|
1292
|
+
export { _default$w as copy_id };
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
interface SudoersCheckParams {
|
|
1296
|
+
file?: string;
|
|
1297
|
+
}
|
|
1298
|
+
interface SudoersCheckResult {
|
|
1299
|
+
success: boolean;
|
|
1300
|
+
}
|
|
1301
|
+
declare const _default$v: TaskFn<SudoersCheckParams, SudoersCheckResult>;
|
|
1302
|
+
|
|
1303
|
+
interface GrantNopasswdParams {
|
|
1304
|
+
/** The username to grant passwordless sudo privileges. */
|
|
1305
|
+
user: string;
|
|
1306
|
+
/** The name of the file to create in /etc/sudoers.d/. Defaults to the username. */
|
|
1307
|
+
name?: string;
|
|
1308
|
+
}
|
|
1309
|
+
interface GrantNopasswdResult {
|
|
1310
|
+
/** True if the operation was successful. */
|
|
1311
|
+
success: boolean;
|
|
1312
|
+
/** The path to the created sudoers file. */
|
|
1313
|
+
filePath: string;
|
|
1314
|
+
}
|
|
1315
|
+
declare const _default$u: TaskFn<GrantNopasswdParams, GrantNopasswdResult>;
|
|
1316
|
+
|
|
1317
|
+
declare namespace sudoers {
|
|
1318
|
+
export { _default$v as check, _default$u as grantNopasswd };
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
interface RebootParams {
|
|
1322
|
+
/**
|
|
1323
|
+
* A message to broadcast to all users before rebooting.
|
|
1324
|
+
*/
|
|
1325
|
+
message?: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* The time to wait before rebooting. E.g., "+5" for 5 minutes, "now" for immediately.
|
|
1328
|
+
* @default "now"
|
|
1329
|
+
*/
|
|
1330
|
+
time?: string;
|
|
1331
|
+
/**
|
|
1332
|
+
* Whether to run the command with sudo. Defaults to true.
|
|
1333
|
+
*/
|
|
1334
|
+
sudo?: boolean;
|
|
1335
|
+
}
|
|
1336
|
+
interface RebootResult {
|
|
1337
|
+
success: boolean;
|
|
1338
|
+
error?: string;
|
|
1339
|
+
status: string;
|
|
1340
|
+
}
|
|
1341
|
+
declare const _default$t: TaskFn<RebootParams, RebootResult>;
|
|
1342
|
+
|
|
1343
|
+
interface ShutdownParams {
|
|
1344
|
+
/**
|
|
1345
|
+
* A message to broadcast to all users before shutting down.
|
|
1346
|
+
*/
|
|
1347
|
+
message?: string;
|
|
1348
|
+
/**
|
|
1349
|
+
* The time to wait before shutting down. E.g., "+5" for 5 minutes, "now" for immediately.
|
|
1350
|
+
* @default "now"
|
|
1351
|
+
*/
|
|
1352
|
+
time?: string;
|
|
1353
|
+
/**
|
|
1354
|
+
* Whether to run the command with sudo. Defaults to true.
|
|
1355
|
+
*/
|
|
1356
|
+
sudo?: boolean;
|
|
1357
|
+
}
|
|
1358
|
+
interface ShutdownResult {
|
|
1359
|
+
success: boolean;
|
|
1360
|
+
error?: string;
|
|
1361
|
+
status: string;
|
|
1362
|
+
}
|
|
1363
|
+
declare const _default$s: TaskFn<ShutdownParams, ShutdownResult>;
|
|
1364
|
+
|
|
1365
|
+
interface RebootNeededParams {
|
|
1366
|
+
}
|
|
1367
|
+
interface RebootNeededResult {
|
|
1368
|
+
reboot_needed: boolean;
|
|
1369
|
+
success: boolean;
|
|
1370
|
+
error?: string;
|
|
1371
|
+
}
|
|
1372
|
+
declare const _default$r: TaskFn<RebootNeededParams, RebootNeededResult>;
|
|
1373
|
+
|
|
1374
|
+
interface RebootIfNeededParams {
|
|
1375
|
+
delay?: number;
|
|
1376
|
+
message?: string;
|
|
1377
|
+
}
|
|
1378
|
+
interface RebootIfNeededResult {
|
|
1379
|
+
rebooting: boolean;
|
|
1380
|
+
success: boolean;
|
|
1381
|
+
error?: string;
|
|
1382
|
+
}
|
|
1383
|
+
declare const _default$q: TaskFn<RebootIfNeededParams, RebootIfNeededResult>;
|
|
1384
|
+
|
|
1385
|
+
type system_RebootIfNeededParams = RebootIfNeededParams;
|
|
1386
|
+
type system_RebootIfNeededResult = RebootIfNeededResult;
|
|
1387
|
+
type system_RebootNeededParams = RebootNeededParams;
|
|
1388
|
+
type system_RebootNeededResult = RebootNeededResult;
|
|
1389
|
+
type system_RebootParams = RebootParams;
|
|
1390
|
+
type system_RebootResult = RebootResult;
|
|
1391
|
+
type system_ShutdownParams = ShutdownParams;
|
|
1392
|
+
type system_ShutdownResult = ShutdownResult;
|
|
1393
|
+
declare namespace system {
|
|
1394
|
+
export { type system_RebootIfNeededParams as RebootIfNeededParams, type system_RebootIfNeededResult as RebootIfNeededResult, type system_RebootNeededParams as RebootNeededParams, type system_RebootNeededResult as RebootNeededResult, type system_RebootParams as RebootParams, type system_RebootResult as RebootResult, type system_ShutdownParams as ShutdownParams, type system_ShutdownResult as ShutdownResult, _default$t as reboot, _default$q as rebootIfNeeded, _default$r as rebootNeeded, _default$s as shutdown };
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
interface DisableServiceParams {
|
|
1398
|
+
service: string;
|
|
1399
|
+
sudo?: boolean;
|
|
1400
|
+
}
|
|
1401
|
+
interface DisableServiceResult {
|
|
1402
|
+
success: boolean;
|
|
1403
|
+
}
|
|
1404
|
+
declare const _default$p: TaskFn<DisableServiceParams, DisableServiceResult>;
|
|
1405
|
+
|
|
1406
|
+
interface SystemdEnableParams {
|
|
1407
|
+
service: string;
|
|
1408
|
+
sudo?: boolean;
|
|
1409
|
+
}
|
|
1410
|
+
interface SystemdEnableResult {
|
|
1411
|
+
success: boolean;
|
|
1412
|
+
}
|
|
1413
|
+
declare const _default$o: TaskFn<SystemdEnableParams, SystemdEnableResult>;
|
|
1414
|
+
|
|
1415
|
+
interface SystemdRestartParams {
|
|
1416
|
+
service: string;
|
|
1417
|
+
sudo?: boolean;
|
|
1418
|
+
}
|
|
1419
|
+
interface SystemdRestartResult {
|
|
1420
|
+
success: boolean;
|
|
1421
|
+
}
|
|
1422
|
+
declare const _default$n: TaskFn<SystemdRestartParams, SystemdRestartResult>;
|
|
1423
|
+
|
|
1424
|
+
interface SystemdStartParams {
|
|
1425
|
+
service: string;
|
|
1426
|
+
sudo?: boolean;
|
|
1427
|
+
}
|
|
1428
|
+
interface SystemdStartResult {
|
|
1429
|
+
success: boolean;
|
|
1430
|
+
}
|
|
1431
|
+
declare const _default$m: TaskFn<SystemdStartParams, SystemdStartResult>;
|
|
1432
|
+
|
|
1433
|
+
interface SystemdStopParams {
|
|
1434
|
+
service: string;
|
|
1435
|
+
sudo?: boolean;
|
|
1436
|
+
}
|
|
1437
|
+
interface SystemdStopResult {
|
|
1438
|
+
success: boolean;
|
|
1439
|
+
}
|
|
1440
|
+
declare const _default$l: TaskFn<SystemdStopParams, SystemdStopResult>;
|
|
1441
|
+
|
|
1442
|
+
interface SystemdReloadParams {
|
|
1443
|
+
service: string;
|
|
1444
|
+
sudo?: boolean;
|
|
1445
|
+
}
|
|
1446
|
+
interface SystemdReloadResult {
|
|
1447
|
+
success: boolean;
|
|
1448
|
+
}
|
|
1449
|
+
declare const _default$k: TaskFn<SystemdReloadParams, SystemdReloadResult>;
|
|
1450
|
+
|
|
1451
|
+
interface SystemdStatusParams {
|
|
1452
|
+
service: string;
|
|
1453
|
+
sudo?: boolean;
|
|
1454
|
+
}
|
|
1455
|
+
interface SystemdStatusResult {
|
|
1456
|
+
active: boolean;
|
|
1457
|
+
}
|
|
1458
|
+
declare const _default$j: TaskFn<SystemdStatusParams, SystemdStatusResult>;
|
|
1459
|
+
|
|
1460
|
+
declare namespace systemd {
|
|
1461
|
+
export { _default$p as disable, _default$o as enable, _default$k as reload, _default$n as restart, _default$m as start, _default$j as status, _default$l as stop };
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
interface TemplateWriteParams {
|
|
1465
|
+
template?: string;
|
|
1466
|
+
template_file?: string;
|
|
1467
|
+
variables: Record<string, any>;
|
|
1468
|
+
to: string;
|
|
1469
|
+
mode?: string;
|
|
1470
|
+
owner?: string;
|
|
1471
|
+
group?: string;
|
|
1472
|
+
sudo?: boolean;
|
|
1473
|
+
}
|
|
1474
|
+
interface TemplateWriteResult {
|
|
1475
|
+
success: boolean;
|
|
1476
|
+
path: string;
|
|
1477
|
+
}
|
|
1478
|
+
declare const _default$i: TaskFn<TemplateWriteParams, TemplateWriteResult>;
|
|
1479
|
+
|
|
1480
|
+
declare namespace template {
|
|
1481
|
+
export { _default$i as write };
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
interface UfwDenyParams {
|
|
1485
|
+
from_addr?: string;
|
|
1486
|
+
from_port?: number;
|
|
1487
|
+
to_addr?: string;
|
|
1488
|
+
to_port?: number;
|
|
1489
|
+
}
|
|
1490
|
+
interface UfwDenyResult {
|
|
1491
|
+
success: boolean;
|
|
1492
|
+
}
|
|
1493
|
+
declare const _default$h: TaskFn<UfwDenyParams, UfwDenyResult>;
|
|
1494
|
+
|
|
1495
|
+
interface UfwDisableParams {
|
|
1496
|
+
}
|
|
1497
|
+
interface UfwDisableResult {
|
|
1498
|
+
success: boolean;
|
|
1499
|
+
}
|
|
1500
|
+
declare const _default$g: TaskFn<UfwDisableParams, UfwDisableResult>;
|
|
1501
|
+
|
|
1502
|
+
interface UfwEnableParams {
|
|
1503
|
+
}
|
|
1504
|
+
interface UfwEnableResult {
|
|
1505
|
+
success: boolean;
|
|
1506
|
+
}
|
|
1507
|
+
declare const _default$f: TaskFn<UfwEnableParams, UfwEnableResult>;
|
|
1508
|
+
|
|
1509
|
+
interface UfwInstallParams {
|
|
1510
|
+
}
|
|
1511
|
+
interface UfwInstallResult {
|
|
1512
|
+
success: boolean;
|
|
1513
|
+
}
|
|
1514
|
+
declare const _default$e: TaskFn<UfwInstallParams, UfwInstallResult>;
|
|
1515
|
+
|
|
1516
|
+
interface UfwReloadParams {
|
|
1517
|
+
}
|
|
1518
|
+
interface UfwReloadResult {
|
|
1519
|
+
success: boolean;
|
|
1520
|
+
}
|
|
1521
|
+
declare const _default$d: TaskFn<UfwReloadParams, UfwReloadResult>;
|
|
1522
|
+
|
|
1523
|
+
declare namespace ufw {
|
|
1524
|
+
export { _default$h as deny, _default$g as disable, _default$f as enable, _default$e as install, _default$d as reload };
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
interface AddGroupsParams {
|
|
1528
|
+
user: string;
|
|
1529
|
+
groups: string[];
|
|
1530
|
+
}
|
|
1531
|
+
interface AddGroupsResult {
|
|
1532
|
+
success: boolean;
|
|
1533
|
+
}
|
|
1534
|
+
declare const _default$c: TaskFn<AddGroupsParams, AddGroupsResult>;
|
|
1535
|
+
|
|
1536
|
+
interface CreateUserParams {
|
|
1537
|
+
user: string;
|
|
1538
|
+
create_home?: boolean;
|
|
1539
|
+
create_group?: boolean;
|
|
1540
|
+
system?: boolean;
|
|
1541
|
+
sudo?: boolean;
|
|
1542
|
+
}
|
|
1543
|
+
interface CreateUserResult {
|
|
1544
|
+
success: boolean;
|
|
1545
|
+
}
|
|
1546
|
+
declare const _default$b: TaskFn<CreateUserParams, CreateUserResult>;
|
|
1547
|
+
|
|
1548
|
+
interface UserExistsParams {
|
|
1549
|
+
user: string;
|
|
1550
|
+
}
|
|
1551
|
+
interface UserExistsResult {
|
|
1552
|
+
exists: boolean;
|
|
1553
|
+
}
|
|
1554
|
+
declare const _default$a: TaskFn<UserExistsParams, UserExistsResult>;
|
|
1555
|
+
|
|
1556
|
+
interface GetGidParams {
|
|
1557
|
+
user: string;
|
|
1558
|
+
}
|
|
1559
|
+
interface GetGidResult {
|
|
1560
|
+
success: boolean;
|
|
1561
|
+
gid: string;
|
|
1562
|
+
}
|
|
1563
|
+
declare const _default$9: TaskFn<GetGidParams, GetGidResult>;
|
|
1564
|
+
|
|
1565
|
+
interface GetGroupsParams {
|
|
1566
|
+
user: string;
|
|
1567
|
+
}
|
|
1568
|
+
interface GetGroupsResult {
|
|
1569
|
+
success: boolean;
|
|
1570
|
+
groups: string[];
|
|
1571
|
+
}
|
|
1572
|
+
declare const _default$8: TaskFn<GetGroupsParams, GetGroupsResult>;
|
|
1573
|
+
|
|
1574
|
+
interface GetUidParams {
|
|
1575
|
+
user: string;
|
|
1576
|
+
}
|
|
1577
|
+
interface GetUidResult {
|
|
1578
|
+
success: boolean;
|
|
1579
|
+
uid: string;
|
|
1580
|
+
}
|
|
1581
|
+
declare const _default$7: TaskFn<GetUidParams, GetUidResult>;
|
|
1582
|
+
|
|
1583
|
+
interface GetUsernameResult {
|
|
1584
|
+
success: boolean;
|
|
1585
|
+
username: string;
|
|
1586
|
+
}
|
|
1587
|
+
declare const _default$6: TaskFn<{}, GetUsernameResult>;
|
|
1588
|
+
|
|
1589
|
+
interface UserHomeDirParams {
|
|
1590
|
+
user: string;
|
|
1591
|
+
}
|
|
1592
|
+
interface UserHomeDirResult {
|
|
1593
|
+
path: string;
|
|
1594
|
+
exists: boolean;
|
|
1595
|
+
}
|
|
1596
|
+
declare const _default$5: TaskFn<UserHomeDirParams, UserHomeDirResult>;
|
|
1597
|
+
|
|
1598
|
+
interface SetUserGroupsParams {
|
|
1599
|
+
user: string;
|
|
1600
|
+
groups: string[];
|
|
1601
|
+
}
|
|
1602
|
+
interface SetUserGroupsResult {
|
|
1603
|
+
success: boolean;
|
|
1604
|
+
}
|
|
1605
|
+
declare const _default$4: TaskFn<SetUserGroupsParams, SetUserGroupsResult>;
|
|
1606
|
+
|
|
1607
|
+
interface SetUserShellParams {
|
|
1608
|
+
user: string;
|
|
1609
|
+
shell: string;
|
|
1610
|
+
}
|
|
1611
|
+
interface SetUserShellResult {
|
|
1612
|
+
success: boolean;
|
|
1613
|
+
}
|
|
1614
|
+
declare const _default$3: TaskFn<SetUserShellParams, SetUserShellResult>;
|
|
1615
|
+
|
|
1616
|
+
interface UserDeleteParams {
|
|
1617
|
+
user: string;
|
|
1618
|
+
/** If true, remove the user's home directory and mail spool. */
|
|
1619
|
+
remove?: boolean;
|
|
1620
|
+
/** Whether to run the command with sudo. Defaults to true. */
|
|
1621
|
+
sudo?: boolean;
|
|
1622
|
+
}
|
|
1623
|
+
interface UserDeleteResult {
|
|
1624
|
+
success: boolean;
|
|
1625
|
+
error?: string;
|
|
1626
|
+
}
|
|
1627
|
+
declare const _default$2: TaskFn<UserDeleteParams, UserDeleteResult>;
|
|
1628
|
+
|
|
1629
|
+
interface ModifyUserParams {
|
|
1630
|
+
user: string;
|
|
1631
|
+
comment?: string;
|
|
1632
|
+
home?: string;
|
|
1633
|
+
expiredate?: string;
|
|
1634
|
+
gid?: string;
|
|
1635
|
+
groups?: string[];
|
|
1636
|
+
login?: string;
|
|
1637
|
+
lock?: boolean;
|
|
1638
|
+
unlock?: boolean;
|
|
1639
|
+
move_home?: boolean;
|
|
1640
|
+
shell?: string;
|
|
1641
|
+
uid?: string;
|
|
1642
|
+
sudo?: boolean;
|
|
1643
|
+
}
|
|
1644
|
+
interface ModifyUserResult {
|
|
1645
|
+
success: boolean;
|
|
1646
|
+
}
|
|
1647
|
+
declare const _default$1: TaskFn<ModifyUserParams, ModifyUserResult>;
|
|
1648
|
+
|
|
1649
|
+
type user_AddGroupsParams = AddGroupsParams;
|
|
1650
|
+
type user_AddGroupsResult = AddGroupsResult;
|
|
1651
|
+
type user_CreateUserParams = CreateUserParams;
|
|
1652
|
+
type user_CreateUserResult = CreateUserResult;
|
|
1653
|
+
type user_GetGidParams = GetGidParams;
|
|
1654
|
+
type user_GetGidResult = GetGidResult;
|
|
1655
|
+
type user_GetGroupsParams = GetGroupsParams;
|
|
1656
|
+
type user_GetGroupsResult = GetGroupsResult;
|
|
1657
|
+
type user_GetUidParams = GetUidParams;
|
|
1658
|
+
type user_GetUidResult = GetUidResult;
|
|
1659
|
+
type user_GetUsernameResult = GetUsernameResult;
|
|
1660
|
+
type user_SetUserGroupsParams = SetUserGroupsParams;
|
|
1661
|
+
type user_SetUserGroupsResult = SetUserGroupsResult;
|
|
1662
|
+
type user_SetUserShellParams = SetUserShellParams;
|
|
1663
|
+
type user_SetUserShellResult = SetUserShellResult;
|
|
1664
|
+
type user_UserDeleteParams = UserDeleteParams;
|
|
1665
|
+
type user_UserDeleteResult = UserDeleteResult;
|
|
1666
|
+
type user_UserExistsParams = UserExistsParams;
|
|
1667
|
+
type user_UserExistsResult = UserExistsResult;
|
|
1668
|
+
type user_UserHomeDirParams = UserHomeDirParams;
|
|
1669
|
+
type user_UserHomeDirResult = UserHomeDirResult;
|
|
1670
|
+
declare namespace user {
|
|
1671
|
+
export { type user_AddGroupsParams as AddGroupsParams, type user_AddGroupsResult as AddGroupsResult, type user_CreateUserParams as CreateUserParams, type user_CreateUserResult as CreateUserResult, type user_GetGidParams as GetGidParams, type user_GetGidResult as GetGidResult, type user_GetGroupsParams as GetGroupsParams, type user_GetGroupsResult as GetGroupsResult, type user_GetUidParams as GetUidParams, type user_GetUidResult as GetUidResult, type user_GetUsernameResult as GetUsernameResult, type user_SetUserGroupsParams as SetUserGroupsParams, type user_SetUserGroupsResult as SetUserGroupsResult, type user_SetUserShellParams as SetUserShellParams, type user_SetUserShellResult as SetUserShellResult, type user_UserDeleteParams as UserDeleteParams, type user_UserDeleteResult as UserDeleteResult, type user_UserExistsParams as UserExistsParams, type user_UserExistsResult as UserExistsResult, type user_UserHomeDirParams as UserHomeDirParams, type user_UserHomeDirResult as UserHomeDirResult, _default$c as addGroups, _default$b as create, _default$2 as delete, _default$a as exists, _default$9 as getGid, _default$8 as getGroups, _default$7 as getUid, _default$6 as getUsername, _default$5 as homeDir, _default$1 as modify, _default$4 as setGroups, _default$3 as setShell };
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
declare const _default: {
|
|
1675
|
+
echo: TaskFn<EchoParams, EchoResult>;
|
|
1676
|
+
whoami: TaskFn<WhoamiParams, WhoamiResult>;
|
|
1677
|
+
dir: typeof dir;
|
|
1678
|
+
file: typeof file;
|
|
1679
|
+
git: typeof git;
|
|
1680
|
+
group: typeof group;
|
|
1681
|
+
host: typeof host;
|
|
1682
|
+
pkg: typeof pkg;
|
|
1683
|
+
k3s: typeof k3s;
|
|
1684
|
+
ssh: typeof ssh;
|
|
1685
|
+
sudoers: typeof sudoers;
|
|
1686
|
+
system: typeof system;
|
|
1687
|
+
systemd: typeof systemd;
|
|
1688
|
+
template: typeof template;
|
|
1689
|
+
ufw: typeof ufw;
|
|
1690
|
+
user: typeof user;
|
|
1691
|
+
};
|
|
1692
|
+
|
|
1693
|
+
export { App, CHECKMARK, type ChgrpParams, type ChgrpResult, type ChmodParams, type ChmodResult, type ChownParams, type ChownResult, Cli, CommandResult, type EnvVarObj, type FileSystemOperations$1 as FileSystemOperations, Host, type IInvocation, type IRuntime, type InputMap, Invocation, LocalRuntime, type LogLevel, type ObjectType, type OsDetailsResult, type PkgInfoParams, type PkgInfoResult, type PkgInstallParams, type PkgInstallResult, type PkgIsInstalledParams, type PkgIsInstalledResult, type PkgRemoveParams, type PkgRemoveResult, type PkgUpdateParams, type PkgUpdateResult, type RebootIfNeededParams, type RebootIfNeededResult, type RebootNeededParams, type RebootNeededResult, type RebootParams, type RebootResult, RemoteRuntime, type RunFn, type RunFnReturnValue, SUDO_PROMPT_REGEX, type ShutdownParams, type ShutdownResult, Task, type TaskContext, type TaskFn, type TaskParams, type TaskPartialFn, Verbosity, XMARK, _default as core, task, withSudo };
|