Socket
Book a DemoInstallSign in
Socket

@eclipse-che/workspace-client

Package Overview
Dependencies
Maintainers
5
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-che/workspace-client

This is a client for workspace REST API and workspace master JSON-RPC API interactions.

latest
Source
npmnpm
Version
0.0.1-1675348695
Version published
Maintainers
5
Created
Source

Workspace client

This is a client for workspace REST API and workspace master JSON-RPC API interactions.

Examples

REST API client

import WorkspaceClient from '@eclipse-che/workspace-client';

const restApiClient = WorkspaceClient.getRestApi();
// get list of workspaces
const promise = restApiClient.getAll();
promise.then((workspaces) => {
    // process workspaces here
});

JSON-RPC API client

import WorkspaceClient from '@eclipse-che/workspace-client';

const entryPoint = '/api/workspace';
const masterApiClient = WorkspaceClient.getJsonRpcApi(entryPoint);
const connectionPromise = masterApiClient.connect(entryPoint);
// get client ID
connectionPromise.then(() => {
    const clientId = masterApiClient.getClientId();
});
const statusChangeHandler = message => {
    const status = message.status;
};
// subscribe to workspace status changes
masterApiClient.subscribeWorkspaceStatus('workspace-id', statusChangeHandler);

License

EPL-2

FAQs

Package last updated on 02 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts