@theia/remote 1.52.0 → 1.53.0-next.55

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.
Files changed (37) hide show
  1. package/README.md +61 -61
  2. package/lib/electron-node/setup/remote-setup-script-service.js +11 -11
  3. package/package.json +5 -5
  4. package/src/electron-browser/port-forwarding/port-forwading-contribution.ts +33 -33
  5. package/src/electron-browser/port-forwarding/port-forwarding-service.ts +92 -92
  6. package/src/electron-browser/port-forwarding/port-forwarding-widget.tsx +140 -140
  7. package/src/electron-browser/remote-electron-file-dialog-service.ts +47 -47
  8. package/src/electron-browser/remote-frontend-contribution.ts +143 -143
  9. package/src/electron-browser/remote-frontend-module.ts +68 -68
  10. package/src/electron-browser/remote-preferences.ts +62 -62
  11. package/src/electron-browser/remote-registry-contribution.ts +73 -73
  12. package/src/electron-browser/remote-service.ts +31 -31
  13. package/src/electron-browser/remote-ssh-contribution.ts +102 -102
  14. package/src/electron-browser/style/port-forwarding-widget.css +44 -44
  15. package/src/electron-common/remote-port-forwarding-provider.ts +30 -30
  16. package/src/electron-common/remote-ssh-connection-provider.ts +29 -29
  17. package/src/electron-common/remote-status-service.ts +35 -35
  18. package/src/electron-node/backend-remote-service-impl.ts +45 -45
  19. package/src/electron-node/remote-backend-module.ts +87 -87
  20. package/src/electron-node/remote-connection-service.ts +56 -56
  21. package/src/electron-node/remote-connection-socket-provider.ts +34 -34
  22. package/src/electron-node/remote-port-forwarding-provider.ts +66 -66
  23. package/src/electron-node/remote-proxy-server-provider.ts +37 -37
  24. package/src/electron-node/remote-status-service.ts +41 -41
  25. package/src/electron-node/remote-types.ts +64 -64
  26. package/src/electron-node/setup/app-native-dependency-contribution.ts +48 -48
  27. package/src/electron-node/setup/main-copy-contribution.ts +28 -28
  28. package/src/electron-node/setup/remote-copy-contribution.ts +74 -74
  29. package/src/electron-node/setup/remote-copy-service.ts +116 -116
  30. package/src/electron-node/setup/remote-native-dependency-contribution.ts +63 -63
  31. package/src/electron-node/setup/remote-native-dependency-service.ts +111 -111
  32. package/src/electron-node/setup/remote-node-setup-service.ts +123 -123
  33. package/src/electron-node/setup/remote-setup-script-service.ts +146 -146
  34. package/src/electron-node/setup/remote-setup-service.ts +220 -220
  35. package/src/electron-node/ssh/remote-ssh-connection-provider.ts +358 -358
  36. package/src/electron-node/ssh/ssh-identity-file-collector.ts +137 -137
  37. package/src/package.spec.ts +29 -29
