@operato/scene-integration 0.0.25 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/client-api.d.ts +1 -0
- package/dist/client-api.js +22 -0
- package/dist/client-api.js.map +1 -0
- package/dist/connection-control.js +2 -3
- package/dist/connection-control.js.map +1 -1
- package/dist/connection-state-subscription.js +2 -3
- package/dist/connection-state-subscription.js.map +1 -1
- package/dist/data-subscription.js +2 -3
- package/dist/data-subscription.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/scenario-control.js +4 -20
- package/dist/scenario-control.js.map +1 -1
- package/dist/scenario-instance-subscription.js +5 -21
- package/dist/scenario-instance-subscription.js.map +1 -1
- package/dist/scenario-queue-subscription.js +2 -3
- package/dist/scenario-queue-subscription.js.map +1 -1
- package/dist/scenario-run.js +4 -20
- package/dist/scenario-run.js.map +1 -1
- package/dist/scenario-start.js +4 -20
- package/dist/scenario-start.js.map +1 -1
- package/dist/scenario-stop.js +4 -20
- package/dist/scenario-stop.js.map +1 -1
- package/dist/templates/connection-control.d.ts +1 -1
- package/dist/templates/connection-control.js +1 -1
- package/dist/templates/connection-control.js.map +1 -1
- package/dist/templates/connection-state-subscription.d.ts +1 -1
- package/dist/templates/connection-state-subscription.js +1 -1
- package/dist/templates/connection-state-subscription.js.map +1 -1
- package/dist/templates/data-subscription.d.ts +1 -1
- package/dist/templates/data-subscription.js +1 -1
- package/dist/templates/data-subscription.js.map +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/scenario-control.d.ts +1 -1
- package/dist/templates/scenario-control.js +1 -1
- package/dist/templates/scenario-control.js.map +1 -1
- package/dist/templates/scenario-instance-subscription.d.ts +1 -1
- package/dist/templates/scenario-instance-subscription.js +1 -1
- package/dist/templates/scenario-instance-subscription.js.map +1 -1
- package/dist/templates/scenario-queue-subscription.d.ts +1 -1
- package/dist/templates/scenario-queue-subscription.js +1 -1
- package/dist/templates/scenario-queue-subscription.js.map +1 -1
- package/dist/templates/scenario-run.d.ts +1 -1
- package/dist/templates/scenario-run.js +1 -1
- package/dist/templates/scenario-run.js.map +1 -1
- package/dist/templates/scenario-start.d.ts +1 -1
- package/dist/templates/scenario-start.js +1 -1
- package/dist/templates/scenario-start.js.map +1 -1
- package/dist/templates/scenario-stop.d.ts +1 -1
- package/dist/templates/scenario-stop.js +1 -1
- package/dist/templates/scenario-stop.js.map +1 -1
- package/{assets → icons}/icon-camera-stream.png +0 -0
- package/{assets → icons}/icon-connection-control.png +0 -0
- package/{assets → icons}/icon-connection-state-subscription.png +0 -0
- package/{assets → icons}/icon-data-subscription.png +0 -0
- package/{assets → icons}/icon-integration.png +0 -0
- package/{assets → icons}/icon-scenario-control.png +0 -0
- package/{assets → icons}/icon-scenario-instance-subscription.png +0 -0
- package/{assets → icons}/icon-scenario-queue-subscription.png +0 -0
- package/{assets → icons}/icon-scenario-run.png +0 -0
- package/{assets → icons}/icon-scenario-start.png +0 -0
- package/{assets → icons}/icon-scenario-stop.png +0 -0
- package/{assets → icons}/no-image.png +0 -0
- package/{assets → icons}/symbol-connection-control.png +0 -0
- package/{assets → icons}/symbol-connection-state-subscription.png +0 -0
- package/{assets → icons}/symbol-data-subscription.png +0 -0
- package/{assets → icons}/symbol-integration.png +0 -0
- package/{assets → icons}/symbol-scenario-control.png +0 -0
- package/{assets → icons}/symbol-scenario-instance-subscription.png +0 -0
- package/{assets → icons}/symbol-scenario-queue-subscription.png +0 -0
- package/{assets → icons}/symbol-scenario-run.png +0 -0
- package/{assets → icons}/symbol-scenario-start.png +0 -0
- package/{assets → icons}/symbol-scenario-stop.png +0 -0
- package/package.json +5 -5
- package/src/client-api.ts +25 -0
- package/src/connection-control.ts +3 -3
- package/src/connection-state-subscription.ts +7 -4
- package/src/data-subscription.ts +3 -3
- package/src/scenario-control.ts +5 -21
- package/src/scenario-instance-subscription.ts +9 -22
- package/src/scenario-queue-subscription.ts +6 -3
- package/src/scenario-run.ts +5 -21
- package/src/scenario-start.ts +5 -21
- package/src/scenario-stop.ts +5 -21
- package/src/templates/connection-control.ts +1 -1
- package/src/templates/connection-state-subscription.ts +1 -1
- package/src/templates/data-subscription.ts +1 -1
- package/src/templates/scenario-control.ts +1 -1
- package/src/templates/scenario-instance-subscription.ts +1 -1
- package/src/templates/scenario-queue-subscription.ts +1 -1
- package/src/templates/scenario-run.ts +1 -1
- package/src/templates/scenario-start.ts +1 -1
- package/src/templates/scenario-stop.ts +1 -1
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/@types/global/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../src/scenario-stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE3F,OAAO,
|
|
1
|
+
{"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../src/scenario-stop.ts"],"names":[],"mappings":"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","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { scenarios } from './client-api'\nimport { getClient } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'instance-name',\n name: 'instanceName'\n },\n {\n type: 'select',\n label: 'scenario-name',\n name: 'scenarioName',\n property: {\n options: scenarios\n }\n }\n ],\n 'value-property': 'nothing',\n help: 'scene/component/scenario-stop'\n}\n\nexport default class ScenarioStop extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioStop._image) {\n ScenarioStop._image = new Image()\n ScenarioStop._image.src = new URL('../icons/symbol-scenario-stop.png', import.meta.url).href\n }\n return ScenarioStop._image\n }\n\n private _client: any\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ScenarioStop.image, left, top, width, height)\n }\n\n ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\n }\n\n get nature() {\n return NATURE\n }\n\n onchange(after: Properties) {\n if ('nothing' in after) {\n this.requestData()\n }\n }\n\n get nothing() {\n return this.state.nothing\n }\n\n set nothing(nothing) {\n this.setState('nothing', nothing)\n }\n\n get client() {\n return this._client\n }\n\n async requestData() {\n let { instanceName, scenarioName } = this.state\n instanceName = instanceName || scenarioName\n if (!instanceName || !this.app.isViewMode) return\n\n var client = this._client\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($instanceName: String!) {\n stopScenario(instanceName: $instanceName) {\n state\n message\n data\n }\n }\n `,\n variables: {\n instanceName: instanceName\n }\n })\n\n this.data = response?.data?.stopScenario?.data\n }\n }\n}\n\nComponent.register('scenario-stop', ScenarioStop)\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../../src/templates/connection-control.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../../src/templates/connection-control.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAErF,eAAe;IACb,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-connection-control.png', import.meta.url).href\n\nexport default {\n type: 'connection-control',\n description: 'connection-control',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'connection-control',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const icon = new URL('../../icons/icon-connection-state-subscription.png', import.meta.url).href;
|
|
2
2
|
export default {
|
|
3
3
|
type: 'connection-state-subscription',
|
|
4
4
|
description: 'connection-state-subscription',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../../src/templates/connection-state-subscription.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../../src/templates/connection-state-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oDAAoD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhG,eAAe;IACb,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+BAA+B;IAC5C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-connection-state-subscription.png', import.meta.url).href\n\nexport default {\n type: 'connection-state-subscription',\n description: 'connection-state-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'connection-state-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../../src/templates/data-subscription.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../../src/templates/data-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,wCAAwC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEpF,eAAe;IACb,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-data-subscription.png', import.meta.url).href\n\nexport default {\n type: 'data-subscription',\n description: 'data-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'data-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-control.js","sourceRoot":"","sources":["../../src/templates/scenario-control.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scenario-control.js","sourceRoot":"","sources":["../../src/templates/scenario-control.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,uCAAuC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEnF,eAAe;IACb,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-control.png', import.meta.url).href\n\nexport default {\n type: 'scenario-control',\n description: 'scenario-control',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-control',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n controlType: '',\n hidden: true\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-instance-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-instance-subscription.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scenario-instance-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-instance-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,kDAAkD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE9F,eAAe;IACb,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-queue-subscription.png', import.meta.url).href\n\nexport default {\n type: 'scenario-queue-subscription',\n description: 'scenario-queue-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-queue-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const icon = new URL('../../icons/icon-scenario-instance-subscription.png', import.meta.url).href;
|
|
2
2
|
export default {
|
|
3
3
|
type: 'scenario-instance-subscription',
|
|
4
4
|
description: 'scenario-instance-subscription',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-queue-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-queue-subscription.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scenario-queue-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-queue-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,qDAAqD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEjG,eAAe;IACb,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-instance-subscription.png', import.meta.url).href\n\nexport default {\n type: 'scenario-instance-subscription',\n description: 'scenario-instance-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-instance-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-run.js","sourceRoot":"","sources":["../../src/templates/scenario-run.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scenario-run.js","sourceRoot":"","sources":["../../src/templates/scenario-run.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE/E,eAAe;IACb,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-run.png', import.meta.url).href\n\nexport default {\n type: 'scenario-run',\n description: 'scenario-run',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-run',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../../src/templates/scenario-start.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../../src/templates/scenario-start.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEjF,eAAe;IACb,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-start.png', import.meta.url).href\n\nexport default {\n type: 'scenario-start',\n description: 'scenario-start',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-start',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../../src/templates/scenario-stop.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../../src/templates/scenario-stop.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhF,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-stop.png', import.meta.url).href\n\nexport default {\n type: 'scenario-stop',\n description: 'scenario-stop',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-stop',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/scene-integration",
|
|
3
3
|
"description": "Things factory integration component for things-scene",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "heartyoh",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
36
|
-
"@operato/board": "^0.
|
|
37
|
-
"@things-factory/builder": "^4.0.
|
|
38
|
-
"@things-factory/operato-board": "^4.0.
|
|
36
|
+
"@operato/board": "^0.3.7",
|
|
37
|
+
"@things-factory/builder": "^4.0.27",
|
|
38
|
+
"@things-factory/operato-board": "^4.0.27",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
40
40
|
"@typescript-eslint/parser": "^4.33.0",
|
|
41
41
|
"@web/dev-server": "^0.1.28",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"prettier --write"
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "a08c67f644a77255e0ccd00a9ebcdb81f89b8adc"
|
|
64
64
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
import { getClient } from './origin-client'
|
|
4
|
+
|
|
5
|
+
export const scenarios = async () => {
|
|
6
|
+
var response = await getClient().query({
|
|
7
|
+
query: gql`
|
|
8
|
+
query {
|
|
9
|
+
scenarios {
|
|
10
|
+
items {
|
|
11
|
+
name
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`
|
|
16
|
+
})
|
|
17
|
+
if (response.errors) {
|
|
18
|
+
return ['']
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const items = response.data.scenarios.items.map((item: any) => item.name)
|
|
22
|
+
const sorted = items.sort()
|
|
23
|
+
|
|
24
|
+
return [''].concat(sorted)
|
|
25
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
4
|
|
|
3
|
-
import COMPONENT_IMAGE from '../assets/symbol-connection-control.png'
|
|
4
5
|
import { getClient } from './origin-client'
|
|
5
|
-
import gql from 'graphql-tag'
|
|
6
6
|
|
|
7
7
|
const NATURE = {
|
|
8
8
|
mutable: false,
|
|
@@ -66,7 +66,7 @@ export default class ConnectionControl extends RectPath(Shape) {
|
|
|
66
66
|
static get image() {
|
|
67
67
|
if (!ConnectionControl._image) {
|
|
68
68
|
ConnectionControl._image = new Image()
|
|
69
|
-
ConnectionControl._image.src =
|
|
69
|
+
ConnectionControl._image.src = new URL('../icons/symbol-connection-control.png', import.meta.url).href
|
|
70
70
|
}
|
|
71
71
|
return ConnectionControl._image
|
|
72
72
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
|
-
import { getClient, subscribe } from './origin-client'
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
-
import gql from 'graphql-tag'
|
|
5
|
+
import { getClient, subscribe } from './origin-client'
|
|
6
6
|
|
|
7
7
|
const NATURE = {
|
|
8
8
|
mutable: false,
|
|
@@ -43,7 +43,10 @@ export default class ConnectionStateSubscription extends DataSource(RectPath(Sha
|
|
|
43
43
|
static get image() {
|
|
44
44
|
if (!ConnectionStateSubscription._image) {
|
|
45
45
|
ConnectionStateSubscription._image = new Image()
|
|
46
|
-
ConnectionStateSubscription._image.src =
|
|
46
|
+
ConnectionStateSubscription._image.src = new URL(
|
|
47
|
+
'../icons/symbol-connection-state-subscription.png',
|
|
48
|
+
import.meta.url
|
|
49
|
+
).href
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
return ConnectionStateSubscription._image
|
package/src/data-subscription.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
4
|
|
|
3
|
-
import COMPONENT_IMAGE from '../assets/symbol-data-subscription.png'
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
5
|
import { subscribe } from './origin-client'
|
|
6
6
|
|
|
7
7
|
const NATURE = {
|
|
@@ -24,7 +24,7 @@ export default class DataSubscription extends DataSource(RectPath(Shape)) {
|
|
|
24
24
|
static get image() {
|
|
25
25
|
if (!DataSubscription._image) {
|
|
26
26
|
DataSubscription._image = new Image()
|
|
27
|
-
DataSubscription._image.src =
|
|
27
|
+
DataSubscription._image.src = new URL('../icons/symbol-data-subscription.png', import.meta.url).href
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return DataSubscription._image
|
package/src/scenario-control.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
4
|
|
|
3
|
-
import
|
|
5
|
+
import { scenarios } from './client-api'
|
|
4
6
|
import { getClient } from './origin-client'
|
|
5
|
-
import gql from 'graphql-tag'
|
|
6
7
|
|
|
7
8
|
const NATURE = {
|
|
8
9
|
mutable: false,
|
|
@@ -14,24 +15,7 @@ const NATURE = {
|
|
|
14
15
|
label: 'scenario-name',
|
|
15
16
|
name: 'scenarioName',
|
|
16
17
|
property: {
|
|
17
|
-
options:
|
|
18
|
-
var response = await getClient().query({
|
|
19
|
-
query: gql`
|
|
20
|
-
query {
|
|
21
|
-
scenarios {
|
|
22
|
-
items {
|
|
23
|
-
name
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`
|
|
28
|
-
})
|
|
29
|
-
if (response.errors) {
|
|
30
|
-
return ['']
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return [''].concat(response.data.scenarios.items.map((item: any) => item.name))
|
|
34
|
-
}
|
|
18
|
+
options: scenarios
|
|
35
19
|
}
|
|
36
20
|
},
|
|
37
21
|
{
|
|
@@ -66,7 +50,7 @@ export default class ScenarioControl extends DataSource(RectPath(Shape)) {
|
|
|
66
50
|
static get image() {
|
|
67
51
|
if (!ScenarioControl._image) {
|
|
68
52
|
ScenarioControl._image = new Image()
|
|
69
|
-
ScenarioControl._image.src =
|
|
53
|
+
ScenarioControl._image.src = new URL('../icons/symbol-scenario-control.png', import.meta.url).href
|
|
70
54
|
}
|
|
71
55
|
return ScenarioControl._image
|
|
72
56
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
|
-
import { getClient, subscribe } from './origin-client'
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
5
|
+
import { scenarios } from './client-api'
|
|
6
|
+
import { subscribe } from './origin-client'
|
|
6
7
|
|
|
7
8
|
const NATURE = {
|
|
8
9
|
mutable: false,
|
|
@@ -14,24 +15,7 @@ const NATURE = {
|
|
|
14
15
|
label: 'scenario-name',
|
|
15
16
|
name: 'scenarioName',
|
|
16
17
|
property: {
|
|
17
|
-
options:
|
|
18
|
-
var response = await getClient().query({
|
|
19
|
-
query: gql`
|
|
20
|
-
query {
|
|
21
|
-
scenarios {
|
|
22
|
-
items {
|
|
23
|
-
name
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`
|
|
28
|
-
})
|
|
29
|
-
if (response.errors) {
|
|
30
|
-
return ['']
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return [''].concat(response.data.scenarios.items.map((item: any) => item.name))
|
|
34
|
-
}
|
|
18
|
+
options: scenarios
|
|
35
19
|
}
|
|
36
20
|
},
|
|
37
21
|
{
|
|
@@ -49,7 +33,10 @@ export default class ScenarioInstanceSubscription extends DataSource(RectPath(Sh
|
|
|
49
33
|
static get image() {
|
|
50
34
|
if (!ScenarioInstanceSubscription._image) {
|
|
51
35
|
ScenarioInstanceSubscription._image = new Image()
|
|
52
|
-
ScenarioInstanceSubscription._image.src =
|
|
36
|
+
ScenarioInstanceSubscription._image.src = new URL(
|
|
37
|
+
'../icons/symbol-scenario-instance-subscription.png',
|
|
38
|
+
import.meta.url
|
|
39
|
+
).href
|
|
53
40
|
}
|
|
54
41
|
|
|
55
42
|
return ScenarioInstanceSubscription._image
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
4
|
|
|
3
|
-
import COMPONENT_IMAGE from '../assets/symbol-scenario-queue-subscription.png'
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
5
|
import { subscribe } from './origin-client'
|
|
6
6
|
|
|
7
7
|
const NATURE = {
|
|
@@ -18,7 +18,10 @@ export default class ScenarioQueueSubscription extends DataSource(RectPath(Shape
|
|
|
18
18
|
static get image() {
|
|
19
19
|
if (!ScenarioQueueSubscription._image) {
|
|
20
20
|
ScenarioQueueSubscription._image = new Image()
|
|
21
|
-
ScenarioQueueSubscription._image.src =
|
|
21
|
+
ScenarioQueueSubscription._image.src = new URL(
|
|
22
|
+
'../icons/symbol-scenario-queue-subscription.png',
|
|
23
|
+
import.meta.url
|
|
24
|
+
).href
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
return ScenarioQueueSubscription._image
|
package/src/scenario-run.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
1
3
|
import { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
4
|
|
|
3
|
-
import
|
|
5
|
+
import { scenarios } from './client-api'
|
|
4
6
|
import { getClient } from './origin-client'
|
|
5
|
-
import gql from 'graphql-tag'
|
|
6
7
|
|
|
7
8
|
const NATURE = {
|
|
8
9
|
mutable: false,
|
|
@@ -14,24 +15,7 @@ const NATURE = {
|
|
|
14
15
|
label: 'scenario-name',
|
|
15
16
|
name: 'scenarioName',
|
|
16
17
|
property: {
|
|
17
|
-
options:
|
|
18
|
-
var response = await getClient().query({
|
|
19
|
-
query: gql`
|
|
20
|
-
query {
|
|
21
|
-
scenarios {
|
|
22
|
-
items {
|
|
23
|
-
name
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`
|
|
28
|
-
})
|
|
29
|
-
if (response.errors) {
|
|
30
|
-
return ['']
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return [''].concat(response.data.scenarios.items.map((item: any) => item.name))
|
|
34
|
-
}
|
|
18
|
+
options: scenarios
|
|
35
19
|
}
|
|
36
20
|
},
|
|
37
21
|
{
|
|
@@ -55,7 +39,7 @@ export default class ScenarioRun extends DataSource(RectPath(Shape)) {
|
|
|
55
39
|
static get image() {
|
|
56
40
|
if (!ScenarioRun._image) {
|
|
57
41
|
ScenarioRun._image = new Image()
|
|
58
|
-
ScenarioRun._image.src =
|
|
42
|
+
ScenarioRun._image.src = new URL('../icons/symbol-scenario-run.png', import.meta.url).href
|
|
59
43
|
}
|
|
60
44
|
return ScenarioRun._image
|
|
61
45
|
}
|