Repository: vmware/build-tools-for-vmware-aria
Pull request #640: [vro-types] Improve type definitions of `SSHSession` class members and functions
Author: login: unbreakabl3
Labels: name: kind/enhancement
description: Enhancement or improvement of existing features
name: area/vro-types
description: Relates to changes to the type definitions
name: lang/typescript
description: Related to typescript code
name: version/minor
description: Introduces a non-breaking feature or change
Created: 2025-03-04T10:01:38Z | Merged: 2025-03-07T06:46:40Z

…initions and additional methods

<!-- Thank you for taking the time to contribute! -->

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### Description

Improve type definitions of SSHSession class functions according to the API. Add missing methods. Fix types. Fix descriptions. Fix class attributes.

### Checklist

<!--
Put an `x` in the boxes that apply. You can also fill these out after creating the PR.
This is simply a reminder of what we are going to look for before merging your code.
If you skip any of the tasks from the checklist, add a comment explaining why that task might be irrelevant to your contribution.

Sample PR title:
[artifact-manager] (#220) Update the package.json template for generating ABX actions
-->

- [ ] I have added relevant error handling and logging messages to help troubleshooting
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation, relevant usage information (if applicable)
- [ ] I have updated the PR title with affected component, related issue number and a short summary of the changes introduced
- [ ] I have added labels for implementation kind (kind/*) and version type (version/*)
- [ ] I have tested against live environment, if applicable
- [ ] I have synced any structure and/or content vRA-NG improvements with vra-ng and ts-vra-ng archetypes (if applicable)
- [ ] I have my changes rebased and squashed to the minimal number of relevant commits. **Notice: don't squash all commits**
- [x] I have added a descriptive commit message with a short title, including a `Fixed #XXX -` or `Closed #XXX -` prefix to auto-close the issue

### Testing

<!-- Please provide a brief description of how were the changes tested -  -->

### Release Notes

The return type of some function definitions in the SSHSession class was not correctly defined and few methods were missing.

### Related issues and PRs

<!-- Link any related issues and pull requests here using #number or user/repo#number -->



Diff:
diff --git a/docs/versions/latest/Release.md b/docs/versions/latest/Release.md
index e328b5945..64cc7a413 100644
--- a/docs/versions/latest/Release.md
+++ b/docs/versions/latest/Release.md
@@ -39,6 +39,27 @@
 [//]: # (Optional But higlhy recommended Specify *NONE* if missing)
 [//]: # (#### Relevant Documentation:)
 
+### *Improve SSHSession class*
+
+Improve type definitions of SSHSession class functions according to the API. Add missing methods. Fix types. Fix descriptions. Fix class attributes.
+  
+#### Previous Behavior
+
+The return type of some function definitions in the SSHSession class was not correctly defined and few methods were missing.
+
+#### New Behavior
+
+The following methods were added to the SSHSession class:
+
+- `setConnectTimeout`
+- `getConnectTimeout`
+- `setTimeout`
+- `getTimeout`
+- `setKeepAliveInterval`
+- `getKeepAliveInterval`
+- `setKeepAliveCountMax`
+- `getKeepAliveCountMax`
+
 ## Upgrade procedure
 
 [//]: # (Explain in details if something needs to be done)
diff --git a/vro-types/o11n-plugin-ssh/index.d.ts b/vro-types/o11n-plugin-ssh/index.d.ts
index 18c34fa04..ce45ee480 100644
--- a/vro-types/o11n-plugin-ssh/index.d.ts
+++ b/vro-types/o11n-plugin-ssh/index.d.ts
@@ -115,13 +115,13 @@ declare class SSHCommand {
  * SSH Session to username@host:port. This object replace the old 'SSHCommand' object.
  */
 declare class SSHSession {
-	exitCode: number;
+	readonly exitCode: number;
 	cmd: string;
-	pty: string;
+	pty: boolean;
 	terminal: string;
-	output: string;
-	error: string;
-	state: string;
+	readonly output: string;
+	readonly error: string;
+	readonly state: string;
 	soTimeout: number;
 	constructor()
 	/**
@@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: SecureString): any;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: string, passphrase: SecureString): any;
 	/**
-	 * Connect the session using Public key Authentication.
+	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentity(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentity(privateKeyPath: string, passphrase: SecureString): any;
 	/**
 	 * Connect the session using either password or Public key Authentication.
 	 * @param isPassword
 	 * @param password
 	 * @param privateKeyPath
 	 */
-	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: any): void;
+	connectWithPasswordOrIdentity(isPassword: boolean, password: SecureString, privateKeyPath: string): any;
 	/**
 	 * The provided userInfo object is used for callback for the keyboard-interactive authentication and for the other types of messages send from the remote server during authentication. The function signatures should be:
 	 *
@@ -175,12 +175,48 @@ declare class SSHSession {
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): any;
+	/**
+	 * Set connection timeout, in milliseconds
+	 * @param setConnectTimeout
+	 */
+	setConnectTimeout(timeout: number): void;
+	/**
+	 * Get connection timeout
+	 */
+	getConnectTimeout(): number;
+	/**
+	 * Set socket timeout, in milliseconds
+	 * @param timeout
+	 */
+	setTimeout(timeout: number): void;
+	/**
+	 * Get socket timeout
+	 */
+	getTimeout(): number;
+	/**
+	 * Set an interval, in milliseconds, to send keep-alive message. If zero, keep-alive message will not be sent.
+	 * @param interval
+	 */
+	setKeepAliveInterval(interval: number): void;
+	/**
+	 * Get keep-alive interval
+	 */
+	getKeepAliveInterval(): number;
+	/**
+	 * Set the number of keep-alive messages that may be sent before the connection is considered to have failed.
+	 * @param count
+	 */
+	setKeepAliveCountMax(count: number): void;
+	/**
+	 * Get keep-alive messages count threshold
+	 */
+	getKeepAliveCountMax(): number;
 	/**
 	 * Sets the encoding that will be used to process the results from executeCommand method
 	 * @param encoding
 	 */
-	setEncoding(encoding: string): void;
+	setEncoding(encoding: string): any;
 	/**
 	 * Returns the encoding used by this SSHSession
 	 */
@@ -188,68 +224,68 @@ declare class SSHSession {
 	/**
 	 * Execute a single command and return immediately. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occured.
 	 */
-	execute(): void;
+	execute(): any;
 	/**
 	 * Execute a single command and wait until end. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occurred.
 	 * @param file
 	 */
-	executeAndLog(file: any): void;
+	executeAndLog(file: any): any;
 	/**
 	 * Execute a single command and wait until completed, return the stdout result if synchronous. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occured.
 	 * @param cmd
 	 * @param wait
 	 */
-	executeCommand(cmd: string, wait: boolean): void;
+	executeCommand(cmd: string, wait: boolean): string;
 	/**
 	 * Copy a file FROM a remote host TO the vCO Server. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Returns 0 if successful, or -1 if an error has occurred.
 	 * @param remoteFile
 	 * @param localFile
 	 */
-	getFile(remoteFile: any, localFile: any): number;
+	getFile(remoteFile: string, localFile: string): number;
 	/**
 	 * Copy a file TO a remote host FROM the vCO Server. Returns 0 if successful, or -1 if an error has occurred. If a remote file name is provided, the destination file name will use it. If only the destination directory is specified, then the destination file will use the source file name. The destination directory must exist.
 	 *
 	 * @param localFile
 	 * @param remoteFile
 	 */
-	putFile(localFile: any, remoteFile: any): number;
+	putFile(localFile: string, remoteFile: string): number;
 	/**
 	 * Recursively search and return matching pattern file and directory. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 * @param pattern
 	 */
-	findAll(basePath: any, pattern: string): string[];
+	findAll(basePath: string, pattern: string): string[];
 	/**
 	 * Recursively search and return matching pattern file ONLY. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 * @param pattern
 	 */
-	findFile(basePath: any, pattern: string): string[];
+	findFile(basePath: string, pattern: string): string[];
 	/**
 	 * Recursively search and return matching pattern directory ONLY.  This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 * @param pattern
 	 */
-	findDir(basePath: any, pattern: string): string[];
+	findDir(basePath: string, pattern: string): string[];
 	/**
 	 * List files and directories in path. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 */
-	listAll(basePath: any): string[];
+	listAll(basePath: string): string[];
 	/**
 	 * List files ONLY in path. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 */
-	listFile(basePath: any): string[];
+	listFile(basePath: string): string[];
 	/**
 	 * List directories ONLY in path. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 */
-	listDir(basePath: any): string[];
+	listDir(basePath: string): string[];
 	/**
 	 * Disconnects the current session if open. The session parameters are given in the object constructor (host, username, password); a session is opened automatically when any method is called that requires a session (like execute). Once open, the session remains open; any method uses the same session but opens a new channel and the closes it when done. You need to use this disconnect method to close the session.
 	 */
-	disconnect(): void;
+	disconnect(): any;
 }
 
 /**


Reviews:
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:54:03Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:55:20Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:56:02Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:56:19Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:56:52Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:57:10Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T10:57:25Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T11:06:37Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T11:07:04Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T11:07:13Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T11:07:23Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T11:07:35Z
user: login: unbreakabl3
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T11:22:00Z
user: login: unbreakabl3
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T11:25:22Z
user: login: unbreakabl3
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T12:36:04Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-05T06:57:07Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-05T06:57:25Z
user: login: unbreakabl3
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T08:12:27Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T07:03:54Z
user: login: VenelinBakalov
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T14:36:14Z
user: login: VenelinBakalov
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-07T06:45:29Z

Review comments:
diff_hunk: @@ -39,6 +39,27 @@
 [//]: # (Optional But higlhy recommended Specify *NONE* if missing)
 [//]: # (#### Relevant Documentation:)
 
+### *Improve SSHSession class*
+
+Improve type definitions of SSHSession class functions according to the API. Add missing methods. Fix types. Fix descriptions. Fix class attributes.
path: docs/versions/latest/Release.md
user: login: VenelinBakalov
body: That's a very good catch, thanks for noting it. I will add a few small suggestions as comments.
created_at: 2025-03-04T10:54:03Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	connectWithPassword(password: SecureString): any;
```
created_at: 2025-03-04T10:55:20Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	connectWithIdentidy(privateKeyPath: any, passphrase: SecureString): any;
```
created_at: 2025-03-04T10:56:01Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
 	/**
-	 * Connect the session using Public key Authentication.
+	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentity(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentity(privateKeyPath: string, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	connectWithIdentity(privateKeyPath: string, passphrase: SecureString): any;
```
created_at: 2025-03-04T10:56:19Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
 	/**
-	 * Connect the session using Public key Authentication.
+	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentity(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentity(privateKeyPath: string, passphrase: any): object;
 	/**
 	 * Connect the session using either password or Public key Authentication.
 	 * @param isPassword
 	 * @param password
 	 * @param privateKeyPath
 	 */
-	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: any): void;
+	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: string): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	connectWithPasswordOrIdentity(isPassword: boolean, password: SecureString, privateKeyPath: any): any;
```
created_at: 2025-03-04T10:56:51Z
author_association: COLLABORATOR
diff_hunk: @@ -169,87 +169,123 @@ declare class SSHSession {
 	 *
 	 * @param userInfo
 	 */
-	setUserInfo(userInfo: any): void;
+	setUserInfo(userInfo: object): void;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	setUserInfo(userInfo: any): void;
```
created_at: 2025-03-04T10:57:10Z
author_association: COLLABORATOR
diff_hunk: @@ -169,87 +169,123 @@ declare class SSHSession {
 	 *
 	 * @param userInfo
 	 */
-	setUserInfo(userInfo: any): void;
+	setUserInfo(userInfo: object): void;
 	/**
 	 * Fills a property list of environment variables that will be set prior to opening a channel.
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	addEnvironment(key: string, value: string): any;
```
created_at: 2025-03-04T10:57:25Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
 	/**
-	 * Connect the session using Public key Authentication.
+	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentity(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentity(privateKeyPath: string, passphrase: any): object;
 	/**
 	 * Connect the session using either password or Public key Authentication.
 	 * @param isPassword
 	 * @param password
 	 * @param privateKeyPath
 	 */
-	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: any): void;
+	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: string): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: Actually for this one I just saw that "path" in the API is defined as type similar to string. So I guess this is why you suggested to change it directly to string right?
created_at: 2025-03-04T11:06:37Z
author_association: COLLABORATOR
diff_hunk: @@ -169,87 +169,123 @@ declare class SSHSession {
 	 *
 	 * @param userInfo
 	 */
-	setUserInfo(userInfo: any): void;
+	setUserInfo(userInfo: object): void;
 	/**
 	 * Fills a property list of environment variables that will be set prior to opening a channel.
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): object;
+	/**
+	 * Set connection timeout, in milliseconds
+	 * @param setConnectTimeout
+	 */
+	setConnectTimeout(timeout: number): void;
+	/**
+	 * Get connection timeout
+	 */
+	getConnectTimeout(): number;
+	/**
+	 * Set socket timeout, in milliseconds
+	 * @param timeout
+	 */
+	setTimeout(timeout: number): void;
+	/**
+	 * Get socket timeout
+	 */
+	getTimeout(): number;
+	/**
+	 * Set an interval, in milliseconds, to send keep-alive message. If zero, keep-alive message will not be sent.
+	 * @param interval
+	 */
+	setKeepAliveInterval(interval: number): void;
+	/**
+	 * Get keep-alive interval
+	 */
+	getKeepAliveInterval(): number;
+	/**
+	 * Set the number of keep-alive messages that may be sent before the connection is considered to have failed.
+	 * @param count
+	 */
+	setKeepAliveCountMax(count: number): void;
+	/**
+	 * Get keep-alive messages count threshold
+	 */
+	getKeepAliveCountMax(): number;
 	/**
 	 * Sets the encoding that will be used to process the results from executeCommand method
 	 * @param encoding
 	 */
-	setEncoding(encoding: string): void;
+	setEncoding(encoding: string): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	setEncoding(encoding: string): any;
```
created_at: 2025-03-04T11:07:04Z
author_association: COLLABORATOR
diff_hunk: @@ -169,87 +169,123 @@ declare class SSHSession {
 	 *
 	 * @param userInfo
 	 */
-	setUserInfo(userInfo: any): void;
+	setUserInfo(userInfo: object): void;
 	/**
 	 * Fills a property list of environment variables that will be set prior to opening a channel.
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): object;
+	/**
+	 * Set connection timeout, in milliseconds
+	 * @param setConnectTimeout
+	 */
+	setConnectTimeout(timeout: number): void;
+	/**
+	 * Get connection timeout
+	 */
+	getConnectTimeout(): number;
+	/**
+	 * Set socket timeout, in milliseconds
+	 * @param timeout
+	 */
+	setTimeout(timeout: number): void;
+	/**
+	 * Get socket timeout
+	 */
+	getTimeout(): number;
+	/**
+	 * Set an interval, in milliseconds, to send keep-alive message. If zero, keep-alive message will not be sent.
+	 * @param interval
+	 */
+	setKeepAliveInterval(interval: number): void;
+	/**
+	 * Get keep-alive interval
+	 */
+	getKeepAliveInterval(): number;
+	/**
+	 * Set the number of keep-alive messages that may be sent before the connection is considered to have failed.
+	 * @param count
+	 */
+	setKeepAliveCountMax(count: number): void;
+	/**
+	 * Get keep-alive messages count threshold
+	 */
+	getKeepAliveCountMax(): number;
 	/**
 	 * Sets the encoding that will be used to process the results from executeCommand method
 	 * @param encoding
 	 */
-	setEncoding(encoding: string): void;
+	setEncoding(encoding: string): object;
 	/**
 	 * Returns the encoding used by this SSHSession
 	 */
-	getEncoding(): any;
+	getEncoding(): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	getEncoding(): any;
```
created_at: 2025-03-04T11:07:13Z
author_association: COLLABORATOR
diff_hunk: @@ -169,87 +169,123 @@ declare class SSHSession {
 	 *
 	 * @param userInfo
 	 */
-	setUserInfo(userInfo: any): void;
+	setUserInfo(userInfo: object): void;
 	/**
 	 * Fills a property list of environment variables that will be set prior to opening a channel.
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): object;
+	/**
+	 * Set connection timeout, in milliseconds
+	 * @param setConnectTimeout
+	 */
+	setConnectTimeout(timeout: number): void;
+	/**
+	 * Get connection timeout
+	 */
+	getConnectTimeout(): number;
+	/**
+	 * Set socket timeout, in milliseconds
+	 * @param timeout
+	 */
+	setTimeout(timeout: number): void;
+	/**
+	 * Get socket timeout
+	 */
+	getTimeout(): number;
+	/**
+	 * Set an interval, in milliseconds, to send keep-alive message. If zero, keep-alive message will not be sent.
+	 * @param interval
+	 */
+	setKeepAliveInterval(interval: number): void;
+	/**
+	 * Get keep-alive interval
+	 */
+	getKeepAliveInterval(): number;
+	/**
+	 * Set the number of keep-alive messages that may be sent before the connection is considered to have failed.
+	 * @param count
+	 */
+	setKeepAliveCountMax(count: number): void;
+	/**
+	 * Get keep-alive messages count threshold
+	 */
+	getKeepAliveCountMax(): number;
 	/**
 	 * Sets the encoding that will be used to process the results from executeCommand method
 	 * @param encoding
 	 */
-	setEncoding(encoding: string): void;
+	setEncoding(encoding: string): object;
 	/**
 	 * Returns the encoding used by this SSHSession
 	 */
-	getEncoding(): any;
+	getEncoding(): object;
 	/**
 	 * Execute a single command and return immediately. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occured.
 	 */
-	execute(): void;
+	execute(): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	execute(): any;
```
created_at: 2025-03-04T11:07:23Z
author_association: COLLABORATOR
diff_hunk: @@ -169,87 +169,123 @@ declare class SSHSession {
 	 *
 	 * @param userInfo
 	 */
-	setUserInfo(userInfo: any): void;
+	setUserInfo(userInfo: object): void;
 	/**
 	 * Fills a property list of environment variables that will be set prior to opening a channel.
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): object;
+	/**
+	 * Set connection timeout, in milliseconds
+	 * @param setConnectTimeout
+	 */
+	setConnectTimeout(timeout: number): void;
+	/**
+	 * Get connection timeout
+	 */
+	getConnectTimeout(): number;
+	/**
+	 * Set socket timeout, in milliseconds
+	 * @param timeout
+	 */
+	setTimeout(timeout: number): void;
+	/**
+	 * Get socket timeout
+	 */
+	getTimeout(): number;
+	/**
+	 * Set an interval, in milliseconds, to send keep-alive message. If zero, keep-alive message will not be sent.
+	 * @param interval
+	 */
+	setKeepAliveInterval(interval: number): void;
+	/**
+	 * Get keep-alive interval
+	 */
+	getKeepAliveInterval(): number;
+	/**
+	 * Set the number of keep-alive messages that may be sent before the connection is considered to have failed.
+	 * @param count
+	 */
+	setKeepAliveCountMax(count: number): void;
+	/**
+	 * Get keep-alive messages count threshold
+	 */
+	getKeepAliveCountMax(): number;
 	/**
 	 * Sets the encoding that will be used to process the results from executeCommand method
 	 * @param encoding
 	 */
-	setEncoding(encoding: string): void;
+	setEncoding(encoding: string): object;
 	/**
 	 * Returns the encoding used by this SSHSession
 	 */
-	getEncoding(): any;
+	getEncoding(): object;
 	/**
 	 * Execute a single command and return immediately. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occured.
 	 */
-	execute(): void;
+	execute(): object;
 	/**
 	 * Execute a single command and wait until end. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occurred.
 	 * @param file
 	 */
-	executeAndLog(file: any): void;
+	executeAndLog(file: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: ```suggestion
	executeAndLog(file: any): any;
```
created_at: 2025-03-04T11:07:34Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: unbreakabl3
body: `Cannot find name 'SecureString'`
created_at: 2025-03-04T11:21:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
 	/**
-	 * Connect the session using Public key Authentication.
+	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentity(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentity(privateKeyPath: string, passphrase: any): object;
 	/**
 	 * Connect the session using either password or Public key Authentication.
 	 * @param isPassword
 	 * @param password
 	 * @param privateKeyPath
 	 */
-	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: any): void;
+	connectWithPasswordOrIdentity(isPassword: boolean, password: any, privateKeyPath: string): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: unbreakabl3
body: right
created_at: 2025-03-04T11:25:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: unbreakabl3
body: What do you think should we do with a `SecureString` ?

created_at: 2025-03-04T12:36:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: That's strange..do you see this only as warning or it is entirely breaking the build?
We have the type defined in vro-types/o11n-core and also re-used in o11n-plugin-mail in the EmailMessage.

Btw I just noticed we have a privateKeyPath here, maybe it is best to change it to string as well since it is a path again
created_at: 2025-03-05T06:57:07Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: Could you double check, I think the commit was not pushed
created_at: 2025-03-05T06:57:25Z
author_association: COLLABORATOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: unbreakabl3
body: It's not breaking the build. Just an IntelliSense warning. Should I set SecureString everywhere its needed?

![image](https://github.com/user-attachments/assets/97cd99fe-30dd-4328-aa3b-b03f33691318)

created_at: 2025-03-05T08:12:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -141,26 +141,26 @@ declare class SSHSession {
 	 * Connect the session using simple username/password authentication.
 	 * @param password
 	 */
-	connectWithPassword(password: any): void;
+	connectWithPassword(password: any): object;
 	/**
 	 * Deprecated use connectWithIdentity(). Connect the session using Public key Authentication.
 	 * @param privateKeyPath
 	 * @param passphrase
 	 */
-	connectWithIdentidy(privateKeyPath: any, passphrase: any): void;
+	connectWithIdentidy(privateKeyPath: any, passphrase: any): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: I did a quick test, I think it should be ok:
![image](https://github.com/user-attachments/assets/916b5445-b6b8-4ae6-adf9-707204751b24)

created_at: 2025-03-06T07:03:54Z
author_association: COLLABORATOR
diff_hunk: @@ -175,81 +175,117 @@ declare class SSHSession {
 	 * @param key
 	 * @param value
 	 */
-	addEnvironment(key: string, value: string): void;
+	addEnvironment(key: string, value: string): any;
+	/**
+	 * Set connection timeout, in milliseconds
+	 * @param setConnectTimeout
+	 */
+	setConnectTimeout(timeout: number): void;
+	/**
+	 * Get connection timeout
+	 */
+	getConnectTimeout(): number;
+	/**
+	 * Set socket timeout, in milliseconds
+	 * @param timeout
+	 */
+	setTimeout(timeout: number): void;
+	/**
+	 * Get socket timeout
+	 */
+	getTimeout(): number;
+	/**
+	 * Set an interval, in milliseconds, to send keep-alive message. If zero, keep-alive message will not be sent.
+	 * @param interval
+	 */
+	setKeepAliveInterval(interval: number): void;
+	/**
+	 * Get keep-alive interval
+	 */
+	getKeepAliveInterval(): number;
+	/**
+	 * Set the number of keep-alive messages that may be sent before the connection is considered to have failed.
+	 * @param count
+	 */
+	setKeepAliveCountMax(count: number): void;
+	/**
+	 * Get keep-alive messages count threshold
+	 */
+	getKeepAliveCountMax(): number;
 	/**
 	 * Sets the encoding that will be used to process the results from executeCommand method
 	 * @param encoding
 	 */
-	setEncoding(encoding: string): void;
+	setEncoding(encoding: string): any;
 	/**
 	 * Returns the encoding used by this SSHSession
 	 */
 	getEncoding(): any;
 	/**
 	 * Execute a single command and return immediately. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occured.
 	 */
-	execute(): void;
+	execute(): any;
 	/**
 	 * Execute a single command and wait until end. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occurred.
 	 * @param file
 	 */
-	executeAndLog(file: any): void;
+	executeAndLog(file: any): any;
 	/**
 	 * Execute a single command and wait until completed, return the stdout result if synchronous. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Value of the exitCode property is changed to -1 for initializing, 0 if successful, and positive number if an error occured.
 	 * @param cmd
 	 * @param wait
 	 */
-	executeCommand(cmd: string, wait: boolean): void;
+	executeCommand(cmd: string, wait: boolean): string;
 	/**
 	 * Copy a file FROM a remote host TO the vCO Server. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session. Returns 0 if successful, or -1 if an error has occurred.
 	 * @param remoteFile
 	 * @param localFile
 	 */
-	getFile(remoteFile: any, localFile: any): number;
+	getFile(remoteFile: string, localFile: string): number;
 	/**
 	 * Copy a file TO a remote host FROM the vCO Server. Returns 0 if successful, or -1 if an error has occurred. If a remote file name is provided, the destination file name will use it. If only the destination directory is specified, then the destination file will use the source file name. The destination directory must exist.
 	 *
 	 * @param localFile
 	 * @param remoteFile
 	 */
-	putFile(localFile: any, remoteFile: any): number;
+	putFile(localFile: string, remoteFile: string): number;
 	/**
 	 * Recursively search and return matching pattern file and directory. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 * @param pattern
 	 */
-	findAll(basePath: any, pattern: string): string[];
+	findAll(basePath: string, pattern: string): string[];
 	/**
 	 * Recursively search and return matching pattern file ONLY. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 * @param pattern
 	 */
-	findFile(basePath: any, pattern: string): string[];
+	findFile(basePath: string, pattern: string): string[];
 	/**
 	 * Recursively search and return matching pattern directory ONLY.  This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 * @param pattern
 	 */
-	findDir(basePath: any, pattern: string): string[];
+	findDir(basePath: string, pattern: string): string[];
 	/**
 	 * List files and directories in path. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 */
-	listAll(basePath: any): string[];
+	listAll(basePath: string): string[];
 	/**
 	 * List files ONLY in path. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 */
-	listFile(basePath: any): string[];
+	listFile(basePath: string): string[];
 	/**
 	 * List directories ONLY in path. This command will connect the session, request an execution channel, execute the command and close the execution channel. The session is open automatically if not opened yet, but will remain open after the command execution. Use disconnect to close the session.
 	 * @param basePath
 	 */
-	listDir(basePath: any): string[];
+	listDir(basePath: string): string[];
 	/**
 	 * Disconnects the current session if open. The session parameters are given in the object constructor (host, username, password); a session is opened automatically when any method is called that requires a session (like execute). Once open, the session remains open; any method uses the same session but opens a new channel and the closes it when done. You need to use this disconnect method to close the session.
 	 */
-	disconnect(): void;
+	disconnect(): object;
path: vro-types/o11n-plugin-ssh/index.d.ts
user: login: VenelinBakalov
body: Last one :) I somehow missed it..
```suggestion
	disconnect(): any;
```
created_at: 2025-03-06T14:36:14Z
author_association: COLLABORATOR

PR comments:
user: login: VenelinBakalov
created_at: 2025-03-04T10:58:58Z
body: @unbreakabl3 I am adding a few small suggestions but I would say to wait before applying the change from Object to any - I need to check with the team which one would be better.
author_association: COLLABORATOR
user: login: VenelinBakalov
created_at: 2025-03-04T11:05:23Z
body: Let's go with "any"
author_association: COLLABORATOR
user: login: unbreakabl3
created_at: 2025-03-04T11:25:03Z
body: > Let's go with "any"

No problem. Just followed the API from vRO.
author_association: CONTRIBUTOR
user: login: vmwclabot
created_at: 2025-03-07T05:41:32Z
body: @unbreakabl3, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding `Signed-off-by: John Doe <john.doe@email.org>` to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click [here](https://cla.vmware.com/dco) to view the Developer Certificate of Origin agreement.

- Commit 3cd9bd63290eb788e583039c22056b2edef9d403 must be signed by bakalovv@vmware.com

author_association: NONE
user: login: vmwclabot
created_at: 2025-03-07T05:41:32Z
body: @unbreakabl3, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding `Signed-off-by: John Doe <john.doe@email.org>` to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click [here](https://cla.vmware.com/dco) to view the Developer Certificate of Origin agreement.

- Commit 3cd9bd63290eb788e583039c22056b2edef9d403 must be signed by bakalovv@vmware.com

author_association: NONE