@eclipse-che/workspace-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-1675348695 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @eclipse-che/workspace-client

Weekly Downloads

65

Version

0.0.1-1675348695

License

EPL-2.0

Unpacked Size

225 kB

Total Files

16

Last publish

Collaborators

  • svor
  • eclipse_che
  • ashumilova
  • florentbenoit
  • mkuznets