@theia/remote 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +61 -0
  2. package/lib/electron-browser/remote-electron-file-dialog-service.d.ts +14 -0
  3. package/lib/electron-browser/remote-electron-file-dialog-service.d.ts.map +1 -0
  4. package/lib/electron-browser/remote-electron-file-dialog-service.js +58 -0
  5. package/lib/electron-browser/remote-electron-file-dialog-service.js.map +1 -0
  6. package/lib/electron-browser/remote-frontend-contribution.d.ts +26 -0
  7. package/lib/electron-browser/remote-frontend-contribution.d.ts.map +1 -0
  8. package/lib/electron-browser/remote-frontend-contribution.js +165 -0
  9. package/lib/electron-browser/remote-frontend-contribution.js.map +1 -0
  10. package/lib/electron-browser/remote-frontend-module.d.ts +4 -0
  11. package/lib/electron-browser/remote-frontend-module.d.ts.map +1 -0
  12. package/lib/electron-browser/remote-frontend-module.js +43 -0
  13. package/lib/electron-browser/remote-frontend-module.js.map +1 -0
  14. package/lib/electron-browser/remote-preferences.d.ts +11 -0
  15. package/lib/electron-browser/remote-preferences.d.ts.map +1 -0
  16. package/lib/electron-browser/remote-preferences.js +49 -0
  17. package/lib/electron-browser/remote-preferences.js.map +1 -0
  18. package/lib/electron-browser/remote-registry-contribution.d.ts +19 -0
  19. package/lib/electron-browser/remote-registry-contribution.d.ts.map +1 -0
  20. package/lib/electron-browser/remote-registry-contribution.js +75 -0
  21. package/lib/electron-browser/remote-registry-contribution.js.map +1 -0
  22. package/lib/electron-browser/remote-service.d.ts +6 -0
  23. package/lib/electron-browser/remote-service.d.ts.map +1 -0
  24. package/lib/electron-browser/remote-service.js +38 -0
  25. package/lib/electron-browser/remote-service.js.map +1 -0
  26. package/lib/electron-browser/remote-ssh-contribution.d.ts +18 -0
  27. package/lib/electron-browser/remote-ssh-contribution.d.ts.map +1 -0
  28. package/lib/electron-browser/remote-ssh-contribution.js +118 -0
  29. package/lib/electron-browser/remote-ssh-contribution.js.map +1 -0
  30. package/lib/electron-common/remote-ssh-connection-provider.d.ts +11 -0
  31. package/lib/electron-common/remote-ssh-connection-provider.d.ts.map +1 -0
  32. package/lib/electron-common/remote-ssh-connection-provider.js +21 -0
  33. package/lib/electron-common/remote-ssh-connection-provider.js.map +1 -0
  34. package/lib/electron-common/remote-status-service.d.ts +15 -0
  35. package/lib/electron-common/remote-status-service.d.ts.map +1 -0
  36. package/lib/electron-common/remote-status-service.js +21 -0
  37. package/lib/electron-common/remote-status-service.js.map +1 -0
  38. package/lib/electron-node/backend-remote-service-impl.d.ts +12 -0
  39. package/lib/electron-node/backend-remote-service-impl.d.ts.map +1 -0
  40. package/lib/electron-node/backend-remote-service-impl.js +51 -0
  41. package/lib/electron-node/backend-remote-service-impl.js.map +1 -0
  42. package/lib/electron-node/remote-backend-module.d.ts +5 -0
  43. package/lib/electron-node/remote-backend-module.d.ts.map +1 -0
  44. package/lib/electron-node/remote-backend-module.js +75 -0
  45. package/lib/electron-node/remote-backend-module.js.map +1 -0
  46. package/lib/electron-node/remote-connection-service.d.ts +15 -0
  47. package/lib/electron-node/remote-connection-service.d.ts.map +1 -0
  48. package/lib/electron-node/remote-connection-service.js +66 -0
  49. package/lib/electron-node/remote-connection-service.js.map +1 -0
  50. package/lib/electron-node/remote-connection-socket-provider.d.ts +9 -0
  51. package/lib/electron-node/remote-connection-socket-provider.d.ts.map +1 -0
  52. package/lib/electron-node/remote-connection-socket-provider.js +38 -0
  53. package/lib/electron-node/remote-connection-socket-provider.js.map +1 -0
  54. package/lib/electron-node/remote-proxy-server-provider.d.ts +6 -0
  55. package/lib/electron-node/remote-proxy-server-provider.d.ts.map +1 -0
  56. package/lib/electron-node/remote-proxy-server-provider.js +44 -0
  57. package/lib/electron-node/remote-proxy-server-provider.js.map +1 -0
  58. package/lib/electron-node/remote-status-service.d.ts +7 -0
  59. package/lib/electron-node/remote-status-service.d.ts.map +1 -0
  60. package/lib/electron-node/remote-status-service.js +55 -0
  61. package/lib/electron-node/remote-status-service.js.map +1 -0
  62. package/lib/electron-node/remote-types.d.ts +35 -0
  63. package/lib/electron-node/remote-types.d.ts.map +1 -0
  64. package/lib/electron-node/remote-types.js +18 -0
  65. package/lib/electron-node/remote-types.js.map +1 -0
  66. package/lib/electron-node/setup/app-native-dependency-contribution.d.ts +8 -0
  67. package/lib/electron-node/setup/app-native-dependency-contribution.d.ts.map +1 -0
  68. package/lib/electron-node/setup/app-native-dependency-contribution.js +58 -0
  69. package/lib/electron-node/setup/app-native-dependency-contribution.js.map +1 -0
  70. package/lib/electron-node/setup/main-copy-contribution.d.ts +5 -0
  71. package/lib/electron-node/setup/main-copy-contribution.d.ts.map +1 -0
  72. package/lib/electron-node/setup/main-copy-contribution.js +38 -0
  73. package/lib/electron-node/setup/main-copy-contribution.js.map +1 -0
  74. package/lib/electron-node/setup/remote-copy-contribution.d.ts +29 -0
  75. package/lib/electron-node/setup/remote-copy-contribution.d.ts.map +1 -0
  76. package/lib/electron-node/setup/remote-copy-contribution.js +79 -0
  77. package/lib/electron-node/setup/remote-copy-contribution.js.map +1 -0
  78. package/lib/electron-node/setup/remote-copy-service.d.ts +19 -0
  79. package/lib/electron-node/setup/remote-copy-service.d.ts.map +1 -0
  80. package/lib/electron-node/setup/remote-copy-service.js +127 -0
  81. package/lib/electron-node/setup/remote-copy-service.js.map +1 -0
  82. package/lib/electron-node/setup/remote-native-dependency-contribution.d.ts +35 -0
  83. package/lib/electron-node/setup/remote-native-dependency-contribution.d.ts.map +1 -0
  84. package/lib/electron-node/setup/remote-native-dependency-contribution.js +35 -0
  85. package/lib/electron-node/setup/remote-native-dependency-contribution.js.map +1 -0
  86. package/lib/electron-node/setup/remote-native-dependency-service.d.ts +24 -0
  87. package/lib/electron-node/setup/remote-native-dependency-service.d.ts.map +1 -0
  88. package/lib/electron-node/setup/remote-native-dependency-service.js +119 -0
  89. package/lib/electron-node/setup/remote-native-dependency-service.js.map +1 -0
  90. package/lib/electron-node/setup/remote-node-setup-service.d.ts +23 -0
  91. package/lib/electron-node/setup/remote-node-setup-service.d.ts.map +1 -0
  92. package/lib/electron-node/setup/remote-node-setup-service.js +133 -0
  93. package/lib/electron-node/setup/remote-node-setup-service.js.map +1 -0
  94. package/lib/electron-node/setup/remote-setup-script-service.d.ts +41 -0
  95. package/lib/electron-node/setup/remote-setup-script-service.d.ts.map +1 -0
  96. package/lib/electron-node/setup/remote-setup-script-service.js +133 -0
  97. package/lib/electron-node/setup/remote-setup-script-service.js.map +1 -0
  98. package/lib/electron-node/setup/remote-setup-service.d.ts +29 -0
  99. package/lib/electron-node/setup/remote-setup-service.d.ts.map +1 -0
  100. package/lib/electron-node/setup/remote-setup-service.js +199 -0
  101. package/lib/electron-node/setup/remote-setup-service.js.map +1 -0
  102. package/lib/electron-node/ssh/remote-ssh-connection-provider.d.ts +56 -0
  103. package/lib/electron-node/ssh/remote-ssh-connection-provider.d.ts.map +1 -0
  104. package/lib/electron-node/ssh/remote-ssh-connection-provider.js +343 -0
  105. package/lib/electron-node/ssh/remote-ssh-connection-provider.js.map +1 -0
  106. package/lib/electron-node/ssh/ssh-identity-file-collector.d.ts +13 -0
  107. package/lib/electron-node/ssh/ssh-identity-file-collector.d.ts.map +1 -0
  108. package/lib/electron-node/ssh/ssh-identity-file-collector.js +132 -0
  109. package/lib/electron-node/ssh/ssh-identity-file-collector.js.map +1 -0
  110. package/lib/package.spec.d.ts +1 -0
  111. package/lib/package.spec.d.ts.map +1 -0
  112. package/lib/package.spec.js +26 -0
  113. package/lib/package.spec.js.map +1 -0
  114. package/package.json +67 -0
  115. package/src/electron-browser/remote-electron-file-dialog-service.ts +47 -0
  116. package/src/electron-browser/remote-frontend-contribution.ts +145 -0
  117. package/src/electron-browser/remote-frontend-module.ts +49 -0
  118. package/src/electron-browser/remote-preferences.ts +62 -0
  119. package/src/electron-browser/remote-registry-contribution.ts +70 -0
  120. package/src/electron-browser/remote-service.ts +31 -0
  121. package/src/electron-browser/remote-ssh-contribution.ts +102 -0
  122. package/src/electron-common/remote-ssh-connection-provider.ts +29 -0
  123. package/src/electron-common/remote-status-service.ts +35 -0
  124. package/src/electron-node/backend-remote-service-impl.ts +45 -0
  125. package/src/electron-node/remote-backend-module.ts +80 -0
  126. package/src/electron-node/remote-connection-service.ts +55 -0
  127. package/src/electron-node/remote-connection-socket-provider.ts +34 -0
  128. package/src/electron-node/remote-proxy-server-provider.ts +37 -0
  129. package/src/electron-node/remote-status-service.ts +41 -0
  130. package/src/electron-node/remote-types.ts +56 -0
  131. package/src/electron-node/setup/app-native-dependency-contribution.ts +48 -0
  132. package/src/electron-node/setup/main-copy-contribution.ts +28 -0
  133. package/src/electron-node/setup/remote-copy-contribution.ts +90 -0
  134. package/src/electron-node/setup/remote-copy-service.ts +114 -0
  135. package/src/electron-node/setup/remote-native-dependency-contribution.ts +63 -0
  136. package/src/electron-node/setup/remote-native-dependency-service.ts +111 -0
  137. package/src/electron-node/setup/remote-node-setup-service.ts +123 -0
  138. package/src/electron-node/setup/remote-setup-script-service.ts +146 -0
  139. package/src/electron-node/setup/remote-setup-service.ts +197 -0
  140. package/src/electron-node/ssh/remote-ssh-connection-provider.ts +356 -0
  141. package/src/electron-node/ssh/ssh-identity-file-collector.ts +137 -0
  142. package/src/package.spec.ts +29 -0