@@ -1,73 +1,73 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { Command, CommandHandler, Emitter, Event } from '@theia/core';
18
- import { inject, injectable } from '@theia/core/shared/inversify';
19
- import { WindowService, WindowReloadOptions } from '@theia/core/lib/browser/window/window-service';
20
-
21
- export const RemoteRegistryContribution = Symbol('RemoteRegistryContribution');
22
-
23
- export interface RemoteRegistryContribution {
24
- registerRemoteCommands(registry: RemoteRegistry): void;
25
- }
26
-
27
- @injectable()
28
- export abstract class AbstractRemoteRegistryContribution implements RemoteRegistryContribution {
29
-
30
- @inject(WindowService)
31
- protected readonly windowService: WindowService;
32
-
33
- abstract registerRemoteCommands(registry: RemoteRegistry): void;
34
-
35
- protected openRemote(port: string, newWindow: boolean, workspace?: string): void {
36
- const searchParams = new URLSearchParams(location.search);
37
- const localPort = searchParams.get('localPort') || searchParams.get('port');
38
- const options: WindowReloadOptions = {
39
- search: { port }
40
- };
41
- if (localPort) {
42
- options.search!.localPort = localPort;
43
- }
44
- if (workspace) {
45
- options.hash = workspace;
46
- }
47
-
48
- if (newWindow) {
49
- this.windowService.openNewDefaultWindow(options);
50
- } else {
51
- this.windowService.reload(options);
52
- }
53
- }
54
- }
55
-
56
- export class RemoteRegistry {
57
-
58
- protected _commands: Command[] = [];
59
- protected onDidRegisterCommandEmitter = new Emitter<[Command, CommandHandler | undefined]>();
60
-
61
- get commands(): readonly Command[] {
62
- return this._commands;
63
- }
64
-
65
- get onDidRegisterCommand(): Event<[Command, CommandHandler | undefined]> {
66
- return this.onDidRegisterCommandEmitter.event;
67
- }
68
-
69
- registerCommand(command: Command, handler?: CommandHandler): void {
70
- this.onDidRegisterCommandEmitter.fire([command, handler]);
71
- this._commands.push(command);
72
- }
73
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { Command, CommandHandler, Emitter, Event } from '@theia/core';
18
+ import { inject, injectable } from '@theia/core/shared/inversify';
19
+ import { WindowService, WindowReloadOptions } from '@theia/core/lib/browser/window/window-service';
20
+
21
+ export const RemoteRegistryContribution = Symbol('RemoteRegistryContribution');
22
+
23
+ export interface RemoteRegistryContribution {
24
+ registerRemoteCommands(registry: RemoteRegistry): void;
25
+ }
26
+
27
+ @injectable()
28
+ export abstract class AbstractRemoteRegistryContribution implements RemoteRegistryContribution {
29
+
30
+ @inject(WindowService)
31
+ protected readonly windowService: WindowService;
32
+
33
+ abstract registerRemoteCommands(registry: RemoteRegistry): void;
34
+
35
+ protected openRemote(port: string, newWindow: boolean, workspace?: string): void {
36
+ const searchParams = new URLSearchParams(location.search);
37
+ const localPort = searchParams.get('localPort') || searchParams.get('port');
38
+ const options: WindowReloadOptions = {
39
+ search: { port }
40
+ };
41
+ if (localPort) {
42
+ options.search!.localPort = localPort;
43
+ }
44
+ if (workspace) {
45
+ options.hash = workspace;
46
+ }
47
+
48
+ if (newWindow) {
49
+ this.windowService.openNewDefaultWindow(options);
50
+ } else {
51
+ this.windowService.reload(options);
52
+ }
53
+ }
54
+ }
55
+
56
+ export class RemoteRegistry {
57
+
58
+ protected _commands: Command[] = [];
59
+ protected onDidRegisterCommandEmitter = new Emitter<[Command, CommandHandler | undefined]>();
60
+
61
+ get commands(): readonly Command[] {
62
+ return this._commands;
63
+ }
64
+
65
+ get onDidRegisterCommand(): Event<[Command, CommandHandler | undefined]> {
66
+ return this.onDidRegisterCommandEmitter.event;
67
+ }
68
+
69
+ registerCommand(command: Command, handler?: CommandHandler): void {
70
+ this.onDidRegisterCommandEmitter.fire([command, handler]);
71
+ this._commands.push(command);
72
+ }
73
+ }
@@ -1,31 +1,31 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { injectable } from '@theia/core/shared/inversify';
18
-
19
- @injectable()
20
- export class RemoteService {
21
-
22
- protected _connected: boolean;
23
-
24
- isConnected(): boolean {
25
- return this._connected;
26
- }
27
-
28
- setConnected(value: boolean): void {
29
- this._connected = value;
30
- }
31
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable } from '@theia/core/shared/inversify';
18
+
19
+ @injectable()
20
+ export class RemoteService {
21
+
22
+ protected _connected: boolean;
23
+
24
+ isConnected(): boolean {
25
+ return this._connected;
26
+ }
27
+
28
+ setConnected(value: boolean): void {
29
+ this._connected = value;
30
+ }
31
+ }
@@ -1,102 +1,102 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { Command, MessageService, nls, QuickInputService } from '@theia/core';
18
- import { inject, injectable } from '@theia/core/shared/inversify';
19
- import { RemoteSSHConnectionProvider } from '../electron-common/remote-ssh-connection-provider';
20
- import { AbstractRemoteRegistryContribution, RemoteRegistry } from './remote-registry-contribution';
21
- import { RemotePreferences } from './remote-preferences';
22
-
23
- export namespace RemoteSSHCommands {
24
- export const CONNECT: Command = Command.toLocalizedCommand({
25
- id: 'remote.ssh.connect',
26
- category: 'SSH',
27
- label: 'Connect to Host...',
28
- }, 'theia/remoteSSH/connect');
29
- export const CONNECT_CURRENT_WINDOW: Command = Command.toLocalizedCommand({
30
- id: 'remote.ssh.connectCurrentWindow',
31
- category: 'SSH',
32
- label: 'Connect Current Window to Host...',
33
- }, 'theia/remoteSSH/connect');
34
- }
35
-
36
- @injectable()
37
- export class RemoteSSHContribution extends AbstractRemoteRegistryContribution {
38
-
39
- @inject(QuickInputService)
40
- protected readonly quickInputService: QuickInputService;
41
-
42
- @inject(RemoteSSHConnectionProvider)
43
- protected readonly sshConnectionProvider: RemoteSSHConnectionProvider;
44
-
45
- @inject(MessageService)
46
- protected readonly messageService: MessageService;
47
-
48
- @inject(RemotePreferences)
49
- protected readonly remotePreferences: RemotePreferences;
50
-
51
- registerRemoteCommands(registry: RemoteRegistry): void {
52
- registry.registerCommand(RemoteSSHCommands.CONNECT, {
53
- execute: () => this.connect(true)
54
- });
55
- registry.registerCommand(RemoteSSHCommands.CONNECT_CURRENT_WINDOW, {
56
- execute: () => this.connect(false)
57
- });
58
- }
59
-
60
- async connect(newWindow: boolean): Promise<void> {
61
- let host: string | undefined;
62
- let user: string | undefined;
63
- host = await this.quickInputService.input({
64
- title: nls.localize('theia/remote/enterHost', 'Enter SSH host name'),
65
- placeHolder: nls.localize('theia/remote/hostPlaceHolder', 'E.g. hello@example.com')
66
- });
67
- if (!host) {
68
- this.messageService.error(nls.localize('theia/remote/needsHost', 'Please enter a host name.'));
69
- return;
70
- }
71
- if (host.includes('@')) {
72
- const split = host.split('@');
73
- user = split[0];
74
- host = split[1];
75
- }
76
- if (!user) {
77
- user = await this.quickInputService.input({
78
- title: nls.localize('theia/remote/enterUser', 'Enter SSH user name'),
79
- placeHolder: nls.localize('theia/remote/userPlaceHolder', 'E.g. hello')
80
- });
81
- }
82
- if (!user) {
83
- this.messageService.error(nls.localize('theia/remote/needsUser', 'Please enter a user name.'));
84
- return;
85
- }
86
-
87
- try {
88
- const remotePort = await this.sendSSHConnect(host!, user!);
89
- this.openRemote(remotePort, newWindow);
90
- } catch (err) {
91
- this.messageService.error(`${nls.localize('theia/remote/sshFailure', 'Could not open SSH connection to remote.')} ${err.message ?? String(err)}`);
92
- }
93
- }
94
-
95
- async sendSSHConnect(host: string, user: string): Promise<string> {
96
- return this.sshConnectionProvider.establishConnection({
97
- host,
98
- user,
99
- nodeDownloadTemplate: this.remotePreferences['remote.nodeDownloadTemplate']
100
- });
101
- }
102
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { Command, MessageService, nls, QuickInputService } from '@theia/core';
18
+ import { inject, injectable } from '@theia/core/shared/inversify';
19
+ import { RemoteSSHConnectionProvider } from '../electron-common/remote-ssh-connection-provider';
20
+ import { AbstractRemoteRegistryContribution, RemoteRegistry } from './remote-registry-contribution';
21
+ import { RemotePreferences } from './remote-preferences';
22
+
23
+ export namespace RemoteSSHCommands {
24
+ export const CONNECT: Command = Command.toLocalizedCommand({
25
+ id: 'remote.ssh.connect',
26
+ category: 'SSH',
27
+ label: 'Connect to Host...',
28
+ }, 'theia/remoteSSH/connect');
29
+ export const CONNECT_CURRENT_WINDOW: Command = Command.toLocalizedCommand({
30
+ id: 'remote.ssh.connectCurrentWindow',
31
+ category: 'SSH',
32
+ label: 'Connect Current Window to Host...',
33
+ }, 'theia/remoteSSH/connect');
34
+ }
35
+
36
+ @injectable()
37
+ export class RemoteSSHContribution extends AbstractRemoteRegistryContribution {
38
+
39
+ @inject(QuickInputService)
40
+ protected readonly quickInputService: QuickInputService;
41
+
42
+ @inject(RemoteSSHConnectionProvider)
43
+ protected readonly sshConnectionProvider: RemoteSSHConnectionProvider;
44
+
45
+ @inject(MessageService)
46
+ protected readonly messageService: MessageService;
47
+
48
+ @inject(RemotePreferences)
49
+ protected readonly remotePreferences: RemotePreferences;
50
+
51
+ registerRemoteCommands(registry: RemoteRegistry): void {
52
+ registry.registerCommand(RemoteSSHCommands.CONNECT, {
53
+ execute: () => this.connect(true)
54
+ });
55
+ registry.registerCommand(RemoteSSHCommands.CONNECT_CURRENT_WINDOW, {
56
+ execute: () => this.connect(false)
57
+ });
58
+ }
59
+
60
+ async connect(newWindow: boolean): Promise<void> {
61
+ let host: string | undefined;
62
+ let user: string | undefined;
63
+ host = await this.quickInputService.input({
64
+ title: nls.localize('theia/remote/enterHost', 'Enter SSH host name'),
65
+ placeHolder: nls.localize('theia/remote/hostPlaceHolder', 'E.g. hello@example.com')
66
+ });
67
+ if (!host) {
68
+ this.messageService.error(nls.localize('theia/remote/needsHost', 'Please enter a host name.'));
69
+ return;
70
+ }
71
+ if (host.includes('@')) {
72
+ const split = host.split('@');
73
+ user = split[0];
74
+ host = split[1];
75
+ }
76
+ if (!user) {
77
+ user = await this.quickInputService.input({
78
+ title: nls.localize('theia/remote/enterUser', 'Enter SSH user name'),
79
+ placeHolder: nls.localize('theia/remote/userPlaceHolder', 'E.g. hello')
80
+ });
81
+ }
82
+ if (!user) {
83
+ this.messageService.error(nls.localize('theia/remote/needsUser', 'Please enter a user name.'));
84
+ return;
85
+ }
86
+
87
+ try {
88
+ const remotePort = await this.sendSSHConnect(host!, user!);
89
+ this.openRemote(remotePort, newWindow);
90
+ } catch (err) {
91
+ this.messageService.error(`${nls.localize('theia/remote/sshFailure', 'Could not open SSH connection to remote.')} ${err.message ?? String(err)}`);
92
+ }
93
+ }
94
+
95
+ async sendSSHConnect(host: string, user: string): Promise<string> {
96
+ return this.sshConnectionProvider.establishConnection({
97
+ host,
98
+ user,
99
+ nodeDownloadTemplate: this.remotePreferences['remote.nodeDownloadTemplate']
100
+ });
101
+ }
102
+ }
@@ -1,44 +1,44 @@
1
- /********************************************************************************
2
- * Copyright (C) 2024 TypeFox and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
-
17
- .port-table {
18
- width: 100%;
19
- margin: calc(var(--theia-ui-padding) * 2);
20
- table-layout: fixed;
21
- }
22
-
23
- .port-table-header {
24
- text-align: left;
25
- }
26
-
27
- .forward-port-button {
28
- margin-left: 0;
29
- width: 100%;
30
- }
31
-
32
- .button-cell {
33
- display: flex;
34
- padding-right: var(--theia-ui-padding);
35
- }
36
-
37
- .forwarded-address:hover {
38
- cursor: pointer;
39
- text-decoration: underline;
40
- }
41
-
42
- .port-edit-input-error {
43
- outline-color: var(--theia-inputValidation-errorBorder);
44
- }
1
+ /********************************************************************************
2
+ * Copyright (C) 2024 TypeFox and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ .port-table {
18
+ width: 100%;
19
+ margin: calc(var(--theia-ui-padding) * 2);
20
+ table-layout: fixed;
21
+ }
22
+
23
+ .port-table-header {
24
+ text-align: left;
25
+ }
26
+
27
+ .forward-port-button {
28
+ margin-left: 0;
29
+ width: 100%;
30
+ }
31
+
32
+ .button-cell {
33
+ display: flex;
34
+ padding-right: var(--theia-ui-padding);
35
+ }
36
+
37
+ .forwarded-address:hover {
38
+ cursor: pointer;
39
+ text-decoration: underline;
40
+ }
41
+
42
+ .port-edit-input-error {
43
+ outline-color: var(--theia-inputValidation-errorBorder);
44
+ }
@@ -1,30 +1,30 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2024 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- export const RemoteRemotePortForwardingProviderPath = '/remote/port-forwarding';
18
-
19
- export const RemotePortForwardingProvider = Symbol('RemoteSSHConnectionProvider');
20
-
21
- export interface ForwardedPort {
22
- port: number;
23
- address?: string;
24
- }
25
-
26
- export interface RemotePortForwardingProvider {
27
- forwardPort(connectionPort: number, portToForward: ForwardedPort): Promise<void>;
28
- portRemoved(port: ForwardedPort): Promise<void>;
29
- getForwardedPorts(): Promise<ForwardedPort[]>
30
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ export const RemoteRemotePortForwardingProviderPath = '/remote/port-forwarding';
18
+
19
+ export const RemotePortForwardingProvider = Symbol('RemoteSSHConnectionProvider');
20
+
21
+ export interface ForwardedPort {
22
+ port: number;
23
+ address?: string;
24
+ }
25
+
26
+ export interface RemotePortForwardingProvider {
27
+ forwardPort(connectionPort: number, portToForward: ForwardedPort): Promise<void>;
28
+ portRemoved(port: ForwardedPort): Promise<void>;
29
+ getForwardedPorts(): Promise<ForwardedPort[]>
30
+ }
@@ -1,29 +1,29 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- export const RemoteSSHConnectionProviderPath = '/remote/ssh';
18
-
19
- export const RemoteSSHConnectionProvider = Symbol('RemoteSSHConnectionProvider');
20
-
21
- export interface RemoteSSHConnectionProviderOptions {
22
- user: string;
23
- host: string;
24
- nodeDownloadTemplate?: string;
25
- }
26
-
27
- export interface RemoteSSHConnectionProvider {
28
- establishConnection(options: RemoteSSHConnectionProviderOptions): Promise<string>;
29
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ export const RemoteSSHConnectionProviderPath = '/remote/ssh';
18
+
19
+ export const RemoteSSHConnectionProvider = Symbol('RemoteSSHConnectionProvider');
20
+
21
+ export interface RemoteSSHConnectionProviderOptions {
22
+ user: string;
23
+ host: string;
24
+ nodeDownloadTemplate?: string;
25
+ }
26
+
27
+ export interface RemoteSSHConnectionProvider {
28
+ establishConnection(options: RemoteSSHConnectionProviderOptions): Promise<string>;
29
+ }