iobroker.eos-admin 9.0.29 → 9.0.31

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.
Files changed (136) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +11 -13
  2. package/README.md +9 -11
  3. package/adminWww/.vite/manifest.json +39 -39
  4. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +111 -110
  5. package/adminWww/apple-touch-icon-eos-v2.png +0 -0
  6. package/adminWww/apple-touch-icon.png +0 -0
  7. package/adminWww/assets/{AdapterUpdateDialog-DXp4Dgkx.js → AdapterUpdateDialog-UhaQHyF1.js} +1 -1
  8. package/adminWww/assets/{Adapters-1AOp__74.js → Adapters-Di3sM_ky.js} +1 -1
  9. package/adminWww/assets/{ConfigManager-CGGXU4Jp.js → ConfigManager-C2naRwDl.js} +1 -1
  10. package/adminWww/assets/{Enums-Bl4EngJF.js → Enums-B9ucB-qg.js} +1 -1
  11. package/adminWww/assets/{Fields-zSEjRWOB.js → Fields-DN41WFbp.js} +1 -1
  12. package/adminWww/assets/{Files-CnYmjEbu.js → Files-C3PbbeNR.js} +1 -1
  13. package/adminWww/assets/{Hosts-zFJyiuvd.js → Hosts-DXjTE0pX.js} +1 -1
  14. package/adminWww/assets/{Instances-D10dnQY4.js → Instances-PKvEjDNQ.js} +1 -1
  15. package/adminWww/assets/{Intro-DxLBfGZ8.js → Intro-BnYMjDZr.js} +1 -1
  16. package/adminWww/assets/{Logs-CAc6o-d_.js → Logs-DTo6XJF_.js} +1 -1
  17. package/adminWww/assets/{Objects-I64lF3ZS.js → Objects-DyEBMDK6.js} +1 -1
  18. package/adminWww/assets/{Overview-BQ7HBH-7.js → Overview-CWLYuqZx.js} +1 -1
  19. package/adminWww/assets/{State-DHLL8gAc.js → State-Ca9_Ke_c.js} +1 -1
  20. package/adminWww/assets/{UsedResources-DlQ_XqoR.js → UsedResources-20bsoxmj.js} +1 -1
  21. package/adminWww/assets/{Users-CKHDvxG5.js → Users-yZyZX-18.js} +1 -1
  22. package/adminWww/assets/{bootstrap-CIDT4MeX.js → bootstrap-BQ4OzwbT.js} +3 -3
  23. package/adminWww/assets/{hostInit-Cvl4lPGh.js → hostInit-CGSSNegd.js} +1 -1
  24. package/adminWww/assets/{icons-material-ngdwOXrt.js → icons-material-C3PNaipj.js} +1 -1
  25. package/adminWww/assets/{index-B9Tfj1YG.js → index-C4CShixx.js} +2 -2
  26. package/adminWww/assets/{installSVGRenderer-COP6GC9p.js → installSVGRenderer-DeaOAT3W.js} +1 -1
  27. package/adminWww/assets/{mf-entry-bootstrap-0-31191d2e.js → mf-entry-bootstrap-0-c5733c2d.js} +2 -2
  28. package/adminWww/index.html +24 -24
  29. package/adminWww/mf-manifest.json +1 -1
  30. package/adminWww/mf-stats.json +1 -1
  31. package/adminWww/remoteEntry-eos-9.0.31.js +12 -0
  32. package/adminWww/remoteEntry.js +1 -1
  33. package/build/lib/eosRuntimeControl.js +21 -10
  34. package/build/lib/eosRuntimeControl.js.map +1 -1
  35. package/build/lib/eosRuntimeHealth.js +12 -9
  36. package/build/lib/eosRuntimeHealth.js.map +1 -1
  37. package/build/lib/eosSplitRuntime.js +61 -0
  38. package/build/lib/eosSplitRuntime.js.map +1 -0
  39. package/build/lib/eosUiProcess.js +91 -13
  40. package/build/lib/eosUiProcess.js.map +1 -1
  41. package/build/lib/eosUiProcessWorker.js +15 -8
  42. package/build/lib/eosUiProcessWorker.js.map +1 -1
  43. package/build/lib/web.js +26 -15
  44. package/build/lib/web.js.map +1 -1
  45. package/docs/README.md +2 -2
  46. package/docs/reports/unified-9.0.30/PRUEFBERICHT.md +37 -0
  47. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/PRUEFERGEBNISSE.json +13 -13
  48. package/docs/reports/unified-9.0.30/raw/INDEX.json +137 -0
  49. package/docs/reports/unified-9.0.30/raw/acceptance-node22.log +30 -0
  50. package/docs/reports/unified-9.0.30/raw/acceptance-node24.log +11 -0
  51. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/backend.log +1 -1
  52. package/docs/reports/unified-9.0.30/raw/baseline-10000.json +1 -0
  53. package/docs/reports/unified-9.0.30/raw/baseline-50000.json +1 -0
  54. package/docs/reports/unified-9.0.30/raw/candidate-10000.json +1 -0
  55. package/docs/reports/unified-9.0.30/raw/candidate-50000.json +1 -0
  56. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/frontend.log +25 -25
  57. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/installer.log +4 -4
  58. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/lint.log +2 -2
  59. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/modules.log +1 -1
  60. package/docs/reports/unified-9.0.30/raw/node22-profile.json +611 -0
  61. package/docs/reports/unified-9.0.30/raw/node22-tests-final.log +17170 -0
  62. package/docs/reports/unified-9.0.30/raw/node24-profile.json +611 -0
  63. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/node24-tests-final.log +2774 -2764
  64. package/docs/reports/unified-9.0.30/raw/profile-combined-node24.log +12 -0
  65. package/docs/reports/unified-9.0.30/raw/profile-split-node24.log +12 -0
  66. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/typecheck.log +1 -1
  67. package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/ui-runtime.log +3 -2
  68. package/docs/reports/unified-9.0.31/PRUEFBERICHT.md +22 -0
  69. package/docs/reports/unified-9.0.31/PRUEFERGEBNISSE.json +112 -0
  70. package/docs/reports/unified-9.0.31/raw/INDEX.json +102 -0
  71. package/docs/reports/unified-9.0.31/raw/backend.log +5 -0
  72. package/docs/reports/unified-9.0.31/raw/branding-build-node22.log +59 -0
  73. package/docs/reports/unified-9.0.31/raw/branding-node24.log +17 -0
  74. package/docs/reports/unified-9.0.31/raw/frontend.log +151 -0
  75. package/docs/reports/unified-9.0.31/raw/https-build-node22.log +235 -0
  76. package/docs/reports/unified-9.0.31/raw/https-node24.log +46 -0
  77. package/docs/reports/unified-9.0.31/raw/installer.log +26 -0
  78. package/docs/reports/unified-9.0.31/raw/lint.log +5 -0
  79. package/docs/reports/unified-9.0.31/raw/modules.log +5 -0
  80. package/docs/reports/{unified-9.0.29 → unified-9.0.31}/raw/node22-tests-final.log +5274 -5208
  81. package/docs/reports/unified-9.0.31/raw/node22-version.log +1 -0
  82. package/docs/reports/unified-9.0.31/raw/node24-tests-final.log +2862 -0
  83. package/docs/reports/unified-9.0.31/raw/node24-version.log +1 -0
  84. package/docs/reports/unified-9.0.31/raw/typecheck.log +5 -0
  85. package/docs/reports/unified-9.0.31/raw/ui-runtime.log +8 -0
  86. package/docs/reports/unified-9.0.31/raw/web-lint.log +0 -0
  87. package/docs/start/START_HIER_9.0.30.md +16 -0
  88. package/docs/start/START_HIER_9.0.31.md +16 -0
  89. package/docs/unified/ARCHITECTURE.md +18 -12
  90. package/io-package.json +12 -12
  91. package/modules/devices/README.md +1 -1
  92. package/modules/devices/lib/deviceRuntime.js +18 -14
  93. package/modules/devices/test/driverLoading.test.js +76 -0
  94. package/package.json +8 -6
  95. package/public/eos-runtime/index.js +7 -6
  96. package/public/eos-tls/trust.html +1 -1
  97. package/release-manifests/unified/build-environment.cdx.json +7 -7
  98. package/release-manifests/unified/files.json +179 -116
  99. package/release-manifests/unified/frontend.cdx.json +7 -7
  100. package/release-manifests/unified/installer.cdx.json +7 -7
  101. package/release-manifests/unified/obsolete-admin-assets.json +172 -6
  102. package/release-manifests/unified/runtime.cdx.json +28 -28
  103. package/release-manifests/unified/validation.json +15 -15
  104. package/tools/eos-release-check.cjs +2 -0
  105. package/tools/eos-release-manifest.cjs +1 -1
  106. package/ui/io-package.json +6 -2
  107. package/ui/lib/datapoint-picker.js +184 -0
  108. package/ui/lib/eos-presentation-routes.js +58 -0
  109. package/ui/lib/eos-presentation.js +140 -0
  110. package/ui/lib/ephemeral-cache.js +7 -4
  111. package/ui/lib/ui-access-policy.js +12 -3
  112. package/ui/main.js +8 -310
  113. package/ui/package.json +1 -1
  114. package/ui/www/ems-apps.html +1 -1
  115. package/ui/www/energy-ledger.html +1 -1
  116. package/ui/www/evcs.html +1 -1
  117. package/ui/www/history.html +1 -1
  118. package/ui/www/index.html +1 -1
  119. package/ui/www/logic.html +1 -1
  120. package/ui/www/login.html +1 -1
  121. package/ui/www/manifest.webmanifest +2 -2
  122. package/ui/www/settings.html +1 -1
  123. package/ui/www/simulation.html +1 -1
  124. package/ui/www/smarthome-config.html +1 -1
  125. package/ui/www/smarthome.html +1 -1
  126. package/ui/www/storagefarm.html +1 -1
  127. package/adminWww/remoteEntry-eos-9.0.29.js +0 -12
  128. package/docs/reports/unified-9.0.29/PRUEFBERICHT.md +0 -30
  129. package/docs/reports/unified-9.0.29/raw/INDEX.json +0 -97
  130. package/docs/reports/unified-9.0.29/raw/tls-targeted-build-node22.log +0 -139
  131. package/docs/reports/unified-9.0.29/raw/tls-targeted-node24.log +0 -132
  132. package/docs/start/START_HIER_9.0.29.md +0 -22
  133. /package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/node22-version.log +0 -0
  134. /package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/node24-version.log +0 -0
  135. /package/docs/reports/{unified-9.0.29 → unified-9.0.30}/raw/npm-audit-runtime.json +0 -0
  136. /package/docs/reports/{unified-9.0.29/raw/tls-lint.log → unified-9.0.30/raw/split-lint.log} +0 -0