@@ -0,0 +1,35 @@
1
+ /// <reference types="node" />
2
+ import { RequestOptions } from '@theia/core/shared/@theia/request';
3
+ import { RemotePlatform } from '../remote-types';
4
+ export interface FileDependencyResult {
5
+ path: string;
6
+ mode?: number;
7
+ }
8
+ export declare type DependencyDownload = FileDependencyDownload | DirectoryDependencyDownload;
9
+ export interface FileDependencyDownload {
10
+ file: FileDependencyResult;
11
+ buffer: Buffer;
12
+ }
13
+ export declare namespace FileDependencyResult {
14
+ function is(item: unknown): item is FileDependencyDownload;
15
+ }
16
+ export interface DirectoryDependencyDownload {
17
+ archive: 'tar' | 'zip' | 'tgz';
18
+ buffer: Buffer;
19
+ }
20
+ export declare namespace DirectoryDependencyDownload {
21
+ function is(item: unknown): item is DirectoryDependencyDownload;
22
+ }
23
+ export interface DownloadOptions {
24
+ remotePlatform: RemotePlatform;
25
+ theiaVersion: string;
26
+ download: (requestInfo: string | RequestOptions) => Promise<Buffer>;
27
+ }
28
+ export declare const RemoteNativeDependencyContribution: unique symbol;
29
+ /**
30
+ * contribution used for downloading prebuild native dependency when connecting to a remote machine with a different system
31
+ */
32
+ export interface RemoteNativeDependencyContribution {
33
+ download(options: DownloadOptions): Promise<DependencyDownload>;
34
+ }
35
+ //# sourceMappingURL=remote-native-dependency-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-native-dependency-contribution.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-contribution.ts"],"names":[],"mappings":";AAiBA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,kBAAkB,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAEtF,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,oBAAoB,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,oBAAoB,CAAC;IAClC,SAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,sBAAsB,CAEhE;CACJ;AAED,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,2BAA2B,CAAC;IACzC,SAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,2BAA2B,CAErE;CACJ;AAED,MAAM,WAAW,eAAe;IAC5B,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACtE;AAED,eAAO,MAAM,kCAAkC,eAA+C,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAC/C,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnE"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.RemoteNativeDependencyContribution = exports.DirectoryDependencyDownload = exports.FileDependencyResult = void 0;
19
+ const core_1 = require("@theia/core");
20
+ var FileDependencyResult;
21
+ (function (FileDependencyResult) {
22
+ function is(item) {
23
+ return (0, core_1.isObject)(item) && 'buffer' in item && 'file' in item;
24
+ }
25
+ FileDependencyResult.is = is;
26
+ })(FileDependencyResult = exports.FileDependencyResult || (exports.FileDependencyResult = {}));
27
+ var DirectoryDependencyDownload;
28
+ (function (DirectoryDependencyDownload) {
29
+ function is(item) {
30
+ return (0, core_1.isObject)(item) && 'buffer' in item && 'archive' in item;
31
+ }
32
+ DirectoryDependencyDownload.is = is;
33
+ })(DirectoryDependencyDownload = exports.DirectoryDependencyDownload || (exports.DirectoryDependencyDownload = {}));
34
+ exports.RemoteNativeDependencyContribution = Symbol('RemoteNativeDependencyContribution');
35
+ //# sourceMappingURL=remote-native-dependency-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-native-dependency-contribution.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,sCAAuC;AAgBvC,IAAiB,oBAAoB,CAIpC;AAJD,WAAiB,oBAAoB;IACjC,SAAgB,EAAE,CAAC,IAAa;QAC5B,OAAO,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,CAAC;IAChE,CAAC;IAFe,uBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAIpC;AAOD,IAAiB,2BAA2B,CAI3C;AAJD,WAAiB,2BAA2B;IACxC,SAAgB,EAAE,CAAC,IAAa;QAC5B,OAAO,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,QAAQ,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC;IACnE,CAAC;IAFe,8BAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAI3C;AAQY,QAAA,kCAAkC,GAAG,MAAM,CAAC,oCAAoC,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /// <reference types="node" />
2
+ import { ContributionProvider } from '@theia/core';
3
+ import { RequestService, RequestOptions } from '@theia/core/shared/@theia/request';
4
+ import { DependencyDownload, RemoteNativeDependencyContribution } from './remote-native-dependency-contribution';
5
+ import { RemotePlatform } from '../remote-types';
6
+ export declare const DEFAULT_HTTP_OPTIONS: {
7
+ method: string;
8
+ headers: {
9
+ Accept: string;
10
+ };
11
+ };
12
+ export interface NativeDependencyFile {
13
+ path: string;
14
+ target: string;
15
+ mode?: number;
16
+ }
17
+ export declare class RemoteNativeDependencyService {
18
+ protected nativeDependencyContributions: ContributionProvider<RemoteNativeDependencyContribution>;
19
+ protected requestService: RequestService;
20
+ downloadDependencies(remotePlatform: RemotePlatform, directory: string): Promise<NativeDependencyFile[]>;
21
+ protected downloadDependency(downloadURI: string | RequestOptions): Promise<Buffer>;
22
+ protected storeDependency(dependency: DependencyDownload, directory: string): Promise<NativeDependencyFile[]>;
23
+ }
24
+ //# sourceMappingURL=remote-native-dependency-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-native-dependency-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,oBAAoB,EAAiB,MAAM,aAAa,CAAC;AAElE,OAAO,EAAkB,cAAc,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAInG,OAAO,EAAE,kBAAkB,EAA+B,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC9I,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMjD,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBACa,6BAA6B;IAGtC,SAAS,CAAC,6BAA6B,EAAE,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;IAGlG,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAEnC,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;cAc9F,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;cAYzE,eAAe,CAAC,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAiCtH"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.RemoteNativeDependencyService = exports.DEFAULT_HTTP_OPTIONS = void 0;
28
+ const core_1 = require("@theia/core");
29
+ const inversify_1 = require("@theia/core/shared/inversify");
30
+ const request_1 = require("@theia/core/shared/@theia/request");
31
+ const decompress = require("decompress");
32
+ const path = require("path");
33
+ const fs = require("fs/promises");
34
+ const remote_native_dependency_contribution_1 = require("./remote-native-dependency-contribution");
35
+ const decompressTar = require('decompress-tar');
36
+ const decompressTargz = require('decompress-targz');
37
+ const decompressUnzip = require('decompress-unzip');
38
+ exports.DEFAULT_HTTP_OPTIONS = {
39
+ method: 'GET',
40
+ headers: {
41
+ Accept: 'application/octet-stream'
42
+ },
43
+ };
44
+ let RemoteNativeDependencyService = class RemoteNativeDependencyService {
45
+ async downloadDependencies(remotePlatform, directory) {
46
+ const contributionResults = await Promise.all(this.nativeDependencyContributions.getContributions()
47
+ .map(async (contribution) => {
48
+ const result = await contribution.download({
49
+ remotePlatform,
50
+ theiaVersion: core_1.THEIA_VERSION,
51
+ download: requestInfo => this.downloadDependency(requestInfo)
52
+ });
53
+ const dependency = await this.storeDependency(result, directory);
54
+ return dependency;
55
+ }));
56
+ return contributionResults.flat();
57
+ }
58
+ async downloadDependency(downloadURI) {
59
+ const options = typeof downloadURI === 'string'
60
+ ? { url: downloadURI, ...exports.DEFAULT_HTTP_OPTIONS }
61
+ : { ...exports.DEFAULT_HTTP_OPTIONS, ...downloadURI };
62
+ const req = await this.requestService.request(options);
63
+ if (request_1.RequestContext.isSuccess(req)) {
64
+ return Buffer.from(req.buffer);
65
+ }
66
+ else {
67
+ throw new Error('Server error while downloading native dependency from: ' + options.url);
68
+ }
69
+ }
70
+ async storeDependency(dependency, directory) {
71
+ if (remote_native_dependency_contribution_1.DirectoryDependencyDownload.is(dependency)) {
72
+ const archiveBuffer = dependency.buffer;
73
+ const plugins = [];
74
+ if (dependency.archive === 'tar') {
75
+ plugins.push(decompressTar());
76
+ }
77
+ else if (dependency.archive === 'tgz') {
78
+ plugins.push(decompressTargz());
79
+ }
80
+ else if (dependency.archive === 'zip') {
81
+ plugins.push(decompressUnzip());
82
+ }
83
+ const files = await decompress(archiveBuffer, directory, { plugins });
84
+ const result = await Promise.all(files.map(async (file) => {
85
+ const localPath = path.join(directory, file.path);
86
+ return {
87
+ path: localPath,
88
+ target: file.path,
89
+ mode: file.mode
90
+ };
91
+ }));
92
+ return result;
93
+ }
94
+ else {
95
+ const fileName = path.basename(dependency.file.path);
96
+ const localPath = path.join(directory, fileName);
97
+ await fs.writeFile(localPath, dependency.buffer);
98
+ return [{
99
+ path: localPath,
100
+ target: dependency.file.path,
101
+ mode: dependency.file.mode
102
+ }];
103
+ }
104
+ }
105
+ };
106
+ __decorate([
107
+ (0, inversify_1.inject)(core_1.ContributionProvider),
108
+ (0, inversify_1.named)(remote_native_dependency_contribution_1.RemoteNativeDependencyContribution),
109
+ __metadata("design:type", Object)
110
+ ], RemoteNativeDependencyService.prototype, "nativeDependencyContributions", void 0);
111
+ __decorate([
112
+ (0, inversify_1.inject)(request_1.RequestService),
113
+ __metadata("design:type", Object)
114
+ ], RemoteNativeDependencyService.prototype, "requestService", void 0);
115
+ RemoteNativeDependencyService = __decorate([
116
+ (0, inversify_1.injectable)()
117
+ ], RemoteNativeDependencyService);
118
+ exports.RemoteNativeDependencyService = RemoteNativeDependencyService;
119
+ //# sourceMappingURL=remote-native-dependency-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-native-dependency-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-native-dependency-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;;;;AAEhF,sCAAkE;AAClE,4DAAyE;AACzE,+DAAmG;AACnG,yCAAyC;AACzC,6BAA6B;AAC7B,kCAAkC;AAClC,mGAA8I;AAG9I,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAChD,MAAM,eAAe,GAAG,OAAO,CAAC,kBAA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AM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,CAAC;oBACJ,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI;oBAC5B,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI;iBAC7B,CAAC,CAAC;SACN;IACL,CAAC;CAEJ,CAAA;AAhEG;IADC,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,0EAAkC,CAAC;;oFAC0B;AAGlG;IADC,IAAA,kBAAM,EAAC,wBAAc,CAAC;;qEACkB;AANhC,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAmEzC;AAnEY,sEAA6B"}
@@ -0,0 +1,23 @@
1
+ import { RequestService } from '@theia/core/shared/@theia/request';
2
+ import { RemoteSetupScriptService } from './remote-setup-script-service';
3
+ import { RemotePlatform } from '../remote-types';
4
+ /**
5
+ * The current node version that Theia recommends.
6
+ *
7
+ * Native dependencies are compiled against this version.
8
+ */
9
+ export declare const REMOTE_NODE_VERSION = "18.17.0";
10
+ export declare class RemoteNodeSetupService {
11
+ protected readonly requestService: RequestService;
12
+ protected readonly scriptService: RemoteSetupScriptService;
13
+ getNodeDirectoryName(platform: RemotePlatform): string;
14
+ protected getPlatformName(platform: RemotePlatform): string;
15
+ protected validatePlatform(platform: RemotePlatform): void;
16
+ protected throwPlatformError(platform: RemotePlatform, supportedArch: string): never;
17
+ protected getNodeFileExtension(platform: RemotePlatform): string;
18
+ getNodeFileName(platform: RemotePlatform): string;
19
+ downloadNode(platform: RemotePlatform, downloadTemplate?: string): Promise<string>;
20
+ generateDownloadScript(platform: RemotePlatform, targetPath: string, downloadTemplate?: string): string;
21
+ protected getDownloadPath(platform: RemotePlatform, downloadTemplate?: string): string;
22
+ }
23
+ //# sourceMappingURL=remote-node-setup-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-node-setup-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-node-setup-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,qBACa,sBAAsB;IAG/B,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;IAE3D,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAItD,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAY3D,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAU1D,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,GAAG,KAAK;IAIpF,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAYhE,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;IAI3C,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAexF,sBAAsB,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAUvG,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;CASzF"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.RemoteNodeSetupService = exports.REMOTE_NODE_VERSION = void 0;
28
+ const path = require("path");
29
+ const fs = require("@theia/core/shared/fs-extra");
30
+ const os = require("os");
31
+ const inversify_1 = require("@theia/core/shared/inversify");
32
+ const request_1 = require("@theia/core/shared/@theia/request");
33
+ const remote_setup_script_service_1 = require("./remote-setup-script-service");
34
+ const core_1 = require("@theia/core");
35
+ /**
36
+ * The current node version that Theia recommends.
37
+ *
38
+ * Native dependencies are compiled against this version.
39
+ */
40
+ exports.REMOTE_NODE_VERSION = '18.17.0';
41
+ let RemoteNodeSetupService = class RemoteNodeSetupService {
42
+ getNodeDirectoryName(platform) {
43
+ return `node-v${exports.REMOTE_NODE_VERSION}-${this.getPlatformName(platform)}-${platform.arch}`;
44
+ }
45
+ getPlatformName(platform) {
46
+ let platformId;
47
+ if (platform.os === core_1.OS.Type.Windows) {
48
+ platformId = 'win';
49
+ }
50
+ else if (platform.os === core_1.OS.Type.OSX) {
51
+ platformId = 'darwin';
52
+ }
53
+ else {
54
+ platformId = 'linux';
55
+ }
56
+ return platformId;
57
+ }
58
+ validatePlatform(platform) {
59
+ if (platform.os === core_1.OS.Type.Windows && !platform.arch.match(/^x(64|86)$/)) {
60
+ this.throwPlatformError(platform, 'x64 and x86');
61
+ }
62
+ else if (platform.os === core_1.OS.Type.Linux && !platform.arch.match(/^(x64|armv7l|arm64)$/)) {
63
+ this.throwPlatformError(platform, 'x64, armv7l and arm64');
64
+ }
65
+ else if (platform.os === core_1.OS.Type.OSX && !platform.arch.match(/^(x64|arm64)$/)) {
66
+ this.throwPlatformError(platform, 'x64 and arm64');
67
+ }
68
+ }
69
+ throwPlatformError(platform, supportedArch) {
70
+ throw new Error(`Invalid architecture for ${platform.os}: '${platform.arch}'. Only ${supportedArch} are supported.`);
71
+ }
72
+ getNodeFileExtension(platform) {
73
+ let fileExtension;
74
+ if (platform.os === core_1.OS.Type.Windows) {
75
+ fileExtension = 'zip';
76
+ }
77
+ else if (platform.os === core_1.OS.Type.OSX) {
78
+ fileExtension = 'tar.gz';
79
+ }
80
+ else {
81
+ fileExtension = 'tar.xz';
82
+ }
83
+ return fileExtension;
84
+ }
85
+ getNodeFileName(platform) {
86
+ return `${this.getNodeDirectoryName(platform)}.${this.getNodeFileExtension(platform)}`;
87
+ }
88
+ async downloadNode(platform, downloadTemplate) {
89
+ this.validatePlatform(platform);
90
+ const fileName = this.getNodeFileName(platform);
91
+ const tmpdir = os.tmpdir();
92
+ const localPath = path.join(tmpdir, fileName);
93
+ if (!await fs.pathExists(localPath)) {
94
+ const downloadPath = this.getDownloadPath(platform, downloadTemplate);
95
+ const downloadResult = await this.requestService.request({
96
+ url: downloadPath
97
+ });
98
+ await fs.writeFile(localPath, downloadResult.buffer);
99
+ }
100
+ return localPath;
101
+ }
102
+ generateDownloadScript(platform, targetPath, downloadTemplate) {
103
+ this.validatePlatform(platform);
104
+ const fileName = this.getNodeFileName(platform);
105
+ const downloadPath = this.getDownloadPath(platform, downloadTemplate);
106
+ const zipPath = this.scriptService.joinPath(platform, targetPath, fileName);
107
+ const download = this.scriptService.downloadFile(platform, downloadPath, zipPath);
108
+ const unzip = this.scriptService.unzip(platform, zipPath, targetPath);
109
+ return this.scriptService.joinScript(platform, download, unzip);
110
+ }
111
+ getDownloadPath(platform, downloadTemplate) {
112
+ const template = downloadTemplate || 'https://nodejs.org/dist/v{version}/node-v{version}-{os}-{arch}.{ext}';
113
+ const downloadPath = template
114
+ .replace(/{version}/g, exports.REMOTE_NODE_VERSION)
115
+ .replace(/{os}/g, this.getPlatformName(platform))
116
+ .replace(/{arch}/g, platform.arch)
117
+ .replace(/{ext}/g, this.getNodeFileExtension(platform));
118
+ return downloadPath;
119
+ }
120
+ };
121
+ __decorate([
122
+ (0, inversify_1.inject)(request_1.RequestService),
123
+ __metadata("design:type", Object)
124
+ ], RemoteNodeSetupService.prototype, "requestService", void 0);
125
+ __decorate([
126
+ (0, inversify_1.inject)(remote_setup_script_service_1.RemoteSetupScriptService),
127
+ __metadata("design:type", remote_setup_script_service_1.RemoteSetupScriptService)
128
+ ], RemoteNodeSetupService.prototype, "scriptService", void 0);
129
+ RemoteNodeSetupService = __decorate([
130
+ (0, inversify_1.injectable)()
131
+ ], RemoteNodeSetupService);
132
+ exports.RemoteNodeSetupService = RemoteNodeSetupService;
133
+ //# sourceMappingURL=remote-node-setup-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-node-setup-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-node-setup-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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G,QAAQ;aACxB,OAAO,CAAC,YAAY,EAAE,2BAAmB,CAAC;aAC1C,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;aAChD,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC;aACjC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC5D,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ,CAAA;AArFG;IADC,IAAA,kBAAM,EAAC,wBAAc,CAAC;;8DAC2B;AAGlD;IADC,IAAA,kBAAM,EAAC,sDAAwB,CAAC;8BACC,sDAAwB;6DAAC;AANlD,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAwFlC;AAxFY,wDAAsB"}
@@ -0,0 +1,41 @@
1
+ import { RemotePlatform } from '../remote-types';
2
+ export interface RemoteScriptStrategy {
3
+ exec(): string;
4
+ downloadFile(url: string, output: string): string;
5
+ unzip(file: string, directory: string): string;
6
+ mkdir(path: string): string;
7
+ home(): string;
8
+ joinPath(...segments: string[]): string;
9
+ joinScript(...segments: string[]): string;
10
+ }
11
+ export declare class RemoteWindowsScriptStrategy implements RemoteScriptStrategy {
12
+ home(): string;
13
+ exec(): string;
14
+ downloadFile(url: string, output: string): string;
15
+ unzip(file: string, directory: string): string;
16
+ mkdir(path: string): string;
17
+ joinPath(...segments: string[]): string;
18
+ joinScript(...segments: string[]): string;
19
+ }
20
+ export declare class RemotePosixScriptStrategy implements RemoteScriptStrategy {
21
+ home(): string;
22
+ exec(): string;
23
+ downloadFile(url: string, output: string): string;
24
+ unzip(file: string, directory: string): string;
25
+ mkdir(path: string): string;
26
+ joinPath(...segments: string[]): string;
27
+ joinScript(...segments: string[]): string;
28
+ }
29
+ export declare class RemoteSetupScriptService {
30
+ protected windowsStrategy: RemoteWindowsScriptStrategy;
31
+ protected posixStrategy: RemotePosixScriptStrategy;
32
+ protected getStrategy(platform: RemotePlatform): RemoteScriptStrategy;
33
+ home(platform: RemotePlatform): string;
34
+ exec(platform: RemotePlatform): string;
35
+ downloadFile(platform: RemotePlatform, url: string, output: string): string;
36
+ unzip(platform: RemotePlatform, file: string, directory: string): string;
37
+ mkdir(platform: RemotePlatform, path: string): string;
38
+ joinPath(platform: RemotePlatform, ...segments: string[]): string;
39
+ joinScript(platform: RemotePlatform, ...segments: string[]): string;
40
+ }
41
+ //# sourceMappingURL=remote-setup-script-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-setup-script-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-script-service.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACjC,IAAI,IAAI,MAAM,CAAC;IACf,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAClD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,IAAI,MAAM,CAAC;IACf,QAAQ,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACxC,UAAU,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CAC7C;AAED,qBACa,2BAA4B,YAAW,oBAAoB;IAEpE,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAIjD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAI9C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI3B,QAAQ,CAAC,GAAG,QAAQ,EAAE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}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.RemoteSetupScriptService = exports.RemotePosixScriptStrategy = exports.RemoteWindowsScriptStrategy = void 0;
28
+ const core_1 = require("@theia/core");
29
+ const inversify_1 = require("@theia/core/shared/inversify");
30
+ let RemoteWindowsScriptStrategy = class RemoteWindowsScriptStrategy {
31
+ home() {
32
+ return 'PowerShell -Command $HOME';
33
+ }
34
+ exec() {
35
+ return 'PowerShell -Command';
36
+ }
37
+ downloadFile(url, output) {
38
+ return `PowerShell -Command Invoke-WebRequest -Uri "${url}" -OutFile ${output}`;
39
+ }
40
+ unzip(file, directory) {
41
+ return `tar -xf "${file}" -C "${directory}"`;
42
+ }
43
+ mkdir(path) {
44
+ return `PowerShell -Command New-Item -Force -itemType Directory -Path "${path}"`;
45
+ }
46
+ joinPath(...segments) {
47
+ return segments.join('\\');
48
+ }
49
+ joinScript(...segments) {
50
+ return segments.join('\r\n');
51
+ }
52
+ };
53
+ RemoteWindowsScriptStrategy = __decorate([
54
+ (0, inversify_1.injectable)()
55
+ ], RemoteWindowsScriptStrategy);
56
+ exports.RemoteWindowsScriptStrategy = RemoteWindowsScriptStrategy;
57
+ let RemotePosixScriptStrategy = class RemotePosixScriptStrategy {
58
+ home() {
59
+ return 'eval echo ~';
60
+ }
61
+ exec() {
62
+ return 'sh -c';
63
+ }
64
+ downloadFile(url, output) {
65
+ return `
66
+ if [ "$(command -v wget)" ]; then
67
+ echo "Downloading using wget"
68
+ wget -O "${output}" "${url}"
69
+ elif [ "$(command -v curl)" ]; then
70
+ echo "Downloading using curl"
71
+ curl "${url}" --output "${output}"
72
+ else
73
+ echo "Failed to find wget or curl."
74
+ exit 1
75
+ fi
76
+ `.trim();
77
+ }
78
+ unzip(file, directory) {
79
+ return `tar -xf "${file}" -C "${directory}"`;
80
+ }
81
+ mkdir(path) {
82
+ return `mkdir -p "${path}"`;
83
+ }
84
+ joinPath(...segments) {
85
+ return segments.join('/');
86
+ }
87
+ joinScript(...segments) {
88
+ return segments.join('\n');
89
+ }
90
+ };
91
+ RemotePosixScriptStrategy = __decorate([
92
+ (0, inversify_1.injectable)()
93
+ ], RemotePosixScriptStrategy);
94
+ exports.RemotePosixScriptStrategy = RemotePosixScriptStrategy;
95
+ let RemoteSetupScriptService = class RemoteSetupScriptService {
96
+ getStrategy(platform) {
97
+ return platform.os === core_1.OS.Type.Windows ? this.windowsStrategy : this.posixStrategy;
98
+ }
99
+ home(platform) {
100
+ return this.getStrategy(platform).home();
101
+ }
102
+ exec(platform) {
103
+ return this.getStrategy(platform).exec();
104
+ }
105
+ downloadFile(platform, url, output) {
106
+ return this.getStrategy(platform).downloadFile(url, output);
107
+ }
108
+ unzip(platform, file, directory) {
109
+ return this.getStrategy(platform).unzip(file, directory);
110
+ }
111
+ mkdir(platform, path) {
112
+ return this.getStrategy(platform).mkdir(path);
113
+ }
114
+ joinPath(platform, ...segments) {
115
+ return this.getStrategy(platform).joinPath(...segments);
116
+ }
117
+ joinScript(platform, ...segments) {
118
+ return this.getStrategy(platform).joinScript(...segments);
119
+ }
120
+ };
121
+ __decorate([
122
+ (0, inversify_1.inject)(RemoteWindowsScriptStrategy),
123
+ __metadata("design:type", RemoteWindowsScriptStrategy)
124
+ ], RemoteSetupScriptService.prototype, "windowsStrategy", void 0);
125
+ __decorate([
126
+ (0, inversify_1.inject)(RemotePosixScriptStrategy),
127
+ __metadata("design:type", RemotePosixScriptStrategy)
128
+ ], RemoteSetupScriptService.prototype, "posixStrategy", void 0);
129
+ RemoteSetupScriptService = __decorate([
130
+ (0, inversify_1.injectable)()
131
+ ], RemoteSetupScriptService);
132
+ exports.RemoteSetupScriptService = RemoteSetupScriptService;
133
+ //# sourceMappingURL=remote-setup-script-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-setup-script-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-script-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;;;;AAEhF,sCAAiC;AACjC,4DAAkE;AAclE,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAEpC,IAAI;QACA,OAAO,2BAA2B,CAAC;IACvC,CAAC;IAED,IAAI;QACA,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,GAAW,EAAE,MAA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CAAC;CACJ,CAAA;AApCG;IADC,IAAA,kBAAM,EAAC,2BAA2B,CAAC;8BACT,2BAA2B;iEAAC;AAGvD;IADC,IAAA,kBAAM,EAAC,yBAAyB,CAAC;8BACT,yBAAyB;+DAAC;AAN1C,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAuCpC;AAvCY,4DAAwB"}
@@ -0,0 +1,29 @@
1
+ import { RemoteConnection, RemoteExecResult, RemotePlatform, RemoteStatusReport } from '../remote-types';
2
+ import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
3
+ import { RemoteCopyService } from './remote-copy-service';
4
+ import { RemoteNativeDependencyService } from './remote-native-dependency-service';
5
+ import { RemoteNodeSetupService } from './remote-node-setup-service';
6
+ import { RemoteSetupScriptService } from './remote-setup-script-service';
7
+ export interface RemoteSetupOptions {
8
+ connection: RemoteConnection;
9
+ report: RemoteStatusReport;
10
+ nodeDownloadTemplate?: string;
11
+ }
12
+ export declare class RemoteSetupService {
13
+ protected readonly copyService: RemoteCopyService;
14
+ protected readonly nativeDependencyService: RemoteNativeDependencyService;
15
+ protected readonly nodeSetupService: RemoteNodeSetupService;
16
+ protected readonly scriptService: RemoteSetupScriptService;
17
+ protected readonly applicationPackage: ApplicationPackage;
18
+ setup(options: RemoteSetupOptions): Promise<void>;
19
+ protected startApplication(connection: RemoteConnection, platform: RemotePlatform, remotePath: string, nodeDir: string): Promise<number>;
20
+ protected detectRemotePlatform(connection: RemoteConnection): Promise<RemotePlatform>;
21
+ protected getRemoteHomeDirectory(connection: RemoteConnection, platform: RemotePlatform): Promise<string>;
22
+ protected getRemoteAppName(): string;
23
+ protected cleanupDirectoryName(name: string): string;
24
+ protected mkdirRemote(connection: RemoteConnection, platform: RemotePlatform, remotePath: string): Promise<void>;
25
+ protected dirExistsRemote(connection: RemoteConnection, remotePath: string): Promise<boolean>;
26
+ protected unzipRemote(connection: RemoteConnection, platform: RemotePlatform, remoteFile: string, remoteDirectory: string): Promise<void>;
27
+ protected executeScriptRemote(connection: RemoteConnection, platform: RemotePlatform, script: string): Promise<RemoteExecResult>;
28
+ }
29
+ //# sourceMappingURL=remote-setup-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-setup-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IAC/B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,qBACa,kBAAkB;IAG3B,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,6BAA6B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;IAG5D,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;IAG3D,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAEpD,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;cAyCvC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,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