@theia/vsx-registry 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 (100) hide show
  1. package/README.md +45 -45
  2. package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
  3. package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
  4. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
  5. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
  6. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
  7. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
  8. package/lib/browser/vsx-extension-commands.d.ts +14 -13
  9. package/lib/browser/vsx-extension-commands.d.ts.map +1 -1
  10. package/lib/browser/vsx-extension-commands.js +68 -63
  11. package/lib/browser/vsx-extension-commands.js.map +1 -1
  12. package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
  13. package/lib/browser/vsx-extension-editor-manager.js +49 -49
  14. package/lib/browser/vsx-extension-editor.d.ts +21 -21
  15. package/lib/browser/vsx-extension-editor.js +109 -109
  16. package/lib/browser/vsx-extension.d.ts +146 -143
  17. package/lib/browser/vsx-extension.d.ts.map +1 -1
  18. package/lib/browser/vsx-extension.js +616 -596
  19. package/lib/browser/vsx-extension.js.map +1 -1
  20. package/lib/browser/vsx-extensions-contribution.d.ts +70 -60
  21. package/lib/browser/vsx-extensions-contribution.d.ts.map +1 -1
  22. package/lib/browser/vsx-extensions-contribution.js +375 -344
  23. package/lib/browser/vsx-extensions-contribution.js.map +1 -1
  24. package/lib/browser/vsx-extensions-model.d.ts +75 -72
  25. package/lib/browser/vsx-extensions-model.d.ts.map +1 -1
  26. package/lib/browser/vsx-extensions-model.js +437 -391
  27. package/lib/browser/vsx-extensions-model.js.map +1 -1
  28. package/lib/browser/vsx-extensions-preferences.d.ts +12 -0
  29. package/lib/browser/vsx-extensions-preferences.d.ts.map +1 -0
  30. package/lib/browser/vsx-extensions-preferences.js +47 -0
  31. package/lib/browser/vsx-extensions-preferences.js.map +1 -0
  32. package/lib/browser/vsx-extensions-search-bar.d.ts +22 -14
  33. package/lib/browser/vsx-extensions-search-bar.d.ts.map +1 -1
  34. package/lib/browser/vsx-extensions-search-bar.js +106 -75
  35. package/lib/browser/vsx-extensions-search-bar.js.map +1 -1
  36. package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
  37. package/lib/browser/vsx-extensions-search-model.js +70 -70
  38. package/lib/browser/vsx-extensions-source.d.ts +19 -19
  39. package/lib/browser/vsx-extensions-source.js +102 -102
  40. package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
  41. package/lib/browser/vsx-extensions-view-container.js +179 -179
  42. package/lib/browser/vsx-extensions-widget.d.ts +35 -34
  43. package/lib/browser/vsx-extensions-widget.d.ts.map +1 -1
  44. package/lib/browser/vsx-extensions-widget.js +164 -156
  45. package/lib/browser/vsx-extensions-widget.js.map +1 -1
  46. package/lib/browser/vsx-language-quick-pick-service.d.ts +15 -15
  47. package/lib/browser/vsx-language-quick-pick-service.js +121 -121
  48. package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
  49. package/lib/browser/vsx-registry-frontend-module.d.ts.map +1 -1
  50. package/lib/browser/vsx-registry-frontend-module.js +99 -97
  51. package/lib/browser/vsx-registry-frontend-module.js.map +1 -1
  52. package/lib/common/index.d.ts +3 -3
  53. package/lib/common/index.js +25 -25
  54. package/lib/common/ovsx-client-provider.d.ts +13 -13
  55. package/lib/common/ovsx-client-provider.js +29 -29
  56. package/lib/common/vsx-environment.d.ts +9 -9
  57. package/lib/common/vsx-environment.js +20 -20
  58. package/lib/common/vsx-extension-uri.d.ts +3 -3
  59. package/lib/common/vsx-extension-uri.js +20 -20
  60. package/lib/common/vsx-registry-common-module.d.ts +3 -3
  61. package/lib/common/vsx-registry-common-module.js +57 -57
  62. package/lib/node/vsx-cli.d.ts +9 -9
  63. package/lib/node/vsx-cli.js +41 -41
  64. package/lib/node/vsx-environment-impl.d.ts +14 -14
  65. package/lib/node/vsx-environment-impl.js +61 -61
  66. package/lib/node/vsx-extension-resolver.d.ts +20 -20
  67. package/lib/node/vsx-extension-resolver.js +154 -154
  68. package/lib/node/vsx-registry-backend-module.d.ts +3 -3
  69. package/lib/node/vsx-registry-backend-module.js +35 -35
  70. package/lib/package.spec.js +25 -25
  71. package/package.json +12 -12
  72. package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
  73. package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
  74. package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
  75. package/src/browser/style/extensions.svg +4 -4
  76. package/src/browser/style/index.css +436 -373
  77. package/src/browser/vsx-extension-commands.ts +68 -63
  78. package/src/browser/vsx-extension-editor-manager.ts +42 -42
  79. package/src/browser/vsx-extension-editor.tsx +96 -96
  80. package/src/browser/vsx-extension.tsx +704 -675
  81. package/src/browser/vsx-extensions-contribution.ts +361 -327
  82. package/src/browser/vsx-extensions-model.ts +436 -389
  83. package/src/browser/vsx-extensions-preferences.ts +58 -0
  84. package/src/browser/vsx-extensions-search-bar.tsx +107 -69
  85. package/src/browser/vsx-extensions-search-model.ts +61 -61
  86. package/src/browser/vsx-extensions-source.ts +83 -83
  87. package/src/browser/vsx-extensions-view-container.ts +179 -179
  88. package/src/browser/vsx-extensions-widget.tsx +165 -156
  89. package/src/browser/vsx-language-quick-pick-service.ts +110 -110
  90. package/src/browser/vsx-registry-frontend-module.ts +108 -106
  91. package/src/common/index.ts +19 -19
  92. package/src/common/ovsx-client-provider.ts +35 -35
  93. package/src/common/vsx-environment.ts +27 -27
  94. package/src/common/vsx-extension-uri.ts +20 -20
  95. package/src/common/vsx-registry-common-module.ts +63 -63
  96. package/src/node/vsx-cli.ts +38 -38
  97. package/src/node/vsx-environment-impl.ts +50 -50
  98. package/src/node/vsx-extension-resolver.ts +125 -125
  99. package/src/node/vsx-registry-backend-module.ts +35 -35
  100. package/src/package.spec.ts +29 -29
