| 1 | import type { RemoteHostInput, RemoteHostView } from "./remoteTypes"; |
| 2 | |
| 3 | export function mockRemoteHostView(id: string, input: RemoteHostInput, previous?: RemoteHostView): RemoteHostView { |
| 4 | return { |
| 5 | id, |
| 6 | label: input.label, |
| 7 | host: input.host, |
| 8 | port: input.port, |
| 9 | user: input.user, |
| 10 | identityFile: input.identityFile, |
| 11 | proxyJump: input.proxyJump, |
| 12 | defaultWorkspace: input.defaultWorkspace, |
| 13 | serveInstall: input.serveInstall, |
| 14 | credentialMode: input.credentialMode, |
| 15 | useSSHConfig: input.useSSHConfig, |
| 16 | passwordSet: input.password ? true : input.clearPassword ? false : previous?.passwordSet, |
| 17 | keyPassphraseSet: input.keyPassphrase ? true : input.clearPassphrase ? false : previous?.keyPassphraseSet, |
| 18 | }; |
| 19 | } |
| 20 |