@theia/workspace 1.45.1 → 1.46.0-next.72

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 (118) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/canonical-uri-service.d.ts +11 -11
  3. package/lib/browser/canonical-uri-service.js +59 -59
  4. package/lib/browser/diff-service.d.ts +10 -10
  5. package/lib/browser/diff-service.js +85 -85
  6. package/lib/browser/index.d.ts +7 -7
  7. package/lib/browser/index.js +34 -34
  8. package/lib/browser/quick-open-workspace.d.ts +25 -25
  9. package/lib/browser/quick-open-workspace.js +137 -137
  10. package/lib/browser/untitled-workspace-exit-dialog.d.ts +19 -19
  11. package/lib/browser/untitled-workspace-exit-dialog.js +74 -74
  12. package/lib/browser/workspace-breadcrumbs-contribution.d.ts +10 -10
  13. package/lib/browser/workspace-breadcrumbs-contribution.js +66 -66
  14. package/lib/browser/workspace-commands.d.ts +117 -117
  15. package/lib/browser/workspace-commands.js +601 -601
  16. package/lib/browser/workspace-commands.spec.d.ts +1 -1
  17. package/lib/browser/workspace-commands.spec.js +127 -127
  18. package/lib/browser/workspace-compare-handler.d.ts +26 -26
  19. package/lib/browser/workspace-compare-handler.js +66 -66
  20. package/lib/browser/workspace-delete-handler.d.ts +75 -75
  21. package/lib/browser/workspace-delete-handler.js +214 -214
  22. package/lib/browser/workspace-duplicate-handler.d.ts +30 -30
  23. package/lib/browser/workspace-duplicate-handler.js +86 -86
  24. package/lib/browser/workspace-frontend-contribution.d.ts +110 -110
  25. package/lib/browser/workspace-frontend-contribution.js +546 -546
  26. package/lib/browser/workspace-frontend-contribution.js.map +1 -1
  27. package/lib/browser/workspace-frontend-module.d.ts +3 -3
  28. package/lib/browser/workspace-frontend-module.js +91 -91
  29. package/lib/browser/workspace-input-dialog.d.ts +19 -19
  30. package/lib/browser/workspace-input-dialog.js +74 -74
  31. package/lib/browser/workspace-preferences.d.ts +11 -11
  32. package/lib/browser/workspace-preferences.js +46 -46
  33. package/lib/browser/workspace-schema-updater.d.ts +34 -34
  34. package/lib/browser/workspace-schema-updater.js +153 -153
  35. package/lib/browser/workspace-service.d.ts +184 -184
  36. package/lib/browser/workspace-service.js +739 -739
  37. package/lib/browser/workspace-storage-service.d.ts +15 -15
  38. package/lib/browser/workspace-storage-service.js +80 -80
  39. package/lib/browser/workspace-trust-preferences.d.ts +21 -21
  40. package/lib/browser/workspace-trust-preferences.js +65 -65
  41. package/lib/browser/workspace-trust-service.d.ts +27 -27
  42. package/lib/browser/workspace-trust-service.js +152 -152
  43. package/lib/browser/workspace-uri-contribution.d.ts +20 -20
  44. package/lib/browser/workspace-uri-contribution.js +113 -113
  45. package/lib/browser/workspace-uri-contribution.spec.d.ts +1 -1
  46. package/lib/browser/workspace-uri-contribution.spec.js +169 -169
  47. package/lib/browser/workspace-user-working-directory-provider.d.ts +12 -12
  48. package/lib/browser/workspace-user-working-directory-provider.js +62 -62
  49. package/lib/browser/workspace-utils.d.ts +15 -15
  50. package/lib/browser/workspace-utils.js +54 -54
  51. package/lib/browser/workspace-variable-contribution.d.ts +23 -23
  52. package/lib/browser/workspace-variable-contribution.js +237 -237
  53. package/lib/browser/workspace-window-title-updater.d.ts +7 -7
  54. package/lib/browser/workspace-window-title-updater.js +57 -57
  55. package/lib/browser-only/browser-only-workspace-server.d.ts +13 -0
  56. package/lib/browser-only/browser-only-workspace-server.d.ts.map +1 -0
  57. package/lib/browser-only/browser-only-workspace-server.js +81 -0
  58. package/lib/browser-only/browser-only-workspace-server.js.map +1 -0
  59. package/lib/browser-only/workspace-frontend-only-module.d.ts +4 -0
  60. package/lib/browser-only/workspace-frontend-only-module.d.ts.map +1 -0
  61. package/lib/browser-only/workspace-frontend-only-module.js +30 -0
  62. package/lib/browser-only/workspace-frontend-only-module.js.map +1 -0
  63. package/lib/common/index.d.ts +3 -3
  64. package/lib/common/index.js +30 -30
  65. package/lib/common/test/mock-workspace-server.d.ts +7 -7
  66. package/lib/common/test/mock-workspace-server.js +35 -35
  67. package/lib/common/untitled-workspace-service.d.ts +8 -8
  68. package/lib/common/untitled-workspace-service.js +60 -60
  69. package/lib/common/workspace-file-service.d.ts +26 -26
  70. package/lib/common/workspace-file-service.js +71 -71
  71. package/lib/common/workspace-protocol.d.ts +26 -26
  72. package/lib/common/workspace-protocol.js +23 -23
  73. package/lib/node/default-workspace-server.d.ts +65 -65
  74. package/lib/node/default-workspace-server.js +248 -248
  75. package/lib/node/default-workspace-server.spec.d.ts +1 -1
  76. package/lib/node/default-workspace-server.spec.js +85 -85
  77. package/lib/node/index.d.ts +2 -2
  78. package/lib/node/index.js +29 -29
  79. package/lib/node/workspace-backend-module.d.ts +3 -3
  80. package/lib/node/workspace-backend-module.js +33 -33
  81. package/package.json +9 -6
  82. package/src/browser/canonical-uri-service.ts +57 -57
  83. package/src/browser/diff-service.ts +62 -62
  84. package/src/browser/index.ts +23 -23
  85. package/src/browser/quick-open-workspace.ts +112 -112
  86. package/src/browser/untitled-workspace-exit-dialog.ts +70 -70
  87. package/src/browser/workspace-breadcrumbs-contribution.ts +56 -56
  88. package/src/browser/workspace-commands.spec.ts +153 -153
  89. package/src/browser/workspace-commands.ts +588 -588
  90. package/src/browser/workspace-compare-handler.ts +56 -56
  91. package/src/browser/workspace-delete-handler.ts +212 -212
  92. package/src/browser/workspace-duplicate-handler.ts +75 -75
  93. package/src/browser/workspace-frontend-contribution.ts +537 -537
  94. package/src/browser/workspace-frontend-module.ts +118 -118
  95. package/src/browser/workspace-input-dialog.ts +61 -61
  96. package/src/browser/workspace-preferences.ts +58 -58
  97. package/src/browser/workspace-schema-updater.ts +150 -150
  98. package/src/browser/workspace-service.ts +780 -780
  99. package/src/browser/workspace-storage-service.ts +67 -67
  100. package/src/browser/workspace-trust-preferences.ts +76 -76
  101. package/src/browser/workspace-trust-service.ts +147 -147
  102. package/src/browser/workspace-uri-contribution.spec.ts +191 -191
  103. package/src/browser/workspace-uri-contribution.ts +97 -97
  104. package/src/browser/workspace-user-working-directory-provider.ts +49 -49
  105. package/src/browser/workspace-utils.ts +45 -45
  106. package/src/browser/workspace-variable-contribution.ts +222 -222
  107. package/src/browser/workspace-window-title-updater.ts +45 -45
  108. package/src/browser-only/browser-only-workspace-server.ts +69 -0
  109. package/src/browser-only/workspace-frontend-only-module.ts +28 -0
  110. package/src/common/index.ts +19 -19
  111. package/src/common/test/mock-workspace-server.ts +29 -29
  112. package/src/common/untitled-workspace-service.ts +50 -50
  113. package/src/common/workspace-file-service.ts +72 -72
  114. package/src/common/workspace-protocol.ts +47 -47
  115. package/src/node/default-workspace-server.spec.ts +100 -100
  116. package/src/node/default-workspace-server.ts +244 -244
  117. package/src/node/index.ts +18 -18
  118. package/src/node/workspace-backend-module.ts +38 -38
