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

@eclipse-emfcloud/coffee-custom-commands-example

Package Overview
Dependencies
Maintainers
8
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-emfcloud/coffee-custom-commands-example - npm Package Compare versions

Comparing version 0.2.0-next.55b519b.29 to 0.2.0-next.5df3bac.51

10

lib/example-command.js

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

const inversify_1 = require("inversify");
const URI = require("urijs");
/**

@@ -65,6 +66,7 @@ * A simple example of a plug-in that provides custom commands.

getCommands(_modelUri, customCommand) {
const [modelURI, elementID] = customCommand.owner.$ref.split('#');
const commandModelUri = new URI(customCommand.owner.$ref).fragment('');
const elementID = new URI(customCommand.owner.$ref).fragment();
return async (executor) => {
var _a;
const element = await this.modelServerClient.getElementById(modelURI, elementID, isTask);
const element = await this.modelServerClient.getElementById(commandModelUri, elementID, isTask);
if (element) {

@@ -75,3 +77,3 @@ this.logger.debug('Got an element: %s.', element);

this.logger.debug(`Setting duration to ${newDuration}.`);
const setOp = (0, modelserver_client_1.replace)(modelURI, element, 'duration', newDuration);
const setOp = (0, modelserver_client_1.replace)(commandModelUri, element, 'duration', newDuration);
const executionResult = (await executor.applyPatch(setOp)).patch;

@@ -92,3 +94,3 @@ if (!executionResult || !executionResult.length) {

const newNewDuration = oldDuration + newValue;
const doubleOp = (0, modelserver_client_1.replace)(modelURI, element, 'duration', newNewDuration);
const doubleOp = (0, modelserver_client_1.replace)(commandModelUri, element, 'duration', newNewDuration);
this.logger.debug(`Updating duration to ${newNewDuration}.`);

@@ -95,0 +97,0 @@ return executor.applyPatch(doubleOp).then(() => true);

6

package.json
{
"name": "@eclipse-emfcloud/coffee-custom-commands-example",
"version": "0.2.0-next.55b519b.29+55b519b",
"version": "0.2.0-next.5df3bac.51+5df3bac",
"description": "Example custom command plug-in for the Model Server.",

@@ -27,3 +27,3 @@ "license": "(EPL-2.0 OR MIT)",

"dependencies": {
"@eclipse-emfcloud/modelserver-plugin-ext": "0.2.0-next.55b519b.29+55b519b",
"@eclipse-emfcloud/modelserver-plugin-ext": "0.2.0-next.5df3bac.51+5df3bac",
"inversify": "^5.1.1"

@@ -49,3 +49,3 @@ },

},
"gitHead": "55b519b108e4c09db3a33bd06ccccb9cf833af5f"
"gitHead": "5df3bacdb0d30c8e7742e73e60f9d5159fc4351e"
}

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