This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(task-plugin): bump to devfile 2.0 API
Change-Id: Ib64a9a1b8e4f15ffba869e79bfe7aa1aa0a87b00 Signed-off-by: Florent Benoit <fbenoit@redhat.com>
- Loading branch information
Showing
14 changed files
with
271 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
extensions/eclipse-che-theia-plugin-ext/src/browser/che-endpoint-main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2018-2021 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
***********************************************************************/ | ||
|
||
import { ComponentExposedEndpoint, ExposedEndpoint } from '@eclipse-che/theia-remote-api/lib/common/endpoint-service'; | ||
|
||
import { CheEndpointMain } from '../common/che-protocol'; | ||
import { EndpointService } from '@eclipse-che/theia-remote-api/lib/common/endpoint-service'; | ||
import { interfaces } from 'inversify'; | ||
|
||
export class CheEndpointMainImpl implements CheEndpointMain { | ||
private readonly endpointService: EndpointService; | ||
|
||
constructor(container: interfaces.Container) { | ||
this.endpointService = container.get(EndpointService); | ||
} | ||
|
||
async $getEndpoints(): Promise<ComponentExposedEndpoint[]> { | ||
return this.endpointService.getEndpoints(); | ||
} | ||
async $getEndpointsByName(...names: string[]): Promise<ExposedEndpoint[]> { | ||
return this.endpointService.getEndpointsByName(...names); | ||
} | ||
async $getEndpointsByType(type: string): Promise<ExposedEndpoint[]> { | ||
return this.$getEndpointsByType(type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
extensions/eclipse-che-theia-plugin-ext/src/plugin/che-endpoint.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2018-2021 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
***********************************************************************/ | ||
|
||
import { CheEndpoint, CheEndpointMain, PLUGIN_RPC_CONTEXT } from '../common/che-protocol'; | ||
|
||
import { RPCProtocol } from '@theia/plugin-ext/lib/common/rpc-protocol'; | ||
import { endpoint } from '@eclipse-che/plugin'; | ||
|
||
export class CheEndpointImpl implements CheEndpoint { | ||
private readonly endpointMain: CheEndpointMain; | ||
|
||
constructor(rpc: RPCProtocol) { | ||
this.endpointMain = rpc.getProxy(PLUGIN_RPC_CONTEXT.CHE_ENDPOINT_MAIN); | ||
} | ||
|
||
async getEndpoints(): Promise<endpoint.ComponentExposedEndpoint[]> { | ||
return this.endpointMain.$getEndpoints(); | ||
} | ||
async getEndpointsByName(...names: string[]): Promise<endpoint.ExposedEndpoint[]> { | ||
return this.endpointMain.$getEndpointsByName(...names); | ||
} | ||
|
||
async getEndpointsByType(type: string): Promise<endpoint.ExposedEndpoint[]> { | ||
return this.endpointMain.$getEndpointsByType(type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2021 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
***********************************************************************/ | ||
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
const chePlugin: any = {}; | ||
chePlugin.devfile = { | ||
get: jest.fn(), | ||
getComponentStatuses: jest.fn(), | ||
}; | ||
|
||
chePlugin.endpoint = { | ||
getEndpointsByType: jest.fn(), | ||
}; | ||
|
||
module.exports = chePlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.