@eclipse-che/workspace-client

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

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
37Jun 4, 2021Mar 22, 2018Minified + gzip package size for @eclipse-che/workspace-client in KB

Readme

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.