@@ -1,16 +1,16 @@
1
- import { StorageService } from '@theia/core/lib/browser/storage-service';
2
- import { WorkspaceService } from './workspace-service';
3
- import { FileStat } from '@theia/filesystem/lib/common/files';
4
- export declare class WorkspaceStorageService implements StorageService {
5
- private prefix;
6
- private initialized;
7
- protected storageService: StorageService;
8
- protected workspaceService: WorkspaceService;
9
- protected init(): void;
10
- setData<T>(key: string, data: T): Promise<void>;
11
- getData<T>(key: string, defaultValue?: T): Promise<T | undefined>;
12
- protected prefixWorkspaceURI(originalKey: string): string;
13
- protected getPrefix(workspaceStat: FileStat | undefined): string;
14
- private updatePrefix;
15
- }
1
+ import { StorageService } from '@theia/core/lib/browser/storage-service';
2
+ import { WorkspaceService } from './workspace-service';
3
+ import { FileStat } from '@theia/filesystem/lib/common/files';
4
+ export declare class WorkspaceStorageService implements StorageService {
5
+ private prefix;
6
+ private initialized;
7
+ protected storageService: StorageService;
8
+ protected workspaceService: WorkspaceService;
9
+ protected init(): void;
10
+ setData<T>(key: string, data: T): Promise<void>;
11
+ getData<T>(key: string, defaultValue?: T): Promise<T | undefined>;
12
+ protected prefixWorkspaceURI(originalKey: string): string;
13
+ protected getPrefix(workspaceStat: FileStat | undefined): string;
14
+ private updatePrefix;
15
+ }
16
16
  //# sourceMappingURL=workspace-storage-service.d.ts.map
