Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-glsp/protocol

Package Overview
Dependencies
Maintainers
6
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-glsp/protocol - npm Package Compare versions

Comparing version 1.1.0-next.697cc23.237 to 1.1.0-next.698b9de.254

lib/client-server-protocol/base-glsp-client.d.ts

9

lib/action-protocol/element-selection.d.ts

@@ -35,2 +35,6 @@ /********************************************************************************

deselectedElementsIDs: string[];
/**
* Whether all currently selected elements should be deselected.
*/
deselectAll?: boolean;
}

@@ -42,4 +46,7 @@ export declare namespace SelectAction {

selectedElementsIDs?: string[];
deselectedElementsIDs?: string[];
deselectedElementsIDs?: string[] | boolean;
}): SelectAction;
function addSelection(selectedElementsIDs: string[]): SelectAction;
function removeSelection(deselectedElementsIDs: string[]): SelectAction;
function setSelection(selectedElementsIDs: string[]): SelectAction;
}

@@ -46,0 +53,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectAllAction = exports.SelectAction = void 0;
const array_util_1 = require("../utils/array-util");
const type_util_1 = require("../utils/type-util");

@@ -14,5 +15,24 @@ const base_protocol_1 = require("./base-protocol");

function create(options = {}) {
return Object.assign({ kind: SelectAction.KIND, selectedElementsIDs: [], deselectedElementsIDs: [] }, options);
var _a, _b;
const deselectedElementsIDs = (_a = options.deselectedElementsIDs) !== null && _a !== void 0 ? _a : [];
return {
kind: SelectAction.KIND,
selectedElementsIDs: (_b = options.selectedElementsIDs) !== null && _b !== void 0 ? _b : [],
deselectedElementsIDs: (0, array_util_1.isStringArray)(deselectedElementsIDs, true) ? deselectedElementsIDs : [],
deselectAll: typeof deselectedElementsIDs === 'boolean' ? deselectedElementsIDs : false
};
}
SelectAction.create = create;
function addSelection(selectedElementsIDs) {
return create({ selectedElementsIDs });
}
SelectAction.addSelection = addSelection;
function removeSelection(deselectedElementsIDs) {
return create({ deselectedElementsIDs });
}
SelectAction.removeSelection = removeSelection;
function setSelection(selectedElementsIDs) {
return create({ selectedElementsIDs, deselectedElementsIDs: true });
}
SelectAction.setSelection = setSelection;
})(SelectAction = exports.SelectAction || (exports.SelectAction = {}));

@@ -19,0 +39,0 @@ var SelectAllAction;

2

lib/action-protocol/element-text-editing.d.ts
/********************************************************************************
* Copyright (c) 2020-2022 EclipseSource and others.
* Copyright (c) 2020-2023 EclipseSource and others.
*

@@ -4,0 +4,0 @@ * This program and the accompanying materials are made available under the

@@ -50,3 +50,2 @@ "use strict";

*/
// eslint-disable-next-line no-shadow
let Severity;

@@ -59,3 +58,2 @@ (function (Severity) {

Severity[Severity["OK"] = 4] = "OK";
// eslint-disable-next-line no-shadow
Severity[Severity["NONE"] = 5] = "NONE";

@@ -62,0 +60,0 @@ })(Severity = ValidationStatus.Severity || (ValidationStatus.Severity = {}));

@@ -5,3 +5,3 @@ "use strict";

/********************************************************************************
* Copyright (c) 2021-2022 STMicroelectronics and others.
* Copyright (c) 2021-2023 STMicroelectronics and others.
*

@@ -8,0 +8,0 @@ * This program and the accompanying materials are made available under the

import { ActionMessage } from '../action-protocol';
import { Disposable } from '../disposable/disposable';
import { DisposeClientSessionParameters, InitializeClientSessionParameters, InitializeParameters, InitializeResult } from './types';

@@ -100,4 +101,5 @@ export declare class ApplicationIdProvider {

* @param handler The action message handler
* @returns A {@link Disposable} that can be used to unregister the handler
*/
onActionMessage(handler: ActionMessageHandler): void;
onActionMessage(handler: ActionMessageHandler): Disposable;
}

