iobroker.nexowatt-ui 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  NexoWatt EOS is the local platform for energy, charging and building control, including the responsive customer cockpit and installer workspace.
4
4
 
5
- **Current stable release:** `1.0.2` (2026-09-09)
5
+ **Current stable release:** `1.0.3` (2026-09-09)
6
6
 
7
7
  It provides live energy-flow visualization, historical analysis, SmartHome visualization, installer-controlled EMS applications, and selected customer controls for desktop, tablet, and smartphone use.
8
8
 
@@ -0,0 +1,88 @@
1
+ # NexoWatt EOS 1.0.3 – offizielle Stable-Version
2
+
3
+ **Veröffentlichungsdatum:** 2026-09-09
4
+ **Status:** Official Stable Patch / produktiver Verkaufsstand
5
+
6
+ ## Zweck des Patches
7
+
8
+ NexoWatt EOS 1.0.3 behebt einen Lizenz-/Authentifizierungsfehler im geschützten AppCenter. Mit einer gültigen Home-Lizenz konnte sich ein Administrator korrekt anmelden und den AppCenter zunächst öffnen. Kurz danach wurde die Seite jedoch erneut gesperrt und der Login-Dialog erschien wieder.
9
+
10
+ Die Admin-Sitzung war dabei weiterhin gültig. Ursache war ein erwartbarer HTTP-403-Status eines nicht in Home enthaltenen Pro-Moduls. Der globale Frontend-Fetch-Handler behandelte bisher jeden 401- oder 403-Status pauschal als Authentifizierungsverlust. Dadurch konnte eine fachliche Lizenzantwort wie `eos_required` die gesamte geschützte Seite verriegeln.
11
+
12
+ ## Korrigierter Authentifizierungsvertrag
13
+
14
+ Nach einer 401-/403-Antwort wird der Auth-Status erneut beim Adapter geprüft. Die Seite wird nur noch gesperrt, wenn mindestens einer dieser Zustände bestätigt wird:
15
+
16
+ - die Sitzung ist tatsächlich nicht mehr angemeldet;
17
+ - die für die aktuelle Seite erforderliche Capability fehlt;
18
+ - der Auth-Status ist nicht erreichbar und kann deshalb nicht sicher bestätigt werden.
19
+
20
+ Ist der Benutzer weiterhin als Admin oder Installer angemeldet und besitzt `appcenter.open`, bleibt der AppCenter geöffnet. Die fachliche API-Antwort wird unverändert an das jeweilige Modul weitergereicht.
21
+
22
+ Damit werden unter anderem folgende fachliche Antworten nicht mehr mit einem Loginverlust verwechselt:
23
+
24
+ - `eos_required`;
25
+ - `license_required`;
26
+ - `readOnly`;
27
+ - `customer_control_disabled`;
28
+ - geräte- oder funktionsbezogene 403-Antworten.
29
+
30
+ ## Home-Lizenz und alte Pro-Konfiguration
31
+
32
+ Beim Wechsel von Pro auf Home können im gespeicherten Projektstand weiterhin Konfigurationen von Pro-Apps vorhanden sein. Diese Daten werden nicht ungefragt gelöscht. Für die an die Home-Oberfläche gelieferte Konfigurationskopie werden Pro-only Apps jedoch mit der bestehenden Lizenznormalisierung auf `installed=false`, `enabled=false` und `licenseBlocked=true` gesetzt.
33
+
34
+ Zusätzlich gelten im Frontend drei Schutzebenen:
35
+
36
+ 1. Mesh/Microgrid, Netzbetreiber-Schnittstelle und Betriebsstrategien werden nur bei gültiger App-Lizenz als installiert bewertet.
37
+ 2. Pro-only Komponenten werden unter Home nicht initialisiert.
38
+ 3. Die Netzbetreiber-Komponente prüft die Edition vor dem Laden des Pro-Treiberverzeichnisses.
39
+
40
+ Dadurch kann ein alter `installed=true`-Wert keine versteckten Pro-API-Aufrufe und keine erneute Login-Sperre mehr auslösen.
41
+
42
+ ## Sicherheitsverhalten bleibt fail-closed
43
+
44
+ Der Patch setzt den AppCenter nicht pauschal auf „frei“. Folgende Fälle sperren weiterhin zuverlässig:
45
+
46
+ - bestätigtes `authed=false`;
47
+ - fehlende Capability `appcenter.open`;
48
+ - nicht erreichbare Auth-Statusprüfung;
49
+ - echter Logout oder abgelaufene Session.
50
+
51
+ Der Hintergrund wird dabei wie bisher inert geschaltet, der Pflichtdialog kann nicht durch Außenklick oder Escape umgangen werden, und die serverseitigen Rollenprüfungen bleiben unverändert.
52
+
53
+ ## Regressionstest
54
+
55
+ Der neue Stable-Test startet den realen AppCenter in Chromium mit:
56
+
57
+ - gültiger Home-Lizenz;
58
+ - angemeldetem Admin und Capability `*`;
59
+ - absichtlich verbliebenen Pro-Flags für Netzbetreiber, Mesh/Microgrid und Betriebsstrategien;
60
+ - einer simulierten fachlichen Antwort `403 eos_required`.
61
+
62
+ Geprüft wird:
63
+
64
+ - Home-Lizenz wird im AppCenter angezeigt;
65
+ - Login-Overlay bleibt geschlossen;
66
+ - Seite und Hintergrund bleiben entsperrt;
67
+ - AppCenter-DOM bleibt vollständig vorhanden;
68
+ - `/api/netoperator/drivers` wird unter Home nicht aufgerufen;
69
+ - eine manuell ausgelöste fachliche 403-Antwort verriegelt die Seite nicht;
70
+ - ein anschließend simulierter echter Sessionverlust mit 401 sperrt die Seite wieder fail-closed;
71
+ - keine Browser-Ausnahmen treten auf.
72
+
73
+ ## Unveränderte Regelungsfunktionen
74
+
75
+ Der Patch betrifft ausschließlich Auth-Fehlerklassifizierung, Lizenzsichtbarkeit und Initialisierung von AppCenter-Komponenten. Unverändert bleiben insbesondere:
76
+
77
+ - NVP- und Netzanschlussregelung;
78
+ - Lade- und Lastmanagement;
79
+ - Speicher- und Speicherfarmregelung;
80
+ - Netzlimit, feste Einspeisebegrenzung und Nulleinspeisung;
81
+ - §14a, Tarife und Prognosen;
82
+ - Export Guard und Single-Writer-Struktur;
83
+ - EZA-/Parkregler-Priorität;
84
+ - sämtliche produktiven Hardware-Writer.
85
+
86
+ ## Aktualisierung
87
+
88
+ Die Version aus einem neuen, leeren Ordner installieren, den Adapter vollständig neu starten und den Browser einmal mit `Strg+F5` neu laden. Der Service-Worker-Cache wurde auf `nexowatt-cache-v503` angehoben. Danach die Home-Lizenz aktivieren, als Admin anmelden und den AppCenter mehrfach öffnen. Er muss nach erfolgreicher Anmeldung dauerhaft geöffnet bleiben. Ein echter Logout muss die Seite anschließend wieder sperren.
package/io-package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "nexowatt-ui",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "news": {
6
+ "1.0.3": {
7
+ "de": "Stable 1.0.3 behebt die sofortige erneute AppCenter-Sperre bei einer gültigen Home-Lizenz. Fachliche 403-Antworten nicht lizenzierter Pro-Module werden nicht mehr als verlorene Anmeldung interpretiert. Alte Pro-Konfigurationsflags werden für Home vor der UI-Ausgabe maskiert und Pro-only Komponenten nicht initialisiert. Ein echter Sessionverlust oder fehlende Seitenberechtigung sperrt den AppCenter weiterhin sicher. EMS-, Netzlimit-, Lade-, Speicher-, §14a-, Tarif-, Export-Guard- und Hardware-Regelung bleiben unverändert.",
8
+ "en": "Stable 1.0.3 fixes the AppCenter being immediately locked again with a valid Home license. Business-level 403 responses from unlicensed Pro modules are no longer interpreted as a lost login session. Stale Pro configuration flags are masked before Home UI delivery and Pro-only components are not initialized. A genuine session loss or missing page capability still locks the AppCenter fail-closed. EMS, grid limit, charging, storage, §14a, tariff, export guard and hardware control remain unchanged.",
9
+ "nl": "Stable 1.0.3 verhelpt dat het AppCenter direct opnieuw werd vergrendeld bij een geldige Home-licentie. Functionele 403-antwoorden van niet-gelicentieerde Pro-modules worden niet langer als een verloren aanmelding geïnterpreteerd. Oude Pro-configuratievlaggen worden vóór de Home-UI gemaskeerd en Pro-only componenten worden niet geïnitialiseerd. Een werkelijk verlopen sessie of ontbrekende paginabevoegdheid vergrendelt het AppCenter nog steeds veilig. EMS-, netlimiet-, laad-, opslag-, §14a-, tarief-, exportguard- en hardwarebesturing blijven ongewijzigd."
10
+ },
6
11
  "1.0.2": {
7
12
  "de": "Stable 1.0.2 trennt Adapter-Erreichbarkeit, EMS-Scheduler, Regelzyklus und Diagnose-Publisher eindeutig. Unabhängige 4-Sekunden-Heartbeats verhindern die falsche Anzeige „Offline / veraltet“ bei legitimen 20–30-Sekunden-Regelzyklen. Ein über 30 Sekunden laufender Zyklus wird als Warnung „Regelzyklus überschreitet Zeitlimit“ angezeigt, während ein gestoppter Adapter oder HTTP-Dienst weiterhin zuverlässig offline wird. Netzlimit, Nulleinspeisung, Lade-, Speicher-, §14a-, Tarif-, Export-Guard- und Hardware-Regelung bleiben unverändert.",
8
13
  "en": "Stable 1.0.2 clearly separates adapter connectivity, EMS scheduler liveness, regulation-cycle health and the diagnostic publisher. Independent four-second heartbeats prevent false Offline/Stale indications during legitimate 20–30 second control cycles. A cycle running beyond 30 seconds is shown as a regulation timeout warning, while a stopped adapter or HTTP service is still reliably reported offline. Grid limit, zero export, charging, storage, §14a, tariff, export guard and hardware control remain unchanged.",
@@ -32,11 +37,6 @@
32
37
  "de": "RC83 erlaubt Speicher-Netzladen ausschließlich bei aktivem, frischem und günstigem dynamischen Tarif. Bei aktivem variablem Netzentgelt ist zusätzlich das konfigurierte NT-/Quartalsfenster Pflicht. Neutral, teuer, unbekannt, Tarif aus oder veraltete Preis-/Freigabedaten führen sofort zur Eigenverbrauchsoptimierung; auch gehaltene alte Tarif-/Reserve-Sollwerte werden unmittelbar vor dem Hardware-Write auf 0 W gestoppt. Das fehlende Objekt gridConstraints.exportLimit.sinkFieldProtocolJson wird vor dem ersten Write angelegt und beendet die wiederkehrende ioBroker-Warnflut.",
33
38
  "en": "RC83 permits storage charging from the grid only with an active, fresh and cheap dynamic tariff. If variable grid fees are enabled, the configured off-peak/quarter window is an additional requirement. Neutral, expensive, unknown, disabled or stale tariff data immediately falls back to self-consumption; held legacy tariff/reserve commands are stopped at 0 W before the hardware write. The missing gridConstraints.exportLimit.sinkFieldProtocolJson object is now created before its first write, eliminating the recurring ioBroker warning flood.",
34
39
  "nl": "RC83 staat netladen van de batterij alleen toe bij een actief, actueel en goedkoop dynamisch tarief. Bij geactiveerde variabele netkosten is bovendien het geconfigureerde dal-/kwartaalvenster verplicht. Neutraal, duur, onbekend, uitgeschakeld of verouderd tarief schakelt direct terug naar eigenverbruik; vastgehouden oude tarief-/reserveopdrachten worden vóór de hardware-write op 0 W gestopt. Het ontbrekende object gridConstraints.exportLimit.sinkFieldProtocolJson wordt vóór de eerste write aangemaakt, waardoor de terugkerende ioBroker-waarschuwingen stoppen."
35
- },
36
- "0.8.207": {
37
- "de": "RC82 macht Netzlimits zum dauerhaft aktiven, nicht abschaltbaren Kernschutz – unabhängig von alten AppCenter-, Legacy-, Backup- oder Lizenzzuständen. Netzanschlussleistung und signierter NVP stammen ausschließlich aus Zuordnung → Allgemein; Hard-Limit = 100 %, Soft-Limit = 90 % und Reserve = exakt 10 %. Die 0-Einspeisung bleibt separat optional. Der wiederkehrende Core-Limits-Shadow-Warnlog zu total.effectiveW ist bereinigt; die interne Diagnose bleibt ohne Log-Spam erhalten.",
38
- "en": "RC82 makes Grid Limits a permanently active core protection function that cannot be disabled by legacy App Center, configuration, backup or licence states. Grid connection power and signed point-of-connection measurement come exclusively from Assignment → General; hard limit is 100%, soft limit 90%, and reserve exactly 10%. Zero export remains separately optional. The recurring Core Limits shadow warning for total.effectiveW has been removed while internal diagnostics remain available without log spam.",
39
- "nl": "RC82 maakt Netlimieten tot een permanent actieve kernbeveiliging die niet kan worden uitgeschakeld door oude AppCenter-, configuratie-, backup- of licentiestatussen. Netaansluitvermogen en gesigneerde NVP komen uitsluitend uit Toewijzing → Algemeen; hardlimit = 100%, softlimit = 90% en reserve exact 10%. Nulteruglevering blijft afzonderlijk optioneel. De terugkerende Core-Limits-shadowwaarschuwing voor total.effectiveW is verwijderd; interne diagnose blijft zonder logspam beschikbaar."
40
40
  }
41
41
  },
42
42
  "title": "NexoWatt EOS",
package/main.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
3
  *
4
4
  * Quelle: src-ts/runtime-executables/main.ts
5
- * Quell-Hash: sha256:5312b4a46ed165db44cff80876611e300c118455ac78dcd0f9ce4f62d7b2c9b6
5
+ * Quell-Hash: sha256:0041ec5c13a845ae5e3a5ed645a5ab4f61cafdfe26c805084268d08e3fd5687d
6
6
  * Erzeugung: npm run sync:ts-runtime-executables
7
7
  *
8
8
  * Zweck:
@@ -15690,6 +15690,13 @@ app.get('/api/smarthome/type-detect', requireCustomerDpDiscovery, async (req, re
15690
15690
  const nativeObj = (this.config && typeof this.config === 'object') ? this.config : {};
15691
15691
  let cfgOut = await _nwHydrateStorageFarmConfigFromRuntimeStates(_nwPickPersistedInstallerConfig());
15692
15692
  cfgOut = _nwMaskTariffProviderForUi(cfgOut);
15693
+ // 1.0.3: Nur die an die UI gelieferte Kopie wird auf die aktuelle Edition
15694
+ // begrenzt. Alte Pro-Konfigurationen bleiben intern erhalten, dürfen bei einer
15695
+ // Home-Lizenz aber weder als installiert erscheinen noch Pro-only Komponenten
15696
+ // und deren APIs aktivieren.
15697
+ if (cfgOut.emsApps && typeof cfgOut.emsApps === 'object') {
15698
+ cfgOut.emsApps = this._nwApplyLicenseLimitsToEmsApps(cfgOut.emsApps);
15699
+ }
15693
15700
  cfgOut.license = this._nwBuildLicenseFeatureInfo();
15694
15701
  cfgOut.locale = this._nwBuildLocaleInfo();
15695
15702
  cfgOut.countryProfile = Object.assign({}, cfgOut.countryProfile || {}, this._nwBuildCountryProfileInfo());
@@ -15878,6 +15885,13 @@ app.get('/api/smarthome/type-detect', requireCustomerDpDiscovery, async (req, re
15878
15885
  try { await this._nwInitLicense(); } catch (e) { try { this.log.warn('License refresh after installer config save failed: ' + (e && e.message ? e.message : e)); } catch (_eLog) {} }
15879
15886
  let cfgOut = await _nwHydrateStorageFarmConfigFromRuntimeStates(_nwPickPersistedInstallerConfig());
15880
15887
  cfgOut = _nwMaskTariffProviderForUi(cfgOut);
15888
+ // 1.0.3: Nur die an die UI gelieferte Kopie wird auf die aktuelle Edition
15889
+ // begrenzt. Alte Pro-Konfigurationen bleiben intern erhalten, dürfen bei einer
15890
+ // Home-Lizenz aber weder als installiert erscheinen noch Pro-only Komponenten
15891
+ // und deren APIs aktivieren.
15892
+ if (cfgOut.emsApps && typeof cfgOut.emsApps === 'object') {
15893
+ cfgOut.emsApps = this._nwApplyLicenseLimitsToEmsApps(cfgOut.emsApps);
15894
+ }
15881
15895
  cfgOut.license = this._nwBuildLicenseFeatureInfo();
15882
15896
  cfgOut.locale = this._nwBuildLocaleInfo();
15883
15897
  cfgOut.countryProfile = Object.assign({}, cfgOut.countryProfile || {}, this._nwBuildCountryProfileInfo());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.nexowatt-ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "NexoWatt EOS – local energy, charging and building control platform.",
5
5
  "author": "NexoWatt",
6
6
  "license": "UNLICENSED",
@@ -27,7 +27,7 @@
27
27
  "ioBroker:check": "node scripts/verify-publish.js",
28
28
  "typecheck": "tsc -p tsconfig.json --noEmit",
29
29
  "test:types": "npm run check:tsconfig-modern && npm run check:ts-source-syntax && npm run check:ts-source-integrity && npm run check:ts-canonical && npm run verify:ts-scaffold && npm run test:ts-script-mirrors && npm run test:ts-frontend-mirrors && npm run test:ts-backend-mirrors && npm run test:ts-adapter-mirrors && npm run test:frontend-mirror-runtime && npm run test:api-state-feature && npm run test:api-state-feature-runtime && npm run test:backend-api-state && npm run test:energy-flow-utils && npm run test:energy-flow-resolver && npm run test:energy-flow-mirrors && npm run test:energy-flow-regression && npm run test:energy-flow-regression-runtime && npm run test:ems-budget-heating-rod && npm run test:ems-budget-heating-rod-runtime && npm run test:ems-mirrors && npm run test:core-limits-reservations && npm run test:adapter-state-api && npm run test:adapter-state-api-runtime && npm run test:adapter-mirrors && npm run test:backend-api-state && npm run test:backend-api-state-runtime && npm run test:feature-visibility-resolver && npm run test:feature-visibility-resolver-runtime && npm run test:feature-visibility-shadow && npm run test:feature-visibility-shadow-runtime && npm run test:frontend-display && npm run test:feature-visibility-resolver && npm run test:feature-visibility-resolver-runtime && npm run test:feature-visibility-shadow && npm run test:feature-visibility-shadow-runtime && npm run test:frontend-display-runtime && npm run test:customer-feature-visibility && npm run test:customer-feature-visibility-runtime && npm run test:main-helpers && npm run typecheck && npm run typecheck:runtime-mirrors && npm run test:runtime-mirrors && npm run test:core-limits-runtime-typing && npm run test:heating-rod-runtime-typing && npm run test:shadow-bridges && npm run test:contracts && npm run test:feature-visibility-effective-runtime && npm run test:ai-advisor-runtime-typing && npm run test:history-runtime-typing && npm run test:smarthome-runtime-typing && npm run test:smarthome-config-runtime-typing && npm run test:ems-apps-runtime-typing && npm run test:app-runtime-typing && npm run test:main-runtime-typing && npm run test:adapter-helpers-mirrors && npm run test:main-runtime-helpers && npm run test:api-state-set-shadow && npm run test:live-dashboard-format-productive && npm run test:heating-rod-legacy-removal-candidate",
30
- "test:all": "npm run publish:check && npm run test:types && npm run check:ts-source-syntax && npm run test:ems-shadow-runtime && npm run test:ai-advisor-runtime-typing && npm run test:history-runtime-typing && npm run test:smarthome-runtime-typing && npm run test:smarthome-config-runtime-typing && npm run test:ems-apps-runtime-typing && npm run test:app-runtime-typing && npm run test:main-runtime-typing && npm run test:rc57-ocpp-stability && npm run test:rc58-ocpp-compact-mapping && npm run test:rc59-ocpp21-native-storage-safety && npm run test:rc60-universal-auto-orchestrator && npm run test:rc60-universal-auto-wallbox && npm run test:rc61-heating-night-lock && npm run test:rc61-evcs-hardening && npm run test:rc63-availability-storage-grid-gate && npm run test:rc64-storage-grid-charge-policy && npm run test:rc65-nt-price-target-override && npm run test:dc-station-display && npm run test:rc66-station-display-stable && npm run test:rc66-station-display-browser && npm run test:rc67-license-bootstrap-access && npm run test:rc68-para14a-communication-fallback && npm run test:dashboard-lp-status-typing && npm run test:rc69-dashboard-lp-feedback && npm run test:rc70-dashboard-lp-status-polish && npm run test:rc72-weather-pv-forecast-auto && npm run test:rc73-ems-admin-overview && npm run test:rc74-pv-forecast-customer-ui && npm run test:rc75-pv-forecast-admin-location && npm run test:rc76-pv-forecast-runtime-hardening && npm run test:rc77-pv-forecast-state-cache-bridge && npm run test:rc78-import-only-grid-budget && npm run test:rc79-import-soft-hard-zero-export && npm run test:rc80-soft-limit-fixed-ten-percent && npm run test:rc81-nvp-assignment-single-source && npm run test:rc82-permanent-grid-protection && npm run test:rc83-storage-cheap-only-log-object && npm run test:rc85 && npm run test:rc86 && npm run test:rc87 && npm run test:rc88 && npm run test:rc89 && npm run test:rc90 && npm run test:rc91 && npm run test:rc92 && npm run test:rc93 && npm run test:stable-1.0.2-health && npm run test:stable-release",
30
+ "test:all": "npm run publish:check && npm run test:types && npm run check:ts-source-syntax && npm run test:ems-shadow-runtime && npm run test:ai-advisor-runtime-typing && npm run test:history-runtime-typing && npm run test:smarthome-runtime-typing && npm run test:smarthome-config-runtime-typing && npm run test:ems-apps-runtime-typing && npm run test:app-runtime-typing && npm run test:main-runtime-typing && npm run test:rc57-ocpp-stability && npm run test:rc58-ocpp-compact-mapping && npm run test:rc59-ocpp21-native-storage-safety && npm run test:rc60-universal-auto-orchestrator && npm run test:rc60-universal-auto-wallbox && npm run test:rc61-heating-night-lock && npm run test:rc61-evcs-hardening && npm run test:rc63-availability-storage-grid-gate && npm run test:rc64-storage-grid-charge-policy && npm run test:rc65-nt-price-target-override && npm run test:dc-station-display && npm run test:rc66-station-display-stable && npm run test:rc66-station-display-browser && npm run test:rc67-license-bootstrap-access && npm run test:rc68-para14a-communication-fallback && npm run test:dashboard-lp-status-typing && npm run test:rc69-dashboard-lp-feedback && npm run test:rc70-dashboard-lp-status-polish && npm run test:rc72-weather-pv-forecast-auto && npm run test:rc73-ems-admin-overview && npm run test:rc74-pv-forecast-customer-ui && npm run test:rc75-pv-forecast-admin-location && npm run test:rc76-pv-forecast-runtime-hardening && npm run test:rc77-pv-forecast-state-cache-bridge && npm run test:rc78-import-only-grid-budget && npm run test:rc79-import-soft-hard-zero-export && npm run test:rc80-soft-limit-fixed-ten-percent && npm run test:rc81-nvp-assignment-single-source && npm run test:rc82-permanent-grid-protection && npm run test:rc83-storage-cheap-only-log-object && npm run test:rc85 && npm run test:rc86 && npm run test:rc87 && npm run test:rc88 && npm run test:rc89 && npm run test:rc90 && npm run test:rc91 && npm run test:rc92 && npm run test:rc93 && npm run test:stable-1.0.2-health && npm run test:stable-1.0.3-home-appcenter && npm run test:stable-release",
31
31
  "release:check": "npm run test:all && npm run build:ts && npm run publish:check && npm run test:package-runtime-start-smoke && npm run test:package",
32
32
  "ci:check": "npm run test:all && npm run build:ts && npm pack --dry-run",
33
33
  "typecheck:contracts": "tsc -p tsconfig.contracts.json --noEmit",
@@ -480,7 +480,8 @@
480
480
  "test:rc92": "node scripts/verify-rc92-history-mobile.cjs",
481
481
  "test:rc93": "node scripts/verify-rc93-certified-export-authority.cjs",
482
482
  "test:stable-release": "node scripts/verify-stable-release.cjs",
483
- "test:stable-1.0.2-health": "node scripts/verify-stable-1.0.2-health-heartbeat.cjs"
483
+ "test:stable-1.0.2-health": "node scripts/verify-stable-1.0.2-health-heartbeat.cjs",
484
+ "test:stable-1.0.3-home-appcenter": "node scripts/verify-stable-1.0.3-home-appcenter-access.cjs"
484
485
  },
485
486
  "dependencies": {
486
487
  "@iobroker/adapter-core": "^3.4.1",
@@ -567,6 +568,7 @@
567
568
  "docs/STABLE_1_0_0_RELEASE_DE.md",
568
569
  "docs/STABLE_1_0_1_RELEASE_DE.md",
569
570
  "docs/STABLE_1_0_2_RELEASE_DE.md",
571
+ "docs/STABLE_1_0_3_RELEASE_DE.md",
570
572
  "ems/charging-budget-helpers.js",
571
573
  "ems/consumers/evcs.js",
572
574
  "ems/consumers/generic-load.js",
@@ -724,8 +726,9 @@
724
726
  "scripts/verify-rc89-admin-overview-health.cjs",
725
727
  "scripts/verify-rc92-history-mobile.cjs",
726
728
  "scripts/verify-rc93-certified-export-authority.cjs",
727
- "scripts/verify-stable-release.cjs",
728
729
  "scripts/verify-stable-1.0.2-health-heartbeat.cjs",
730
+ "scripts/verify-stable-1.0.3-home-appcenter-access.cjs",
731
+ "scripts/verify-stable-release.cjs",
729
732
  "www/admin-guard.js",
730
733
  "www/admin.png",
731
734
  "www/app.js",
@@ -14,6 +14,17 @@ const fs = require('node:fs');
14
14
  const path = require('node:path');
15
15
 
16
16
  const root = path.resolve(__dirname, '..');
17
+
18
+ function versionAtLeast(actual, minimum) {
19
+ const parse = (value) => String(value || '').split('.').map((part) => Number(part) || 0);
20
+ const a = parse(actual);
21
+ const b = parse(minimum);
22
+ for (let index = 0; index < Math.max(a.length, b.length, 3); index += 1) {
23
+ if ((a[index] || 0) > (b[index] || 0)) return true;
24
+ if ((a[index] || 0) < (b[index] || 0)) return false;
25
+ }
26
+ return true;
27
+ }
17
28
  const pkg = require(path.join(root, 'package.json'));
18
29
  const {
19
30
  AdminOverviewPublisher,
@@ -227,7 +238,7 @@ async function verifyEngineHeartbeat() {
227
238
  }
228
239
 
229
240
  async function main() {
230
- assert.equal(pkg.version, '1.0.2', 'regression contract must run for Stable 1.0.2');
241
+ assert.equal(versionAtLeast(pkg.version, '1.0.2'), true, '1.0.2 health regression requires Stable 1.0.2 or newer');
231
242
  await verifyPublisherHeartbeat();
232
243
  await verifyEngineHeartbeat();
233
244
 
@@ -250,8 +261,8 @@ async function main() {
250
261
  assert(heartbeatBlock.includes('}, 4000);'), 'info.connection heartbeat must be four seconds');
251
262
  assert(!heartbeatBlock.includes('}, 30000);'), '30-second info.connection heartbeat must be removed');
252
263
 
253
- console.log('[Stable 1.0.2] OK: 25-s field cycle remains online; scheduler stall and genuine offline state stay distinguishable.');
254
- console.log('[Stable 1.0.2] OK: independent 4-s adapter, scheduler and overview heartbeat lifecycle verified.');
264
+ console.log(`[Stable 1.0.2 baseline on ${pkg.version}] OK: 25-s field cycle remains online; scheduler stall and genuine offline state stay distinguishable.`);
265
+ console.log(`[Stable 1.0.2 baseline on ${pkg.version}] OK: independent 4-s adapter, scheduler and overview heartbeat lifecycle verified.`);
255
266
  }
256
267
 
257
268
  main().catch((error) => {
@@ -0,0 +1,381 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * Stable 1.0.3 regression contract
6
+ *
7
+ * Reproduces the Home-license AppCenter relock reported in the field:
8
+ * an authenticated admin opens the protected AppCenter, a stale Pro app flag
9
+ * would normally request a Pro-only API, and the API answers with a legitimate
10
+ * business/license 403 (`eos_required`). That response must never be confused
11
+ * with a lost login session. A genuine 401 plus an unauthenticated status must
12
+ * still lock the page fail-closed.
13
+ */
14
+ const assert = require('node:assert/strict');
15
+ const fs = require('node:fs');
16
+ const os = require('node:os');
17
+ const path = require('node:path');
18
+ const { spawn } = require('node:child_process');
19
+
20
+ const ROOT = path.resolve(__dirname, '..');
21
+ const CHROMIUM = [
22
+ process.env.CHROMIUM_BIN,
23
+ '/usr/bin/chromium',
24
+ '/usr/bin/chromium-browser',
25
+ '/usr/bin/google-chrome',
26
+ ].find((candidate) => candidate && fs.existsSync(candidate));
27
+ assert.ok(CHROMIUM, 'Chromium/Chrome für den Home-AppCenter-Regressionsstest wurde nicht gefunden.');
28
+
29
+ const read = (relativePath) => fs.readFileSync(path.join(ROOT, relativePath), 'utf8');
30
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
31
+
32
+ async function waitFor(test, timeoutMs, label) {
33
+ const started = Date.now();
34
+ let last;
35
+ while (Date.now() - started < timeoutMs) {
36
+ try {
37
+ last = await test();
38
+ if (last) return last;
39
+ } catch (error) {
40
+ last = error;
41
+ }
42
+ await wait(60);
43
+ }
44
+ throw new Error(`Timeout bei ${label}: ${last && last.message ? last.message : JSON.stringify(last)}`);
45
+ }
46
+
47
+ class CdpClient {
48
+ constructor(url) {
49
+ this.ws = new WebSocket(url);
50
+ this.nextId = 1;
51
+ this.pending = new Map();
52
+ this.events = [];
53
+ }
54
+
55
+ async open() {
56
+ await new Promise((resolve, reject) => {
57
+ this.ws.addEventListener('open', resolve, { once: true });
58
+ this.ws.addEventListener('error', reject, { once: true });
59
+ });
60
+ this.ws.addEventListener('message', (event) => {
61
+ const message = JSON.parse(String(event.data || '{}'));
62
+ if (message.id && this.pending.has(message.id)) {
63
+ const pending = this.pending.get(message.id);
64
+ this.pending.delete(message.id);
65
+ if (message.error) pending.reject(new Error(`${message.error.code}: ${message.error.message}`));
66
+ else pending.resolve(message.result || {});
67
+ } else if (message.method) {
68
+ this.events.push(message);
69
+ }
70
+ });
71
+ }
72
+
73
+ send(method, params = {}) {
74
+ const id = this.nextId++;
75
+ return new Promise((resolve, reject) => {
76
+ this.pending.set(id, { resolve, reject });
77
+ this.ws.send(JSON.stringify({ id, method, params }));
78
+ });
79
+ }
80
+
81
+ async evaluate(expression) {
82
+ const result = await this.send('Runtime.evaluate', {
83
+ expression,
84
+ awaitPromise: true,
85
+ returnByValue: true,
86
+ userGesture: true,
87
+ });
88
+ if (result.exceptionDetails) {
89
+ const description = result.exceptionDetails.exception?.description || result.exceptionDetails.text;
90
+ throw new Error(description || 'Browser-Auswertung fehlgeschlagen');
91
+ }
92
+ return result.result ? result.result.value : undefined;
93
+ }
94
+
95
+ close() {
96
+ try { this.ws.close(); } catch (_) {}
97
+ }
98
+ }
99
+
100
+ function inlineStaticScripts(html) {
101
+ return html.replace(/<script([^>]*)\ssrc="\/static\/([^"]+)"([^>]*)><\/script>/gi, (full, before, source, after) => {
102
+ const absolute = path.join(ROOT, 'www', source);
103
+ if (!fs.existsSync(absolute)) return '';
104
+ const code = fs.readFileSync(absolute, 'utf8').replace(/<\/script/gi, '<\\/script');
105
+ return `<script${before}${after}>\n${code}\n</script>`;
106
+ });
107
+ }
108
+
109
+ function buildHomeAppCenterHtml() {
110
+ let html = read('www/ems-apps.html');
111
+ const css = read('www/styles.css').replace(/<\/style/gi, '<\\/style');
112
+
113
+ const homeLicense = {
114
+ valid: true,
115
+ ok: true,
116
+ type: 'full',
117
+ edition: 'hems',
118
+ editionLabel: 'Home',
119
+ maxWallboxes: 3,
120
+ maxStoragePowerW: 50_000,
121
+ storagePowerProfile: { id: 'home', label: 'Home', maxCommandW: 50_000, unrestricted: false },
122
+ features: {
123
+ dashboard: true,
124
+ history: true,
125
+ chargingManagement: true,
126
+ storageControl: true,
127
+ thermalControl: true,
128
+ heatingRodControl: true,
129
+ thresholdControl: true,
130
+ relayControl: true,
131
+ gridConstraints: true,
132
+ aiAdvisor: true,
133
+ dynamicTariffs: true,
134
+ para14a: true,
135
+ energyWallet: true,
136
+ energyLedger: true,
137
+ },
138
+ homeIncludedApps: ['charging', 'storage', 'thermal', 'heatingrod', 'threshold', 'relay', 'grid', 'aiAdvisor', 'tariff', 'para14a', 'energyWallet', 'energyLedger'],
139
+ };
140
+
141
+ // Intentionally retain stale Pro flags. Stable 1.0.3 must mask them before
142
+ // rendering and must not request a Pro-only endpoint under a Home license.
143
+ const config = {
144
+ license: homeLicense,
145
+ emsApps: {
146
+ apps: {
147
+ grid: { installed: true, enabled: true },
148
+ charging: { installed: true, enabled: true },
149
+ storage: { installed: true, enabled: true },
150
+ netOperator: { installed: true, enabled: true },
151
+ meshMicrogrid: { installed: true, enabled: true },
152
+ operatingStrategies: { installed: true, enabled: true },
153
+ },
154
+ },
155
+ settingsConfig: { evcsCount: 0, evcsList: [], stationGroups: [] },
156
+ installerConfig: { gridConnectionPower: 30 },
157
+ datapoints: {},
158
+ storage: {},
159
+ storageFarm: { storages: [] },
160
+ countryProfile: { country: 'DE' },
161
+ gridConstraints: {},
162
+ chargingManagement: {},
163
+ netOperatorInterface: { enabled: true, mode: 'active' },
164
+ operatingStrategies: { enabled: true, mode: 'active' },
165
+ meshMicrogrid: { enabled: true, nodes: [] },
166
+ };
167
+
168
+ const mock = `<script>
169
+ window.__nwRequests = [];
170
+ window.__nwErrors = [];
171
+ window.__nwAuthStatus = {
172
+ ok: true, enabled: true, strict: true, authed: true,
173
+ user: 'admin', role: 'admin', roles: ['admin'],
174
+ groups: ['system.group.administrator'], capabilities: ['*'],
175
+ isAdmin: true, isInstaller: true, isCustomer: false, protectWrites: true
176
+ };
177
+ window.__nwHomeLicense = ${JSON.stringify(homeLicense)};
178
+ window.__nwConfig = ${JSON.stringify(config)};
179
+ window.fetch = async function(input, init) {
180
+ const raw = String(typeof input === 'string' ? input : (input && input.url) || '');
181
+ const url = raw.replace(/^https?:\\/\\/[^/]+/, '');
182
+ window.__nwRequests.push(url);
183
+ let status = 200;
184
+ let data = { ok: true };
185
+ if (url.indexOf('/api/strict-auth/status') === 0 || url.indexOf('/api/auth/status') === 0 || url.indexOf('/api/session/me') === 0) {
186
+ data = window.__nwAuthStatus;
187
+ } else if (url.indexOf('/api/installer/config') === 0) {
188
+ data = { ok: true, license: window.__nwHomeLicense, config: window.__nwConfig };
189
+ } else if (url.indexOf('/api/license/info') === 0) {
190
+ data = Object.assign({ ok: true }, window.__nwHomeLicense);
191
+ } else if (url.indexOf('/api/netoperator/drivers') === 0) {
192
+ status = 403;
193
+ data = { ok: false, error: 'eos_required', message: 'EOS Pro erforderlich.' };
194
+ } else if (url.indexOf('/api/pro-only-fixture') === 0) {
195
+ status = 403;
196
+ data = { ok: false, error: 'eos_required', message: 'Fachliche Lizenzgrenze.' };
197
+ } else if (url.indexOf('/api/protected-fixture') === 0) {
198
+ status = 401;
199
+ data = { ok: false, error: 'unauthorized' };
200
+ } else if (url.indexOf('/api/installer/backup/userdata') === 0) {
201
+ data = { ok: true, available: false };
202
+ } else if (url.indexOf('/api/installer/tariff-provider/providers') === 0) {
203
+ data = { ok: true, providers: [] };
204
+ } else if (url.indexOf('/api/ems/status') === 0) {
205
+ data = { ok: true, status: {} };
206
+ } else if (url.indexOf('/api/ems/charging/diagnostics') === 0) {
207
+ data = { ok: true, wallboxes: [], stations: [], summary: {} };
208
+ } else if (url.indexOf('/api/ems/charging/audit') === 0) {
209
+ data = { ok: true, summary: {}, wallboxes: [], events: [] };
210
+ } else if (url.indexOf('/api/state') === 0) {
211
+ data = { ok: true, states: {} };
212
+ } else if (url.indexOf('/config') === 0) {
213
+ data = { license: window.__nwHomeLicense, featureVisibility: {} };
214
+ }
215
+ return new Response(JSON.stringify(data), { status: status, headers: { 'Content-Type': 'application/json' } });
216
+ };
217
+ window.addEventListener('error', function(event) {
218
+ window.__nwErrors.push(String(event.message || event.error || 'window error'));
219
+ });
220
+ window.addEventListener('unhandledrejection', function(event) {
221
+ window.__nwErrors.push('unhandledrejection: ' + String(event.reason && event.reason.message || event.reason));
222
+ });
223
+ </script>`;
224
+
225
+ html = html.replace(/<link[^>]+href="\/static\/styles\.css"[^>]*>/i, `<style>${css}</style>`);
226
+ html = html.replace(/<link[^>]+(?:rel="manifest"|href="\/assets\/)[^>]*>/gi, '');
227
+ html = html.replace(/<script[^>]+src="\/static\/admin-guard\.js"[^>]*><\/script>/i, '');
228
+ html = html.replace('<script src="/static/auth.js"></script>', `${mock}<script src="/static/auth.js"></script>`);
229
+ html = inlineStaticScripts(html);
230
+ return html;
231
+ }
232
+
233
+ function staticContracts() {
234
+ const pkg = JSON.parse(read('package.json'));
235
+ const auth = read('src-ts/runtime-executables/www/auth.ts');
236
+ const appCenter = read('src-ts/runtime-executables/www/ems-apps.ts');
237
+ const netOperator = read('src-ts/runtime-executables/www/netoperator-appcenter.ts');
238
+ const main = read('src-ts/runtime-executables/main.ts');
239
+
240
+ assert.equal(pkg.version, '1.0.3', 'Home-AppCenter regression contract must run for Stable 1.0.3');
241
+ assert.match(auth, /const mustPromptForAuthentication = authStatusUnavailable \|\| sessionMissing \|\| pageCapabilityMissing/);
242
+ assert.match(auth, /Ein fachlicher API-Fehler bleibt/);
243
+ assert.match(appCenter, /_isAppLicensed\('netOperator'\) && \(\(\) =>/);
244
+ assert.match(appCenter, /_isAppLicensed\('operatingStrategies'\) && \(\(\) =>/);
245
+ assert.match(appCenter, /if \(_isAppLicensed\('netOperator'\) && window\.NexoWattNetOperatorAppCenter\)/);
246
+ assert.match(appCenter, /if \(_isAppLicensed\('operatingStrategies'\) && window\.NexoWattOperatingStrategiesAppCenter\)/);
247
+ assert.match(main, /cfgOut\.emsApps = this\._nwApplyLicenseLimitsToEmsApps\(cfgOut\.emsApps\)/);
248
+
249
+ const editionCheck = netOperator.indexOf("const eos = String(getEdition() || '').toLowerCase() === 'eos';");
250
+ const homeReturn = netOperator.indexOf('if (!eos) {', editionCheck);
251
+ const driverLoad = netOperator.indexOf('if (!driverRows.length) await loadDrivers();', editionCheck);
252
+ assert(editionCheck >= 0 && homeReturn > editionCheck && driverLoad > homeReturn,
253
+ 'Netzbetreiber-AppCenter must return for Home before loading Pro-only drivers.');
254
+ }
255
+
256
+ async function runBrowserRegression() {
257
+ const profile = fs.mkdtempSync(path.join(os.tmpdir(), 'nw-home-appcenter-'));
258
+ const browserLog = [];
259
+ const browser = spawn(CHROMIUM, [
260
+ '--headless=new', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage',
261
+ '--disable-background-networking', '--disable-component-update', '--disable-default-apps',
262
+ '--disable-extensions', '--no-first-run', '--remote-debugging-port=0',
263
+ `--user-data-dir=${profile}`, 'about:blank',
264
+ ], { stdio: ['ignore', 'pipe', 'pipe'] });
265
+ browser.stdout.on('data', (chunk) => browserLog.push(String(chunk)));
266
+ browser.stderr.on('data', (chunk) => browserLog.push(String(chunk)));
267
+
268
+ let cdp;
269
+ try {
270
+ const portFile = path.join(profile, 'DevToolsActivePort');
271
+ await waitFor(() => fs.existsSync(portFile), 15_000, 'DevToolsActivePort');
272
+ const port = Number(fs.readFileSync(portFile, 'utf8').split(/\r?\n/)[0]);
273
+ const target = await waitFor(async () => {
274
+ const response = await fetch(`http://127.0.0.1:${port}/json/list`);
275
+ const list = await response.json();
276
+ return list.find((entry) => entry.type === 'page');
277
+ }, 15_000, 'Browser-Target');
278
+
279
+ cdp = new CdpClient(target.webSocketDebuggerUrl);
280
+ await cdp.open();
281
+ await cdp.send('Runtime.enable');
282
+ await cdp.send('Page.enable');
283
+ const tree = await cdp.send('Page.getFrameTree');
284
+ await cdp.send('Page.setDocumentContent', {
285
+ frameId: tree.frameTree.frame.id,
286
+ html: buildHomeAppCenterHtml(),
287
+ });
288
+
289
+ const initial = await waitFor(async () => cdp.evaluate(`(() => {
290
+ const auth = window.NW_AUTH && window.NW_AUTH.getState && window.NW_AUTH.getState();
291
+ const status = document.getElementById('nw-emsapps-status');
292
+ if (!auth || !auth._loaded || !status || !/Konfiguration geladen/i.test(status.textContent || '')) return null;
293
+ return {
294
+ auth: auth,
295
+ overlay: !!document.querySelector('#nwAuthOverlay.show'),
296
+ locked: document.body.classList.contains('nw-auth-page-locked'),
297
+ pending: document.documentElement.classList.contains('nw-auth-capability-pending'),
298
+ appCenterPresent: !!document.getElementById('appsList'),
299
+ homeVisible: /Lizenz:\\s*Home/i.test(document.body.innerText || ''),
300
+ requests: (window.__nwRequests || []).slice(),
301
+ errors: (window.__nwErrors || []).slice(),
302
+ };
303
+ })()`), 20_000, 'Home-AppCenter vollständig geladen');
304
+
305
+ assert.equal(initial.auth.authed, true, 'Home admin session must remain authenticated');
306
+ assert.equal(initial.auth.role, 'admin');
307
+ assert.deepEqual(initial.auth.capabilities, ['*']);
308
+ assert.equal(initial.overlay, false, 'Login overlay must stay closed after successful Home admin login');
309
+ assert.equal(initial.locked, false, 'AppCenter background must not be relocked');
310
+ assert.equal(initial.pending, false, 'Capability-pending class must be cleared');
311
+ assert.equal(initial.appCenterPresent, true, 'AppCenter DOM must remain available');
312
+ assert.equal(initial.homeVisible, true, 'Home license must be rendered in the AppCenter');
313
+ assert.equal(initial.requests.some((url) => String(url).startsWith('/api/netoperator/drivers')), false,
314
+ 'Home AppCenter must not call the Pro-only netoperator driver API even with stale Pro flags');
315
+ assert.deepEqual(initial.errors, [], `Browser errors during Home AppCenter startup: ${JSON.stringify(initial.errors)}`);
316
+
317
+ // Business/license 403: session is still valid, so the protected page must stay open.
318
+ const business403 = await cdp.evaluate(`(async () => {
319
+ const response = await fetch('/api/pro-only-fixture');
320
+ await new Promise((resolve) => setTimeout(resolve, 250));
321
+ return {
322
+ status: response.status,
323
+ auth: window.NW_AUTH.getState(),
324
+ overlay: !!document.querySelector('#nwAuthOverlay.show'),
325
+ locked: document.body.classList.contains('nw-auth-page-locked'),
326
+ appCenterPresent: !!document.getElementById('appsList'),
327
+ };
328
+ })()`);
329
+ assert.equal(business403.status, 403);
330
+ assert.equal(business403.auth.authed, true);
331
+ assert.equal(business403.overlay, false, 'A legitimate license 403 must not reopen the login dialog');
332
+ assert.equal(business403.locked, false, 'A legitimate license 403 must not lock the AppCenter');
333
+ assert.equal(business403.appCenterPresent, true, 'A legitimate license 403 must not replace the AppCenter');
334
+
335
+ // Genuine login loss: status endpoint now confirms no session and a protected
336
+ // endpoint answers 401. The same fail-closed page must then lock immediately.
337
+ const genuineLoss = await cdp.evaluate(`(async () => {
338
+ window.__nwAuthStatus = {
339
+ ok: true, enabled: true, strict: true, authed: false,
340
+ user: null, role: 'none', capabilities: [],
341
+ isAdmin: false, isInstaller: false, isCustomer: false, protectWrites: true
342
+ };
343
+ const response = await fetch('/api/protected-fixture');
344
+ await new Promise((resolve) => setTimeout(resolve, 250));
345
+ return {
346
+ status: response.status,
347
+ auth: window.NW_AUTH.getState(),
348
+ overlay: !!document.querySelector('#nwAuthOverlay.show'),
349
+ locked: document.body.classList.contains('nw-auth-page-locked'),
350
+ lockText: String(document.body.innerText || '').slice(0, 800),
351
+ };
352
+ })()`);
353
+ assert.equal(genuineLoss.status, 401);
354
+ assert.equal(genuineLoss.auth.authed, false);
355
+ assert.equal(genuineLoss.overlay, true, 'A genuine lost session must open the mandatory login dialog');
356
+ assert.equal(genuineLoss.locked, true, 'A genuine lost session must lock the protected page');
357
+ assert.match(genuineLoss.lockText, /Zugriff geschützt|Anmeldung erforderlich|Bitte anmelden/i);
358
+
359
+ const exceptions = cdp.events.filter((event) => event.method === 'Runtime.exceptionThrown');
360
+ assert.equal(exceptions.length, 0, `Browser exceptions: ${JSON.stringify(exceptions)}`);
361
+ } catch (error) {
362
+ const tail = browserLog.join('').split(/\r?\n/).slice(-30).join('\n');
363
+ if (tail) console.error(tail);
364
+ throw error;
365
+ } finally {
366
+ if (cdp) cdp.close();
367
+ try { browser.kill('SIGKILL'); } catch (_) {}
368
+ await wait(250);
369
+ try { fs.rmSync(profile, { recursive: true, force: true }); } catch (_) {}
370
+ }
371
+ }
372
+
373
+ (async () => {
374
+ staticContracts();
375
+ await runBrowserRegression();
376
+ console.log('[Stable 1.0.3] OK: Home admin remains in AppCenter; stale Pro flags trigger no Pro API call.');
377
+ console.log('[Stable 1.0.3] OK: license/business 403 stays component-local; genuine session loss still locks fail-closed.');
378
+ })().catch((error) => {
379
+ console.error(error && error.stack ? error.stack : error);
380
+ process.exit(1);
381
+ });
@@ -46,6 +46,7 @@ for (const required of [
46
46
  stableDocPath,
47
47
  'scripts/verify-stable-release.cjs',
48
48
  'scripts/verify-stable-1.0.2-health-heartbeat.cjs',
49
+ 'scripts/verify-stable-1.0.3-home-appcenter-access.cjs',
49
50
  ]) {
50
51
  if (!files.includes(required)) fail(`Stable-Paketdatei fehlt in package.json files: ${required}`);
51
52
  if (!fs.existsSync(path.join(root, required))) fail(`Stable-Paketdatei fehlt im Repository: ${required}`);
@@ -60,6 +61,12 @@ if (pkg.scripts?.['test:stable-1.0.2-health'] !== 'node scripts/verify-stable-1.
60
61
  if (!String(pkg.scripts?.['test:all'] || '').includes('npm run test:stable-1.0.2-health')) {
61
62
  fail('test:stable-1.0.2-health ist nicht Bestandteil von test:all.');
62
63
  }
64
+ if (pkg.scripts?.['test:stable-1.0.3-home-appcenter'] !== 'node scripts/verify-stable-1.0.3-home-appcenter-access.cjs') {
65
+ fail('test:stable-1.0.3-home-appcenter ist nicht korrekt registriert.');
66
+ }
67
+ if (!String(pkg.scripts?.['test:all'] || '').includes('npm run test:stable-1.0.3-home-appcenter')) {
68
+ fail('test:stable-1.0.3-home-appcenter ist nicht Bestandteil von test:all.');
69
+ }
63
70
  if (!String(pkg.scripts?.['test:all'] || '').includes('npm run test:stable-release')) {
64
71
  fail('test:stable-release ist nicht Bestandteil von test:all.');
65
72
  }
@@ -102,7 +109,7 @@ for (const relativePath of ['src-ts/runtime-executables/www/ems-apps.ts', 'src-t
102
109
  }
103
110
  for (const relativePath of ['src-ts/runtime-executables/www/sw.ts', 'src-ts/runtime-mirrors/www/sw.ts', 'www/sw.js']) {
104
111
  const text = read(relativePath);
105
- if (!text.includes("const CACHE_NAME = 'nexowatt-cache-v500';")) fail(`PWA-Cache-Bump fehlt in ${relativePath}.`);
112
+ if (!text.includes("const CACHE_NAME = 'nexowatt-cache-v503';")) fail(`PWA-Cache-Bump fehlt in ${relativePath}.`);
106
113
  }
107
114
 
108
115
 
@@ -163,6 +170,47 @@ for (const token of ['25_000', '35_000', "offlineValues['info.connection'] = fal
163
170
  if (!healthRegression.includes(token)) fail(`1.0.2-Feldregression unvollständig: ${token}`);
164
171
  }
165
172
 
173
+
174
+ // Stable 1.0.3: a valid Home admin session must not be invalidated by
175
+ // business-level 403 responses from Pro-only APIs. Genuine session/capability
176
+ // loss remains fail-closed.
177
+ const authSource = read('src-ts/runtime-executables/www/auth.ts');
178
+ const appCenterSource = read('src-ts/runtime-executables/www/ems-apps.ts');
179
+ const netOperatorSource = read('src-ts/runtime-executables/www/netoperator-appcenter.ts');
180
+ const homeAppCenterRegression = read('scripts/verify-stable-1.0.3-home-appcenter-access.cjs');
181
+ for (const token of [
182
+ 'const mustPromptForAuthentication = authStatusUnavailable || sessionMissing || pageCapabilityMissing',
183
+ 'Ein fachlicher API-Fehler bleibt',
184
+ ]) {
185
+ if (!authSource.includes(token)) fail(`1.0.3-Auth-Vertrag fehlt: ${token}`);
186
+ }
187
+ for (const token of [
188
+ "_isAppLicensed('netOperator') && (() =>",
189
+ "_isAppLicensed('operatingStrategies') && (() =>",
190
+ "if (_isAppLicensed('netOperator') && window.NexoWattNetOperatorAppCenter)",
191
+ "if (_isAppLicensed('operatingStrategies') && window.NexoWattOperatingStrategiesAppCenter)",
192
+ ]) {
193
+ if (!appCenterSource.includes(token)) fail(`1.0.3-Home-AppCenter-Guard fehlt: ${token}`);
194
+ }
195
+ const editionCheck = netOperatorSource.indexOf("const eos = String(getEdition() || '').toLowerCase() === 'eos';");
196
+ const homeReturn = netOperatorSource.indexOf('if (!eos) {', editionCheck);
197
+ const driverLoad = netOperatorSource.indexOf('if (!driverRows.length) await loadDrivers();', editionCheck);
198
+ if (!(editionCheck >= 0 && homeReturn > editionCheck && driverLoad > homeReturn)) {
199
+ fail('Netzbetreiber-Treiber werden weiterhin vor dem Home-Editions-Guard geladen.');
200
+ }
201
+ for (const token of [
202
+ "error: 'eos_required'",
203
+ "fetch('/api/pro-only-fixture')",
204
+ "fetch('/api/protected-fixture')",
205
+ '/api/netoperator/drivers',
206
+ 'genuine lost session',
207
+ ]) {
208
+ if (!homeAppCenterRegression.includes(token)) fail(`1.0.3-Home-Feldregression unvollständig: ${token}`);
209
+ }
210
+ if (!mainSource.includes('cfgOut.emsApps = this._nwApplyLicenseLimitsToEmsApps(cfgOut.emsApps)')) {
211
+ fail('Home-Konfigurationskopie wird nicht über die Lizenznormalisierung maskiert.');
212
+ }
213
+
166
214
  const rc66Verifier = read('scripts/verify-rc66-station-display-stable.js');
167
215
  if (!rc66Verifier.includes("isVersionAtLeast(pkg.version, '0.8.191')")) {
168
216
  fail('RC66-Prüfer besitzt keinen SemVer-festen Mindestversionsvergleich.');
@@ -172,4 +220,4 @@ if (/versionParts\[0\]\s*!==\s*0/.test(rc66Verifier)) {
172
220
  }
173
221
 
174
222
  console.log(`[stable-release] OK: ${pkg.name}@${version} ist konsistent als Official Stable versiegelt.`);
175
- console.log('[stable-release] OK: 1.0.2-Liveness-/Tick-Patch, 1.0.1-Memory-/SSE-Härtung und RC93-Regelungsbaseline sind synchron.');
223
+ console.log('[stable-release] OK: 1.0.3-Home-AppCenter-Auth, 1.0.2-Liveness, 1.0.1-Memory/SSE und RC93-Regelungsbaseline sind synchron.');
package/www/auth.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
3
  *
4
4
  * Quelle: src-ts/runtime-executables/www/auth.ts
5
- * Quell-Hash: sha256:e340dda3ae74754c014e12ec81d42120db57d8cd48f0f8f8b354321b6445129d
5
+ * Quell-Hash: sha256:824e4620ae465e5f00e6c24f47f6da19643e1d769547be0bb5d0fd5993f99be4
6
6
  * Erzeugung: npm run sync:ts-runtime-executables
7
7
  *
8
8
  * Zweck:
@@ -670,13 +670,30 @@
670
670
  || url.indexOf('/api/strict-auth/') === 0
671
671
  || url.indexOf('/api/installer/') === 0;
672
672
  if (!isAuthEndpoint && (r.status === 401 || r.status === 403)) {
673
- // Refresh state and then prompt
673
+ // 1.0.3: HTTP 403 bedeutet nicht automatisch, dass die EOS-Sitzung verloren
674
+ // gegangen ist. Home-Lizenzen erhalten für Pro-only APIs absichtlich einen
675
+ // fachlichen 403 (z. B. `eos_required`). Der alte globale Handler deutete
676
+ // jeden solchen Status als Rollenverlust, ersetzte das bereits autorisierte
677
+ // App-Center durch den Sperrbildschirm und öffnete den Login erneut.
678
+ //
679
+ // Deshalb ist der anschließend gelesene Auth-Status die einzige Quelle für
680
+ // die Login-Sperre: Nur eine wirklich fehlende Session oder eine fehlende
681
+ // Seiten-Capability darf die Seite verriegeln. Ein fachlicher API-Fehler bleibt
682
+ // der aufrufenden Komponente über die unveränderte Response sichtbar.
674
683
  await refreshStatus();
675
- if (state.enabled && state.protectWrites) {
676
- const protectedPage = isProtectedPage();
677
- const message = r.status === 401
678
- ? 'Bitte anmelden, um diese geschützte Seite zu bedienen.'
679
- : 'Keine Berechtigung. Bitte mit der erforderlichen EOS-Rolle anmelden.';
684
+ const protectedPage = isProtectedPage();
685
+ const pageCapability = requiredPageCapability();
686
+ const sessionMissing = !state.authed;
687
+ const pageCapabilityMissing = !!(pageCapability && !hasCapability(state.capabilities, pageCapability));
688
+ const authStatusUnavailable = state.statusError === true;
689
+ const mustPromptForAuthentication = authStatusUnavailable || sessionMissing || pageCapabilityMissing;
690
+
691
+ if (mustPromptForAuthentication && (protectedPage || (state.enabled && state.protectWrites))) {
692
+ const message = authStatusUnavailable
693
+ ? 'Berechtigungsprüfung nicht erreichbar. Bitte Verbindung prüfen und erneut anmelden.'
694
+ : (sessionMissing
695
+ ? 'Bitte anmelden, um diese geschützte Seite zu bedienen.'
696
+ : 'Keine Berechtigung. Bitte mit der erforderlichen EOS-Rolle anmelden.');
680
697
  if (protectedPage) renderPageLock(message);
681
698
  showOverlay(message, protectedPage ? { mandatory: true, reason: message } : {});
682
699
  }
package/www/ems-apps.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
3
  *
4
4
  * Quelle: src-ts/runtime-executables/www/ems-apps.ts
5
- * Quell-Hash: sha256:4e9c69435a6161e835beb69de22375e5b94fbcb9a9f97bfdf4e6c85ebe0cba1f
5
+ * Quell-Hash: sha256:6c0787cbba3c201cc4900898749e9430912568df617ade55d4d215b3fbdba88d
6
6
  * Erzeugung: npm run sync:ts-runtime-executables
7
7
  *
8
8
  * Zweck:
@@ -2505,7 +2505,7 @@ http://mesh-peer.local:8188" ${isEos ? '' : 'disabled'}>${_meshHtmlEscape(Array.
2505
2505
  * wenn die Funktions-App installiert ist. Dadurch stehen im Apps-Reiter
2506
2506
  * keine tiefen Modul-Einstellungen mehr.
2507
2507
  */
2508
- const isMeshInstalled = (() => {
2508
+ const isMeshInstalled = _isAppLicensed('meshMicrogrid') && (() => {
2509
2509
  const cb = document.getElementById('app_meshMicrogrid_installed');
2510
2510
  if (cb) return !!cb.checked;
2511
2511
  const app = currentConfig && currentConfig.emsApps && currentConfig.emsApps.apps && currentConfig.emsApps.apps.meshMicrogrid
@@ -2513,7 +2513,7 @@ http://mesh-peer.local:8188" ${isEos ? '' : 'disabled'}>${_meshHtmlEscape(Array.
2513
2513
  : null;
2514
2514
  return !!(app && app.installed);
2515
2515
  })();
2516
- const isOperatingStrategiesInstalled = (() => {
2516
+ const isOperatingStrategiesInstalled = _isAppLicensed('operatingStrategies') && (() => {
2517
2517
  const cb = document.getElementById('app_operatingStrategies_installed');
2518
2518
  if (cb) return !!cb.checked;
2519
2519
  const app = currentConfig && currentConfig.emsApps && currentConfig.emsApps.apps && currentConfig.emsApps.apps.operatingStrategies
@@ -2521,7 +2521,7 @@ http://mesh-peer.local:8188" ${isEos ? '' : 'disabled'}>${_meshHtmlEscape(Array.
2521
2521
  : null;
2522
2522
  return !!(app && app.installed);
2523
2523
  })();
2524
- const isNetOperatorInstalled = (() => {
2524
+ const isNetOperatorInstalled = _isAppLicensed('netOperator') && (() => {
2525
2525
  const cb = document.getElementById('app_netOperator_installed');
2526
2526
  if (cb) return !!cb.checked;
2527
2527
  const app = currentConfig && currentConfig.emsApps && currentConfig.emsApps.apps && currentConfig.emsApps.apps.netOperator
@@ -11165,8 +11165,23 @@ http://mesh-peer.local:8188" ${isEos ? '' : 'disabled'}>${_meshHtmlEscape(Array.
11165
11165
  try { buildAppsUI(); } catch (_eBuildApps) {}
11166
11166
  setAppsFromConfig(currentConfig);
11167
11167
  try { if (window.NexoWattEnergyOriginAppCenter) window.NexoWattEnergyOriginAppCenter.apply(currentConfig, _licenseEdition()); } catch (_eLedgerUi) {}
11168
- try { if (window.NexoWattNetOperatorAppCenter) window.NexoWattNetOperatorAppCenter.apply(currentConfig, _licenseEdition()); } catch (_eNetOperatorUi) {}
11169
- try { if (window.NexoWattOperatingStrategiesAppCenter) window.NexoWattOperatingStrategiesAppCenter.apply(currentConfig, _licenseEdition()); } catch (_eOperatingStrategiesUi) {}
11168
+ // 1.0.3: Pro-only Komponenten werden unter Home nicht initialisiert. Alte, vor
11169
+ // dem Lizenzwechsel gespeicherte `installed=true`-Flags dürfen dadurch weder
11170
+ // versteckte Pro-API-Aufrufe noch einen globalen Auth-Dialog auslösen.
11171
+ try {
11172
+ if (_isAppLicensed('netOperator') && window.NexoWattNetOperatorAppCenter) {
11173
+ window.NexoWattNetOperatorAppCenter.apply(currentConfig, _licenseEdition());
11174
+ } else if (els.netOperatorMount) {
11175
+ els.netOperatorMount.innerHTML = '';
11176
+ }
11177
+ } catch (_eNetOperatorUi) {}
11178
+ try {
11179
+ if (_isAppLicensed('operatingStrategies') && window.NexoWattOperatingStrategiesAppCenter) {
11180
+ window.NexoWattOperatingStrategiesAppCenter.apply(currentConfig, _licenseEdition());
11181
+ } else if (els.operatingStrategiesMount) {
11182
+ els.operatingStrategiesMount.innerHTML = '';
11183
+ }
11184
+ } catch (_eOperatingStrategiesUi) {}
11170
11185
 
11171
11186
  // Plant params
11172
11187
  els.gridConnectionPower.value = numOrEmpty(currentConfig.installerConfig && currentConfig.installerConfig.gridConnectionPower);
@@ -44,6 +44,6 @@
44
44
  "purpose": "maskable"
45
45
  }
46
46
  ],
47
- "version": "1.0.2",
48
- "appVersion": "1.0.2"
47
+ "version": "1.0.3",
48
+ "appVersion": "1.0.3"
49
49
  }
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
3
  *
4
4
  * Quelle: src-ts/runtime-executables/www/netoperator-appcenter.ts
5
- * Quell-Hash: sha256:914f7d9a055fefceaca9fe34222f6b6ca1255b0b55880a1ae53816c0ba928101
5
+ * Quell-Hash: sha256:582c24a0291427a938d058e1b95fab318eb3dc677569a424582a00b16654a334
6
6
  * Erzeugung: npm run sync:ts-runtime-executables
7
7
  *
8
8
  * Zweck:
@@ -89,9 +89,21 @@
89
89
  return;
90
90
  const cfg = { ...defaultConfig(), ...(config || {}) };
91
91
  cfg.transport = { ...defaultConfig().transport, ...(config?.transport || {}) };
92
+ const eos = String(getEdition() || '').toLowerCase() === 'eos';
93
+ // 1.0.3: Das Treiberverzeichnis ist Pro-only. Bei Home darf diese Komponente
94
+ // auch dann keinen API-Aufruf starten, wenn ein alter Pro-Konfigurationsstand
95
+ // `installed=true` enthält. So entsteht weder ein erwartbarer 403 noch ein
96
+ // irreführender Auth-Dialog im bereits autorisierten App-Center.
97
+ if (!eos) {
98
+ mount.innerHTML = `
99
+ <div class="nw-card">
100
+ <div class="nw-card__title">Netzbetreiber-Schnittstelle</div>
101
+ <div class="nw-card__subtitle">Diese Funktion ist in NexoWatt EOS Pro verfügbar. Die lokale Netzlimit- und Einspeisebegrenzung der Home-Version bleibt davon unabhängig aktiv.</div>
102
+ </div>`;
103
+ return;
104
+ }
92
105
  if (!driverRows.length)
93
106
  await loadDrivers();
94
- const eos = String(getEdition() || '').toLowerCase() === 'eos';
95
107
  mount.innerHTML = `
96
108
  <div class="nw-card">
97
109
  <div class="nw-card__title">Netzbetreiber-Schnittstelle</div>
package/www/sw.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
3
  *
4
4
  * Quelle: src-ts/runtime-executables/www/sw.ts
5
- * Quell-Hash: sha256:62b4175a0d0ca098381826465451c317190e059d4049e2a72a90f044cccc86d7
5
+ * Quell-Hash: sha256:1e67d8ca913c7c5cad512a717da8507f19e11656498b5e43acff6df20ea150e6
6
6
  * Erzeugung: npm run sync:ts-runtime-executables
7
7
  *
8
8
  * Zweck:
@@ -43,7 +43,7 @@
43
43
  // Increment cache name on releases so browser updates JS/HTML reliably.
44
44
  // NOTE: Keep this monotonic to force SW updates on hotfixes.
45
45
  // 1.0.0 Stable: force all existing PWA clients onto the official stable shell.
46
- const CACHE_NAME = 'nexowatt-cache-v500';
46
+ const CACHE_NAME = 'nexowatt-cache-v503';
47
47
 
48
48
  const OFFLINE_URLS = [
49
49
  './',