@@ -1,81 +1,81 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 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.WorkspaceStorageService = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const storage_service_1 = require("@theia/core/lib/browser/storage-service");
30
- const workspace_service_1 = require("./workspace-service");
31
- /*
32
- * Prefixes any stored data with the current workspace path.
33
- */
34
- let WorkspaceStorageService = class WorkspaceStorageService {
35
- init() {
36
- this.initialized = this.workspaceService.roots.then(() => {
37
- this.updatePrefix();
38
- this.workspaceService.onWorkspaceLocationChanged(() => this.updatePrefix());
39
- });
40
- }
41
- async setData(key, data) {
42
- if (!this.prefix) {
43
- await this.initialized;
44
- }
45
- const fullKey = this.prefixWorkspaceURI(key);
46
- return this.storageService.setData(fullKey, data);
47
- }
48
- async getData(key, defaultValue) {
49
- await this.initialized;
50
- const fullKey = this.prefixWorkspaceURI(key);
51
- return this.storageService.getData(fullKey, defaultValue);
52
- }
53
- prefixWorkspaceURI(originalKey) {
54
- return `${this.prefix}:${originalKey}`;
55
- }
56
- getPrefix(workspaceStat) {
57
- return workspaceStat ? workspaceStat.resource.toString() : '_global_';
58
- }
59
- updatePrefix() {
60
- this.prefix = this.getPrefix(this.workspaceService.workspace);
61
- }
62
- };
63
- __decorate([
64
- (0, inversify_1.inject)(storage_service_1.LocalStorageService),
65
- __metadata("design:type", Object)
66
- ], WorkspaceStorageService.prototype, "storageService", void 0);
67
- __decorate([
68
- (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
69
- __metadata("design:type", workspace_service_1.WorkspaceService)
70
- ], WorkspaceStorageService.prototype, "workspaceService", void 0);
71
- __decorate([
72
- (0, inversify_1.postConstruct)(),
73
- __metadata("design:type", Function),
74
- __metadata("design:paramtypes", []),
75
- __metadata("design:returntype", void 0)
76
- ], WorkspaceStorageService.prototype, "init", null);
77
- WorkspaceStorageService = __decorate([
78
- (0, inversify_1.injectable)()
79
- ], WorkspaceStorageService);
80
- exports.WorkspaceStorageService = WorkspaceStorageService;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 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.WorkspaceStorageService = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const storage_service_1 = require("@theia/core/lib/browser/storage-service");
30
+ const workspace_service_1 = require("./workspace-service");
31
+ /*
32
+ * Prefixes any stored data with the current workspace path.
33
+ */
34
+ let WorkspaceStorageService = class WorkspaceStorageService {
35
+ init() {
36
+ this.initialized = this.workspaceService.roots.then(() => {
37
+ this.updatePrefix();
38
+ this.workspaceService.onWorkspaceLocationChanged(() => this.updatePrefix());
39
+ });
40
+ }
41
+ async setData(key, data) {
42
+ if (!this.prefix) {
43
+ await this.initialized;
44
+ }
45
+ const fullKey = this.prefixWorkspaceURI(key);
46
+ return this.storageService.setData(fullKey, data);
47
+ }
48
+ async getData(key, defaultValue) {
49
+ await this.initialized;
50
+ const fullKey = this.prefixWorkspaceURI(key);
51
+ return this.storageService.getData(fullKey, defaultValue);
52
+ }
53
+ prefixWorkspaceURI(originalKey) {
54
+ return `${this.prefix}:${originalKey}`;
55
+ }
56
+ getPrefix(workspaceStat) {
57
+ return workspaceStat ? workspaceStat.resource.toString() : '_global_';
58
+ }
59
+ updatePrefix() {
60
+ this.prefix = this.getPrefix(this.workspaceService.workspace);
61
+ }
62
+ };
63
+ __decorate([
64
+ (0, inversify_1.inject)(storage_service_1.LocalStorageService),
65
+ __metadata("design:type", Object)
66
+ ], WorkspaceStorageService.prototype, "storageService", void 0);
67
+ __decorate([
68
+ (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
69
+ __metadata("design:type", workspace_service_1.WorkspaceService)
70
+ ], WorkspaceStorageService.prototype, "workspaceService", void 0);
71
+ __decorate([
72
+ (0, inversify_1.postConstruct)(),
73
+ __metadata("design:type", Function),
74
+ __metadata("design:paramtypes", []),
75
+ __metadata("design:returntype", void 0)
76
+ ], WorkspaceStorageService.prototype, "init", null);
77
+ WorkspaceStorageService = __decorate([
78
+ (0, inversify_1.injectable)()
79
+ ], WorkspaceStorageService);
80
+ exports.WorkspaceStorageService = WorkspaceStorageService;
81
81
  //# sourceMappingURL=workspace-storage-service.js.map
@@ -1,22 +1,22 @@
1
- import { PreferenceProxy, PreferenceSchema, PreferenceService } from '@theia/core/lib/browser/preferences';
2
- import { interfaces } from '@theia/core/shared/inversify';
3
- export declare const WORKSPACE_TRUST_ENABLED = "security.workspace.trust.enabled";
4
- export declare const WORKSPACE_TRUST_STARTUP_PROMPT = "security.workspace.trust.startupPrompt";
5
- export declare const WORKSPACE_TRUST_EMPTY_WINDOW = "security.workspace.trust.emptyWindow";
6
- export declare enum WorkspaceTrustPrompt {
7
- ALWAYS = "always",
8
- ONCE = "once",
9
- NEVER = "never"
10
- }
11
- export declare const workspaceTrustPreferenceSchema: PreferenceSchema;
12
- export interface WorkspaceTrustConfiguration {
13
- [WORKSPACE_TRUST_ENABLED]: boolean;
14
- [WORKSPACE_TRUST_STARTUP_PROMPT]: WorkspaceTrustPrompt;
15
- [WORKSPACE_TRUST_EMPTY_WINDOW]: boolean;
16
- }
17
- export declare const WorkspaceTrustPreferenceContribution: unique symbol;
18
- export declare const WorkspaceTrustPreferences: unique symbol;
19
- export declare type WorkspaceTrustPreferences = PreferenceProxy<WorkspaceTrustConfiguration>;
20
- export declare function createWorkspaceTrustPreferences(preferences: PreferenceService, schema?: PreferenceSchema): WorkspaceTrustPreferences;
21
- export declare function bindWorkspaceTrustPreferences(bind: interfaces.Bind): void;
1
+ import { PreferenceProxy, PreferenceSchema, PreferenceService } from '@theia/core/lib/browser/preferences';
2
+ import { interfaces } from '@theia/core/shared/inversify';
3
+ export declare const WORKSPACE_TRUST_ENABLED = "security.workspace.trust.enabled";
4
+ export declare const WORKSPACE_TRUST_STARTUP_PROMPT = "security.workspace.trust.startupPrompt";
5
+ export declare const WORKSPACE_TRUST_EMPTY_WINDOW = "security.workspace.trust.emptyWindow";
6
+ export declare enum WorkspaceTrustPrompt {
7
+ ALWAYS = "always",
8
+ ONCE = "once",
9
+ NEVER = "never"
10
+ }
11
+ export declare const workspaceTrustPreferenceSchema: PreferenceSchema;
12
+ export interface WorkspaceTrustConfiguration {
13
+ [WORKSPACE_TRUST_ENABLED]: boolean;
14
+ [WORKSPACE_TRUST_STARTUP_PROMPT]: WorkspaceTrustPrompt;
15
+ [WORKSPACE_TRUST_EMPTY_WINDOW]: boolean;
16
+ }
17
+ export declare const WorkspaceTrustPreferenceContribution: unique symbol;
18
+ export declare const WorkspaceTrustPreferences: unique symbol;
19
+ export declare type WorkspaceTrustPreferences = PreferenceProxy<WorkspaceTrustConfiguration>;
20
+ export declare function createWorkspaceTrustPreferences(preferences: PreferenceService, schema?: PreferenceSchema): WorkspaceTrustPreferences;
21
+ export declare function bindWorkspaceTrustPreferences(bind: interfaces.Bind): void;
22
22
  //# sourceMappingURL=workspace-trust-preferences.d.ts.map
@@ -1,66 +1,66 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2021 EclipseSource 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.bindWorkspaceTrustPreferences = exports.createWorkspaceTrustPreferences = exports.WorkspaceTrustPreferences = exports.WorkspaceTrustPreferenceContribution = exports.workspaceTrustPreferenceSchema = exports.WorkspaceTrustPrompt = exports.WORKSPACE_TRUST_EMPTY_WINDOW = exports.WORKSPACE_TRUST_STARTUP_PROMPT = exports.WORKSPACE_TRUST_ENABLED = void 0;
19
- const preferences_1 = require("@theia/core/lib/browser/preferences");
20
- const nls_1 = require("@theia/core/lib/common/nls");
21
- exports.WORKSPACE_TRUST_ENABLED = 'security.workspace.trust.enabled';
22
- exports.WORKSPACE_TRUST_STARTUP_PROMPT = 'security.workspace.trust.startupPrompt';
23
- exports.WORKSPACE_TRUST_EMPTY_WINDOW = 'security.workspace.trust.emptyWindow';
24
- var WorkspaceTrustPrompt;
25
- (function (WorkspaceTrustPrompt) {
26
- WorkspaceTrustPrompt["ALWAYS"] = "always";
27
- WorkspaceTrustPrompt["ONCE"] = "once";
28
- WorkspaceTrustPrompt["NEVER"] = "never";
29
- })(WorkspaceTrustPrompt = exports.WorkspaceTrustPrompt || (exports.WorkspaceTrustPrompt = {}));
30
- exports.workspaceTrustPreferenceSchema = {
31
- type: 'object',
32
- properties: {
33
- [exports.WORKSPACE_TRUST_ENABLED]: {
34
- description: nls_1.nls.localize('theia/workspace/trustEnabled', 'Controls whether or not workspace trust is enabled. If disabled, all workspaces are trusted.'),
35
- type: 'boolean',
36
- defaultValue: true
37
- },
38
- [exports.WORKSPACE_TRUST_STARTUP_PROMPT]: {
39
- description: nls_1.nls.localizeByDefault('Controls when the startup prompt to trust a workspace is shown.'),
40
- enum: Object.values(WorkspaceTrustPrompt),
41
- defaultValue: WorkspaceTrustPrompt.ALWAYS
42
- },
43
- [exports.WORKSPACE_TRUST_EMPTY_WINDOW]: {
44
- description: nls_1.nls.localize('theia/workspace/trustEmptyWindow', 'Controls whether or not the empty workspace is trusted by default.'),
45
- type: 'boolean',
46
- defaultValue: true
47
- }
48
- }
49
- };
50
- exports.WorkspaceTrustPreferenceContribution = Symbol('WorkspaceTrustPreferenceContribution');
51
- exports.WorkspaceTrustPreferences = Symbol('WorkspaceTrustPreferences');
52
- function createWorkspaceTrustPreferences(preferences, schema = exports.workspaceTrustPreferenceSchema) {
53
- return (0, preferences_1.createPreferenceProxy)(preferences, schema);
54
- }
55
- exports.createWorkspaceTrustPreferences = createWorkspaceTrustPreferences;
56
- function bindWorkspaceTrustPreferences(bind) {
57
- bind(exports.WorkspaceTrustPreferences).toDynamicValue(ctx => {
58
- const preferences = ctx.container.get(preferences_1.PreferenceService);
59
- const contribution = ctx.container.get(exports.WorkspaceTrustPreferenceContribution);
60
- return createWorkspaceTrustPreferences(preferences, contribution.schema);
61
- }).inSingletonScope();
62
- bind(exports.WorkspaceTrustPreferenceContribution).toConstantValue({ schema: exports.workspaceTrustPreferenceSchema });
63
- bind(preferences_1.PreferenceContribution).toService(exports.WorkspaceTrustPreferenceContribution);
64
- }
65
- exports.bindWorkspaceTrustPreferences = bindWorkspaceTrustPreferences;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2021 EclipseSource 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.bindWorkspaceTrustPreferences = exports.createWorkspaceTrustPreferences = exports.WorkspaceTrustPreferences = exports.WorkspaceTrustPreferenceContribution = exports.workspaceTrustPreferenceSchema = exports.WorkspaceTrustPrompt = exports.WORKSPACE_TRUST_EMPTY_WINDOW = exports.WORKSPACE_TRUST_STARTUP_PROMPT = exports.WORKSPACE_TRUST_ENABLED = void 0;
19
+ const preferences_1 = require("@theia/core/lib/browser/preferences");
20
+ const nls_1 = require("@theia/core/lib/common/nls");
21
+ exports.WORKSPACE_TRUST_ENABLED = 'security.workspace.trust.enabled';
22
+ exports.WORKSPACE_TRUST_STARTUP_PROMPT = 'security.workspace.trust.startupPrompt';
23
+ exports.WORKSPACE_TRUST_EMPTY_WINDOW = 'security.workspace.trust.emptyWindow';
24
+ var WorkspaceTrustPrompt;
25
+ (function (WorkspaceTrustPrompt) {
26
+ WorkspaceTrustPrompt["ALWAYS"] = "always";
27
+ WorkspaceTrustPrompt["ONCE"] = "once";
28
+ WorkspaceTrustPrompt["NEVER"] = "never";
29
+ })(WorkspaceTrustPrompt = exports.WorkspaceTrustPrompt || (exports.WorkspaceTrustPrompt = {}));
30
+ exports.workspaceTrustPreferenceSchema = {
31
+ type: 'object',
32
+ properties: {
33
+ [exports.WORKSPACE_TRUST_ENABLED]: {
34
+ description: nls_1.nls.localize('theia/workspace/trustEnabled', 'Controls whether or not workspace trust is enabled. If disabled, all workspaces are trusted.'),
35
+ type: 'boolean',
36
+ defaultValue: true
37
+ },
38
+ [exports.WORKSPACE_TRUST_STARTUP_PROMPT]: {
39
+ description: nls_1.nls.localizeByDefault('Controls when the startup prompt to trust a workspace is shown.'),
40
+ enum: Object.values(WorkspaceTrustPrompt),
41
+ defaultValue: WorkspaceTrustPrompt.ALWAYS
42
+ },
43
+ [exports.WORKSPACE_TRUST_EMPTY_WINDOW]: {
44
+ description: nls_1.nls.localize('theia/workspace/trustEmptyWindow', 'Controls whether or not the empty workspace is trusted by default.'),
45
+ type: 'boolean',
46
+ defaultValue: true
47
+ }
48
+ }
49
+ };
50
+ exports.WorkspaceTrustPreferenceContribution = Symbol('WorkspaceTrustPreferenceContribution');
51
+ exports.WorkspaceTrustPreferences = Symbol('WorkspaceTrustPreferences');
52
+ function createWorkspaceTrustPreferences(preferences, schema = exports.workspaceTrustPreferenceSchema) {
53
+ return (0, preferences_1.createPreferenceProxy)(preferences, schema);
54
+ }
55
+ exports.createWorkspaceTrustPreferences = createWorkspaceTrustPreferences;
56
+ function bindWorkspaceTrustPreferences(bind) {
57
+ bind(exports.WorkspaceTrustPreferences).toDynamicValue(ctx => {
58
+ const preferences = ctx.container.get(preferences_1.PreferenceService);
59
+ const contribution = ctx.container.get(exports.WorkspaceTrustPreferenceContribution);
60
+ return createWorkspaceTrustPreferences(preferences, contribution.schema);
61
+ }).inSingletonScope();
62
+ bind(exports.WorkspaceTrustPreferenceContribution).toConstantValue({ schema: exports.workspaceTrustPreferenceSchema });
63
+ bind(preferences_1.PreferenceContribution).toService(exports.WorkspaceTrustPreferenceContribution);
64
+ }
65
+ exports.bindWorkspaceTrustPreferences = bindWorkspaceTrustPreferences;
66
66
  //# sourceMappingURL=workspace-trust-preferences.js.map
@@ -1,28 +1,28 @@
1
- import { PreferenceChange, StorageService } from '@theia/core/lib/browser';
2
- import { PreferenceService } from '@theia/core/lib/browser/preferences/preference-service';
3
- import { MessageService } from '@theia/core/lib/common/message-service';
4
- import { Deferred } from '@theia/core/lib/common/promise-util';
5
- import { WindowService } from '@theia/core/lib/browser/window/window-service';
6
- import { WorkspaceTrustPreferences } from './workspace-trust-preferences';
7
- import { WorkspaceService } from './workspace-service';
8
- export declare class WorkspaceTrustService {
9
- protected readonly workspaceService: WorkspaceService;
10
- protected readonly preferences: PreferenceService;
11
- protected readonly storage: StorageService;
12
- protected readonly messageService: MessageService;
13
- protected readonly workspaceTrustPref: WorkspaceTrustPreferences;
14
- protected readonly windowService: WindowService;
15
- protected workspaceTrust: Deferred<boolean>;
16
- protected init(): void;
17
- protected doInit(): Promise<void>;
18
- getWorkspaceTrust(): Promise<boolean>;
19
- protected resolveWorkspaceTrust(givenTrust?: boolean): Promise<void>;
20
- protected isWorkspaceTrustResolved(): boolean;
21
- protected calculateWorkspaceTrust(): Promise<boolean | undefined>;
22
- protected loadWorkspaceTrust(): Promise<boolean | undefined>;
23
- protected storeWorkspaceTrust(trust: boolean): Promise<void>;
24
- protected handlePreferenceChange(change: PreferenceChange): Promise<void>;
25
- protected confirmRestart(): Promise<boolean>;
26
- requestWorkspaceTrust(): Promise<boolean | undefined>;
27
- }
1
+ import { PreferenceChange, StorageService } from '@theia/core/lib/browser';
2
+ import { PreferenceService } from '@theia/core/lib/browser/preferences/preference-service';
3
+ import { MessageService } from '@theia/core/lib/common/message-service';
4
+ import { Deferred } from '@theia/core/lib/common/promise-util';
5
+ import { WindowService } from '@theia/core/lib/browser/window/window-service';
6
+ import { WorkspaceTrustPreferences } from './workspace-trust-preferences';
7
+ import { WorkspaceService } from './workspace-service';
8
+ export declare class WorkspaceTrustService {
9
+ protected readonly workspaceService: WorkspaceService;
10
+ protected readonly preferences: PreferenceService;
11
+ protected readonly storage: StorageService;
12
+ protected readonly messageService: MessageService;
13
+ protected readonly workspaceTrustPref: WorkspaceTrustPreferences;
14
+ protected readonly windowService: WindowService;
15
+ protected workspaceTrust: Deferred<boolean>;
16
+ protected init(): void;
17
+ protected doInit(): Promise<void>;
18
+ getWorkspaceTrust(): Promise<boolean>;
19
+ protected resolveWorkspaceTrust(givenTrust?: boolean): Promise<void>;
20
+ protected isWorkspaceTrustResolved(): boolean;
21
+ protected calculateWorkspaceTrust(): Promise<boolean | undefined>;
22
+ protected loadWorkspaceTrust(): Promise<boolean | undefined>;
23
+ protected storeWorkspaceTrust(trust: boolean): Promise<void>;
24
+ protected handlePreferenceChange(change: PreferenceChange): Promise<void>;
25
+ protected confirmRestart(): Promise<boolean>;
26
+ requestWorkspaceTrust(): Promise<boolean | undefined>;
27
+ }
28
28
  //# sourceMappingURL=workspace-trust-service.d.ts.map