@@ -104,0 +106,0 @@ export declare namespace GLSPClient {

@@ -29,3 +29,2 @@ "use strict";

exports.ApplicationIdProvider = ApplicationIdProvider;
// eslint-disable-next-line no-shadow
var ClientState;

@@ -32,0 +31,0 @@ (function (ClientState) {

@@ -19,5 +19,5 @@ /********************************************************************************

/**
* Interface for implementations of a server component using json-rpc for client-server communication.
* Interface for implementations of a ts server component.
* Based on the specification of the Graphical Language Server Protocol:
* https://github.com/eclipse-glsp/glsp/blob/master/PROTOCOL.md
* https://www.eclipse.org/glsp/documentation/protocol/
*/

@@ -24,0 +24,0 @@ export interface GLSPServer {

@@ -31,10 +31,11 @@ /********************************************************************************

export * from './action-protocol';
export * from './client-server-protocol/base-glsp-client';
export * from './client-server-protocol/glsp-client';
export * from './client-server-protocol/glsp-server';
export * from './client-server-protocol/jsonrpc/base-jsonrpc-glsp-client';
export * from './client-server-protocol/jsonrpc/glsp-jsonrpc-client';
export * from './client-server-protocol/jsonrpc/glsp-jsonrpc-server';
export * from './client-server-protocol/jsonrpc/websocket-connection';
export * from './client-server-protocol/types';
export * from './disposable/disposable';
export * from './jsonrpc/base-jsonrpc-glsp-client';
export * from './jsonrpc/glsp-jsonrpc-client';
export * from './jsonrpc/glsp-jsonrpc-server';
export * from './jsonrpc/websocket-connection';
export * from './model/default-types';

@@ -41,0 +42,0 @@ export * from './model/model-schema';

@@ -49,10 +49,11 @@ "use strict";

__exportStar(require("./action-protocol"), exports);
__exportStar(require("./client-server-protocol/base-glsp-client"), exports);
__exportStar(require("./client-server-protocol/glsp-client"), exports);
__exportStar(require("./client-server-protocol/glsp-server"), exports);
__exportStar(require("./client-server-protocol/jsonrpc/base-jsonrpc-glsp-client"), exports);
__exportStar(require("./client-server-protocol/jsonrpc/glsp-jsonrpc-client"), exports);
__exportStar(require("./client-server-protocol/jsonrpc/glsp-jsonrpc-server"), exports);
__exportStar(require("./client-server-protocol/jsonrpc/websocket-connection"), exports);
__exportStar(require("./client-server-protocol/types"), exports);
__exportStar(require("./disposable/disposable"), exports);
__exportStar(require("./jsonrpc/base-jsonrpc-glsp-client"), exports);
__exportStar(require("./jsonrpc/glsp-jsonrpc-client"), exports);
__exportStar(require("./jsonrpc/glsp-jsonrpc-server"), exports);
__exportStar(require("./jsonrpc/websocket-connection"), exports);
__exportStar(require("./model/default-types"), exports);

@@ -59,0 +60,0 @@ __exportStar(require("./model/model-schema"), exports);

@@ -30,3 +30,3 @@ /********************************************************************************

* Initializes a container with the given {@link ContainerConfiguration}. The container configuration
* consists of the set of {@link ContainerModule}s that should be loaded in the container and/or
* consists of the set of {@link ContainerModule}s that should be loaded in the container.
* In addition, for more fine-grained control {@link ModuleConfiguration}s can be passed as part fo the container configuration

@@ -33,0 +33,0 @@ * Module loading is distinct,this means each module will only get loaded once even if it is configured multiple times.

@@ -8,3 +8,3 @@ "use strict";

* Initializes a container with the given {@link ContainerConfiguration}. The container configuration
* consists of the set of {@link ContainerModule}s that should be loaded in the container and/or
* consists of the set of {@link ContainerModule}s that should be loaded in the container.
* In addition, for more fine-grained control {@link ModuleConfiguration}s can be passed as part fo the container configuration

@@ -11,0 +11,0 @@ * Module loading is distinct,this means each module will only get loaded once even if it is configured multiple times.

{
"name": "@eclipse-glsp/protocol",
"version": "1.1.0-next.697cc23.237+697cc23",
"version": "1.1.0-next.698b9de.254+698b9de",
"description": "The protocol definition for client-server communication in GLSP",

@@ -49,3 +49,3 @@ "keywords": [

"dependencies": {
"sprotty-protocol": "0.13.0-next.f4445dd.342",
"sprotty-protocol": "0.14.0-next.02bbac0.26",
"uuid": "7.0.3",

@@ -63,3 +63,3 @@ "vscode-jsonrpc": "^8.0.2"

},
"gitHead": "697cc23a264a10d95c1970941e77ae5de7d3edcf"
"gitHead": "698b9de3c249e10b84941f97845b39799e54353f"
}

@@ -11,4 +11,4 @@ # Eclipse GLSP - Protocol

For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/).
If you have questions, contact us on our [spectrum chat](https://spectrum.chat/glsp/) and have a look at our [communication and support options](https://www.eclipse.org/glsp/contact/).
If you have questions, please raise them in the [discussions](https://github.com/eclipse-glsp/glsp/discussions) and have a look at our [communication and support options](https://www.eclipse.org/glsp/contact/).
![alt](https://www.eclipse.org/glsp/images/diagramanimated.gif)

@@ -48,3 +48,4 @@ /********************************************************************************

selectedElementsIDs: [],
deselectedElementsIDs: []
deselectedElementsIDs: [],
deselectAll: false
};

@@ -57,3 +58,4 @@ expect(SelectAction.create()).to.deep.equals(expected);

selectedElementsIDs: ['selected'],
deselectedElementsIDs: ['deselected']
deselectedElementsIDs: ['deselected'],
deselectAll: false
};

@@ -63,3 +65,49 @@ const { selectedElementsIDs, deselectedElementsIDs } = expected;

});
it('should return an object conforming to the interface with matching properties for the given required and optional arguments: deselectAll', () => {
const expected: SelectAction = {
kind: 'elementSelected',
selectedElementsIDs: ['selected'],
deselectedElementsIDs: [],
deselectAll: true
};
const { selectedElementsIDs } = expected;
expect(SelectAction.create({ deselectedElementsIDs: true, selectedElementsIDs })).to.deep.equals(expected);
});
});
describe('addSelection', () => {
it('should return an object conforming to the interface with matching properties for the given required and optional arguments', () => {
const expected: SelectAction = {
kind: 'elementSelected',
selectedElementsIDs: ['selected'],
deselectedElementsIDs: [],
deselectAll: false
};
const { selectedElementsIDs } = expected;
expect(SelectAction.addSelection(selectedElementsIDs)).to.deep.equals(expected);
});
});
describe('removeSelection', () => {
it('should return an object conforming to the interface with matching properties for the given required and optional arguments', () => {
const expected: SelectAction = {
kind: 'elementSelected',
selectedElementsIDs: [],
deselectedElementsIDs: ['deselected'],
deselectAll: false
};
const { deselectedElementsIDs } = expected;
expect(SelectAction.removeSelection(deselectedElementsIDs)).to.deep.equals(expected);
});
});
describe('setSelection', () => {
it('should return an object conforming to the interface with matching properties for the given required and optional arguments', () => {
const expected: SelectAction = {
kind: 'elementSelected',
selectedElementsIDs: ['selected'],
deselectedElementsIDs: [],
deselectAll: true
};
const { selectedElementsIDs } = expected;
expect(SelectAction.setSelection(selectedElementsIDs)).to.deep.equals(expected);
});
});
});

@@ -66,0 +114,0 @@

@@ -17,2 +17,3 @@ /********************************************************************************

import * as sprotty from 'sprotty-protocol/lib/actions';
import { isStringArray } from '../utils/array-util';
import { hasArrayProp, hasBooleanProp } from '../utils/type-util';

@@ -40,2 +41,7 @@ import { Action } from './base-protocol';

deselectedElementsIDs: string[];
/**
* Whether all currently selected elements should be deselected.
*/
deselectAll?: boolean;
}

@@ -50,10 +56,23 @@

export function create(options: { selectedElementsIDs?: string[]; deselectedElementsIDs?: string[] } = {}): SelectAction {
export function create(options: { selectedElementsIDs?: string[]; deselectedElementsIDs?: string[] | boolean } = {}): SelectAction {
const deselectedElementsIDs = options.deselectedElementsIDs ?? [];
return {
kind: KIND,
selectedElementsIDs: [],
deselectedElementsIDs: [],
...options
selectedElementsIDs: options.selectedElementsIDs ?? [],
deselectedElementsIDs: isStringArray(deselectedElementsIDs, true) ? deselectedElementsIDs : [],
deselectAll: typeof deselectedElementsIDs === 'boolean' ? deselectedElementsIDs : false
};
}
export function addSelection(selectedElementsIDs: string[]): SelectAction {
return create({ selectedElementsIDs });
}
export function removeSelection(deselectedElementsIDs: string[]): SelectAction {
return create({ deselectedElementsIDs });
}
export function setSelection(selectedElementsIDs: string[]): SelectAction {
return create({ selectedElementsIDs, deselectedElementsIDs: true });
}
}

@@ -60,0 +79,0 @@

/********************************************************************************
* Copyright (c) 2020-2022 EclipseSource and others.
* Copyright (c) 2020-2023 EclipseSource and others.
*

@@ -167,3 +167,2 @@ * This program and the accompanying materials are made available under the

*/
// eslint-disable-next-line no-shadow
export enum Severity {

@@ -175,3 +174,2 @@ FATAL,

OK,
// eslint-disable-next-line no-shadow
NONE

@@ -178,0 +176,0 @@ }

/********************************************************************************
* Copyright (c) 2022 STMicroelectronics and others.
* Copyright (c) 2022-2023 STMicroelectronics and others.
*

@@ -4,0 +4,0 @@ * This program and the accompanying materials are made available under the

/********************************************************************************
* Copyright (c) 2021-2022 STMicroelectronics and others.
* Copyright (c) 2021-2023 STMicroelectronics and others.
*

@@ -4,0 +4,0 @@ * This program and the accompanying materials are made available under the

@@ -19,2 +19,3 @@ /********************************************************************************

import { ActionMessage } from '../action-protocol';
import { Disposable } from '../disposable/disposable';
import { DisposeClientSessionParameters, InitializeClientSessionParameters, InitializeParameters, InitializeResult } from './types';

@@ -34,3 +35,2 @@

// eslint-disable-next-line no-shadow
export enum ClientState {

@@ -138,4 +138,5 @@ /**

* @param handler The action message handler
* @returns A {@link Disposable} that can be used to unregister the handler
*/
onActionMessage(handler: ActionMessageHandler): void;
onActionMessage(handler: ActionMessageHandler): Disposable;
}

@@ -142,0 +143,0 @@ export namespace GLSPClient {

@@ -21,5 +21,5 @@ /********************************************************************************

/**
* Interface for implementations of a server component using json-rpc for client-server communication.
* Interface for implementations of a ts server component.
* Based on the specification of the Graphical Language Server Protocol:
* https://github.com/eclipse-glsp/glsp/blob/master/PROTOCOL.md
* https://www.eclipse.org/glsp/documentation/protocol/
*/

@@ -26,0 +26,0 @@ export interface GLSPServer {

@@ -22,3 +22,3 @@ /********************************************************************************

declare module 'sprotty-protocol/lib/actions' {
// eslint-disable-next-line no-shadow
// eslint-disable-next-line @typescript-eslint/no-shadow
namespace SetViewportAction {

@@ -28,3 +28,3 @@ export function is(object: any): object is SetViewportAction;

// eslint-disable-next-line no-shadow
// eslint-disable-next-line @typescript-eslint/no-shadow
namespace SetBoundsAction {

@@ -52,10 +52,11 @@ export function is(object: any): object is SetBoundsAction;

export * from './action-protocol';
export * from './client-server-protocol/base-glsp-client';
export * from './client-server-protocol/glsp-client';
export * from './client-server-protocol/glsp-server';
export * from './client-server-protocol/jsonrpc/base-jsonrpc-glsp-client';
export * from './client-server-protocol/jsonrpc/glsp-jsonrpc-client';
export * from './client-server-protocol/jsonrpc/glsp-jsonrpc-server';
export * from './client-server-protocol/jsonrpc/websocket-connection';
export * from './client-server-protocol/types';
export * from './disposable/disposable';
export * from './jsonrpc/base-jsonrpc-glsp-client';
export * from './jsonrpc/glsp-jsonrpc-client';
export * from './jsonrpc/glsp-jsonrpc-server';
export * from './jsonrpc/websocket-connection';
export * from './model/default-types';

@@ -62,0 +63,0 @@ export * from './model/model-schema';

@@ -17,3 +17,3 @@ /********************************************************************************

import { Container, ContainerModule, interfaces } from 'inversify';
import { asArray, distinctAdd, MaybeArray, remove } from './array-util';
import { MaybeArray, asArray, distinctAdd, remove } from './array-util';
import { hasFunctionProp, hasNumberProp } from './type-util';

@@ -34,3 +34,3 @@

* Initializes a container with the given {@link ContainerConfiguration}. The container configuration
* consists of the set of {@link ContainerModule}s that should be loaded in the container and/or
* consists of the set of {@link ContainerModule}s that should be loaded in the container.
* In addition, for more fine-grained control {@link ModuleConfiguration}s can be passed as part fo the container configuration

@@ -37,0 +37,0 @@ * Module loading is distinct,this means each module will only get loaded once even if it is configured multiple times.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc