{"_id":"@eclipse-emfcloud/coffee-custom-routes-example","_rev":"29-9e92a90cb0f7aa4defd91cb0be103c86","name":"@eclipse-emfcloud/coffee-custom-routes-example","dist-tags":{"next":"0.2.0-next.5f3a7a1.52","latest":"0.2.0-next.ce04993.18"},"versions":{"0.2.0-next.ce04993.18":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.ce04993.18","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.ce04993.18+ce04993","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"ce04993de916e356ac692284e7bb9ff5ca0f9218","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.ce04993.18","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-lD3emoeURwcF18Tqn9EzA2B+PKSv2iT4enNBE7GTmUmBPZoXR6K64TRUVHigyghCFW76LBaPIvewhgQd4UibWw==","shasum":"9024fe208a80216059e141e0023d003774964d65","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.ce04993.18.tgz","fileCount":11,"unpackedSize":30948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJhGOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosJhAAkqQIIl6CYQsDl7ZXaKPSBAruf2keNkVI6Qs7+ydWFg+lBkiV\r\n4glFZvsfcVlsf7vV5t26qS7Ilxt/1d5EqUPmUYZ8m7eKesBrGSz1RkcCePZq\r\nIeHsCAMFVd6w8Wln9LwICtAkz1MTwsh9SbHzc6gFpmRfzzU6PO2Paabxkw3u\r\nyQp4YGdgM2//Cezf1OUtnJPE0hAIxaFbUNxWXcZKlMvHLyJK/x031ydIxKur\r\ngvZB2w9YodtXOhMydljKeZUwkN1aOJJN0Knv+4JoLkYAVOVl36ORMntjpbzp\r\nPOThZkfmwSenrHx4PkqsYiayXiQC2BLgR1+4i8sFwgIvGzWcu1ZwZasQJYaS\r\nm9A0uzIGUF3OEzUpglyiJi6GKyPEFMUwOTQ+MmXajmWCFG3O1e1RWVXobV3N\r\nskiu1+TgbH6G/MTL+8IwwFhuLShHvQg6qCpSvOffyT5dEKwrhIGRh+HVRmY7\r\n4MMkoiy46+MGXkKR9ZDUpOqJJFaez/9D81VkUAwN4Yd5VxETK1I1lOL+bpZ9\r\nJiDSQvKm+X+wDVJCTljzUBgdNJEnzJtE1H1KJeyXxBCX5Pii/9DBs2GPM7+E\r\nWQLNoEarDmnjAuC1E1+36bGyqFi3kPPqrktzwrJApYS0aaEEFCfDshmNhk0x\r\nD3z6OLTm7QjUPYH5KLUpEBomTk6E5dXlDIE=\r\n=v1qB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1vv8v+I4m3SCJVUckV2+6X5DCs4MQvkHZD+rtgMtRgAiBZYo9LXLoVzEoyIEujd3IiSswm4PnnCn1117Hqyl6q3Q=="}]},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.ce04993.18_1646662030756_0.29591982777314674"},"_hasShrinkwrap":false},"0.2.0-next.9fc5830.19":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.9fc5830.19","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.9fc5830.19+9fc5830","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"9fc583029b021b7ac8a9a55e5790b720c559a068","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.9fc5830.19","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-pnvbl1/Iu1I3/CYAWCmoIDpcYtFu9RyQfQHgDKM2XTTZLjcJADvPm/o/K2kM2mklmn10JNoSnVZHAkkq8zafGQ==","shasum":"591382fbd537a09da8956537548531d304203068","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.9fc5830.19.tgz","fileCount":11,"unpackedSize":30948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ2EeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgXw/+IFuo5Xst7VWuaZHGPvHQiJmIgnF82L9OsqDVlRiKMBrqeGGO\r\ntZNfhzeb/wvt6kBIfbGOr4tlgq1FFNjdL2ndq5qTKrL6gfwgYZU3OO3VPkEQ\r\nhQ5sP1ekruummbTRit04L52helDj8WVqj2qoUrbmREf8aVkpDnadgU5QCQ+3\r\nrSP+S3m/YxFkHEhJDrOvwBIqzeAjkkEARDAiJWts1Hx5SrsO5ULgg4Ss7Y1+\r\n/ayFJfzM4pysxvqZmr6RQ8I9j2A3ufryAC/7UE89jlsyzJuqDn3eWKtasajA\r\nNgdJEqptLc+oFBq6FRkHPU9i3D8FYjKYChAMgIy2BsdHCq9k5oMrEioYKLZy\r\nIqOTeWUWwfO1bQao/DQZtIR8PY/9XSD0l3duhXtTHoeR5d0A89GyWhAWEZhI\r\ndk4EUUO/QVmfiwl6iLwLk2Gk7L4cjOmLT/+1h6rvqUoTYr0Z0hQSvKE78+bN\r\nFCGscB6YJu3IjspS0bYwQVsUg4QdUoOfXiU6BOVEe17vpOuNKucDRl3p9Yqj\r\nAnGNGlDE1lpNf4N3lZFtSs/KSZvinBl85fxbUoCK+tqOA4jHV2/vY44pAxBA\r\nTqjmNgJJxiFILuVO8kgEk7LDdMQXNSEDTEA54AG6shUj0HnvfDkHD+6rRpZX\r\nYsbc5p3HAPObkXY0OHlmdbWbvvF6SfRzpKU=\r\n=fza4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSka2N5M94zMWHcBMLWVkogjoiy5Btzi7+FZYDEz4ZmQIhAOfqBBmwABsNzi4Hl/mPtNJ6KU9Pqy6Wpx9ikNud0IzV"}]},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.9fc5830.19_1646747933922_0.3695215419526505"},"_hasShrinkwrap":false},"0.2.0-next.46e550b.20":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.46e550b.20","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.46e550b.20+46e550b","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"46e550b857dd3546d19725118e16f119fcd7ef7c","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.46e550b.20","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-D1oBizc7m7iNi6xA+ELOhVkd82que48v6RAW/j8VfFBkegqXiymBxv8+KOa4YzbIKJQGfpBdfgRx7BCO5z9seQ==","shasum":"16c958ab07f6e9d7a8288f12511121a730354a60","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.46e550b.20.tgz","fileCount":11,"unpackedSize":30948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMw6TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozEg//Wt2cDUwhNtK9graorai013sV56lUTH0wOCAsQKH9qZ0ozs2q\r\nLCYVNtj787SYgVMWZDrJ7Z0E5JSBafqc1XFzNnwdxDeaMbu5x2iza18xFitn\r\nC/ODYY4sM3bUyKjM/5H/yNIHT6jBzqFAOnaVP1L5x+XANSFMOq01a4ihW3A2\r\nl4ita72tQm31HTLXkIS1L/rjdCiLn3wYrZL9fghVoyJQXgmUIcr9FAW/CK3Z\r\nSPJAHoXfmy/3PyeUWSLHlmgrks2JuEWoFYx6EbzkOzfuffo6S0bp7BrX8xZQ\r\noVgWxnp229OKNMcL4dzH0O8xBKjeBz8ZQVeX43BCNR6xshQb0z3wtTKFoV12\r\nGBnNnezrQ+C8xeQNUBP1iaMRDGjjjP4zWmugCSniELyiLfg62O9mIN8mDUAs\r\nNONSkxx5TTHxywN/lcWn5lXPQqSA5kndBOxyDruiZxmcaCPglI9rc1gi0Di3\r\nvM4Lp7ms6aZQAP5QTyhXiBjvnO+wtAlsYcRPTtyojDLjLxQ2OIzGyulZuAle\r\nwmGQ+Eygwm1YF1mtq6dLBvCgiA20ZLrw23fHkc6JFM9kJ3R29/jrhpEyLHwB\r\nRnkIVHSWKAeERm8/Ce0x2TvQwI+5I5vSl9T9LWR8v4FF4v0tyInvGX4Mj+5x\r\nKnImXaCXAbdDTI5AvoNOd3qPPwJCUejbFQ0=\r\n=uDfy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDT+paLI+fF7mXht7BmsZIB7sG2w09aPe298hXdcKO5AiBPRjgdTz3RBVZhTSxvvNz2k7oOMvz/yYFuMfCoIwM8WA=="}]},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.46e550b.20_1647513235296_0.1593913875262032"},"_hasShrinkwrap":false},"0.2.0-next.78c57e3.21":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.78c57e3.21","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.78c57e3.21+78c57e3","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"78c57e3df521ffc8e67dfbc5814882edc192fd89","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.78c57e3.21","_nodeVersion":"12.22.11","_npmVersion":"lerna/4.0.0/node@v12.22.11+x64 (linux)","dist":{"integrity":"sha512-RaDVVRVi0CSjH5a5nvQ9KuajO0uBIDb0o2XfbnQyq+4PoeyCuZo3IpSGkYBhX5VeI9UzHRfhbV9afsct4bBvYg==","shasum":"ea423977f1a2c2e17ead2e77d1f7469a11a78b98","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.78c57e3.21.tgz","fileCount":11,"unpackedSize":31125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPdeoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJtw//QjFugGIa1s2Q1tLMaHEYzjOnDpOriyk4OlM6xdHz+7Xb2iY1\r\nLrEMj1BMAb0QxS1Yzc2DNo/IQzD9TOzXbe07gv6ETXvFHwrd2OnRmg6c4keu\r\nQIotOtgrqGMFvUir1PVWagSJJed8vsZ1iz9ADGTZJ9AuA5Wtr8juGu56ND6i\r\nofL8jJokJGkfIi8yDccDgAA1OFFfeCyff4r3XFtsO0PFAIurTHP1nLfoIz91\r\n5j3tsARlukpq5QGP4VuHPDTs2bO17sRzoAjlPP+wGNVYxQlDEUBMxPtHINDQ\r\nivm+RJ2W5Ek6vPQMRqqt5zr2aCo4sdSQgDJ/yF470h/v2kjlJnefphdCkt0h\r\nBI7tyMuZqnPBi6HOJOsLxD0pFdErSRecMN6LeKOD4QX8rktOcLEIxzninhV0\r\nn7o50Esp91HvhloOvmK3Ifdfc/xzAazXopgx7sRV0Lnb9L2Dsjj9wnVF8N17\r\nSz30Ga/FbhHJVujSRVupbXClMcJ6XAXFLqXNfAyMP26OWXZf+Sw1IuRL9UpL\r\nTY2asMToI1/WdWmr8Y1uAXMB4jJYgRLcvyj40qxRp06Hh7OFWNjuGuSd7Heo\r\n7oYyB1lPS5P6GmrIRgyKkrimMPUEHZ/AywnnKmYvw1nWsvQLINcDFWPDS61b\r\nnwgKwf8aQrt0455pbf/HW7S3rp9L9FSOF8A=\r\n=0zrW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeosKGMXJ1wbeRLgehxVLSt+85pteFmBgvkgkPi+IWawIhAIjrTXPXop9yUryp+g3CA/IMOU3H+g0mXI4RSjE4rOb2"}]},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.78c57e3.21_1648220071954_0.07988986242897211"},"_hasShrinkwrap":false},"0.2.0-next.4f5c0b2.23":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.4f5c0b2.23","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.4f5c0b2.23+4f5c0b2","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"4f5c0b2c2af215e9afb7199fb9b45490f6ed49be","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.4f5c0b2.23","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-J5d4yAA68nsyviHQu315MSMByMxL5BJUB7TfDqcA0XrYK8yG5KYmw+bzboXn1ssnEQ1sp1dmZBzQ4bouJI0zgQ==","shasum":"9011b7cfc7e50ce664f0fc082a507f377bcf726e","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.4f5c0b2.23.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKtkAemUIhif+5qn0lTfW8dkVyEB9S0ibtmmDbxbM84AiEAoxxJrZl60tlR6qh0knIGbYaoW6Aj03cOTCZ5OBZgkWg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiU+0YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTAxAAkKsp6LAdXOurElfAhDO9okv8SpA1hGF9I4m5sb5BKdKCmc7k\r\nGsdP4lo2iocCL5VuzmXJ36q4YN9aBFt6ORYP30mBd4B1ufyqknATUkiEkQuI\r\nyJtecTHIY02Phjv8ZRkcukJxN88WUQf0vzZn6ZqagRuNJktz4t7UlJzyd12y\r\nlaIV8ihpjXZkxFb4aCVZw0a2TGI0MeLP4+oO3Mdh4RlKJgXuyK+BHwegJPB3\r\nVpMiY9F0so8QXt1ESZ4AoWKwoBzj+EW16U7Xxvv37Mg+XEZQrxGRM4QuSBKN\r\nc4X7zH3sj4TNUBcT0YKvUluZIpvQwUbnBGSTdecaQwsocEJ3cif9dWtdSU5Y\r\npGUwxzok8aV5s2D5UlrAKuYkRHM3OsW/4flQSETX3x0R6vazUU9s6zwf4Uss\r\nVXHslR9OIRAFWTQ8ih5wuPR0z8uwDv0S7x8fxIFOX4DUJubgZwYdQMXM80aZ\r\nIfjEKzuT/UeGLl8AXK7rqYJI9W8gcOvc7RmsGDxe24x0aUcJq6/WTbNVS5ar\r\nrcCB9eJyIL5O70Xbmvg16F7TCbcZM3Nwip91c89HBe4bFU/K1FYLNDmZ+Kj6\r\nm2vNW6+ibbC0U6K1N91mRFntV6dvqWtnYFlzUPU3vlhiFm3NHIJzdX2IC2eZ\r\nItLULscCEtSFh89msYy8Z/D2Ox9+9bj0uFw=\r\n=Ixz9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.4f5c0b2.23_1649667351914_0.9316342576688419"},"_hasShrinkwrap":false},"0.2.0-next.16b2e5e.24":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.16b2e5e.24","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.16b2e5e.24+16b2e5e","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"16b2e5ed6441a4fd5b63e2bc9b6bd13ae1c44405","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.16b2e5e.24","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-1j8dOzjkn4ML2E8GN/NDtZww3zYsPHKUVrGsYejg8ZB46c7P/ZKsoBHNxGoJEC1BfMUdkXcVycPAN3my4OMDAA==","shasum":"991ccdcf123da0ffe09ee536fa6f6ad1926b64ab","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.16b2e5e.24.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLM+uvW1sg+yffb8oZolKkkL/am61+NBMNLl0qIFyXnQIgPpnvoHxCaUDgk/y0Nf847kEYEZUggrTyQ+kY3rND8YI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVdo4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFyxAAjus+e5+Gs4r4g65SGHuOU1ExyiNSCZUC54tkNaxrNMyGVMY4\r\nM8ejz2BW/yrmrIl3jFkoZQqrHdhDr4HHldEQkCrXZ5rDfG9DKtxHEr4mGTnR\r\nPF7IxeCUJesbON+/8Ron9jWM/YYL3uzxgGbNkoRastqA/T1X8Ku080QKtbqn\r\n4iOKrhhPGXaH/jTMhMEFTwrfUZNdmzc2DzO3Z3V4CziyCR/zrmhaMqJU7HNu\r\nFLXtRzpmdmkS8LE9CjCKiYOk0Z2Xbrf3pBzIOOGIBcHFmeC8HFJJ6iIXiFUI\r\nEfkPq5GOE1QKfNxyCsGH58CljsBHwyJGfrThJbpb04GHU+cpKww3gDWLRlD8\r\nDBaEcl+/iycGXjmYZWBxuuMwA3hMozp14zL5gmcExVdnN82XyacpAXU2t5Io\r\nosDLbCHOwyDHdT/hO4qNcTJJOTeerG51rK5NZnbXTb7LO3LLKlMndfXXwHKr\r\nKBPgkzjVJ6ir0TiTcvixuSgT4RvioFFhf9SIWWJeqaol/+I4VG+v9ocnGLz9\r\n9C4IQ6L1iogeCgCNVrxq6Udkq2qUB//b6+tiLqqzu98fup3wmPWMjRwTm7hZ\r\nfzNzxcpqiS0nZ/4hZSFQxJDXkEOY11up/lhCVZJSpFA0/YAjq7kAvoxc8KNq\r\nSJkp9CiGD5Deuhz5K/knOkjHfFYgAaRSNBI=\r\n=+r98\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.16b2e5e.24_1649793592171_0.866488636849543"},"_hasShrinkwrap":false},"0.2.0-next.8645d4b.27":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.8645d4b.27","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.8645d4b.27+8645d4b","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"8645d4be4d399914237f4b7deae61ba652e7575d","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.8645d4b.27","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-olQbakT0I/dgh1ZCsj38AHFaNIXoRY5uDeWAxj4NtB8jSI+iLckA//96motS81HoMUrejQzqpZtr1xhvcuwinQ==","shasum":"8fb26bef5e5ab85afa447e1e0b20e4f6711ced42","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.8645d4b.27.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCK2rie22OLX/l9PBtXgYXN0ksgoW9OJqZ9UxuTrAbIEQIgfKtJld0aOQj0dc7z6+/mQO7MqIx/AdQaYeWlAR/rOGg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVud9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmvBAAmQkqaQ3zCzCUF2Y3PXLdZZhEGdEDy5/kwgdosFIk2n2+HoKi\r\nIlHbgG363SQQ+D20MxWI0fXeGWQPkewlSglF6w3k3uHpGgGbVV8c2Xlt+CRA\r\nq57BZIKH1TdaDpGmytnSZWbOVD1JFKSruvv1AIGo13r8pxUi+TKI/ZmdU/ah\r\nIVOdWOW536IhYVRwWWAi4ZNkdIf1LKtd8Vj/ogGsqKWod5XyLCtH0HSEPkrm\r\nbmeniwJRoj5CDVCEgDUukpfMWlTnbUkaTkKyjoK5k3+yiUIvGB5C1hVoBA/f\r\ncgqCqGD6CWqlYC8358yx1AO80CAFhSGGys4mao/OSiprZT6AaA0KRlMoR+mR\r\nbEkKcRKr1c62zNBvAQ1xrnGlGJEP8qnwVxAonHfA3MLi3FpVqRNrQlwfhEtw\r\nv/jLMNIEdftzKhnQbA56Q/Qy14YwKE+CShonqSE4gASzyy7bZ5rxVUsJe2SU\r\n6eGqr0j5hoKguDL5sjojCEDgNpWZ/2reGf+liSgNHx20y0DKOiBBsmX31JIn\r\nJm6+myeNGL/vW1g3aboq0R7JdnNXLwZGlNMLPCl6IR9KHzN761rZFLrQCU9O\r\n4sMvO/h8TKNNsUogGZZrKrrLnANBw8rSBhPmj5onxv9ud6pxxSDtdS1jDypi\r\nZGH1MqvP9j+qPcANQlePgQwuG50tgZMqVQ0=\r\n=MD+Q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.8645d4b.27_1649862525473_0.5821565250649205"},"_hasShrinkwrap":false},"0.2.0-next.55b519b.29":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.55b519b.29","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.55b519b.29+55b519b","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"55b519b108e4c09db3a33bd06ccccb9cf833af5f","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.55b519b.29","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-hFUoF7vyofDoDxN/urF8aCioUYF8En7QOqKXLzR3ILMS6Fu0Xgkj3e0N26vaoYLeOJ0dN8iyU/GAl+pU41UxwQ==","shasum":"3627ce2e1905b741e5df66ed29fdee9f0ab1597e","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.55b519b.29.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN/kUX4oY3ZX9FbuOXO29tHDkhwSN2yW/Ho4d3sR6tOAIhAJLKiB33k1OPC0OsMpLzJH3SiMXauE4X+SDOtEUzaTcA"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicPJwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrs1RAAizOwLjay/NEk2XukiiTdVmJWAEM99A5raLUgun3Fa1plQiFN\r\n2XETiahyzVUM0FH+aNDaoATR69GTknlzkWG1sZ8KkYZZ5PCSsxt8pKCs6dhe\r\nLDyAX0PPW1iHmRZS4JRAlSX3Dzi6wlIL8Uf18qI3T9paCNkV7G5uoqyGmkgT\r\nXSW3cwJe8+ctr5s0y11Sdb97zictDt7o5Bqaryx0RkcOz0HFD3MJxzYpkSgJ\r\n0Vfh5icZPmQZc1xC9jhN/Ymyju57383Xq9Y6Am1fXVqdmb3GDSLH7Ypx5qN2\r\n0MsoKXe4KK5eTrJ3xA3rTfSxHLvjUGdA1TV7DTa36+crow2h3bNW9FSyj3Kx\r\na/OC/4x3QoYBsy0kKStRsL4zDV3PeTrTSBDcSjYbPYauYy1dh/5UFayRtWar\r\n/ryyWjDa32Uwd2UAATnbVcNhk+UwVIuMnwL/RCOaTbb6Zo+fxifyEzvvX6L5\r\nZcZdrqUy/Ns5ilW/xCkYBgYKKuc8cMt8gQzByLLczBzUAmHfjVIbgbCdXdA6\r\n8MsqvVy59x9JMxvedWKse+z3bf8/BZDdVOxO1DcgR0u7gslfSKBDsyfhmv3N\r\nBywM5Pv48WzWMz9jXRPIyudgU6olaBwQzXa74wFGq9o4K8RZ8A9PyiEpl/0K\r\nBksi725/MHI6Fuo8Xw5Ccn0+c+LhrYmykrs=\r\n=lHEl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.55b519b.29_1651569263999_0.33002371532526875"},"_hasShrinkwrap":false},"0.2.0-next.d9b3b27.30":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.d9b3b27.30","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.d9b3b27.30+d9b3b27","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"d9b3b27cb095d547d0a474c187cc836abb75fbc0","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.d9b3b27.30","_nodeVersion":"12.22.11","_npmVersion":"lerna/4.0.0/node@v12.22.11+x64 (linux)","dist":{"integrity":"sha512-scRNB5PML9s866CSnKb1G0ofGFZkXFPgKz6jgJwZfcTbziARQPSt3GcIQcuCILQwk7LHS2LBLRWv+Dj+bAB8FA==","shasum":"44615b61dc522f870e6cfe3a5765d5b54a3e3a78","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.d9b3b27.30.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKn79Hap3O/IcU9LjHfH0CfDVwOdGmyZWVErz0HEgM5wIhALwjVjNdBsOQtATnhleJ35xESzAbdDn2m3W4ItEdKlYH"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJic80sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvAg/+M5zBsXuM3YOLjp9K7yRNWs41XOQbiGaNC5Hez2h7SdbadPIU\r\n1yVxduFj0mFy6nqxNGU2cGJF74alEBlCJwvcplZDig8MpEEeXhBn8kuTkAEG\r\n7tIHvq1kpBD0Wx4FgsNGsxPqpVJ8OEVrit+w5BL1uorqnB8N3ucij8UxwEpd\r\n5Vyu9LqAcvQ3Y58l+w9cc+w6/kpUTfbK6mm6gsl8XuhPtA3Zkme97bgh1PG6\r\nCiF4mE4BrcMmPeYlKlMdL9IGNYJA4Dx4yB3ZDbLPWPD4k1P4X+PtiBdyU9TF\r\nuR+TsuoLrPIWDqNVIlip1Pv9wuw0apEtHvLb65IN3JI1Ss5JL7c10dYIUjcY\r\nvRQPXuVpTCbXGuk6AZNQsRJd+vJPd3rQpDlgLYmhcwXZOF+jjJThWZImc+Cv\r\n956zUpGDCZ7BMCLtPI1BkinzlIC8NU0NpuwiNsFgNBm3HZ60qPb2M+eLNN32\r\n6A8AGCM4ChqqznRvIJzEUc10jFHiz6c/J8rDzVMiiG8HAMhg/5PjwY4NcGTB\r\nbFrZjCo5U3L5lwkH2XDsARQquQUGrFL7UgzMzKZW/nubG+cWBf73kwqPsnhl\r\nr4k2dD0Pd1nvN5OWFI/iFQrhC6pxObpEfmHT8PDva/f+58KPTNuNviZ+QMxI\r\naA3QP06qSuGBDpRcsudBFZZ0U9pPd3Gc/+c=\r\n=/SuH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.d9b3b27.30_1651756331963_0.19924658546256713"},"_hasShrinkwrap":false},"0.2.0-next.781fe49.31":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.781fe49.31","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.781fe49.31+781fe49","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"781fe498b9aae55aa92bb75032514b1044e47367","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.781fe49.31","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-44Ri43QDr1xjpS6SOTur0i0QXUwyzANvIvH3x+DSxhfo4Rl0bmeIYDGgR3HA7U16yyWhAmHoT09N1WaWlxRH9w==","shasum":"3e55162aee65e789664779465fa40b20451fff4d","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.781fe49.31.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2PV6cpAJQceLjPeJWmD1HJOEeA8i+rxTF7B9PwCxxfAiBbDF5dB30sw0PKCn2HU4iTMlMjcQrcpnycKdDJppbFjg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilTQCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFUw//bDaqdnTtV+F+rYydcGodCIpPsxRYV+v9qTALtlYCvmmgBgaP\r\n4HXCGOKFZzw5CemfxcbvrIRA+ekEJTSSRoUtsCK7FY6bo/wWXWJIm7Ac0Mma\r\n64uBb3B99AQx/6pr+bA1O/i8bLK4WifASxjfuvYK+ivT37gtVx6K40IPEf4d\r\nY2Ob04TZ7t6MsGI3iE910pi+stwu3nHngqlC++fYfRLbYfrfSFnliwlQuhtJ\r\n4Ois047jZW0Yz2fNVhGYhPaWkpGZgVyKq6/vlC6xXhgNSvkGqTsgNP1l65Vh\r\n+NtComLMoQTBwLychXFm5TSPW4bZrDX7pGgLbGSF4W4mSIQ+aw6QQm/cfh5Z\r\nqxd69F0+rUjvkSTRx010gNvXF4hX/jbnp46JOoIIedDQb8lN/XqWD1bpW03F\r\nEvVOALWASc0+QsPo9JGbcZWa+fGDfGYzONb5voB9MyoPVKPaSmOQc8tFmhBj\r\nLY37580VcmIQ6tbEsv1aM5EGk09XvOkXdPbDqleVciiqrSX1JnklhWP8pPyL\r\n07a+7Ogt7npy95ddDe5deX293rImQzEpBjLg+O8+BHWc5CitTVQvNdFs1DDp\r\ncdpOjqQeJRSG/SL1QkjJnezE2VvAq913ivu813U9cEARkzWmcJTlgxu3jp46\r\nSMZkHBCRhHKAHCFdRqxOLcBLiURKhalglVQ=\r\n=R2tk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.781fe49.31_1653945346789_0.9105003516479082"},"_hasShrinkwrap":false},"0.2.0-next.b2780ef.32":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.b2780ef.32","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.b2780ef.32+b2780ef","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"b2780ef42cb27b0f72283c41a480f99c15150295","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.b2780ef.32","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-4kH/NznPrJfy/gCasW4zJAe0eJYnQQcZqtIOfaYeTcQoAUOaS70AWZP9TnKA8YpWX+nMktKjaBzLcx2QFBkX9g==","shasum":"acbeb825efd1ab85282b4520254ed1f03d404784","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.b2780ef.32.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDp/V2rAYujTMt6YON3MG9CoL/a1EjDGJ/DeSBL5HWFSwIhALNWDpJ5IxV90uJkXKlH5qrxc4yt1F8EYJ/2P5BLIzUs"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuuaOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqUhAAknvGFwU1KrQS0wqs8XwFY1tnqb8klOJWupM7/Qr2bcOBiBjw\r\nmuwAE8MFQveIdOIRGgmrNdsT+zRTxwThlqWnt3zpRDXqdpJlN0t/h4ndGcQj\r\nwj19a4Sd70PIBrU+K/f1AZMa9Rs26HnrHgkYsvJbGOSpQpBQiH/HgJvNagr6\r\nWAciEABakoXlXBP9iDhFvtnwPn5z7p8UWLAENW+f56TEcoAoNRta7WZAlNWp\r\nI3vceqGxY+Mj56q/RtObJbUPh1rBXO+Jeu3X0H1XjDq/lD0ysXrt1IaIaR4V\r\n3FLcvmsgsn1mNejwPrzuqd4jrbfiFOZz6gaOTs/dKaBa7PMkRXzuFIR1oUtA\r\nGHde+bakBmXKytqZoDNSgwiS2z1YtoP0039IpViydXgVZdkl20iJlMK7pHbK\r\nBoVVLMrrGW7vPPpdwU87D1F9N+sb+1M08YFqDxX7VeFxaXZYwB8dCgzGWkO+\r\nY8ExuJjkZoNf6gXi4rY4/DyGhSTfXonV1q6hmmrHyvWRyLZe0+0piIqk6RkC\r\nmduZqwtrAcPNNkvXrZL0ejBHIdklEpBTnN9429Ry6r9HaVTZbiECwixBazov\r\nrIOkHzIoVSgUJE8II91wVI+kua7rQCYZzq3CavkJ2vJHv5vV9tmkRtnvp+fr\r\nzn1PjrLQYBhEoJTf+syeJcSgp0D/ATPNgk4=\r\n=5iCK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.b2780ef.32_1656415885844_0.5476949205502775"},"_hasShrinkwrap":false},"0.2.0-next.86a87c5.33":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.86a87c5.33","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.86a87c5.33+86a87c5","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"86a87c5efa5ff811ed92ced5a7be20123c29d5c1","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.86a87c5.33","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-j+BV3EWTghZxYaqqHmd2S/TgtgS1Qzqn2q8cprrsHtlNXV7Ee4vuqyoH1uLUdtQEwsva2vQb7i6f9Nd1x7VHBA==","shasum":"fdd8f54e64e59a5a283abd186bc2ae6699c0f62a","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.86a87c5.33.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGudGKEPfu0ElVJDt8IA7W5hVoD1MDX/FCzSw/sqhuKwIgEaQflGJR2l6WHiKMZGi+eP8q0YJVOXbXOQWKYqK7wwc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuyu2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgYg/9FFN1kwWhhmnRTrEvtsjO6JLmXP6aRT/hzsEtvSk14qejpJa0\r\nx95E4yDY/dPg9DHP4PG7QiNlTP9WfwJeg2risNM2Vmwzl3TfcoMInME4Bw1c\r\nS4maacMNddRM8QOmDKPAlBSgKIbjp4ZdC7iU8c/VUZ8aYFyh9I1BbflXvYwb\r\nJkWHtJdlpR3+PPpLG5uJ1zjBVHciCzAHP4wddYO5MqvKk3L9VLbct7Drw2mh\r\ndzd0jmJ8HBxvOzVIzx/xyW9hW1yJE5sCrTKhUTBqK5zLhPYniDez6cnBJt1h\r\nzMvvdA7+UkIwMXIg47TRE+eTtp5HYuP7KjXkXX0xtmkzFfdEGjKv21tBphm9\r\ntvTpmup43rDz525iG7EwDTDTRs9fjoknkJzQqwpblK4NDg/4JJk7xyp/RTbD\r\nf4pd83yIeDNka1+nTe7aefqXXjdZLTvGBSUiMHJViCKAdnm2bqutCWqfQBjc\r\na2Ny3DC/+X/oztEqEif7t10q7HWVRrvfUPzBAcHrZT0diYltBcDoiRY9uIHl\r\nMnDhAYyQ+sJBukDinV07U8Vvytu0cKX2Nx9NSVPgRZHAUU41VrUfXoMjdELK\r\nOKblAIZU753ZwHbQ5SuHUxLfSEr44oKK7Z1Ue0oW3k67zSDvuES+Tx9dHR5D\r\nFTPvIG13uM4odSyJnBuQquVdz4HZa+58HB0=\r\n=f/fD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.86a87c5.33_1656433590636_0.6507017943657714"},"_hasShrinkwrap":false},"0.2.0-next.272d84f.34":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.272d84f.34","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.272d84f.34+272d84f","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"272d84fba75fb1cc11cbd4a5efa340150326c7fb","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.272d84f.34","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-sgWSCV9oCLdvBatvMCnhq23OSMvMBnzd8f+vZIEHmht+L37i8Bx1nUUJk0OJjNf5NafreuXiFJZALUlFFOYv9Q==","shasum":"6be0d9811e0bef8146aa5195b1b6acdc71a04f69","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.272d84f.34.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9d6B1qu5KWGdggf/2mhkhUtKIM/grNNELEaLXtgiNEwIhAOmBAyi5sw+zncHSBaLnY/LqFAjX/KpfgVI2D5SruG6l"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIcjUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRjhAAowaKyPeHJsEmVSuIKnHjdkQJENcDGF90iMzoJLWNvF74Lfmy\r\n23l2VqbRFNLP9MawwVdPAue9984LZnqKpSQmhH0OaG1VBl5witRtWPvG0OmG\r\neyFWGFeHfDZTBj9lJDvwTBiEvMasCc50i8HUvJ8uA1MsILbnLMVxyM+KU9E7\r\ngjdb8zuVwFl7eo3jOgLkm9TUbUaFNSqvJstr3/spdFf5muP01zxHd9we48IV\r\nmNR3rp/rWfjuiJ3Izrl2s4b45MaM6bh/APN3dw1gPJqMHfIjYVjPKhA8pe7J\r\nCVxpNknsLxXZ9q2WzHz0Omlr3eKoOMHW9/MFoMVOcb29DeZIaJG7mwJgFast\r\nG++JS4ogzBuNKKStjsg5Wkx/UeKlt8oy5+v970w+UL2YELOJkcYhEJAnNCvd\r\nf27+Fmcy7wJA6k33fpKqr6jkRR19HPJkLJZdznY9ExOVeUs+0tCYPN8zfGBu\r\n7900beMXCJQAYwOcuDClSPv/tnLhYJVSv9XbkR0Ly8GqqJvDSJTPks+0QCIz\r\nsq6JZKXsK4Bn6yN+8sgNbbczPLk0DXJmWQ+GYcaHtGEisVXP42DOx9EeL6Z6\r\nfkt/YPOysMjpCI291B1LJ9BuKY2gPcsCypM2rXYHufaHRzRE1XuufnPQKTQ3\r\nRXpjpi4EXyqVEgEDJDQX8TavfDrUTjmtGsQ=\r\n=pwUx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.272d84f.34_1663158484407_0.8530662391332005"},"_hasShrinkwrap":false},"0.2.0-next.fa05ec6.35":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.fa05ec6.35","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.fa05ec6.35+fa05ec6","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"fa05ec69a41c900abfb5280fb969463a97b8b856","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.fa05ec6.35","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-VYaG3oDreF3HRsBxtebYKguXydVLO/9MBuUxKKeTTolZMHsXexGWEW9vWISiEsRdw6Pyikvei4lNlUzzNfYW6g==","shasum":"7bb6ec48abc0f3a77cf0e4450fa328e4120df5c7","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.fa05ec6.35.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOD5M6REepon8FxNPZZpFlmn2OeYJETBR3CFVaclveugIhAL/1UEJTp3WPlqDhJXR3iUeALCFUjGWBdWCa6k8WoGXW"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP9EYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvnA//ZQwKi8dTh8zn0s7fev1iU1scuMY7vZADRSSwqbYTMrGtBRRh\r\nShzpPvmzrVc6qTx24w6MND5zpiEBdK2DgGaTHcU+ra0UOb4QKNp08dDpaSWL\r\nLdO2ZJtDeQO0bmM0Iesj0N8A5xexESymFSn56GKHG7U6+6jyFNjFXjzbTlFi\r\nb8AuehpsDDM82qhn/ToBN6eKh3amWbaEZhfqjRvlxsi9/Oqx6y4BFK3gLa0y\r\nLfymrRw0+g9G6R47hiAEfLD5SnyRVfLA9Ei9QHjRlqirwCt6z2Q/TEQLfGzI\r\n46dUBY7xQKx3yBNWxtpc4KanP4Z9UjcXhQI6+TN1LfRq0/7KCmuJ+9xN7g+e\r\nyG0M2Ng+fX1Lj2gkL7/HZBj0iWwqsec+WTmM5B0r/dCOaSMLJi+7gXszM5bR\r\n4aswWau/6jJmIu7UWypiOPuGNmtJCi7qsM19Q2hGVGvfzvkW19e3SeFjov31\r\n7Ze+rNCb1riXaTJh2AdssrY6TpRnLE3p0IVOiJqHB1EB9/j0weIGxiIpH8c1\r\nPdsy3HbKBCt19HDo+/adsQPh2RiFZ6MZNVq69da831m2bQHjaawFIep6JqSM\r\n5aaYvebncn94EljMMDCz0xNld8qg4o6492Jry3jSSsGp6hFkV8sjLnBIP4wq\r\naPUiR6Ckb4Tzgp9GOUGrIEQ54h59qkSRI74=\r\n=Dm0k\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.fa05ec6.35_1665126680399_0.13739591179859056"},"_hasShrinkwrap":false},"0.2.0-next.f084791.36":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.f084791.36","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.f084791.36+f084791","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"f0847916f6965220b32a1d4ff9adc0b70818aeb8","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.f084791.36","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-nX064b/f1w3jyK7FXQgTZROs9YDlI7s0HQSI8by2js7RPmBzfjOovuXlMiFNUtDTiksFmPblwA0fHkvA8boQfQ==","shasum":"26e5c3e8a1d25e5ef8e9deb0f472bf0425fff0d8","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.f084791.36.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBB1hhbZ3e5PKomq7Ovaw+sCgviDcqoodCb4q3cgUq/oAiByoNRVNfPVCF+0nxLzARajrGgpTtnS7CSsmgO65ljYjg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ8pDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyZg/+M7FhKdXmzu04t4Dsj161f2+oG+FLTGs/1qYd9/8WfV2JUBf4\r\nmP5GHMq8c26WUNWzJc0ELF/0bOJr9VhP1eWG6uZkOf3BfA/vUl1YtGsE+JD3\r\nFtEvLMQ5kzWeLekdfRH3m8hoY4KwLS3M4jd/T0j0yrWx641PZCPQQAzT+ydp\r\nNezw6LVJs/TQ63Ey3fOfhGMYU+mJt2QxYYqumDbgYOhBZO1ddp8kPoQuVerf\r\nAvsZz6OucTptL92VSRAVU6m/XAMuZUwrX5cDHyK/WzlJgwDcMj/TA4+yv53/\r\nXBn34QwFZfKc20qGtgkafDU1dDCfLpOBbElivDWhxfPbwFEcqjQukuBy8TsT\r\n+oS8ju6euc6/3nKkl8BXYk5Z1eJSrt5Vn6541yGf7qHah5W8EsVDi4G2UOGM\r\nJDKqDUUKCXaf8Wyvw6pyEo1ThNNdCfdoCULFslA5EWKN6p59BtCi0qYaTDW6\r\nARA3l0liSAMVcLgx6rLqnVpwlyCcgANbrnWtDk5e8RP+aOPIBCMrA8Ap6Liy\r\n8/wNJy6YNhviy0/j1BiQAdqKkO5eXresCmmbW8ocvEiPYTy0/rz4zVPutPae\r\nSA25vtz4BjdxizhxRLi4XPmydvPONxijb2q3LnpcED5/onjZAoKJ9kVgndWQ\r\n15857i6o1wRTo3M56wjNzBbeFJhlkVLaH0g=\r\n=JYTf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.f084791.36_1665387075150_0.5439398157537363"},"_hasShrinkwrap":false},"0.2.0-next.25c5b16.37":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.25c5b16.37","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.25c5b16.37+25c5b16","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"25c5b16914cd1f50afc5b1487ae01ec2bba8f185","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.25c5b16.37","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-Y4XRFJy4P/2jzIYXkwgINmfUnmCEXpgdupXa9N53eN4ZwyCHam/9GLgohtO/IWKvKsXXgFxZMvbtzr6MoMmqog==","shasum":"d32f6d13a98edbd669b7f72ff1cda71cace51a17","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.25c5b16.37.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB8jWaHvFBGiaCMvdwoCfDI2iMw3yuYMDT171ctQvbWsAiB8hEnQHq33TZnLbDoDPDKSSB1RPvZRz4iM5sk456EM5A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSRUlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzEw//Zr3O7lbkeSCSW8+2/W9fyr/TK/e7IBSziSa4K7PrLChWtNWF\r\ntNIX2qotDx7Nc3dGOGLdt+KX5OUBS2s5D4h2QGJAgQKUliSt3BXdppyXxPRO\r\nPxtAmFBVTyzLs1MmDTEy7qgoeMwMEsFeCP1VsXOuS9DxiqX+4rh8g0sqW8/6\r\nzNIukxK1iDg4OaReSlN4TpVOTjNAkzTiqF+vFkN5yPZ1e47jF6GIf+8fGuWd\r\nTmAFjo7IhFod9PcNmTInSqYmobjfDu6+aa37BZhHqMrvL2/MvOAESr5GmBDN\r\n6Zc5f/0c7ck3zIzF3v0anwG2YtIhokTZ1nZdCQnKvmtXsfF6MLl1v/zY1hYE\r\nfTblJu2WKgxkiSWTtVKjoCsHr/Yzi+eaLzPVbrgkZkl3A5h/40Tl/1pFQ5/i\r\nKLe8YX4caWtOdj2KdJMr9C0S3868AF0x5TCTFqdXg1f1XU8aOep/CdkhjveH\r\nNyc6C0nXros+clKKFE+aWCll8pBr1vCa6RCdM9BgsUXHYT41zIJshDXu047P\r\nXPaovAPQQd6WIJV2R5belH6KvdckF+Jg0rjbWy7VMwhSijKMfjaCyrx3uBeF\r\nLbC8IdeCqc84nGUtVnoysS2gK2DGwVNZbl9nkJt7uWJBp1vZ3KJj87UJxEAY\r\n31UnZAwrkHPGkk5zaH6SBGomI2cRoI7UJHk=\r\n=YU1X\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.25c5b16.37_1665733925057_0.044210072342306006"},"_hasShrinkwrap":false},"0.2.0-next.c2cb14b.38":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.c2cb14b.38","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.c2cb14b.38+c2cb14b","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"c2cb14bfbb3ed4dc725e02d95069829ace3b9a3e","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.c2cb14b.38","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-d+bukjnOJzWGt87fHQM29VSRo4kGRv9GSte2JpGSc6qnlcr6N1xPQafdlqMtOzCC/HIhGhl2PvN/X0jciXF3lw==","shasum":"27b30777f06e0c6d8eb2454bea044158a93e1b03","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.c2cb14b.38.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfa+RQYBQX1HW7bmG2R0nwszPNju4C1U1LLrhMsPNQNwIgeDTwVExzp69ndWY3c/sRMeo1mxYAXedW3K2G/pDRoms="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWkoOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqijQ/+KgGJJmPVBgNyDph7hjfbFZAhrmWacBmG+3Kf//70qTqSJ7uq\r\naf1b9oPgAL37UhMPKYXOD2B8BzM8fJ+wKkIhGIJAI3wFSw8jOe4Rwzyw6rOL\r\nxalW8JJw4KRF3kt65stk+dImWor3oR59cKeexEUuaIQg7P+ucbs7E1RrvZc+\r\no017bd3nesuOYcE06z8Od49F5BVSFgqMjWEH3CKn/U7mx5iD5zeO4oMI+AiJ\r\nfhbmydMWMrstttCQ7CTcqzizfNQxcutoSX4H4mVtHDvM9K/LtqyC5IezrmtL\r\nsyTpZ/dCNUe6v7hRqQCUs2b5IPqVYGgzUNFmLY7NJCXVh0krEwVh8M5LSye6\r\nFNeEiCCr6MPOR5Z0IUR7gZDBP+dqf4lKTz/tMDChuVFrDKw50LDVQn4+1K9D\r\n78BpT4wcEuYFIxaLoJsCNiIrZ3ymDwgOgn8S32UAf0OjqPVZgY1Ytz3jcPeB\r\nx7EupZ3E+1/n9uRKk65bokSnyo8h/lerfsshvpCa5at0rxqTvSCoLFkmgqor\r\nezzScZ5Wu4iOxOk/wdPBYirEMPbfxwl9NlPvtfNHXQOWJcs0c0187LCmCPln\r\n2sH8xLaxNKj3/Ve6zzxxnpgNfxaUnyjNyc7D4ryp2R/wdffOwwROuS+njo0X\r\nk9VLDYXVTQNB3i+LVgRBNotm2JYx9mG+B6g=\r\n=Hu0e\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.c2cb14b.38_1666861582253_0.3826246780768743"},"_hasShrinkwrap":false},"0.2.0-next.e746384.40":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.e746384.40","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.e746384.40+e746384","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"e746384fe2a31ddecd147965cbd5c0427bace8c4","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.e746384.40","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-68zIjmc0ECCYVH0Mgc/m6Tqru6Wwy7dVIAIQW5ruQaUoTdpEH7JbyCpigFslMhq/knEJRDOLeF+dhnSwzK9e0g==","shasum":"64386a5b128e1c36a7445a1deed26b85c547a545","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.e746384.40.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+qWmB91cLYGNJ3kuvZvQk80orrAlLYvbuAsA/sE5yqAiBQXUEhy/TeVaJNdqv8WYEtr3njKjJ6k39Cdpx3TlF0Gw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWnDKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoe8Q/9H6h8VtG19Wb34PICRThdisLt5qCrh1NeNOvHmXXPNGCC6Hdf\r\nHqnFdRI4+3XFOsNiCycKhI3Bizi2K/LR1aW9+mh/ZjYWiIFDDYx7MFG6pQKQ\r\n4MxmkWhrxgf+pVtovct4H10MN5cajVjZdy5NDB8RAVN8ES+BsZVRXsv/jfUv\r\nnJD6rN8EutfQ5XRlGf98zv4YK4P7J6PBgj21himwow0ITRDfLpw8MpR5/px9\r\n1G0O1tCR5OzkDiZxIab17pHsetdcfHRIVjcMEO/oaE1xBUsgdTjkghjF5GdO\r\nFr5Von30HXf33Wxlg9A4efRlEfJOJcXpgSYMiFXWoQ2SUBsPBxFv9+c3Qi/s\r\nIWF63mjN9TSKzwa1F47eFDzMXtasUi8k9roZTA8x+acrOhLtvLiSJrXNh/V/\r\noAIJxGaTHXW/uyvreatw8TDFV1WZS/7soJJVkZVtEuJeg8Ak2RSlzCLNmftX\r\neqR5QZx4CaCpKuNMiw6kaHLRfE8IrTzFC0tKrPRLavCj06Yigj9wAR9a9bwt\r\nX81IuCFQI/HJHnJw05nZv2Tg+n14V851NEEe+Dw80r8oPMA9ibCjVui4Xj7P\r\nq2ic6B3aCqyLEyE8pFfNgS9/3Iy4tTgU/g5v0zwdU7T33b/UQhbjo8LPnAc7\r\nOLSO+WO4vPYjXET89/bo7u1pthVNLjn5S64=\r\n=Tpgf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.e746384.40_1666871498264_0.7244539928816145"},"_hasShrinkwrap":false},"0.2.0-next.8f7fc56.41":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.8f7fc56.41","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.8f7fc56.41+8f7fc56","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"8f7fc5611df9d4afe350354e5de6d20379c8d173","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.8f7fc56.41","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-Xgv+8WI5FHo/ygzJRMlBHyfAICd+NWvYfaZZD2062LccyOYOpEaKI7DUB4AR6iADw+E1+/k2BVpCZjiuXppZUA==","shasum":"4c51b4893bb616c97cdcc7bddd4ba79b68288c22","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.8f7fc56.41.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFM4kt9Oq7VIxTeHfCUERI+Q7OrbZlXXmZO/Fa4bOBnyAiBITuoWfGhR/wYx7zvlY48xcgs3ws6poCoe42C2N74mtg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZN0nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaGxAAkj3eTQO6Gp8YpgssEjbGu92/qEMvcLKpJS1G5liTL0moz6Kh\r\nFu6xrS+7P5uNQUph7OKQKYKJXqGXSHAiWV2Qs7C+9MJ+DQbNF2Rd0G5ZEOYP\r\nhfvQoh3/G2ztmiyl7AGZwExBcEVO0QI+eh20zWw6jKTK70JB2pAMLjtntm4c\r\nmO0EZWr88+PCs77n7MIvTfcj3aIOzuGXwtZBE8k1v5OusIdW9YSZ9XWNABCt\r\nRuwVCeA7qwaJ9lQC+PKNrpW2vLU1Gsqytl6mWEWgkzp8RHOZxbscZhyAWP0G\r\nqeEoY75itBxY4qJVEej2o/Dko0EfxNW9Qe0b1y/QL/dKG8qcOiTVTBIK+mvt\r\nGs3GSIBP78Zv0/z4l2DnXHJoZEZRVRly1AjTQTVn3zl8mzB4Fj7rQxIK/SX0\r\na5n/bj8+bNtu1WiCNzRwDrTPx802JWPV9hhprhiA5pp19y15ZsWks4VApEZW\r\nanDpir4Y+poCQTheytkaHVurbSQ5ViKBpGTEvhAoFY7nvIEqOE4JLcUlE/VC\r\nd7rjH5+IEd3skJSpXrcMhGQBydt1RSuBqnH9N9JeinBDFRyY3m69SH2YuSBd\r\nb8gbodsm50rPygWpvSBt8dfCXQ9v1PxJsM+7DGq7X4Pr9YQEWmL0DLMtjWv1\r\nqs84ysiAuqvS381Smywp6lnmHJKzV/nGoWE=\r\n=5aYB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.8f7fc56.41_1667554599706_0.6144946724959655"},"_hasShrinkwrap":false},"0.2.0-next.b2ea1fa.44":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.b2ea1fa.44","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.b2ea1fa.44+b2ea1fa","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"b2ea1fa70505fee10fce2ccd321462a0e6a99386","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.b2ea1fa.44","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-63DCqJyoZp238j0Ndo6CsXjiC1B1TMksJamcRIBRg3A/dB4WENFv8g0aMKqGcelLwa86jAKm0DuUhMJEUhKE2g==","shasum":"877d49dd05822d31ebbfa59f71362f4ff693c81b","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.b2ea1fa.44.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjxtcZ8glGeGznNz5krXIC4atlqfMsc4pOHRONCAPghAiEA9loccM1IVGXvYdIflHPeSeML+NAcb0W58YIBp8yGraY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZOsYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzVQ//TzQnTAt2rrFPBEH9Uf1DMWMwNgvoLItvIZxsQN8XCNhqsDRz\r\n6Z6TQN+JzDyhzcydzyQ532Ybey6IdCrAucQ0FGMqGHSUrwJpXSK75vx4h7wc\r\n4GyHRaY81Cug3iaGfOXIRhIxH+uMle92ENKBVS25X65ViRdXvCDzcxwfRgQM\r\n3H9ttYAYt8oaj1UlkveLyR+VffmSlaMrvggVd7BmVpNj34+6kL9w4/QLdmUU\r\nBC0jEtPIGypkIYYLKPXhSEkdk7oSbKAAeOELyhPppRAMYVIefFHIl8hajIkY\r\nP8/W7pFK6UMXlbtL1XxOeq6ldg3JxY/yJHGPEZG5CfgR7nkS8EXhCDC0lFJO\r\nKYySENyGoubgZk+bA3hewhw9AHE/i5ThDL4NriesmRglR3TtCpY6uqJGZ00a\r\nMZ1jYM2E4D2Qp+kbeCb2GYM+D88+4kN7izesV9rx6TtmE8yVHcw40GqVgEPv\r\ngUQQZClqSdpVcL85Pl1fxXkK6/fmq/zAF+/gTPRHd8uqf/e8YwkodAu2kz5z\r\nFG5XmWe6NP5yvxBSobrgyxn3fckoc1h0G93jdFnsGDrVGtRgGpujVo3pYxgy\r\nasUiWJEo2OJIOTqZNkv9Hvdrb8yXXt9rI6CQmisol7HJ8W0kX6xZ6LTY/UA9\r\n7ArWOblspQaqmAjXqQkoZ1jqc1IosqExbDs=\r\n=oYG6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.b2ea1fa.44_1667558168633_0.6941401613962521"},"_hasShrinkwrap":false},"0.2.0-next.4e5d48f.45":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.4e5d48f.45","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.4e5d48f.45+4e5d48f","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"4e5d48f6b599d7e1c672f9c5b58119b1578bc74b","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.4e5d48f.45","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-58RPaQBprUAiw+BzzFMkgGMuP4ulgs1aqg01MJ3b72HruF6et6nzMlvdfkjdmkUFfGWht84gYEQl8r+2Orpghw==","shasum":"5eec6fba956fa12b637c3f3c0f52042c69899b3c","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.4e5d48f.45.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIJWrxqX8L4nsKDQhRI6O2SXtXXc8BeWSyUfCAln0GVAiEA4GQ4bxYZeOKBdH8vLBwqgzbvmO98SkdeRB2IQVvoqII="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaVhsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8vhAAizJ2UymuRbI215bRbqHn6psDJ0LaXmpSWiO8/8v0XBWbLKC7\r\nE6osgkV6HyMOirB9YEsm54W39nc31m26A9+rNsE+LaJW0aEgzuJyMN5+3m3B\r\nHQabp7H2s/mM557t26CJUKVOGkCx5Rty54yxWpftYPtv66JJ5M4ZYrx0wIZq\r\nkA2RU6++Be8tdoofAir2kkEMY7j4cZj4WuG/G/xc/efv2EZqRNCswXQPX47u\r\ndcKUB/ZK3AYDSjiwzqwcPXlEOTUezT47x8YjKHMSa/Yf4yCGk2dLsa01Q/Ku\r\nWacjT8AQR2u/B9HuQwMMMBe7l8ejAoMz4CtHdcZhINuv6ctSfAVFx+18g6DO\r\nChzSNSpqZnYuqAq7v/2xr/lt2J/knzt9ufVI7DXMAEuHePMt0EkykzGvdq2N\r\nFF4apI2k+80v6fzM/sGKmqO07ySF4FDv+Ll15lNfWXNeeHpoxG3nzzpNIVoA\r\nJYJfXI2dLPHNvlsMS9CKDQWLp439jyM43yUAOBkbCFqP+H0SZl34QOiRIcd+\r\ntf98q/Pmk3NpcpybVIhuQgUJzKWUO0Sj2yN5q1oRXGwXPl9UBv2ANV1CIeaf\r\nqVQ5/wHr0TWOqQt5wuxjl3MiA+EIsUP6ViVI82D9kb2/Zqgh8zMsNMd+0lkk\r\n9KI0K5X3eGZ3N8ytOmHZhJvbM9WAivu7Ff0=\r\n=mYF5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.4e5d48f.45_1667848300066_0.3152413169194437"},"_hasShrinkwrap":false},"0.2.0-next.e9ebcb4.46":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.e9ebcb4.46","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.e9ebcb4.46+e9ebcb4","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"e9ebcb42f1ae5d31bd5bcb84a2bb4305c98a86f1","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.e9ebcb4.46","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-WABtEzR1KrEumH9V4oVzoXArzJyAYh8g4ntHFDd7p4bThgApTwi+eldf0h5ZdpEtF3BbKaPHZ+sAy06IJmwRZw==","shasum":"e27493cd63c5eaa7f104c738c7a631199b6b8563","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.e9ebcb4.46.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICBCENav+0Tx7hMSUqCLQprW2tAENUA8mJdq752i265wAiBqyOTFtgTohG1SwlL9JYOhkXxHiYHGIrGVzMPRTxfBAQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc5T+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq76BAAhVRkDiZ0tOc+FjD1j2SeSld1vdk0azol2uNIr8/G2FnT0+oc\r\ntK/t9LvluatiHVfvot7oTFcMZEefzxBVcn73P3W9tGC3TqmFrq7pwamRG7eb\r\nG2fllJsvHg3HDm63B/vHzYQFXGTyWJv1IUfd9BNnrBMMNP2rZp8DOL2SfM5r\r\nSWNmRyfFrd3qIPAAtop83QRWZX0Jz7PWGD/7LE4bbnaCjizOK34WPGFLiuvo\r\nksDJp6ul/tBVJWPxiqTYOMt2W+LxGx8uCKsmN9t2TUDwL+gqZKnSfvPnzFtg\r\nZitBwjxrBrtA1O7ZrPHw4kOFjO2hPJAOu7mHlYxwyMP89ahfnqX0QBVlAfny\r\nvubFz4td/SjztXmYX+aHxKcIsIkXYtlFnHDBupJQWylDqg9vgUaJd9Pa/vEm\r\numcphpcWCo9aBPLruGqD52Klq9Loe7Vft9F8Bb5amUlZIKqxzchdfh8gVnAI\r\n1LkwzQ2HWls+Nqdzzqxujlg4NsINgKdLHq9apzvVSuy3yV3ZrQBFdIo477T8\r\nqAnIL5nhWzvu/+ReYlzH9iRy4ekrsZn7u4G6bU2bBgZt3dAa4sfGbuVoMBHm\r\nHfp8eZ+22zGM5xHtXcOOU+vVEEV+1uZSO5ij5imcEPcrfb6VOG3z9HgzRvXc\r\nVh8vsF+DAue2JEV5BJS3F9gwzKC01XGvN4U=\r\n=Wg9r\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.e9ebcb4.46_1668519166503_0.6732569935049122"},"_hasShrinkwrap":false},"0.2.0-next.ffbe5f3.47":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.ffbe5f3.47","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.ffbe5f3.47+ffbe5f3","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"ffbe5f30df65a7540da11c6c99dfd61bea3b3b48","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.ffbe5f3.47","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-pLKJXSv4mRWBCcyPsoG0NbPYgaCvPKyOyClLUgR27kYEF1iA6a8JcoHJFXvRLJ3bVNbi4BuMzas1m5sXZxISzw==","shasum":"7ab90895cc06470f1f5fed693b696fbf8bcc6558","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.ffbe5f3.47.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjPQNrw+Cw8WxrozwxECtrFaxaJF00dKwGd8T0NYGT/QIgaANz5bsGOd91j9U4Q5HChjowzWNehsO6QUYgiz7XIRY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdLXRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrDQ/+KEzzNgPIF5nigWHizycJzbuH9S1NU5syD706G0TAM0+qXLT8\r\nAqFPfo1q6DyOJDmoEFzf9HqKwGkr5z3bLdDv8OaSAu8YeCzyjBeHNsW+510H\r\nn6N3FMulX9sJk0J0y+5wnRZvV29soQV9AnP+7B8oxZmcCuHgE3pHdeA1Fo3x\r\nYYJxNEFvg2N8DnGNWm3A161NwP/ko6VGeIp4mcU6G5ElWH0tH+GqK5YxlKiX\r\nYaKVrrY9Y1hguFp8g0aFHb09u/YBIjRjR81qWRheoygd75VdTteF54Z90xpG\r\nea4m6tC9LNVl6ncmIZAImCJzmhO57Z574fhrlDrMVoAFtPOH9OHBlQzscJXG\r\nzl9mjBlfSUj0t2LOFWx8jnAxvfHBMMW1GkMtqGdAIwfNr7Dl1EJaIfJsIWw0\r\nf82CY41OwiAX8SsBl18QBErrNNtEnuErA10WnLi7vJL28pAACCTFq92vN8dQ\r\n3tP3jL091p2CACBpyLIkoYkBy3zNFERQNCTjBXxr5RSm66SioTkriF7DOx2+\r\nV/JjVJvO25qteNlcDpvAIHm8kkqUL4UJdrP3t5olwkH/R0Gx2GfpmrlLj08I\r\neI/nmplS1Bv7rkjXx4mhyPziT3YBWWMZcCw4LVnLlfrl+BMUrEbL8WYN0xkd\r\nOaP9rpfa5bRphC0MnnTJmhNL/9fASS1fc+4=\r\n=25iX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.ffbe5f3.47_1668593105183_0.09338992992665074"},"_hasShrinkwrap":false},"0.2.0-next.c976fe5.48":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.c976fe5.48","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.c976fe5.48+c976fe5","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"c976fe5a966c1edbfa7787a36d12087b8193471a","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.c976fe5.48","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-q1tttsOMim8ptIIEDC0Hl4shV4AxqK633Jw/E6dMuWuNNRtC86gHVXZUY6uUVmeXBkbAa/sfCVS/5C6cmblGmA==","shasum":"c5603f91ce5c29a21bfc4d0b81bd50587ec270d0","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.c976fe5.48.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSwdV05MEZFEB9wQWYnu1VLQ1nvCC74gBy1zSjH/dP2AiEAjlQBiTEXe3we8dAyT7kjPwyudEz4OwOfDW+MBwdeBXQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh3rCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYOw//VJH2Us2G32ZPQs9jOqTHbvPrXxagZFSzUQbpYCmXiw3zBa/W\r\nK/llRtxUl1+XbQZ0kZ5UPq1/E4F/4kTShhyIB7KZjUrEYpsgKhPGhGIoW7XJ\r\ncrqSg1EbqddfNM97xDMOOAUfU6OvZtQ2FqIU5cfsfejZEBIONwmqU4nKNVxR\r\nkEq+adbtr7mn5WFeA2zRWv/g18f60z/vpGsYtecf+sUoXl6ztMVBw6/C7K/+\r\n8GLYGU6Q/TuREy7dEt51MDsj2GwePBdOlgxykVrG9JejNg9OP0jCNN0BqZay\r\n5x6+gbC4padgXElDVSYQx9v7t5cd/kvn5qjsfsoc1xwSZO7+LLCJlKjPviz5\r\nx+nj/j/xuNZLeXClH3uZVGrbq0f5G4etUIr41MtGjEhtASEFm58sdi4QSfzK\r\nO8g/RkDOjwojd5691Yk0Chazb5BAMcMN+izM3Yjo+NkgjflJZnTpN0eua7xq\r\nwgsBpgjZti8aW5PVS10j04ZWJKrYRVlr4dKW8h124SzrnObIKF5e/sVwlvaA\r\n3JFh+wo19xDY8Ty2HlCsm1zfK9919k/176q0E2GAzM58Qy7qgjP5S6w3ycFp\r\n2oLVCHUIBihDO0kxU/B8YqKxhvxjU4boSzHTT1fbYgVDblvP8weovydNaeLL\r\n5cRx0+zqOqgriCXz5jvPZ7hiw++Nwgy2lcY=\r\n=SEbL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.c976fe5.48_1669823169771_0.13889259480087968"},"_hasShrinkwrap":false},"0.2.0-next.3f289f8.49":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.3f289f8.49","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.3f289f8.49+3f289f8","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"3f289f822254de3839c23244794ce684efb272ec","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.3f289f8.49","_nodeVersion":"14.19.3","_npmVersion":"lerna/6.1.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-xkuF35fRqUD8woUsB1+v1ia+UFxtyDW4G8G/3TksE5Uyh1rkacOSj4vnM4WmsmVyYAS50OVvIqHtvZ5YLF9AwA==","shasum":"27234218621c1267543ebdb6494171e21684fceb","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.3f289f8.49.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2H1KO+Uqj/Y64/manFepErfnL12AnOktjgNdNV859zgIhAOvF28J0wib8v6CJzs9eWGh3ZEHqgyC8lRLM9mdkbHTv"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiJrmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoE6g//eGRVjFm9yw6rgiFvV2IRWkfJqDOnh4NM3vKrJ9A23CWIWVh8\r\nZNB2cI0+ObepriUiOv4E4GCkg2uSMwR4DroReXlt/SOaWW3YGwxJ+rq+Xg6i\r\ni4lBCEig+I2KE7ZCMoB1pgtZdNmNyRfvN43Qr0WRoHQ1Q6mb/zIJXSdfTTLq\r\nkO0RxEAnIyiDxGz4ywyW9q1R/USla8riEJxD3rXyaE4ZfcbWf3bmyf3g2kfY\r\nTShBDH5gAJxEEsYnEJY0pFG5iqoiwHvCQha3HF2TcC9f/S0ZnB27KF8GWDbo\r\nQrJ8Yozh7DJoXEgB3gQYuDUZA4/mkxBKGACjoNwS1GWdvhfyKatA//wyBAFn\r\nssZwlI5A8zTWdIEMd8JndOYM7gIiA5JzLE/btpshgR2N1WgAnH/sfx6jfZ91\r\nW30U59y3slr4rU3NUAnPAl6TYJu7U/ZnWc4MUZagG6fTpxA7kgtcYXV9QChg\r\nFjvF8GuYviXZOgWEaAV9J6qaV8552xWPrbDXmxHCrYYf0z7OzmdTwHpiSTPz\r\nPh9YrAvoT+TOF0qlUdpFUqmLQvavthdWP4HOjEQno9vuFyZjnGJFOQheoE2Y\r\netzfWobYfkJgMrXTb3nxbQg4mYT1dAmySe1BjhQwBlUqCteNwOf6ZqKQiLvX\r\n/3dZtxW68t1vXqdBTNcP/t5Z9osW502yYhY=\r\n=1jwE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.3f289f8.49_1669896934461_0.913041426644337"},"_hasShrinkwrap":false},"0.2.0-next.4b57c0e.50":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.4b57c0e.50","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.4b57c0e.50+4b57c0e","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"4b57c0efcffcb87cb03b408115fd37f257a3d337","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.4b57c0e.50","_nodeVersion":"14.19.3","_npmVersion":"lerna/6.1.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-bBvlbLq0aeJrImHNLKZFygHdBD0IWpXYNkLy/eOrzvO9jE71930Dq/rBYEJeECoNmaACbXOGIlPZCNHaK9hoKg==","shasum":"274c1e8fda615b19bc6534698e6ef9b51de22691","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.4b57c0e.50.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgtfBn13qgK4yrwgv3RucxHvTXsngPZn/xfgjbXGSP9QIhAOU31lpEoW2ZSoTPUPvBoO/FSWxZmLFY8rTvfrvn4yg4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmzF8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorzA//SIe9XOExbK96cvOPCF2obdkRNpo7K84d6cBcziPnJ6M8byNH\r\nfRmFn64b8lfAx1viWS6FPHCczE3KWt+R2P5ECs25Qfxy+xoVe2m3WptwKIxY\r\nz80/FUApUSNlLNQf+CSm3wHP1oZFDTLaTTiyNFWTT5l64KQZwL2S6kcEPAqV\r\nNGqOF9VaB5kwSmdkpOEJbqPisMVgjx2m1iTIvwZ8gy3Q4rW8EdLck9MZpsbt\r\nQTN79ZPVF/htbBBFzl5Dm86tYdBTlkvE7qdyTHrNNlcUzX1heA3ia/FCNvbm\r\n9SZ1cnkXDfPfxmg9GK3ZPUmkHpec+mcVF0KPJ9TDp6Y6GuyF6CpcxMKBkudB\r\nFt0JrRWIe5XWSOD6nMB1YWmf3cREm81RKrN8TnbO+WbrcVxYRiH3e2gAuT2r\r\nwOMOwvQHm3KHdNcXCpGJmjAcIjOXlq1NEjdSEUBtQP9UpLgNaopBetuC0p0Z\r\nRAOxCqjvev1R7LcAwblyXsq9m+qCv1mD55lSFzVBWSuLLElPYcuSkIhOE1Z2\r\nG7YS6vzDaCKVF/ZITg5hOvmuYg/x8hEOlL7Ke7/Gg2nRGYBfmI+AfxyqLdDM\r\njMPwqbQduE/TB2OohZN+JbC5wekGZ/K9PnJQxjyejAbEpzKttwQBlUzbrPhu\r\n40lPN4nZ2qu/w10QkND0G+8Wgryyf1QbunM=\r\n=XclY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.4b57c0e.50_1671115132270_0.43831338470263304"},"_hasShrinkwrap":false},"0.2.0-next.5df3bac.51":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.5df3bac.51","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.5df3bac.51+5df3bac","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"5df3bacdb0d30c8e7742e73e60f9d5159fc4351e","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.5df3bac.51","_nodeVersion":"14.19.3","_npmVersion":"lerna/6.1.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-U/qYyBuExVr0nZWF3WvlSxImTNlp5ONT3NqDAH6ETb2VJ2nAH6NJ3FFAMW+k6AcR7WpRMoNQ9xHgI+9a9rMYvQ==","shasum":"91cac3a8a2d5f6cb957f4e5384a6bf8a1fe2a556","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.5df3bac.51.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0wFnjGgahIwryLBUXXRSZ6Pj7Q79Ex4kJUpgkuZ0E8AiEA+Xq8psbd4GsGh/mhXRKoWNq/YQnKrpYnfh45ooq2p9I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxnVTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCyA/9Ho1M/aHzTNwzdTUd7k3XbzSr047IOh33CVHKXGWt33DEDUFO\r\n26iO37rgUc0COxMCrMwdq3HEtYbidxCQSjk09DDjZGX6Bo+Dk6NbZubqD5QV\r\nTCmdJ1tnxYHPfIx1tCchYbzGVOVH2xoimIUBTaEFjdOx5XM51Rf1qPsk36Ke\r\nmlhlTsQ+EUj1iU3D+GWb7GMG3eLLw3Dis9+HlpEGxn7AokQDuRhdBiFI3RMH\r\ndAhQth8sP9D/WlXQ4gKWqHvJyURokUG1UjY8N6WiKBwq3vkB9qPGgGm5/80x\r\nIsSfdg1rhUM7bSQbApFO0tap6pkc4YOta7i1kaFmuHGa+j0GoieKjDVNUuzS\r\n/OmoLNasFGmqkfBLpWa2VLqI+DClbY6E5BmX50rJhiPf8ynVXJziIRvtGrpU\r\nGjpuE5a+d9CzSsH8xLdpmx9V4yZ/+dpNLB1TgNj3nSFfJsjqXPW1q9chUhJd\r\nqQlC5Zl3GaGTQAoZ430FfHDAsXFhWpIjSZLrY5V0HKIqgsBkGzBZ7CrXjsEk\r\nChlnoA7lJexCW8aH6rNqhVMabdKoL+pRadBHcjjkCMnkINH4mAqLP80AdnNt\r\npn4kT7QK03P8/+6fnFJh0i4KS38f2ghbnBb/OyxMDl2kvVIoVmkpXal5PunR\r\nD8u3gfOzJdYovryc2yPzrY7/o/JMOB8a8Qo=\r\n=ydPp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.5df3bac.51_1673950547486_0.29099741198761864"},"_hasShrinkwrap":false},"0.2.0-next.5f3a7a1.52":{"name":"@eclipse-emfcloud/coffee-custom-routes-example","version":"0.2.0-next.5f3a7a1.52","description":"Example custom API route plug-in for the Model Server.","license":"(EPL-2.0 OR MIT)","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"homepage":"https://www.eclipse.org/emfcloud/","bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"dependencies":{"@eclipse-emfcloud/modelserver-plugin-ext":"0.2.0-next.5f3a7a1.52+5f3a7a1","inversify":"^5.1.1"},"devDependencies":{"@types/reflect-metadata":"^0.1.0","eslint-config-prettier":"^8.3.0","reflect-metadata":"^0.1.13","rimraf":"^2.6.1","typescript":"^4.2.3"},"publishConfig":{"access":"public"},"scripts":{"prepare":"yarn clean && yarn build","clean":"rimraf lib","lint":"eslint --ext .ts,.tsx ./src","lint:fix":"eslint --fix --ext .ts,.tsx ./src","build":"tsc","watch":"tsc -w"},"gitHead":"5f3a7a1e42f42b435f48ceababd78891ae686d31","readme":"# Custom Route Provider Example\n\nThis package provides an example of a custom route provider plug-in for the _Model Server_.\nIt provides an API endpoint that greets clients.\n\n## Details\n\nThe plug-in contributes a route provider that establishes custom API Endpoints on `/api/v2/custom/greeter` supporting requests to greet callers and report who has been greeted during the server session.\nResponses follow the typical _Model Server_ JSON protocol.\n\n```plain\n> GET http://localhost:8082/api/v2/custom/greeter/greet/Fred\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": \"Hello, Fred!\"\n  }\n\n> GET http://localhost:8082/api/v2/custom/greeter/who\n< 200 OK\n  {\n    \"type\": \"success\",\n    \"data\": [\n      \"Alice\",\n      \"Bob\",\n      \"Cathy\",\n      \"Fred\"\n    ]\n  }\n```\n\n## Setup\n\nSee the [parent readme](../../README.md) for details of how to set up and build the project.\n\n## How to Run\n\nFor detailed instructions how to run the example server configuration that includes this plug-in example, see the [Example Server readme](../example-server/README.md).\n\n### Send Requests to the Model Server\n\nThere are a variety of tools available for ad hoc REST interactions with services such as the _Model Server_.\nA recommended option is the [Postman](https://www.postman.com) application.\n\nStart by fetching the current state of the model.\nSend a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee\n```\n\nThe result should look something like this:\n\n```json\n{\n  \"type\": \"success\",\n  \"data\": {\n    \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine\",\n    \"$id\": \"/\",\n    \"children\": [\n      // ... structural components here ...\n    ],\n    \"name\": \"Super Brewer 3000\",\n    \"workflows\": [\n      {\n        \"$id\": \"//@workflows.0\",\n        \"name\": \"Simple Workflow\",\n        \"nodes\": [\n          {\n            \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask\",\n            \"$id\": \"//@workflows.0/@nodes.0\",\n            \"name\": \"PreHeat\",\n            \"component\": {\n              \"$type\": \"http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit\",\n              \"$ref\": \"//@children.0\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nMake note of the EMF-style URI fragment `$id` of the **PreHeat** task, which must be inferred from the model structure.\nThe URI fragment is `//@workflows.0/@nodes.0`: the first node of the first workflow in the root `Machine` object.\nThis will be used to build requests for custom commands.\n\nNext, send a request to execute the custom \"increment duration\" command.\nThis command is a composite of two commands in a four-step process:\n\n1. Fetch the current value of the `duration` property of the affected `Task`.\n   The default is `0` when the property is not present, as is initially the case in this example model.\n2. Add `1` to the current `duration` and execute a `set` command to update the duration.\n3. Extract the previous value of the `duration` from the `CommandExecutionResult` returned by the server.\n   Add the new `duration` value calculated at step 2 to this previous value of the `duration`.\n4. Execute a second command that sets the second new `duration` computation into the `Task`.\n\nThe example command provider uses a transaction on the target model to execute these two commands, receiving intermediate results that are inputs to later commands in the sequence, in a single undoable operation on the undo stack.\n\nTo execute this custom command, send a `PATCH` request to\n\n```plain\n    http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2\n```\n\nwith the following body:\n\n```json\n{\n  \"data\": {\n    \"type\": \"modelserver.emfcommand\",\n    \"data\": {\n      \"type\": \"increment-duration\",\n      \"$type\": \"http://www.eclipse.org/emfcloud/modelserver/command#//Command\",\n      \"owner\": {\n        \"$ref\": \"SuperBrewer3000.coffee#//@workflows.0/@nodes.0\",\n        \"$type\": \"http://www.eclipse.org/emfcloud/coffee/model#//AutomaticTask\"\n      }\n    }\n  }\n}\n```\n\nYou also need to set the following two headers for the request to work:\n\n- Content-Length = \\<calculated when request is sent>\n- Content-Type = application/json\n\nNote that this uses the EMF URI fragment determined earlier in the `owner.$ref` property.\nThe command is a custom `increment-duration` type and has no other parameters.\n\nFetch the model again with a GET request to see the updated `duration` of the **PreHeat** task.\n\nNow repeat the same command a few times, each time getting the model again to see how the `duration` changes.\n\n> Do you recognize a pattern?\n\n#### Undo the Commands\n\nA critical component of this custom command provider framework is the new _Model Server_ protocol for opening and closing transactions on models.\nThis transaction context allows a command provider plug-in in the _Model Server_ to execute a chain of commands with intermediate results, all captured as a single undoable unit on the stack.\nDuring the transaction, the _Model Server_ receives private notification of the model changes and broadcast to subscribers at large is deferred to the close of the transaction.\nIf the transaction is rolled back, of course such broadcast will not occur as all changes performed are reverted.\n\nTo send an undo command to the _Model Server_, simply send a `GET` request to\n\n```plain\n    http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee\n```\n\nFollow that up with a `GET` on the `/api/v2/models` endpoint to see how the `duration` of the **PreHeat** `Task` is reverted.\nThe intermediate `+1` increments are not evident because both original commands are undone at each step.\n","readmeFilename":"README.md","_id":"@eclipse-emfcloud/coffee-custom-routes-example@0.2.0-next.5f3a7a1.52","_nodeVersion":"14.19.3","_npmVersion":"lerna/6.1.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-sihOQ+CMpmIMbL/EJmOSaeI5ZgpvduSrpjG3Oc/wGPfEWPf8AAS4d19/Ab3pej7C7TQOq/5se1f7dxkfZsDd3w==","shasum":"f74705c8453fb36fe0ad945bf53369497a22a567","tarball":"https://registry.npmjs.org/@eclipse-emfcloud/coffee-custom-routes-example/-/coffee-custom-routes-example-0.2.0-next.5f3a7a1.52.tgz","fileCount":11,"unpackedSize":31125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYYtmSMWzg4yI+Y3Q8ZSokAWEJBNizrfjVFN7RyVfCnwIgRSdA8mR3UuS/j3cldax+iJ506hYezOYIxKWklnhyRdg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0lETACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoPhAAkJn8IdmPJlzPcYfEBW1rm3U2NdvruaSs+RzEfD9Io/G2Vx8D\r\nRA9uoxixETZjvWpVykDwPr0lX8ci4uM7iDAySiztndsGiVvIz1a4ZAz0awVK\r\nJuosFZpvJkyfpic3iaMvFG9U1v1B2PaXh4HUyybGkqSDm+A8XeDT8pmZ2GrJ\r\nqG1kqI+KcqWC/Bmy1BmT0Dbrep90KsDqIrMXHZCKLQIS7BnXqEw16VqQQnPj\r\nRy8yn2XXsWM0aa2ZXnaaDM6xmeOyS6fo3dEDJSpgj5fE60MHRUavRM3caJT9\r\ne9WKYonrfzFEoC/RXLJGZzYJ3p/Tysm4+LndanrPQ7MNwgk4ReAT2yxjcv1L\r\ny0EHHD5vPlCQWWerfNdCP1YJTpeREkK0UJF3JIcBGONEcDMY719QrUQ21Q+l\r\nZpSyaaKhCKa0ZXrU5JdxEvGmvhk8cR59/9A+yuBdHjLLgNYzcEmj80XWBOrf\r\n5gFF7OUrxYREj/NF6S0t6JX0ai17ChpWViuxoliamXZQrudBQu/6srqDXKZK\r\nv6XFoic4yQp9e1rQg6M3o+SaFSGE68KmEqta++GZboRuim+p7BecZnxqIzK0\r\nQhvc6p2dzKrTJZKtgftY5ZL/caVMSzO//VEhdReqIKgDpNvjXTyi9yYhFZDS\r\n8JBcN/H4Bg1AIdgmuSpALR6B0wXuhBECoD4=\r\n=m4SR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},"directories":{},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-custom-routes-example_0.2.0-next.5f3a7a1.52_1674727698985_0.8755266796560739"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-07T14:07:10.699Z","0.2.0-next.ce04993.18":"2022-03-07T14:07:10.945Z","modified":"2023-01-26T10:08:19.267Z","0.2.0-next.9fc5830.19":"2022-03-08T13:58:54.088Z","0.2.0-next.46e550b.20":"2022-03-17T10:33:55.443Z","0.2.0-next.78c57e3.21":"2022-03-25T14:54:32.268Z","0.2.0-next.4f5c0b2.23":"2022-04-11T08:55:52.068Z","0.2.0-next.16b2e5e.24":"2022-04-12T19:59:52.305Z","0.2.0-next.8645d4b.27":"2022-04-13T15:08:45.657Z","0.2.0-next.55b519b.29":"2022-05-03T09:14:24.160Z","0.2.0-next.d9b3b27.30":"2022-05-05T13:12:12.128Z","0.2.0-next.781fe49.31":"2022-05-30T21:15:46.932Z","0.2.0-next.b2780ef.32":"2022-06-28T11:31:26.032Z","0.2.0-next.86a87c5.33":"2022-06-28T16:26:30.809Z","0.2.0-next.272d84f.34":"2022-09-14T12:28:04.563Z","0.2.0-next.fa05ec6.35":"2022-10-07T07:11:20.592Z","0.2.0-next.f084791.36":"2022-10-10T07:31:15.299Z","0.2.0-next.25c5b16.37":"2022-10-14T07:52:05.176Z","0.2.0-next.c2cb14b.38":"2022-10-27T09:06:22.440Z","0.2.0-next.e746384.40":"2022-10-27T11:51:38.447Z","0.2.0-next.8f7fc56.41":"2022-11-04T09:36:39.882Z","0.2.0-next.b2ea1fa.44":"2022-11-04T10:36:08.816Z","0.2.0-next.4e5d48f.45":"2022-11-07T19:11:40.281Z","0.2.0-next.e9ebcb4.46":"2022-11-15T13:32:46.631Z","0.2.0-next.ffbe5f3.47":"2022-11-16T10:05:05.429Z","0.2.0-next.c976fe5.48":"2022-11-30T15:46:09.982Z","0.2.0-next.3f289f8.49":"2022-12-01T12:15:34.640Z","0.2.0-next.4b57c0e.50":"2022-12-15T14:38:52.465Z","0.2.0-next.5df3bac.51":"2023-01-17T10:15:47.675Z","0.2.0-next.5f3a7a1.52":"2023-01-26T10:08:19.096Z"},"maintainers":[{"name":"ndoschek","email":"ndoschek@eclipsesource.com"},{"name":"tortmayr","email":"tortmayr@eclipsesource.com"},{"name":"eugenneufeld","email":"eneufeld@eclipsesource.com"},{"name":"eclipse-emfcloud-bot","email":"emfcloud-bot@eclipse.org"},{"name":"mfleck","email":"mfleck@eclipsesource.com"},{"name":"jfaltermeier","email":"jfaltermeier@eclipsesource.com"},{"name":"planger","email":"planger@eclipsesource.com"},{"name":"lkoehler","email":"lkoehler@eclipsesource.com"}],"description":"Example custom API route plug-in for the Model Server.","homepage":"https://www.eclipse.org/emfcloud/","repository":{"type":"git","url":"git+https://github.com/eclipse-emfcloud/modelserver-node.git"},"contributors":[{"name":"STMicroelectronics","url":"https://www.st.com/"},{"name":"Eclipse emf.cloud Project","email":"emfcloud-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.emfcloud"}],"bugs":{"url":"https://github.com/eclipse-emfcloud/modelserver-node/issues"},"license":"(EPL-2.0 OR MIT)","readme":"","readmeFilename":""}