@@ -1,106 +1,108 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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 '../../src/browser/style/index.css';
18
-
19
- import { ContainerModule } from '@theia/core/shared/inversify';
20
- import {
21
- WidgetFactory, bindViewContribution, FrontendApplicationContribution, ViewContainerIdentifier, OpenHandler, WidgetManager, WebSocketConnectionProvider
22
- } from '@theia/core/lib/browser';
23
- import { VSXExtensionsViewContainer } from './vsx-extensions-view-container';
24
- import { VSXExtensionsContribution } from './vsx-extensions-contribution';
25
- import { VSXExtensionsSearchBar } from './vsx-extensions-search-bar';
26
- import { VSXExtensionsModel } from './vsx-extensions-model';
27
- import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
28
- import { VSXExtensionsWidget, VSXExtensionsWidgetOptions } from './vsx-extensions-widget';
29
- import { VSXExtensionFactory, VSXExtension, VSXExtensionOptions } from './vsx-extension';
30
- import { VSXExtensionEditor } from './vsx-extension-editor';
31
- import { VSXExtensionEditorManager } from './vsx-extension-editor-manager';
32
- import { VSXExtensionsSourceOptions } from './vsx-extensions-source';
33
- import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
34
- import { bindExtensionPreferences } from './recommended-extensions/recommended-extensions-preference-contribution';
35
- import { bindPreferenceProviderOverrides } from './recommended-extensions/preference-provider-overrides';
36
- import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
37
- import { LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
38
- import { VSXLanguageQuickPickService } from './vsx-language-quick-pick-service';
39
-
40
- export default new ContainerModule((bind, unbind, isBound, rebind) => {
41
- bind(VSXEnvironment)
42
- .toDynamicValue(ctx => WebSocketConnectionProvider.createProxy(ctx.container, VSX_ENVIRONMENT_PATH))
43
- .inSingletonScope();
44
- bind(VSXExtension).toSelf();
45
- bind(VSXExtensionFactory).toFactory(ctx => (option: VSXExtensionOptions) => {
46
- const child = ctx.container.createChild();
47
- child.bind(VSXExtensionOptions).toConstantValue(option);
48
- return child.get(VSXExtension);
49
- });
50
- bind(VSXExtensionsModel).toSelf().inSingletonScope();
51
-
52
- bind(VSXExtensionEditor).toSelf();
53
- bind(WidgetFactory).toDynamicValue(ctx => ({
54
- id: VSXExtensionEditor.ID,
55
- createWidget: async (options: VSXExtensionOptions) => {
56
- const extension = await ctx.container.get(VSXExtensionsModel).resolve(options.id);
57
- const child = ctx.container.createChild();
58
- child.bind(VSXExtension).toConstantValue(extension);
59
- return child.get(VSXExtensionEditor);
60
- }
61
- })).inSingletonScope();
62
- bind(VSXExtensionEditorManager).toSelf().inSingletonScope();
63
- bind(OpenHandler).toService(VSXExtensionEditorManager);
64
-
65
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
66
- id: VSXExtensionsWidget.ID,
67
- createWidget: async (options: VSXExtensionsWidgetOptions) => VSXExtensionsWidget.createWidget(container, options)
68
- })).inSingletonScope();
69
- bind(WidgetFactory).toDynamicValue(ctx => ({
70
- id: VSXExtensionsViewContainer.ID,
71
- createWidget: async () => {
72
- const child = ctx.container.createChild();
73
- child.bind(ViewContainerIdentifier).toConstantValue({
74
- id: VSXExtensionsViewContainer.ID,
75
- progressLocationId: 'extensions'
76
- });
77
- child.bind(VSXExtensionsViewContainer).toSelf();
78
- const viewContainer = child.get(VSXExtensionsViewContainer);
79
- const widgetManager = child.get(WidgetManager);
80
- for (const id of [
81
- VSXExtensionsSourceOptions.SEARCH_RESULT,
82
- VSXExtensionsSourceOptions.RECOMMENDED,
83
- VSXExtensionsSourceOptions.INSTALLED,
84
- VSXExtensionsSourceOptions.BUILT_IN,
85
- ]) {
86
- const widget = await widgetManager.getOrCreateWidget(VSXExtensionsWidget.ID, { id });
87
- viewContainer.addWidget(widget, {
88
- initiallyCollapsed: id === VSXExtensionsSourceOptions.BUILT_IN
89
- });
90
- }
91
- return viewContainer;
92
- }
93
- })).inSingletonScope();
94
-
95
- bind(VSXExtensionsSearchModel).toSelf().inSingletonScope();
96
- bind(VSXExtensionsSearchBar).toSelf().inSingletonScope();
97
-
98
- rebind(LanguageQuickPickService).to(VSXLanguageQuickPickService).inSingletonScope();
99
-
100
- bindViewContribution(bind, VSXExtensionsContribution);
101
- bind(FrontendApplicationContribution).toService(VSXExtensionsContribution);
102
- bind(ColorContribution).toService(VSXExtensionsContribution);
103
-
104
- bindExtensionPreferences(bind);
105
- bindPreferenceProviderOverrides(bind, unbind);
106
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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 '../../src/browser/style/index.css';
18
+
19
+ import { ContainerModule } from '@theia/core/shared/inversify';
20
+ import {
21
+ WidgetFactory, bindViewContribution, FrontendApplicationContribution, ViewContainerIdentifier, OpenHandler, WidgetManager, WebSocketConnectionProvider
22
+ } from '@theia/core/lib/browser';
23
+ import { VSXExtensionsViewContainer } from './vsx-extensions-view-container';
24
+ import { VSXExtensionsContribution } from './vsx-extensions-contribution';
25
+ import { VSXExtensionsSearchBar } from './vsx-extensions-search-bar';
26
+ import { VSXExtensionsModel } from './vsx-extensions-model';
27
+ import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
28
+ import { VSXExtensionsWidget, VSXExtensionsWidgetOptions } from './vsx-extensions-widget';
29
+ import { VSXExtensionFactory, VSXExtension, VSXExtensionOptions } from './vsx-extension';
30
+ import { VSXExtensionEditor } from './vsx-extension-editor';
31
+ import { VSXExtensionEditorManager } from './vsx-extension-editor-manager';
32
+ import { VSXExtensionsSourceOptions } from './vsx-extensions-source';
33
+ import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
34
+ import { bindExtensionPreferences } from './recommended-extensions/recommended-extensions-preference-contribution';
35
+ import { bindPreferenceProviderOverrides } from './recommended-extensions/preference-provider-overrides';
36
+ import { bindVsxExtensionsPreferences } from './vsx-extensions-preferences';
37
+ import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
38
+ import { LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
39
+ import { VSXLanguageQuickPickService } from './vsx-language-quick-pick-service';
40
+
41
+ export default new ContainerModule((bind, unbind, isBound, rebind) => {
42
+ bind(VSXEnvironment)
43
+ .toDynamicValue(ctx => WebSocketConnectionProvider.createProxy(ctx.container, VSX_ENVIRONMENT_PATH))
44
+ .inSingletonScope();
45
+ bind(VSXExtension).toSelf();
46
+ bind(VSXExtensionFactory).toFactory(ctx => (option: VSXExtensionOptions) => {
47
+ const child = ctx.container.createChild();
48
+ child.bind(VSXExtensionOptions).toConstantValue(option);
49
+ return child.get(VSXExtension);
50
+ });
51
+ bind(VSXExtensionsModel).toSelf().inSingletonScope();
52
+
53
+ bind(VSXExtensionEditor).toSelf();
54
+ bind(WidgetFactory).toDynamicValue(ctx => ({
55
+ id: VSXExtensionEditor.ID,
56
+ createWidget: async (options: VSXExtensionOptions) => {
57
+ const extension = await ctx.container.get(VSXExtensionsModel).resolve(options.id);
58
+ const child = ctx.container.createChild();
59
+ child.bind(VSXExtension).toConstantValue(extension);
60
+ return child.get(VSXExtensionEditor);
61
+ }
62
+ })).inSingletonScope();
63
+ bind(VSXExtensionEditorManager).toSelf().inSingletonScope();
64
+ bind(OpenHandler).toService(VSXExtensionEditorManager);
65
+
66
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
67
+ id: VSXExtensionsWidget.ID,
68
+ createWidget: async (options: VSXExtensionsWidgetOptions) => VSXExtensionsWidget.createWidget(container, options)
69
+ })).inSingletonScope();
70
+ bind(WidgetFactory).toDynamicValue(ctx => ({
71
+ id: VSXExtensionsViewContainer.ID,
72
+ createWidget: async () => {
73
+ const child = ctx.container.createChild();
74
+ child.bind(ViewContainerIdentifier).toConstantValue({
75
+ id: VSXExtensionsViewContainer.ID,
76
+ progressLocationId: 'extensions'
77
+ });
78
+ child.bind(VSXExtensionsViewContainer).toSelf();
79
+ const viewContainer = child.get(VSXExtensionsViewContainer);
80
+ const widgetManager = child.get(WidgetManager);
81
+ for (const id of [
82
+ VSXExtensionsSourceOptions.SEARCH_RESULT,
83
+ VSXExtensionsSourceOptions.RECOMMENDED,
84
+ VSXExtensionsSourceOptions.INSTALLED,
85
+ VSXExtensionsSourceOptions.BUILT_IN,
86
+ ]) {
87
+ const widget = await widgetManager.getOrCreateWidget(VSXExtensionsWidget.ID, { id });
88
+ viewContainer.addWidget(widget, {
89
+ initiallyCollapsed: id === VSXExtensionsSourceOptions.BUILT_IN
90
+ });
91
+ }
92
+ return viewContainer;
93
+ }
94
+ })).inSingletonScope();
95
+
96
+ bind(VSXExtensionsSearchModel).toSelf().inSingletonScope();
97
+ bind(VSXExtensionsSearchBar).toSelf().inSingletonScope();
98
+
99
+ rebind(LanguageQuickPickService).to(VSXLanguageQuickPickService).inSingletonScope();
100
+
101
+ bindViewContribution(bind, VSXExtensionsContribution);
102
+ bind(FrontendApplicationContribution).toService(VSXExtensionsContribution);
103
+ bind(ColorContribution).toService(VSXExtensionsContribution);
104
+
105
+ bindExtensionPreferences(bind);
106
+ bindPreferenceProviderOverrides(bind, unbind);
107
+ bindVsxExtensionsPreferences(bind);
108
+ });
@@ -1,19 +1,19 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 Ericsson 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 { OVSXClientProvider, OVSXUrlResolver } from './ovsx-client-provider';
18
- export { VSXEnvironment } from './vsx-environment';
19
- export { VSXExtensionUri } from './vsx-extension-uri';
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 Ericsson 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 { OVSXClientProvider, OVSXUrlResolver } from './ovsx-client-provider';
18
+ export { VSXEnvironment } from './vsx-environment';
19
+ export { VSXExtensionUri } from './vsx-extension-uri';
@@ -1,35 +1,35 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 Ericsson 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 { MaybePromise } from '@theia/core/lib/common';
18
- import { RequestService } from '@theia/core/shared/@theia/request';
19
- import type { interfaces } from '@theia/core/shared/inversify';
20
- import { OVSXClient, OVSXHttpClient } from '@theia/ovsx-client';
21
- import { VSXEnvironment } from './vsx-environment';
22
-
23
- export const OVSXUrlResolver = Symbol('OVSXUrlResolver') as symbol & interfaces.Abstract<OVSXUrlResolver>;
24
- export type OVSXUrlResolver = (value: string) => MaybePromise<string>;
25
-
26
- export const OVSXClientProvider = Symbol('OVSXClientProvider') as symbol & interfaces.Abstract<OVSXClientProvider>;
27
- export type OVSXClientProvider = () => MaybePromise<OVSXClient>;
28
-
29
- /**
30
- * @deprecated since 1.32.0
31
- */
32
- export async function createOVSXClient(vsxEnvironment: VSXEnvironment, requestService: RequestService): Promise<OVSXClient> {
33
- const apiUrl = await vsxEnvironment.getRegistryApiUri();
34
- return new OVSXHttpClient(apiUrl, requestService);
35
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 Ericsson 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 { MaybePromise } from '@theia/core/lib/common';
18
+ import { RequestService } from '@theia/core/shared/@theia/request';
19
+ import type { interfaces } from '@theia/core/shared/inversify';
20
+ import { OVSXClient, OVSXHttpClient } from '@theia/ovsx-client';
21
+ import { VSXEnvironment } from './vsx-environment';
22
+
23
+ export const OVSXUrlResolver = Symbol('OVSXUrlResolver') as symbol & interfaces.Abstract<OVSXUrlResolver>;
24
+ export type OVSXUrlResolver = (value: string) => MaybePromise<string>;
25
+
26
+ export const OVSXClientProvider = Symbol('OVSXClientProvider') as symbol & interfaces.Abstract<OVSXClientProvider>;
27
+ export type OVSXClientProvider = () => MaybePromise<OVSXClient>;
28
+
29
+ /**
30
+ * @deprecated since 1.32.0
31
+ */
32
+ export async function createOVSXClient(vsxEnvironment: VSXEnvironment, requestService: RequestService): Promise<OVSXClient> {
33
+ const apiUrl = await vsxEnvironment.getRegistryApiUri();
34
+ return new OVSXHttpClient(apiUrl, requestService);
35
+ }
@@ -1,27 +1,27 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 Ericsson 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 type { OVSXRouterConfig } from '@theia/ovsx-client';
18
-
19
- export const VSX_ENVIRONMENT_PATH = '/services/vsx-environment';
20
-
21
- export const VSXEnvironment = Symbol('VSXEnvironment');
22
- export interface VSXEnvironment {
23
- getRegistryUri(): Promise<string>;
24
- getRegistryApiUri(): Promise<string>;
25
- getVscodeApiVersion(): Promise<string>;
26
- getOvsxRouterConfig?(): Promise<OVSXRouterConfig | undefined>;
27
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 Ericsson 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 type { OVSXRouterConfig } from '@theia/ovsx-client';
18
+
19
+ export const VSX_ENVIRONMENT_PATH = '/services/vsx-environment';
20
+
21
+ export const VSXEnvironment = Symbol('VSXEnvironment');
22
+ export interface VSXEnvironment {
23
+ getRegistryUri(): Promise<string>;
24
+ getRegistryApiUri(): Promise<string>;
25
+ getVscodeApiVersion(): Promise<string>;
26
+ getOvsxRouterConfig?(): Promise<OVSXRouterConfig | undefined>;
27
+ }
@@ -1,20 +1,20 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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 { VSCodeExtensionUri as VSXExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
18
- /** @deprecated since 1.25.0. Import `VSCodeExtensionUri from `plugin-ext-vscode` package instead. */
19
- export { VSXExtensionUri };
20
-
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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 { VSCodeExtensionUri as VSXExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
18
+ /** @deprecated since 1.25.0. Import `VSCodeExtensionUri from `plugin-ext-vscode` package instead. */
19
+ export { VSXExtensionUri };
20
+
@@ -1,63 +1,63 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 Ericsson 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 { ContainerModule } from '@theia/core/shared/inversify';
18
- import { OVSXClientProvider, OVSXUrlResolver } from '../common';
19
- import { RequestService } from '@theia/core/shared/@theia/request';
20
- import { ExtensionIdMatchesFilterFactory, OVSXApiFilter, OVSXApiFilterImpl, OVSXClient, OVSXHttpClient, OVSXRouterClient, RequestContainsFilterFactory } from '@theia/ovsx-client';
21
- import { VSXEnvironment } from './vsx-environment';
22
-
23
- export default new ContainerModule(bind => {
24
- bind(OVSXUrlResolver)
25
- .toFunction(url => url);
26
- bind(OVSXClientProvider)
27
- .toDynamicValue(ctx => {
28
- const vsxEnvironment = ctx.container.get<VSXEnvironment>(VSXEnvironment);
29
- const requestService = ctx.container.get<RequestService>(RequestService);
30
- const urlResolver = ctx.container.get(OVSXUrlResolver);
31
- const clientPromise = Promise
32
- .all([
33
- vsxEnvironment.getRegistryApiUri(),
34
- vsxEnvironment.getOvsxRouterConfig?.(),
35
- ])
36
- .then<OVSXClient>(async ([apiUrl, ovsxRouterConfig]) => {
37
- if (ovsxRouterConfig) {
38
- const clientFactory = OVSXHttpClient.createClientFactory(requestService);
39
- return OVSXRouterClient.FromConfig(
40
- ovsxRouterConfig,
41
- async url => clientFactory(await urlResolver(url)),
42
- [RequestContainsFilterFactory, ExtensionIdMatchesFilterFactory]
43
- );
44
- }
45
- return new OVSXHttpClient(
46
- await urlResolver(apiUrl),
47
- requestService
48
- );
49
- });
50
- // reuse the promise for subsequent calls to this provider
51
- return () => clientPromise;
52
- })
53
- .inSingletonScope();
54
- bind(OVSXApiFilter)
55
- .toDynamicValue(ctx => {
56
- const vsxEnvironment = ctx.container.get<VSXEnvironment>(VSXEnvironment);
57
- const apiFilter = new OVSXApiFilterImpl('-- temporary invalid version value --');
58
- vsxEnvironment.getVscodeApiVersion()
59
- .then(apiVersion => apiFilter.supportedApiVersion = apiVersion);
60
- return apiFilter;
61
- })
62
- .inSingletonScope();
63
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 Ericsson 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 { ContainerModule } from '@theia/core/shared/inversify';
18
+ import { OVSXClientProvider, OVSXUrlResolver } from '../common';
19
+ import { RequestService } from '@theia/core/shared/@theia/request';
20
+ import { ExtensionIdMatchesFilterFactory, OVSXApiFilter, OVSXApiFilterImpl, OVSXClient, OVSXHttpClient, OVSXRouterClient, RequestContainsFilterFactory } from '@theia/ovsx-client';
21
+ import { VSXEnvironment } from './vsx-environment';
22
+
23
+ export default new ContainerModule(bind => {
24
+ bind(OVSXUrlResolver)
25
+ .toFunction(url => url);
26
+ bind(OVSXClientProvider)
27
+ .toDynamicValue(ctx => {
28
+ const vsxEnvironment = ctx.container.get<VSXEnvironment>(VSXEnvironment);
29
+ const requestService = ctx.container.get<RequestService>(RequestService);
30
+ const urlResolver = ctx.container.get(OVSXUrlResolver);
31
+ const clientPromise = Promise
32
+ .all([
33
+ vsxEnvironment.getRegistryApiUri(),
34
+ vsxEnvironment.getOvsxRouterConfig?.(),
35
+ ])
36
+ .then<OVSXClient>(async ([apiUrl, ovsxRouterConfig]) => {
37
+ if (ovsxRouterConfig) {
38
+ const clientFactory = OVSXHttpClient.createClientFactory(requestService);
39
+ return OVSXRouterClient.FromConfig(
40
+ ovsxRouterConfig,
41
+ async url => clientFactory(await urlResolver(url)),
42
+ [RequestContainsFilterFactory, ExtensionIdMatchesFilterFactory]
43
+ );
44
+ }
45
+ return new OVSXHttpClient(
46
+ await urlResolver(apiUrl),
47
+ requestService
48
+ );
49
+ });
50
+ // reuse the promise for subsequent calls to this provider
51
+ return () => clientPromise;
52
+ })
53
+ .inSingletonScope();
54
+ bind(OVSXApiFilter)
55
+ .toDynamicValue(ctx => {
56
+ const vsxEnvironment = ctx.container.get<VSXEnvironment>(VSXEnvironment);
57
+ const apiFilter = new OVSXApiFilterImpl('-- temporary invalid version value --');
58
+ vsxEnvironment.getVscodeApiVersion()
59
+ .then(apiVersion => apiFilter.supportedApiVersion = apiVersion);
60
+ return apiFilter;
61
+ })
62
+ .inSingletonScope();
63
+ });