@operato/scene-excel 0.1.10 → 0.1.18

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 CHANGED
@@ -3,6 +3,72 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.1.18](https://github.com/things-scene/operato-scene/compare/v0.1.17...v0.1.18) (2026-01-27)
7
+
8
+ **Note:** Version bump only for package @operato/scene-excel
9
+
10
+
11
+
12
+
13
+
14
+ ### [0.1.17](https://github.com/things-scene/operato-scene/compare/v0.1.16...v0.1.17) (2026-01-27)
15
+
16
+ **Note:** Version bump only for package @operato/scene-excel
17
+
18
+
19
+
20
+
21
+
22
+ ### [0.1.16](https://github.com/things-scene/operato-scene/compare/v0.1.15...v0.1.16) (2026-01-27)
23
+
24
+ **Note:** Version bump only for package @operato/scene-excel
25
+
26
+
27
+
28
+
29
+
30
+ ### [0.1.15](https://github.com/things-scene/operato-scene/compare/v0.1.14...v0.1.15) (2026-01-27)
31
+
32
+ **Note:** Version bump only for package @operato/scene-excel
33
+
34
+
35
+
36
+
37
+
38
+ ### [0.1.14](https://github.com/things-scene/operato-scene/compare/v0.1.13...v0.1.14) (2026-01-27)
39
+
40
+ **Note:** Version bump only for package @operato/scene-excel
41
+
42
+
43
+
44
+
45
+
46
+ ### [0.1.13](https://github.com/things-scene/operato-scene/compare/v0.1.12...v0.1.13) (2026-01-27)
47
+
48
+ **Note:** Version bump only for package @operato/scene-excel
49
+
50
+
51
+
52
+
53
+
54
+ ### [0.1.12](https://github.com/things-scene/operato-scene/compare/v0.1.11...v0.1.12) (2026-01-27)
55
+
56
+
57
+ ### :bug: Bug Fix
58
+
59
+ * TypeScript build errors with @types/node v24 compatibility ([ef33580](https://github.com/things-scene/operato-scene/commit/ef335805bc6af9872fc1de717b4f3841e565b26f))
60
+
61
+
62
+
63
+ ### [0.1.11](https://github.com/things-scene/operato-scene/compare/v0.1.10...v0.1.11) (2022-08-13)
64
+
65
+
66
+ ### :bug: Bug Fix
67
+
68
+ * latest @hatiolab/things-scene@2.8.7 ([597d80e](https://github.com/things-scene/operato-scene/commit/597d80ebb2953d56f3dc61cc6d1cc862ef1bca0b))
69
+
70
+
71
+
6
72
  ### [0.1.10](https://github.com/things-scene/operato-scene/compare/v0.1.9...v0.1.10) (2022-08-12)
7
73
 
8
74
 
package/dist/excel.js CHANGED
@@ -108,7 +108,7 @@ export default class Excel extends DataSource(RectPath(Shape)) {
108
108
  }
109
109
  _stopRepeater() {
110
110
  if (this.repeatTimer)
111
- clearTimeout(this.repeatTimer);
111
+ clearInterval(this.repeatTimer);
112
112
  delete this.repeatTimer;
113
113
  }
114
114
  ondropfile(transfered, files) {
package/dist/excel.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"excel.js","sourceRoot":"","sources":["../src/excel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,aAAa;AACb,OAAO,IAAI,MAAM,OAAO,CAAA;AAExB,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE5G,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,gBAAgB;SAC9B;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,SAAS;SACvB;KACF;IACD,IAAI,EAAE,uBAAuB;CAC9B,CAAA;AAED,KAAK,UAAU,SAAS,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC5B,0BAA0B;QAC1B,IAAI,G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,IAAI,CAAC,EAAE;4BACzB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;wBAC7B,CAAC,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAA;gBACJ,SAAS,GAAG,KAAK,CAAA;YACnB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;SAClB;QAED,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,WAAW;YAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAEpD,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,UAAU,CAAC,UAAe,EAAE,KAAU;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBACvC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;gBACnB,OAAM;aACP;SACF;IACH,CAAC;IAED,QAAQ,CAAC,KAAiB,EAAE,MAAkB;QAC5C,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE;YACvC,IAAI,CAAC,aAAa,EAAE,CAAA;SACrB;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\n// @ts-ignore\nimport XLSX from '!xlsx'\n\nimport { Component, ComponentNature, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'src',\n name: 'src',\n placeholder: 'Excel File URL'\n },\n {\n type: 'number',\n label: 'period',\n name: 'period',\n placeholder: 'seconds'\n }\n ],\n help: 'scene/component/excel'\n}\n\nasync function fetchData(url: string) {\n if (!url.startsWith('data:')) {\n // prevent read from cache\n if (url.indexOf('?') !== -1) {\n url = url + `&ts=${Date.now()}`\n } else {\n url = url + `?ts=${Date.now()}`\n }\n }\n\n const file = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/xlsx'\n },\n credentials: 'include'\n })\n\n const workbook: XLSX.WorkBook = XLSX.read(await file.arrayBuffer(), { type: 'array' })\n\n var result: { [key: string]: unknown } = {}\n workbook.SheetNames.forEach((sheet: string) => {\n var roa = XLSX.utils.sheet_to_json(workbook.Sheets[sheet])\n if (roa.length) {\n result[sheet] = roa\n }\n })\n\n console.log('result', result)\n return result\n}\n\nexport default class Excel extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!Excel._image) {\n Excel._image = new Image()\n Excel._image.src = new URL('../icons/symbol-excel.png', import.meta.url).href\n }\n\n return Excel._image\n }\n\n private repeatTimer?: NodeJS.Timer\n private src?: string\n\n dispose() {\n this._stopRepeater()\n super.dispose()\n }\n\n ready() {\n const { src } = this.state\n\n if (src) {\n this._initInterval()\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n /*\n * TODO role이 publisher 인지 subscriber 인지에 따라서 구분할 수 있는 표시를 추가할 것.\n */\n\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, Excel.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n\n _initInterval() {\n this._stopRepeater()\n this._startRepeater()\n }\n\n _startRepeater() {\n var { src, period } = this.state\n period = Number(period)\n\n var fetchable = true\n\n if (period && this.app.isViewMode) {\n this.repeatTimer = setInterval(() => {\n fetchable &&\n this.repeatTimer &&\n requestAnimationFrame(() => {\n fetchable = true\n fetchData(src).then(data => {\n this.setState('data', data)\n })\n })\n fetchable = false\n }, period * 1000)\n }\n\n fetchData(src).then(data => {\n this.setState('data', data)\n })\n }\n\n _stopRepeater() {\n if (this.repeatTimer) clearTimeout(this.repeatTimer)\n\n delete this.repeatTimer\n }\n\n ondropfile(transfered: any, files: any) {\n for (let i = 0; i < transfered.length; i++) {\n if (/\\.xlsx?$/.test(transfered[i].name)) {\n this.src = files[i]\n return\n }\n }\n }\n\n onchange(after: Properties, before: Properties) {\n if ('period' in after || 'src' in after) {\n this._initInterval()\n }\n }\n}\n\nComponent.register('excel', Excel)\n"]}
1
+ {"version":3,"file":"excel.js","sourceRoot":"","sources":["../src/excel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,aAAa;AACb,OAAO,IAAI,MAAM,OAAO,CAAA;AAExB,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE5G,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,gBAAgB;SAC9B;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,SAAS;SACvB;KACF;IACD,IAAI,EAAE,uBAAuB;CAC9B,CAAA;AAED,KAAK,UAAU,SAAS,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC5B,0BAA0B;QAC1B,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAC3B,GAAG,GAAG,GAAG,GAAG,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;SAChC;aAAM;YACL,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AG,KAAK,CAAA;YACnB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;SAClB;QAED,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,WAAW;YAAE,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAErD,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,UAAU,CAAC,UAAe,EAAE,KAAU;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBACvC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;gBACnB,OAAM;aACP;SACF;IACH,CAAC;IAED,QAAQ,CAAC,KAAiB,EAAE,MAAkB;QAC5C,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE;YACvC,IAAI,CAAC,aAAa,EAAE,CAAA;SACrB;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\n// @ts-ignore\nimport XLSX from '!xlsx'\n\nimport { Component, ComponentNature, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'src',\n name: 'src',\n placeholder: 'Excel File URL'\n },\n {\n type: 'number',\n label: 'period',\n name: 'period',\n placeholder: 'seconds'\n }\n ],\n help: 'scene/component/excel'\n}\n\nasync function fetchData(url: string) {\n if (!url.startsWith('data:')) {\n // prevent read from cache\n if (url.indexOf('?') !== -1) {\n url = url + `&ts=${Date.now()}`\n } else {\n url = url + `?ts=${Date.now()}`\n }\n }\n\n const file = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/xlsx'\n },\n credentials: 'include'\n })\n\n const workbook: XLSX.WorkBook = XLSX.read(await file.arrayBuffer(), { type: 'array' })\n\n var result: { [key: string]: unknown } = {}\n workbook.SheetNames.forEach((sheet: string) => {\n var roa = XLSX.utils.sheet_to_json(workbook.Sheets[sheet])\n if (roa.length) {\n result[sheet] = roa\n }\n })\n\n console.log('result', result)\n return result\n}\n\nexport default class Excel extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!Excel._image) {\n Excel._image = new Image()\n Excel._image.src = new URL('../icons/symbol-excel.png', import.meta.url).href\n }\n\n return Excel._image\n }\n\n private repeatTimer?: ReturnType<typeof setInterval>\n private src?: string\n\n dispose() {\n this._stopRepeater()\n super.dispose()\n }\n\n ready() {\n const { src } = this.state\n\n if (src) {\n this._initInterval()\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n /*\n * TODO role이 publisher 인지 subscriber 인지에 따라서 구분할 수 있는 표시를 추가할 것.\n */\n\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, Excel.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n\n _initInterval() {\n this._stopRepeater()\n this._startRepeater()\n }\n\n _startRepeater() {\n var { src, period } = this.state\n period = Number(period)\n\n var fetchable = true\n\n if (period && this.app.isViewMode) {\n this.repeatTimer = setInterval(() => {\n fetchable &&\n this.repeatTimer &&\n requestAnimationFrame(() => {\n fetchable = true\n fetchData(src).then(data => {\n this.setState('data', data)\n })\n })\n fetchable = false\n }, period * 1000)\n }\n\n fetchData(src).then(data => {\n this.setState('data', data)\n })\n }\n\n _stopRepeater() {\n if (this.repeatTimer) clearInterval(this.repeatTimer)\n\n delete this.repeatTimer\n }\n\n ondropfile(transfered: any, files: any) {\n for (let i = 0; i < transfered.length; i++) {\n if (/\\.xlsx?$/.test(transfered[i].name)) {\n this.src = files[i]\n return\n }\n }\n }\n\n onchange(after: Properties, before: Properties) {\n if ('period' in after || 'src' in after) {\n this._initInterval()\n }\n }\n}\n\nComponent.register('excel', Excel)\n"]}
@@ -0,0 +1,15 @@
1
+ {
2
+ "keep": {
3
+ "days": true,
4
+ "amount": 2
5
+ },
6
+ "auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
7
+ "files": [
8
+ {
9
+ "date": 1745807196830,
10
+ "name": "logs/application-2025-04-28-11.log",
11
+ "hash": "4a66dbdce2f2c9095e2cb99cf3464dfb953ce02c22440f75e81aa6ac3181783e"
12
+ }
13
+ ],
14
+ "hashType": "sha256"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "keep": {
3
+ "days": true,
4
+ "amount": 14
5
+ },
6
+ "auditLog": "logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json",
7
+ "files": [
8
+ {
9
+ "date": 1745807198680,
10
+ "name": "logs/connections-2025-04-28-11.log",
11
+ "hash": "5c647827a4a88401fd1b44ce37a9d229abf29d3c418ae0d5115bd1cf3dde3bcb"
12
+ }
13
+ ],
14
+ "hashType": "sha256"
15
+ }
@@ -0,0 +1,5 @@
1
+ 2025-04-28T11:26:38+09:00 info: File Storage is Ready.
2
+ 2025-04-28T11:26:51+09:00 info: File Storage is Ready.
3
+ 2025-04-28T11:26:52+09:00 info: Default DataSource established
4
+ 2025-04-28T11:26:53+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
5
+ 2025-04-28T11:26:53+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
@@ -0,0 +1,56 @@
1
+ 2025-04-28T11:26:53+09:00 info: Initializing ConnectionManager...
2
+ 2025-04-28T11:26:53+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2025-04-28T11:26:53+09:00 info: Connector 'echo-back' started to ready
4
+ 2025-04-28T11:26:53+09:00 info: Connector 'http-connector' started to ready
5
+ 2025-04-28T11:26:53+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2025-04-28T11:26:53+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2025-04-28T11:26:53+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2025-04-28T11:26:53+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2025-04-28T11:26:53+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2025-04-28T11:26:53+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2025-04-28T11:26:53+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2025-04-28T11:26:53+09:00 info: Connector 'socket-server' started to ready
13
+ 2025-04-28T11:26:53+09:00 info: Connector 'operato-connector' started to ready
14
+ 2025-04-28T11:26:53+09:00 info: Connector 'headless-connector' started to ready
15
+ 2025-04-28T11:26:53+09:00 info: Connector 'email-connector' started to ready
16
+ 2025-04-28T11:26:53+09:00 info: Connector 'influxdb-connector' started to ready
17
+ 2025-04-28T11:26:53+09:00 info: Connector 'msgraph-connector' started to ready
18
+ 2025-04-28T11:26:53+09:00 info: Connector 'weather-api-connector' started to ready
19
+ 2025-04-28T11:26:53+09:00 info: Connector 'proxy-connector' started to ready
20
+ 2025-04-28T11:26:53+09:00 info: echo-back-servers are ready
21
+ 2025-04-28T11:26:53+09:00 info: echo-back connections are ready
22
+ 2025-04-28T11:26:53+09:00 info: http-connector connections are ready
23
+ 2025-04-28T11:26:53+09:00 info: graphql-connector connections are ready
24
+ 2025-04-28T11:26:53+09:00 info: sqlite-connector connections are ready
25
+ 2025-04-28T11:26:53+09:00 info: postgresql-connector connections are ready
26
+ 2025-04-28T11:26:53+09:00 info: mqtt-connector connections are ready
27
+ 2025-04-28T11:26:53+09:00 info: mssql-connector connections are ready
28
+ 2025-04-28T11:26:53+09:00 info: oracle-connector connections are ready
29
+ 2025-04-28T11:26:53+09:00 info: mysql-connector connections are ready
30
+ 2025-04-28T11:26:53+09:00 info: socket servers are ready
31
+ 2025-04-28T11:26:53+09:00 info: operato-connector connections are ready
32
+ 2025-04-28T11:26:53+09:00 info: headless-connector connections are ready
33
+ 2025-04-28T11:26:53+09:00 info: email connections are ready
34
+ 2025-04-28T11:26:53+09:00 info: influxdb connections are ready
35
+ 2025-04-28T11:26:53+09:00 info: msgraph-connector connections are ready
36
+ 2025-04-28T11:26:53+09:00 info: Weather API connections are ready
37
+ 2025-04-28T11:26:53+09:00 info: proxy-connector connections are ready
38
+ 2025-04-28T11:26:53+09:00 info: All connector for 'echo-back-server' ready
39
+ 2025-04-28T11:26:53+09:00 info: All connector for 'echo-back' ready
40
+ 2025-04-28T11:26:53+09:00 info: All connector for 'http-connector' ready
41
+ 2025-04-28T11:26:53+09:00 info: All connector for 'graphql-connector' ready
42
+ 2025-04-28T11:26:53+09:00 info: All connector for 'sqlite-connector' ready
43
+ 2025-04-28T11:26:53+09:00 info: All connector for 'postgresql-connector' ready
44
+ 2025-04-28T11:26:53+09:00 info: All connector for 'mqtt-connector' ready
45
+ 2025-04-28T11:26:53+09:00 info: All connector for 'mssql-connector' ready
46
+ 2025-04-28T11:26:53+09:00 info: All connector for 'oracle-connector' ready
47
+ 2025-04-28T11:26:53+09:00 info: All connector for 'mysql-connector' ready
48
+ 2025-04-28T11:26:53+09:00 info: All connector for 'socket-server' ready
49
+ 2025-04-28T11:26:53+09:00 info: All connector for 'operato-connector' ready
50
+ 2025-04-28T11:26:53+09:00 info: All connector for 'headless-connector' ready
51
+ 2025-04-28T11:26:53+09:00 info: All connector for 'email-connector' ready
52
+ 2025-04-28T11:26:53+09:00 info: All connector for 'influxdb-connector' ready
53
+ 2025-04-28T11:26:53+09:00 info: All connector for 'msgraph-connector' ready
54
+ 2025-04-28T11:26:53+09:00 info: All connector for 'weather-api-connector' ready
55
+ 2025-04-28T11:26:53+09:00 info: All connector for 'proxy-connector' ready
56
+ 2025-04-28T11:26:53+09:00 info: ConnectionManager initialization done:
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-excel",
3
3
  "description": "Excel integration component for things-scene",
4
4
  "license": "MIT",
5
- "version": "0.1.10",
5
+ "version": "0.1.18",
6
6
  "author": "heartyoh",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
@@ -26,14 +26,14 @@
26
26
  "migration": "things-factory-migration"
27
27
  },
28
28
  "dependencies": {
29
- "@hatiolab/things-scene": "^2.8.5",
29
+ "@hatiolab/things-scene": "^2.8.7",
30
30
  "xlsx": "^0.16.8"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hatiolab/prettier-config": "^1.0.0",
34
34
  "@operato/board": "^0.4.6",
35
- "@things-factory/builder": "^4.3.0-alpha.0",
36
- "@things-factory/operato-board": "^4.3.0-alpha.0",
35
+ "@things-factory/builder": "^4.3.74",
36
+ "@things-factory/operato-board": "^4.3.76",
37
37
  "@types/xlsx": "^0.0.36",
38
38
  "@typescript-eslint/eslint-plugin": "^4.33.0",
39
39
  "@typescript-eslint/parser": "^4.33.0",
@@ -59,5 +59,5 @@
59
59
  "prettier --write"
60
60
  ]
61
61
  },
62
- "gitHead": "fec0663b9dd4e5d0d092ed5b8f29380a1ae9763b"
62
+ "gitHead": "09fac73096902530d84321e121b307006533fe24"
63
63
  }