@eclipse-emfcloud/coffee-custom-commands-example
Advanced tools
Comparing version 0.2.0-next.e746384.40 to 0.2.0-next.e9ebcb4.46
@@ -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); |
{ | ||
"name": "@eclipse-emfcloud/coffee-custom-commands-example", | ||
"version": "0.2.0-next.e746384.40+e746384", | ||
"version": "0.2.0-next.e9ebcb4.46+e9ebcb4", | ||
"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.e746384.40+e746384", | ||
"@eclipse-emfcloud/modelserver-plugin-ext": "0.2.0-next.e9ebcb4.46+e9ebcb4", | ||
"inversify": "^5.1.1" | ||
@@ -49,3 +49,3 @@ }, | ||
}, | ||
"gitHead": "e746384fe2a31ddecd147965cbd5c0427bace8c4" | ||
"gitHead": "e9ebcb42f1ae5d31bd5bcb84a2bb4305c98a86f1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
34342
160