@@ -0,0 +1,140 @@
1
+ /**
2
+ * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
+ *
4
+ * Quelle: src-ts/runtime-executables/lib/eos-presentation.ts
5
+ * Quell-Hash: sha256:e93e16ad5cb445fc484dc6eefcad7022020e05b6fa0af7f426c74b3282f5653c
6
+ * Erzeugung: npm run sync:ts-runtime-executables
7
+ *
8
+ * Zweck:
9
+ * Diese JavaScript-Datei ist das ausführbare Build-Artefakt für lib/eos-presentation.js.
10
+ * Die fachliche Bearbeitung erfolgt ab 0.7.131 in der TypeScript-Quelle.
11
+ * Ab 0.7.132 sind doppelte Legacy-JS-Bäume wie .nwcore entfernt.
12
+ *
13
+ * Pflege-Regel:
14
+ * 1. Änderung zuerst in src-ts/runtime-executables/ vornehmen.
15
+ * 2. npm run sync:ts-runtime-executables ausführen.
16
+ * 3. npm run test:runtime-executables prüfen.
17
+ */
18
+ "use strict";
19
+ var __importDefault = (this && this.__importDefault) || function (mod) {
20
+ return (mod && mod.__esModule) ? mod : { "default": mod };
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.createHostedRuntime = createHostedRuntime;
24
+ /** Copyright (c) 2026 NexoWatt. Confidential and proprietary. */
25
+ const node_path_1 = __importDefault(require("node:path"));
26
+ const datapoint_picker_1 = require("./datapoint-picker");
27
+ const eos_presentation_routes_1 = require("./eos-presentation-routes");
28
+ const hosted_http_boundary_1 = require("./hosted-http-boundary");
29
+ const runtime_proxy_html_1 = require("./runtime-proxy-html");
30
+ const express = require('express4');
31
+ const { centralAccess, centralLicenseSnapshot } = require('./hosted-adapter');
32
+ function canUse(access, capability) {
33
+ return access.authenticated === true && Array.isArray(access.capabilities) &&
34
+ (access.capabilities.includes('*') || access.capabilities.includes(capability));
35
+ }
36
+ function noStore(res) {
37
+ res.set({
38
+ 'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate',
39
+ Pragma: 'no-cache',
40
+ Expires: '0',
41
+ });
42
+ }
43
+ /** Read-only UI. Browser input cannot invoke an operational or state-write handler here. */
44
+ function createHostedRuntime(owner, bridge) {
45
+ const root = node_path_1.default.resolve(__dirname, '..');
46
+ const migration = owner.config?.eosUiMigration;
47
+ const namespace = migration?.preserveNamespace === true && typeof migration.source === 'string' &&
48
+ /^nexowatt-ui\.\d+$/.test(migration.source) ? migration.source : owner.namespace;
49
+ const sendHtml = (0, runtime_proxy_html_1.createRuntimeFileSender)(root, namespace);
50
+ const app = express();
51
+ app.disable('x-powered-by');
52
+ app.use(async (req, res, next) => {
53
+ const route = (0, eos_presentation_routes_1.presentationRoute)(req.method, req.url);
54
+ if (!route)
55
+ return next();
56
+ res.set({
57
+ 'X-Content-Type-Options': 'nosniff',
58
+ 'X-Frame-Options': 'SAMEORIGIN',
59
+ 'Referrer-Policy': 'no-referrer',
60
+ 'Permissions-Policy': 'camera=(), microphone=(), geolocation=(), payment=(), usb=()',
61
+ 'Content-Security-Policy': "base-uri 'self'; object-src 'none'; frame-ancestors 'self'",
62
+ });
63
+ if (bridge.originAllowed(req) !== true) {
64
+ res.status(403).json({ ok: false, error: 'origin_forbidden', message: 'Zugriff von fremder Origin blockiert.' });
65
+ return;
66
+ }
67
+ if (route === 'asset' || route === 'file')
68
+ return next();
69
+ noStore(res);
70
+ try {
71
+ const access = await centralAccess(bridge, req);
72
+ if (access.role === 'none' || access.authenticated !== true) {
73
+ if (route === 'dashboard') {
74
+ const prefix = (0, runtime_proxy_html_1.runtimeProxyPrefix)(req, namespace) || '';
75
+ res.redirect(303, prefix + '/login.html?returnTo=' + encodeURIComponent(prefix + '/'));
76
+ }
77
+ else
78
+ res.status(401).json({ ok: false, error: 'authentication_required', mode: 'eos' });
79
+ return;
80
+ }
81
+ if (!canUse(access, 'frontend.open')) {
82
+ res.status(403).json({ ok: false, error: 'forbidden' });
83
+ return;
84
+ }
85
+ const license = centralLicenseSnapshot(bridge);
86
+ if (req.path.toLowerCase().startsWith('/api/smarthome/') && !license.grants.includes('smartHome')) {
87
+ res.status(403).json({ ok: false, error: 'EOS_FEATURE_LICENSE_REQUIRED' });
88
+ return;
89
+ }
90
+ if (!license.ok) {
91
+ res.status(403).type('html').send('<!doctype html><html lang="de"><meta charset="utf-8"><title>NexoWatt EOS – Lizenz</title><h1>EOS-Lizenz erforderlich</h1><p><a href="/nexowatt/license">Lizenz aktivieren</a></p></html>');
92
+ return;
93
+ }
94
+ next();
95
+ }
96
+ catch {
97
+ res.status(503).json({ ok: false, error: 'authentication_unavailable' });
98
+ }
99
+ });
100
+ const requireMapping = async (req, res, next) => {
101
+ const access = await centralAccess(bridge, req);
102
+ if (access.role === 'none' || access.authenticated !== true) {
103
+ res.status(401).json({ ok: false, error: 'unauthorized', message: 'Installer-/Admin-Anmeldung erforderlich.' });
104
+ return;
105
+ }
106
+ if (!canUse(access, 'mapping.edit')) {
107
+ res.status(403).json({ ok: false, error: 'forbidden', message: 'Diese Funktion ist für diese Rolle nicht freigegeben.' });
108
+ return;
109
+ }
110
+ next();
111
+ };
112
+ const picker = (0, datapoint_picker_1.registerDatapointPicker)(app, owner, requireMapping);
113
+ app.get('/', (req, res) => sendHtml(req, res, node_path_1.default.join(root, 'www', 'index.html')));
114
+ for (const [url, [file, type]] of eos_presentation_routes_1.PRESENTATION_FILES) {
115
+ app.get(url, (_req, res) => { res.type(type).sendFile(node_path_1.default.join(root, file)); });
116
+ }
117
+ app.get('/static/evcs-electrical-limits.js', (_req, res) => {
118
+ res.sendFile(node_path_1.default.join(root, 'lib', 'evcs-electrical-limits.js'));
119
+ });
120
+ const staticOptions = { index: false, redirect: false, dotfiles: 'deny' };
121
+ app.use('/static', express.static(node_path_1.default.join(root, 'www'), staticOptions));
122
+ app.use('/assets', express.static(node_path_1.default.join(root, 'www', 'assets'), staticOptions));
123
+ app.use((_error, _req, res, next) => {
124
+ if (res.headersSent)
125
+ return next(_error);
126
+ res.status(503).json({ ok: false, error: 'EOS_UI_UNAVAILABLE' });
127
+ });
128
+ const handle = (0, hosted_http_boundary_1.createHostedHttpHandler)(app);
129
+ let running = false;
130
+ return {
131
+ async start() { running = true; },
132
+ async stop() { running = false; picker.close(); },
133
+ handle(req, res, next) {
134
+ if (!running || !(0, eos_presentation_routes_1.presentationRoute)(req.method, req.url))
135
+ return next();
136
+ return handle(req, res, next);
137
+ },
138
+ status() { return { state: running ? 'ready' : 'stopped', active: running, canWrite: false, emsReady: false }; },
139
+ };
140
+ }
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/lib/ephemeral-cache.ts
10
- * Quell-Hash: sha256:8836aeca081c6bfc69ef5afb57d1f392c51881d50958a2718febef6122a0acac
10
+ * Quell-Hash: sha256:726b8b689a45fd0422ce656823bf117ea83097c7fb136cf955953f82d90e4887
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -88,26 +88,29 @@ exports.EphemeralMap = EphemeralMap;
88
88
  class ExpiringSnapshot {
89
89
  constructor(load, ttlMs, time = clock) {
90
90
  this.load = load;
91
+ this.time = time;
91
92
  this.pending = null;
92
93
  this.closed = false;
93
94
  this.cache = new EphemeralMap(ttlMs, 1, time);
94
95
  }
95
96
  get retained() { return this.cache.has('snapshot'); }
96
97
  get loading() { return this.pending !== null; }
97
- get(force = false) {
98
+ get(force = false, maxAgeMs) {
98
99
  if (this.closed)
99
100
  return Promise.reject(new Error('EOS_UI_STOPPING'));
100
101
  // A refresh already in progress is newer than the previously cached snapshot.
101
102
  if (this.pending)
102
103
  return this.pending;
103
104
  const cached = !force ? this.cache.get('snapshot') : undefined;
104
- if (cached)
105
+ if (cached && (maxAgeMs === undefined || this.time.now() - cached.startedAt <= maxAgeMs)) {
105
106
  return Promise.resolve(cached.value);
107
+ }
106
108
  this.cache.clear();
109
+ const startedAt = this.time.now();
107
110
  const request = Promise.resolve().then(this.load).then(value => {
108
111
  if (this.closed)
109
112
  throw new Error('EOS_UI_STOPPING');
110
- this.cache.set('snapshot', { value });
113
+ this.cache.set('snapshot', { value, startedAt });
111
114
  return value;
112
115
  });
113
116
  this.pending = request;
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/lib/ui-access-policy.ts
10
- * Quell-Hash: sha256:c3b68fac91389ad1502fd03a889fdeca278c5230f7441c80bd77b767f0f030de
10
+ * Quell-Hash: sha256:2a345524e918cf1fcb7d195cc41afd5957d02b51c762a1975054c7abe00ca248
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -55,7 +55,7 @@ var __importStar = (this && this.__importStar) || (function () {
55
55
  };
56
56
  })();
57
57
  Object.defineProperty(exports, "__esModule", { value: true });
58
- exports.EosSessionClient = exports.UiLoginLimiter = void 0;
58
+ exports.EosSessionClient = exports.UiLoginLimiter = exports.APPLE_TOUCH_ICON_PATHS = void 0;
59
59
  exports.parseUiCookies = parseUiCookies;
60
60
  exports.uiAuthMode = uiAuthMode;
61
61
  exports.uiSessionBinding = uiSessionBinding;
@@ -211,7 +211,16 @@ function uiRequestPath(req) {
211
211
  }
212
212
  const AUTH_READ = new Set(['/api/auth/status', '/api/strict-auth/status', '/api/session/me', '/api/locale']);
213
213
  const AUTH_WRITE = new Set(['/api/auth/login', '/api/strict-auth/login', '/api/installer/login', '/api/auth/logout', '/api/strict-auth/logout', '/api/installer/logout']);
214
- const PUBLIC_PAGES = new Set(['/login', '/login.html', '/static/login.html', '/favicon.ico', '/apple-touch-icon.png', '/apple-touch-icon-precomposed.png', '/apple-touch-icon-180x180.png', '/apple-touch-icon-180x180-precomposed.png', '/manifest.webmanifest', '/sw.js']);
214
+ exports.APPLE_TOUCH_ICON_PATHS = [
215
+ '/apple-touch-icon-eos-v2.png',
216
+ '/apple-touch-icon.png',
217
+ '/apple-touch-icon-precomposed.png',
218
+ '/apple-touch-icon-180x180.png',
219
+ '/apple-touch-icon-180x180-precomposed.png',
220
+ ];
221
+ const PUBLIC_PAGES = new Set([
222
+ '/login', '/login.html', '/static/login.html', '/favicon.ico', '/manifest.webmanifest', '/sw.js', ...exports.APPLE_TOUCH_ICON_PATHS,
223
+ ]);
215
224
  /** Nur öffentliche Programm-Assets; niemals HTML, API-Daten oder Konfiguration. */
216
225
  function isPublicUiRequest(req) {
217
226
  const pathname = uiRequestPath(req);
package/ui/main.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/main.ts
10
- * Quell-Hash: sha256:2e8e4d4b14ec885e68c7127c75bee1f355db2521addbf8e46c94a91bfd462f27
10
+ * Quell-Hash: sha256:beaaa7b6572b6b3f4a1ea5bae6595cd9196a3d5595ad0e9a66da0e6e9f15cad1
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -46,7 +46,7 @@ const { cleanControls, extendSuggestion, collectKeywordDetectionCandidates, keyw
46
46
  const { smartHomeEnabled, registerSmartHomeActivationApi } = require('./lib/smarthome-activation');
47
47
  const { readPreservedUiStates, parseInstallerConfigState } = require('./lib/preserved-ui-config');
48
48
  const { createRuntimeFileSender, runtimeProxyPrefix, rewriteRuntimeProxyHtml, isHttpsRuntimeProxy } = require('./lib/runtime-proxy-html');
49
- const { parseUiCookies, isPublicUiRequest, isIndependentMachineRequest, uiRequestPath, constantTimeToken } = require('./lib/ui-access-policy');
49
+ const { APPLE_TOUCH_ICON_PATHS, parseUiCookies, isPublicUiRequest, isIndependentMachineRequest, uiRequestPath, constantTimeToken } = require('./lib/ui-access-policy');
50
50
  const { resolveUiTlsOptions, UiTlsConfigurationError } = require('./lib/ui-server-transport');
51
51
  const { createMeshPeerClient, safeMeshPeerError } = require('./lib/mesh-peer-http');
52
52
  const path = require('path');
@@ -77,6 +77,7 @@ const { registerPartnerIntegrationApi, assertPartnerPersistence } = require('./l
77
77
  const { PartnerRuntime } = require('./lib/partner-runtime');
78
78
  const { SseRuntimeGuard } = require('./lib/sse-runtime-guard');
79
79
  const { EphemeralMap, ExpiringSnapshot } = require('./lib/ephemeral-cache');
80
+ const { registerDatapointPicker } = require('./lib/datapoint-picker');
80
81
  const { buildStationDisplayPresentation } = require('./lib/station-display-presentation'), { isUnlicensedLicenseBootstrapRequest } = require('./lib/license-bootstrap-access');
81
82
  const tariffProviderRegistry = require('./ems/services/tariff-provider-registry');
82
83
  const { normalizeEvcsEnergyTotalKwh } = require('./ems/services/evcs-unit-conversion');
@@ -13236,13 +13237,8 @@ app.get('/sw.js', (_req, res) => {
13236
13237
  res.type('application/javascript');
13237
13238
  res.sendFile(path.join(__dirname, 'www', 'sw.js'));
13238
13239
  });
13239
- // API-Kommentar: GET-Route. Zweck: stellt einen Web-/API-Endpunkt bereit. Zusammenhang: Frontend-Dateien in www/* können diesen Endpunkt direkt nutzen. Route/Handler: '/apple-touch-icon.png', (_req, res) => {
13240
- app.get('/apple-touch-icon.png', (_req, res) => {
13241
- res.type('image/png');
13242
- res.sendFile(path.join(__dirname, 'www', 'apple-touch-icon.png'));
13243
- });
13244
- // Conventional iOS probes are fixed public image aliases, never a public directory.
13245
- app.get(['/apple-touch-icon-precomposed.png', '/apple-touch-icon-180x180.png', '/apple-touch-icon-180x180-precomposed.png'], (_req, res) => {
13240
+ // The versioned path and conventional iOS probes serve the same dedicated icon.
13241
+ app.get(APPLE_TOUCH_ICON_PATHS, (_req, res) => {
13246
13242
  res.type('image/png');
13247
13243
  res.sendFile(path.join(__dirname, 'www', 'assets', 'icons', 'nexowatt-180.png'));
13248
13244
  });
@@ -15456,207 +15452,8 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
15456
15452
  } finally { endMeshAppSave(mutationToken); }
15457
15453
  });
15458
15454
 
15459
- // Technische Datenpunktauswahl: Installer/Admin liest mögliche Zuordnungen. Kunden erhalten keinen freien DP-Zugriff.
15460
- app.get('/api/smarthome/dpsearch', requireDpDiscovery, async (req, res) => {
15461
- try {
15462
- const qRaw = (req.query && req.query.q) || '';
15463
- const q = (typeof qRaw === 'string' ? qRaw : String(qRaw || '')).trim();
15464
- const qLower = (q || '').toLowerCase();
15465
- const direction = req.query?.direction;
15466
- const allowedTypes = new Set(['boolean', 'number', 'string']);
15467
- function csvFilter(value, maxItems, validator) {
15468
- if (value === undefined) return new Set();
15469
- if (typeof value !== 'string' || !value || value.length > 1024) return null;
15470
- const entries = value.split(',');
15471
- return entries.length <= maxItems && entries.every(validator) ? new Set(entries) : null;
15472
- }
15473
- const types = csvFilter(req.query?.types, 3, value => allowedTypes.has(value));
15474
- const roles = csvFilter(req.query?.roles, 16, value => /^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/.test(value));
15475
- if ((direction !== undefined && direction !== 'read' && direction !== 'write') || !types || !roles) {
15476
- return res.status(400).json({ ok: false, error: 'EOS_DP_FILTER_INVALID' });
15477
- }
15478
-
15479
- const limitRaw = (req.query && req.query.limit) || '';
15480
- let limit = parseInt(limitRaw, 10);
15481
- if (!Number.isFinite(limit) || limit <= 0) limit = 200;
15482
- if (limit > 5000) limit = 5000;
15483
-
15484
- if (typeof this.getForeignObjectsAsync !== 'function') {
15485
- this.log.warn('SmartHomeConfig dpsearch: getForeignObjectsAsync not available');
15486
- return res.json({ ok: false, error: 'datapoint search not supported' });
15487
- }
15488
-
15489
- // Cache all state objects for a short period to avoid heavy DB reads while typing
15490
-
15491
- const now = Date.now();
15492
-
15493
- const ttlMs = 15000;
15494
-
15495
- if (!this._nwDpCache || !this._nwDpCache.ts || (now - this._nwDpCache.ts) > ttlMs) {
15496
-
15497
- const all = await this.getForeignObjectsAsync('*', 'state');
15498
-
15499
- const items = [];
15500
-
15501
- for (const id of Object.keys(all || {})) {
15502
-
15503
- const obj = all[id];
15504
-
15505
- if (!obj || !obj.common) continue;
15506
-
15507
- const nameRaw = obj.common.name || '';
15508
-
15509
- const name = typeof nameRaw === 'string' ? nameRaw : JSON.stringify(nameRaw);
15510
-
15511
- items.push({
15512
-
15513
- id,
15514
-
15515
- name,
15516
-
15517
- role: obj.common.role || '',
15518
-
15519
- type: obj.common.type || '',
15520
-
15521
- unit: obj.common.unit || '',
15522
- read: obj.common.read === true,
15523
- write: obj.common.write === true,
15524
-
15525
- idLower: String(id).toLowerCase(),
15526
-
15527
- nameLower: String(name).toLowerCase(),
15528
-
15529
- });
15530
-
15531
- }
15532
-
15533
- // Stable, user-friendly order
15534
-
15535
- items.sort((a, b) => a.idLower.localeCompare(b.idLower));
15536
-
15537
- // Build byId map (plain object) for fast lookup
15538
-
15539
- const byId = {};
15540
-
15541
- for (const it of items) {
15542
-
15543
- if (!it || !it.id) continue;
15544
-
15545
- byId[it.id] = it;
15546
-
15547
- }
15548
-
15549
- // Build a lightweight trie for folder-like browsing (dot-separated IDs)
15550
- /**
15551
- * Code-Teil: makeNode
15552
- * Zweck: Kapselt einen lokalen Verarbeitungsschritt, damit Aufrufer nicht direkt in Detaildaten eingreifen.
15553
- * Zusammenhang: Teil von Adapterkern: Lifecycle, Webserver, API, States, EMS-Engine; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
15554
- * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
15555
- */
15556
- const makeNode = () => ({ children: Object.create(null), item: null });
15557
-
15558
- const root = makeNode();
15559
-
15560
- for (const it of items) {
15561
-
15562
- const sid = String(it.id || '');
15563
-
15564
- if (!sid) continue;
15565
-
15566
- const parts = sid.split('.').filter(Boolean);
15567
-
15568
- let node = root;
15569
-
15570
- for (const seg of parts) {
15571
-
15572
- if (!node.children[seg]) node.children[seg] = makeNode();
15573
-
15574
- node = node.children[seg];
15575
-
15576
- }
15577
-
15578
- node.item = it;
15579
-
15580
- }
15581
-
15582
- this._nwDpCache = { ts: now, items, byId, trie: root };
15583
-
15584
- }
15585
-
15586
- const items = (this._nwDpCache && this._nwDpCache.items) ? this._nwDpCache.items : [];
15587
-
15588
- const results = [];
15589
- const seen = new Set();
15590
- /**
15591
- * Code-Teil: pushItem
15592
- * Zweck: Kapselt einen lokalen Verarbeitungsschritt, damit Aufrufer nicht direkt in Detaildaten eingreifen.
15593
- * Zusammenhang: Teil von Adapterkern: Lifecycle, Webserver, API, States, EMS-Engine; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
15594
- * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
15595
- */
15596
- function pushItem(it) {
15597
- if (!it || !it.id || seen.has(it.id)) return;
15598
- if (direction && it[direction] !== true) return;
15599
- if (types.size && !types.has(it.type)) return;
15600
- seen.add(it.id);
15601
- results.push({
15602
- id: it.id,
15603
- name: it.name,
15604
- role: it.role,
15605
- type: it.type,
15606
- unit: it.unit,
15607
- read: it.read,
15608
- write: it.write,
15609
- });
15610
- }
15611
-
15612
- function matchesQuery(it) {
15613
- return !qLower || it.idLower.includes(qLower) || it.nameLower.includes(qLower)
15614
- || (direction && typeof it.role === 'string' && it.role.toLowerCase().includes(qLower));
15615
- }
15616
- // Reserve the first results for the requested function even with
15617
- // thousands of other devices in earlier branches of the object tree.
15618
- if (roles.size) {
15619
- for (const it of items) {
15620
- if (roles.has(it.role) && matchesQuery(it)) pushItem(it);
15621
- if (results.length >= limit) return res.json({ ok: true, results });
15622
- }
15623
- }
15624
-
15625
- if (!qLower) {
15626
- // Browse-Mode: zeige zuerst typische Admin-Bereiche
15627
- const preferredPrefixes = ['0_userdata.0.', 'alias.0.', 'javascript.0.'];
15628
- for (const pref of preferredPrefixes) {
15629
- for (const it of items) {
15630
- if (!it.idLower.startsWith(pref)) continue;
15631
- pushItem(it);
15632
- if (results.length >= limit) break;
15633
- }
15634
- if (results.length >= limit) break;
15635
- }
15636
-
15637
- if (results.length < limit) {
15638
- for (const it of items) {
15639
- pushItem(it);
15640
- if (results.length >= limit) break;
15641
- }
15642
- }
15643
-
15644
- return res.json({ ok: true, results });
15645
- }
15646
-
15647
- for (const it of items) {
15648
- if (matchesQuery(it)) {
15649
- pushItem(it);
15650
- if (results.length >= limit) break;
15651
- }
15652
- }
15653
-
15654
- res.json({ ok: true, results });
15655
- } catch (e) {
15656
- this.log.warn('SmartHomeConfig dpsearch error: ' + e.message);
15657
- res.status(500).json({ ok: false, error: 'internal error' });
15658
- }
15659
- });
15455
+ this._nwDpPicker?.close();
15456
+ this._nwDpPicker = registerDatapointPicker(app, this, requireDpDiscovery);
15660
15457
 
15661
15458
  // --- SmartHomeConfig DP-Test (Installer): read/write a datapoint quickly ---
15662
15459
  // Read current foreign state
@@ -18538,106 +18335,6 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
18538
18335
  }
18539
18336
  });
18540
18337
 
18541
- // --- Datenpunkt-Objekt-Browser (Tree) ---
18542
- // Technische Datenpunktauswahl: Installer/Admin liest mögliche Zuordnungen. Kunden erhalten keinen freien DP-Zugriff.
18543
- app.get(['/api/object/tree', '/api/smarthome/object/tree'], requireDpDiscovery, async (req, res) => {
18544
- try {
18545
- const prefixRaw = (req.query && req.query.prefix) || '';
18546
- const prefix = (typeof prefixRaw === 'string' ? prefixRaw : String(prefixRaw || '')).trim();
18547
-
18548
- if (typeof this.getForeignObjectsAsync !== 'function') {
18549
- return res.status(500).json({ ok: false, error: 'getForeignObjectsAsync not available' });
18550
- }
18551
-
18552
- // Build/refresh cache if needed
18553
- const now = Date.now();
18554
- const ttlMs = 30000;
18555
- if (!this._nwDpCache || !this._nwDpCache.ts || (now - this._nwDpCache.ts) > ttlMs || !this._nwDpCache.trie) {
18556
- const all = await this.getForeignObjectsAsync('*', 'state');
18557
- const items = [];
18558
- for (const id of Object.keys(all || {})) {
18559
- const obj = all[id];
18560
- if (!obj || !obj.common) continue;
18561
- const nameRaw = obj.common.name || '';
18562
- const name = (typeof nameRaw === 'string') ? nameRaw : JSON.stringify(nameRaw);
18563
- items.push({
18564
- id,
18565
- name,
18566
- role: obj.common.role || '',
18567
- type: obj.common.type || '',
18568
- unit: obj.common.unit || '',
18569
- read: obj.common.read === true,
18570
- write: obj.common.write === true,
18571
- idLower: String(id).toLowerCase(),
18572
- nameLower: String(name).toLowerCase(),
18573
- });
18574
- }
18575
- items.sort((a, b) => a.idLower.localeCompare(b.idLower));
18576
- const byId = {};
18577
- for (const it of items) {
18578
- if (it && it.id) byId[it.id] = it;
18579
- }
18580
- /**
18581
- * Code-Teil: makeNode
18582
- * Zweck: Kapselt einen lokalen Verarbeitungsschritt, damit Aufrufer nicht direkt in Detaildaten eingreifen.
18583
- * Zusammenhang: Teil von Adapterkern: Lifecycle, Webserver, API, States, EMS-Engine; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
18584
- * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
18585
- */
18586
- const makeNode = () => ({ children: Object.create(null), item: null });
18587
- const root = makeNode();
18588
- for (const it of items) {
18589
- const sid = String(it.id || '');
18590
- if (!sid) continue;
18591
- const parts = sid.split('.').filter(Boolean);
18592
- let node = root;
18593
- for (const seg of parts) {
18594
- if (!node.children[seg]) node.children[seg] = makeNode();
18595
- node = node.children[seg];
18596
- }
18597
- node.item = it;
18598
- }
18599
- this._nwDpCache = { ts: now, items, byId, trie: root };
18600
- }
18601
-
18602
- const cache = this._nwDpCache;
18603
- const trie = cache && cache.trie ? cache.trie : null;
18604
- if (!trie) return res.json({ ok: true, prefix, children: [] });
18605
-
18606
- const parts = prefix ? prefix.split('.').filter(Boolean) : [];
18607
- let node = trie;
18608
- for (const seg of parts) {
18609
- if (!node.children || !node.children[seg]) { node = null; break; }
18610
- node = node.children[seg];
18611
- }
18612
- if (!node) return res.json({ ok: true, prefix, children: [] });
18613
-
18614
- const out = [];
18615
- const keys = Object.keys(node.children || {});
18616
- keys.sort((a, b) => a.localeCompare(b));
18617
- for (const seg of keys) {
18618
- const child = node.children[seg];
18619
- const id = prefix ? (prefix + '.' + seg) : seg;
18620
- const it = child && child.item ? child.item : (cache && cache.byId ? cache.byId[id] : null);
18621
- out.push({
18622
- id,
18623
- label: seg,
18624
- hasChildren: !!(child && child.children && Object.keys(child.children).length),
18625
- isState: !!it,
18626
- name: it ? it.name : '',
18627
- role: it ? it.role : '',
18628
- type: it ? it.type : '',
18629
- unit: it ? it.unit : '',
18630
- ...(it ? { read: it.read, write: it.write } : {}),
18631
- });
18632
- }
18633
-
18634
- res.json({ ok: true, prefix, children: out });
18635
- } catch (e) {
18636
- try { this.log.warn('object tree API error: ' + (e && e.message ? e.message : e)); } catch (_e2) {}
18637
- res.status(500).json({ ok: false, error: 'internal error' });
18638
- }
18639
- });
18640
-
18641
18338
  // --- EMS Apps / Installer Page ---
18642
18339
  // API-Kommentar: GET-Route. Zweck: stellt einen Web-/API-Endpunkt bereit. Zusammenhang: Frontend-Dateien in www/* können diesen Endpunkt direkt nutzen. Route/Handler: ['/ems-apps.html', '/ems-apps'], (req, res) => {
18643
18340
  app.get(['/ems-apps.html', '/ems-apps'], async (req, res) => {
@@ -34759,6 +34456,7 @@ return res.json(out);
34759
34456
  cleanup.capture(() => this._nwHistoryApiCache?.clear());
34760
34457
  cleanup.capture(() => this._nwShcfgDetectCache?.clear());
34761
34458
  cleanup.capture(() => this._nwTypeDetectorObjectsCache?.close());
34459
+ cleanup.capture(() => this._nwDpPicker?.close());
34762
34460
  cleanup.capture(() => this._partnerRuntime?.stop());
34763
34461
  cleanup.capture(() => this._meshCoordinator?.stop());
34764
34462
  this._nwShutdownStartedAt = Date.now();
package/ui/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexowatt-eos-ui-internal",
3
- "version": "9.0.29",
3
+ "version": "9.0.31",
4
4
  "description": "Internal UI and EMS module hosted by iobroker.eos-admin; not an ioBroker adapter entry point.",
5
5
  "author": "NexoWatt",
6
6
  "license": "UNLICENSED",
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
 
31
31
  <meta content="width=device-width, initial-scale=1" name="viewport"/>
32
32
  <title>NexoWatt EOS – App-Center (Installer)</title>
@@ -11,7 +11,7 @@
11
11
  <link rel="manifest" href="/manifest.webmanifest">
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
13
13
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
14
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
14
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
15
15
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
16
16
  <script src="/static/runtime-base.js"></script>
17
17
  <script src="/static/auth.js"></script>
package/ui/www/evcs.html CHANGED
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
31
31
  <script src="/static/runtime-base.js"></script>
32
32
  <script src="/static/auth.js"></script>
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
31
31
  <script src="/static/runtime-base.js"></script>
32
32
  <script src="/static/auth.js"></script>
package/ui/www/index.html CHANGED
@@ -28,7 +28,7 @@
28
28
  <link rel="manifest" href="/manifest.webmanifest">
29
29
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
30
30
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
31
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
31
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
32
32
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
33
33
  <script src="/static/runtime-base.js"></script>
34
34
  <script src="/static/auth.js"></script>
package/ui/www/logic.html CHANGED
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
31
31
  <script src="/static/runtime-base.js"></script>
32
32
  <script src="/static/auth.js"></script>