iobroker.eos-admin 9.0.25 → 9.0.26

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 (245) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +3 -3
  2. package/README.md +6 -4
  3. package/START_HIER_9.0.26.md +80 -0
  4. package/adminWww/.vite/manifest.json +39 -39
  5. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
  6. package/adminWww/assets/{AdapterUpdateDialog-CLDpmxDx.js → AdapterUpdateDialog-DIjnNZ5k.js} +1 -1
  7. package/adminWww/assets/{Adapters-BCGeX2v7.js → Adapters-D8UOQg1q.js} +1 -1
  8. package/adminWww/assets/{ConfigManager-B_sJf5_w.js → ConfigManager-CAvT_4-g.js} +1 -1
  9. package/adminWww/assets/{Enums-D3n1pOtc.js → Enums-CrNUOX0d.js} +1 -1
  10. package/adminWww/assets/{Fields-Bdx5gPoT.js → Fields-D-0qFiqr.js} +1 -1
  11. package/adminWww/assets/{Files-BPK84lYU.js → Files-BL8kvaeC.js} +1 -1
  12. package/adminWww/assets/{Hosts--Jr6oLf2.js → Hosts-BToJLy61.js} +1 -1
  13. package/adminWww/assets/{Instances-DxTOzFus.js → Instances-Dlrp1KGP.js} +1 -1
  14. package/adminWww/assets/{Intro-CYBGeZtu.js → Intro-5EbxvP4X.js} +1 -1
  15. package/adminWww/assets/{Logs-CVNC-4S8.js → Logs-xdFVJ6fZ.js} +1 -1
  16. package/adminWww/assets/{Objects-Cqm9Rvym.js → Objects-DhyJ5eAY.js} +1 -1
  17. package/adminWww/assets/{Overview-JgjcHwlz.js → Overview-BspgcFB7.js} +1 -1
  18. package/adminWww/assets/{State-BV14HSwZ.js → State-CJ1mKH_U.js} +1 -1
  19. package/adminWww/assets/{UsedResources-Dz48WzEF.js → UsedResources-BMiCxqWH.js} +1 -1
  20. package/adminWww/assets/{Users-D19YlRCD.js → Users-DrlJHRa5.js} +1 -1
  21. package/adminWww/assets/{bootstrap-a7POLSDr.js → bootstrap-BU7j1Fe_.js} +3 -3
  22. package/adminWww/assets/{hostInit-keGjwsZR.js → hostInit-Cgee6juw.js} +1 -1
  23. package/adminWww/assets/{icons-material-Omb_HCfb.js → icons-material-C0U9EKON.js} +1 -1
  24. package/adminWww/assets/{index-DqPrQK7T.js → index-BUZf1ftI.js} +2 -2
  25. package/adminWww/assets/{installSVGRenderer-iWfLFoQU.js → installSVGRenderer-CcjgaxiA.js} +1 -1
  26. package/adminWww/assets/{mf-entry-bootstrap-0-2a856bb6.js → mf-entry-bootstrap-0-96d40e57.js} +2 -2
  27. package/adminWww/index.html +23 -23
  28. package/adminWww/mf-manifest.json +1 -1
  29. package/adminWww/mf-stats.json +1 -1
  30. package/adminWww/remoteEntry-eos-9.0.26.js +12 -0
  31. package/adminWww/remoteEntry.js +1 -1
  32. package/build/lib/eosKiosk.js +11 -1
  33. package/build/lib/eosKiosk.js.map +1 -1
  34. package/build/lib/eosModuleHost.js +134 -38
  35. package/build/lib/eosModuleHost.js.map +1 -1
  36. package/build/lib/eosModuleHttp.js +9 -3
  37. package/build/lib/eosModuleHttp.js.map +1 -1
  38. package/build/lib/eosModuleLoad.js +83 -0
  39. package/build/lib/eosModuleLoad.js.map +1 -0
  40. package/build/lib/eosModuleProcess.js +16 -1
  41. package/build/lib/eosModuleProcess.js.map +1 -1
  42. package/build/lib/eosModuleProcessProtocol.js +13 -1
  43. package/build/lib/eosModuleProcessProtocol.js.map +1 -1
  44. package/build/lib/eosModuleProcessWorker.js +50 -23
  45. package/build/lib/eosModuleProcessWorker.js.map +1 -1
  46. package/build/lib/eosRuntimeControl.js +17 -6
  47. package/build/lib/eosRuntimeControl.js.map +1 -1
  48. package/build/lib/eosTlsHttp.js +84 -0
  49. package/build/lib/eosTlsHttp.js.map +1 -1
  50. package/build/lib/eosUiProcessWorker.js +1 -0
  51. package/build/lib/eosUiProcessWorker.js.map +1 -1
  52. package/build/lib/web.js +18 -1
  53. package/build/lib/web.js.map +1 -1
  54. package/docs/reports/unified-9.0.26/ACTIVATION.md +50 -0
  55. package/docs/reports/unified-9.0.26/BACKUP_READINESS_REVIEW.md +30 -0
  56. package/docs/reports/unified-9.0.26/BACKUP_UI.md +69 -0
  57. package/docs/reports/unified-9.0.26/CHARGING_CLIENT_REVIEW.md +24 -0
  58. package/docs/reports/unified-9.0.26/EVCS_DELETE_UI_REVIEW.md +120 -0
  59. package/docs/reports/unified-9.0.26/EVCS_IDENTITY_REVIEW.md +47 -0
  60. package/docs/reports/unified-9.0.26/INDEPENDENT_REVIEW.md +114 -0
  61. package/docs/reports/unified-9.0.26/LIFECYCLE_REVIEW.md +47 -0
  62. package/docs/reports/unified-9.0.26/OCPP_DELETION_REVIEW.md +49 -0
  63. package/docs/reports/unified-9.0.26/PIPELINE_OFFLINE_ASSERTION_REVIEW.md +71 -0
  64. package/docs/reports/unified-9.0.26/PRUEFBERICHT.md +71 -0
  65. package/docs/reports/unified-9.0.26/PWA_TLS.md +43 -0
  66. package/docs/reports/unified-9.0.26/TARIFF_STARTUP.md +42 -0
  67. package/docs/reports/unified-9.0.26/installed-package/README.md +105 -0
  68. package/docs/reports/unified-9.0.26/installed-package/baseline925-git-export.json +31 -0
  69. package/docs/reports/unified-9.0.26/installed-package/baseline925-node22-install.log +15 -0
  70. package/docs/reports/unified-9.0.26/installed-package/baseline925-node22-lifecycle.log +17 -0
  71. package/docs/reports/unified-9.0.26/installed-package/baseline925-node22.log +26 -0
  72. package/docs/reports/unified-9.0.26/installed-package/baseline925-node24-lifecycle.log +17 -0
  73. package/docs/reports/unified-9.0.26/installed-package/baseline925-node24.log +10 -0
  74. package/docs/reports/unified-9.0.26/installed-package/diagnostic-node22.log +26 -0
  75. package/docs/reports/unified-9.0.26/installed-package/diagnostic-node24.log +10 -0
  76. package/docs/reports/unified-9.0.26/installed-package/registry925-comparison.json +18 -0
  77. package/docs/reports/unified-9.0.26/raw/INDEX.json +43 -0
  78. package/docs/reports/unified-9.0.26/raw/activation/INTERNAL_VISUAL_CHECKS.md +1 -0
  79. package/docs/reports/unified-9.0.26/raw/activation/eslint.log +0 -0
  80. package/docs/reports/unified-9.0.26/raw/activation/node22-browser.json +74 -0
  81. package/docs/reports/unified-9.0.26/raw/activation/node22-browser.stderr.log +2 -0
  82. package/docs/reports/unified-9.0.26/raw/activation/node22-real-processes.log +40 -0
  83. package/docs/reports/unified-9.0.26/raw/activation/node22-unit-http.log +196 -0
  84. package/docs/reports/unified-9.0.26/raw/activation/node24-browser.json +74 -0
  85. package/docs/reports/unified-9.0.26/raw/activation/node24-browser.stderr.log +0 -0
  86. package/docs/reports/unified-9.0.26/raw/activation/node24-module-http.log +18 -0
  87. package/docs/reports/unified-9.0.26/raw/activation/node24-tests.log +43 -0
  88. package/docs/reports/unified-9.0.26/raw/activation/typecheck.log +0 -0
  89. package/docs/reports/unified-9.0.26/raw/activation/verification.json +38 -0
  90. package/docs/reports/unified-9.0.26/raw/backup-ui/field-map.json +497 -0
  91. package/docs/reports/unified-9.0.26/raw/backup-ui/node22-browser.json +67 -0
  92. package/docs/reports/unified-9.0.26/raw/backup-ui/node22-browser.stderr.log +2 -0
  93. package/docs/reports/unified-9.0.26/raw/backup-ui/node24-browser.json +67 -0
  94. package/docs/reports/unified-9.0.26/raw/backup-ui/node24-browser.stderr.log +0 -0
  95. package/docs/reports/unified-9.0.26/raw/backup-ui/verification.json +32 -0
  96. package/docs/reports/unified-9.0.26/raw/build-and-static/FINAL_CHECKS.json +45 -0
  97. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-backend-before-ems-tariff.log +5 -0
  98. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-backend-delivery.log +5 -0
  99. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-frontend.log +152 -0
  100. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-installer.log +26 -0
  101. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-modules.log +5 -0
  102. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-ui-runtime-delivery.log +7 -0
  103. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-ui-runtime.log +7 -0
  104. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-lint-complete.log +45 -0
  105. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-lint-delivery.log +45 -0
  106. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-production-audit.json +77 -0
  107. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-production-audit.stderr +1 -0
  108. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-registry-check.json +7 -0
  109. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-registry-check.stderr +9 -0
  110. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-sbom-vendored.log +1 -0
  111. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-typecheck-complete.log +5 -0
  112. package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-typecheck-delivery.log +5 -0
  113. package/docs/reports/unified-9.0.26/raw/charging-control-client-review-hashes.json +10 -0
  114. package/docs/reports/unified-9.0.26/raw/charging-control-client-review-node22.log +86 -0
  115. package/docs/reports/unified-9.0.26/raw/charging-control-client-review-node24.log +20 -0
  116. package/docs/reports/unified-9.0.26/raw/charging-identity/node22.log +130 -0
  117. package/docs/reports/unified-9.0.26/raw/charging-identity/node24.log +27 -0
  118. package/docs/reports/unified-9.0.26/raw/charging-identity-review/PRODUCT_REVIEW.md +45 -0
  119. package/docs/reports/unified-9.0.26/raw/charging-identity-review/independent-probes.json +18 -0
  120. package/docs/reports/unified-9.0.26/raw/charging-identity-review/independent-probes.stderr +0 -0
  121. package/docs/reports/unified-9.0.26/raw/charging-identity-review/node24-tests.log +38 -0
  122. package/docs/reports/unified-9.0.26/raw/charging-identity-review/registry-ipc.json +24 -0
  123. package/docs/reports/unified-9.0.26/raw/charging-identity-review/review-probes.cjs +81 -0
  124. package/docs/reports/unified-9.0.26/raw/deletion-station-kiosk-node22.log +188 -0
  125. package/docs/reports/unified-9.0.26/raw/deletion-station-kiosk-node24.log +36 -0
  126. package/docs/reports/unified-9.0.26/raw/evcs-control-fence-node22.log +148 -0
  127. package/docs/reports/unified-9.0.26/raw/evcs-control-fence-node24.log +30 -0
  128. package/docs/reports/unified-9.0.26/raw/evcs-delete/browser-lint.log +0 -0
  129. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-browser.json +28 -0
  130. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-browser.log +3 -0
  131. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-client-handshake.log +112 -0
  132. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-corrected.log +94 -0
  133. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-diagnostic.log +27 -0
  134. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-repro.log +94 -0
  135. package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-tick-probe.log +36 -0
  136. package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-browser.json +28 -0
  137. package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-browser.log +1 -0
  138. package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-client-handshake.log +24 -0
  139. package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-pipeline-corrected.log +23 -0
  140. package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-pipeline-repro.log +23 -0
  141. package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-pipeline-tick-probe.log +28 -0
  142. package/docs/reports/unified-9.0.26/raw/evcs-delete/pipeline-corrected-snapshot.json +23 -0
  143. package/docs/reports/unified-9.0.26/raw/evcs-delete/pipeline-lint.log +6 -0
  144. package/docs/reports/unified-9.0.26/raw/final-source-snapshot.json +16 -0
  145. package/docs/reports/unified-9.0.26/raw/git-vendor-source/node22.log +28 -0
  146. package/docs/reports/unified-9.0.26/raw/git-vendor-source/node24.log +10 -0
  147. package/docs/reports/unified-9.0.26/raw/git-vendor-source/verification.json +29 -0
  148. package/docs/reports/unified-9.0.26/raw/independent-review/GIT_ADDENDUM.json +20 -0
  149. package/docs/reports/unified-9.0.26/raw/independent-review/INDEX.json +76 -0
  150. package/docs/reports/unified-9.0.26/raw/independent-review/baseline925-artifacts-independent.json +16 -0
  151. package/docs/reports/unified-9.0.26/raw/independent-review/git-runtime-complete-node22.log +22 -0
  152. package/docs/reports/unified-9.0.26/raw/independent-review/git-runtime-complete-node24.log +9 -0
  153. package/docs/reports/unified-9.0.26/raw/independent-review/git-runtime-node24.log +9 -0
  154. package/docs/reports/unified-9.0.26/raw/independent-review/git-transport-independent.json +33 -0
  155. package/docs/reports/unified-9.0.26/raw/independent-review/npm-dry-run-file-inventory.json +16271 -0
  156. package/docs/reports/unified-9.0.26/raw/independent-review/npm-git-complete-inventory.json +40 -0
  157. package/docs/reports/unified-9.0.26/raw/independent-review/public-trust-node24.log +9 -0
  158. package/docs/reports/unified-9.0.26/raw/independent-review/runtime-lifecycle-import-node24.log +35 -0
  159. package/docs/reports/unified-9.0.26/raw/lifecycle/node22-baseline925.json +30 -0
  160. package/docs/reports/unified-9.0.26/raw/lifecycle/node22-candidate926.json +30 -0
  161. package/docs/reports/unified-9.0.26/raw/lifecycle/node24-baseline925.json +30 -0
  162. package/docs/reports/unified-9.0.26/raw/lifecycle/node24-candidate926.json +30 -0
  163. package/docs/reports/unified-9.0.26/raw/node22-tests-before-backup-git-regression.log +16035 -0
  164. package/docs/reports/unified-9.0.26/raw/node22-tests-before-backup-ui.log +16037 -0
  165. package/docs/reports/unified-9.0.26/raw/node22-tests-before-ems-tariff.log +16064 -0
  166. package/docs/reports/unified-9.0.26/raw/node22-tests-before-git-regression.log +16027 -0
  167. package/docs/reports/unified-9.0.26/raw/node22-tests-before-pipeline-fixture.log +11584 -0
  168. package/docs/reports/unified-9.0.26/raw/node22-tests-before-remap-noop.log +11581 -0
  169. package/docs/reports/unified-9.0.26/raw/node22-tests-final.log +16520 -0
  170. package/docs/reports/unified-9.0.26/raw/node22-version.log +1 -0
  171. package/docs/reports/unified-9.0.26/raw/node24-tests-before-backup-git-regression.log +2678 -0
  172. package/docs/reports/unified-9.0.26/raw/node24-tests-before-backup-ui.log +2678 -0
  173. package/docs/reports/unified-9.0.26/raw/node24-tests-before-ems-tariff.log +1860 -0
  174. package/docs/reports/unified-9.0.26/raw/node24-tests-before-git-regression.log +2677 -0
  175. package/docs/reports/unified-9.0.26/raw/node24-tests-before-pipeline-fixture.log +1925 -0
  176. package/docs/reports/unified-9.0.26/raw/node24-tests-before-remap-noop.log +1924 -0
  177. package/docs/reports/unified-9.0.26/raw/node24-tests-final.log +2757 -0
  178. package/docs/reports/unified-9.0.26/raw/node24-version.log +1 -0
  179. package/docs/reports/unified-9.0.26/raw/ocpp-deletion-node22.log +148 -0
  180. package/docs/reports/unified-9.0.26/raw/ocpp-deletion-node24.log +30 -0
  181. package/docs/reports/unified-9.0.26/raw/publish-overlay-provenance.json +10 -0
  182. package/docs/reports/unified-9.0.26/raw/pwa/INTERNAL_VISUAL_CHECKS.md +1 -0
  183. package/docs/reports/unified-9.0.26/raw/pwa/index.json +18 -0
  184. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-baseline.log +48 -0
  185. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser-node22.json +33 -0
  186. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser-node22.stderr +5 -0
  187. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser.json +33 -0
  188. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser.stderr +2 -0
  189. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-focused-node22.log +137 -0
  190. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-focused-node24.log +32 -0
  191. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-lint.log +0 -0
  192. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-recovery-node22.log +28 -0
  193. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-recovery-node24.log +10 -0
  194. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-tls-final.log +9 -0
  195. package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-typecheck.log +0 -0
  196. package/docs/reports/unified-9.0.26/raw/tariff-deletion-station-kiosk-node22.log +250 -0
  197. package/docs/reports/unified-9.0.26/raw/tariff-deletion-station-kiosk-node24.log +46 -0
  198. package/docs/reports/unified-9.0.26/raw/tariff-startup/PRODUCT_REVIEW.md +30 -0
  199. package/docs/reports/unified-9.0.26/raw/tariff-startup/browser-eslint.log +0 -0
  200. package/docs/reports/unified-9.0.26/raw/tariff-startup/eslint.log +0 -0
  201. package/docs/reports/unified-9.0.26/raw/tariff-startup/independent-review-node24.log +35 -0
  202. package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-browser.json +43 -0
  203. package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-browser.stderr +2 -0
  204. package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-process-final.log +26 -0
  205. package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-tests.log +378 -0
  206. package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-browser.json +43 -0
  207. package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-browser.stderr +0 -0
  208. package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-process-final.log +10 -0
  209. package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-tests.log +66 -0
  210. package/docs/reports/unified-9.0.26/raw/tariff-startup/process-verification.json +41 -0
  211. package/docs/reports/unified-9.0.26/raw/tariff-startup/typecheck.log +0 -0
  212. package/docs/unified/NEXOWATT_TLS_DE.md +12 -2
  213. package/io-package.json +8 -9
  214. package/modules/backup/admin/index.html +24 -95
  215. package/modules/backup/admin/index.js +350 -98
  216. package/modules/backup/admin/style.css +40 -0
  217. package/package.json +12 -8
  218. package/public/eos-runtime/index.js +12 -2
  219. package/public/eos-tls/index.html +1 -1
  220. package/public/eos-tls/trust.css +19 -0
  221. package/public/eos-tls/trust.html +52 -0
  222. package/release-manifests/unified/build-environment.cdx.json +6 -6
  223. package/release-manifests/unified/files.json +316 -126
  224. package/release-manifests/unified/frontend.cdx.json +6 -6
  225. package/release-manifests/unified/installer.cdx.json +2 -2
  226. package/release-manifests/unified/obsolete-admin-assets.json +539 -457
  227. package/release-manifests/unified/runtime.cdx.json +26 -26
  228. package/release-manifests/unified/validation.json +15 -15
  229. package/tools/eos-lifecycle-benchmark.cjs +50 -0
  230. package/tools/eos-release-manifest.cjs +1 -1
  231. package/ui/ems/engine.js +5 -1
  232. package/ui/io-package.json +1 -1
  233. package/ui/lib/charging-point-identity.js +465 -0
  234. package/ui/lib/charging-station-identity.js +111 -0
  235. package/ui/lib/ocpp-auto-discovery.js +34 -3
  236. package/ui/main.js +165 -29
  237. package/ui/package.json +1 -1
  238. package/ui/www/app.js +63 -18
  239. package/ui/www/customer-tariff.js +67 -11
  240. package/ui/www/dc-station-display.js +15 -11
  241. package/ui/www/ems-apps.js +40 -6
  242. package/ui/www/evcs.js +55 -12
  243. package/ui/www/login.html +1 -0
  244. package/ui/www/manifest.webmanifest +2 -2
  245. package/adminWww/remoteEntry-eos-9.0.25.js +0 -12
@@ -0,0 +1,465 @@
1
+ /**
2
+ * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
+ *
4
+ * Quelle: src-ts/runtime-executables/lib/charging-point-identity.ts
5
+ * Quell-Hash: sha256:6db008926f84201dda3c8ef6f3391e56fcda0f771eb61fda7b14bf210b6c3f93
6
+ * Erzeugung: npm run sync:ts-runtime-executables
7
+ *
8
+ * Zweck:
9
+ * Diese JavaScript-Datei ist das ausführbare Build-Artefakt für lib/charging-point-identity.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
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.getChargingControlIdentity = exports.CHARGING_IDENTITY_STATE = void 0;
21
+ exports.beginChargingControlWrite = beginChargingControlWrite;
22
+ exports.chargingPointLayout = chargingPointLayout;
23
+ exports.remapChargingPointDefaultModes = remapChargingPointDefaultModes;
24
+ exports.chargingPointLayoutChanged = chargingPointLayoutChanged;
25
+ exports.publicChargingControlIdentity = publicChargingControlIdentity;
26
+ exports.assertChargingControlIdentity = assertChargingControlIdentity;
27
+ exports.synchronizeChargingPointIdentity = synchronizeChargingPointIdentity;
28
+ exports.bindChargingPointIdentityBaseline = bindChargingPointIdentityBaseline;
29
+ /** Stable ownership of index-based charging wishes during configuration changes. */
30
+ const node_crypto_1 = require("node:crypto");
31
+ const ems_control_values_1 = require("./ems-control-values");
32
+ exports.CHARGING_IDENTITY_STATE = 'chargingManagement.controlIdentityRegistry';
33
+ const MAX_ROWS = 50;
34
+ const MAX_BYTES = 131072;
35
+ const timers = ['chargingSince', 'boostSince', 'boostUntil', 'boostRemainingMin', 'boostActive'];
36
+ const fields = [...ems_control_values_1.EMS_CONTROL_FIELDS, ...timers, 'legacyMode'];
37
+ const reservations = new WeakMap();
38
+ const confirmed = new WeakMap();
39
+ const record = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
40
+ const fail = (code) => Object.assign(new Error(code), { code });
41
+ function reservation(adapter) {
42
+ let state = reservations.get(adapter);
43
+ if (!state) {
44
+ state = { pending: new Set() };
45
+ reservations.set(adapter, state);
46
+ }
47
+ return state;
48
+ }
49
+ /** Synchronous admission before an HTTP/state-mirror operation's first await. */
50
+ function beginChargingControlWrite(adapter) {
51
+ const state = reservation(adapter);
52
+ if (adapter._nwEvcsIdentityTransitionPending || adapter._nwMeshAppSaveInProgress || adapter._nwShuttingDown || state.pending.size >= 64) {
53
+ throw fail('EOS_EVCS_IDENTITY_BUSY');
54
+ }
55
+ let release;
56
+ const pending = new Promise(resolve => { release = resolve; });
57
+ state.pending.add(pending);
58
+ let completed = false;
59
+ return () => {
60
+ if (completed)
61
+ return;
62
+ completed = true;
63
+ state.pending.delete(pending);
64
+ release?.();
65
+ };
66
+ }
67
+ function rowsOf(input) {
68
+ if (!Array.isArray(input) || input.length > MAX_ROWS || !input.every(record))
69
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
70
+ return input;
71
+ }
72
+ /** No names, array positions or credentials are stored as physical identity. */
73
+ function identity(row, slot, namespace) {
74
+ for (const key of ['setPowerWId', 'setCurrentAId', 'enableWriteId', 'powerId', 'energyTotalId', 'statusId', 'onlineId', 'activeId', 'lockWriteId', 'phaseSwitchId', 'modeId']) {
75
+ const value = row[key];
76
+ if (value === undefined || value === null || value === '')
77
+ continue;
78
+ if (typeof value !== 'string' || value.length > 2048 || /[\u0000-\u001f\u007f]/.test(value))
79
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
80
+ const target = value.trim();
81
+ if (!target)
82
+ continue;
83
+ if (key === 'modeId' && target === `${namespace}.evcs.${slot}.mode`)
84
+ continue;
85
+ const connector = row.connectorNo === undefined || row.connectorNo === null || row.connectorNo === '' || Number(row.connectorNo) === 0 ? 1 : Number(row.connectorNo);
86
+ if (!Number.isSafeInteger(connector) || connector < 1 || connector > 1024)
87
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
88
+ return (0, node_crypto_1.createHash)('sha256').update(JSON.stringify([target, connector])).digest('hex');
89
+ }
90
+ return null;
91
+ }
92
+ function commandIdentity(row, slot, namespace, bridges) {
93
+ const targets = [];
94
+ for (const key of ['setPowerWId', 'setCurrentAId', 'enableWriteId', 'activeId', 'lockWriteId', 'phaseSwitchId', 'modeId']) {
95
+ const value = row[key];
96
+ if (value === undefined || value === null || value === '')
97
+ continue;
98
+ if (typeof value !== 'string' || value.length > 2048 || /[\u0000-\u001f\u007f]/.test(value))
99
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
100
+ const target = value.trim();
101
+ if (!target || (key === 'modeId' && target === `${namespace}.evcs.${slot}.mode`))
102
+ continue;
103
+ targets.push([key, target]);
104
+ }
105
+ return (0, node_crypto_1.createHash)('sha256').update(JSON.stringify([targets, bridges])).digest('hex');
106
+ }
107
+ /** A configured generic bridge is also a real command destination. */
108
+ function scalarText(value) {
109
+ if (value === undefined || value === null)
110
+ return '';
111
+ if (typeof value !== 'string' && typeof value !== 'number')
112
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
113
+ return String(value);
114
+ }
115
+ function bridgeTargets(rows, slot, kiosk) {
116
+ if (!record(kiosk) || kiosk.stations === undefined)
117
+ return [];
118
+ if (!Array.isArray(kiosk.stations) || kiosk.stations.length > 100 || !kiosk.stations.every(record))
119
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
120
+ const lp = `lp${slot}`, targets = [];
121
+ const safeId = (value) => scalarText(value || '').trim().toLowerCase().replace(/[^a-z0-9_\-]+/g, '_').replace(/^_+|_+$/g, '').slice(0, 64) || 'station';
122
+ for (const [index, station] of kiosk.stations.entries()) {
123
+ const bridge = scalarText(station.controlBridge || station.commandBridge || '').trim().toLowerCase();
124
+ const profile = scalarText(station.controlProfile || station.controlBackend || (bridge === 'generic' ? 'commandState' : 'chargingManagement')).trim().toLowerCase();
125
+ if (!['json', 'commandstate', 'command-state', 'external', 'bridge', 'generic', 'ocpp', 'modbus', 'mqtt', 'vendor', 'manufacturer', 'hersteller', 'nexowatt-devices', 'dual', 'both', 'mirror', 'hybrid'].includes(profile))
126
+ continue;
127
+ const raw = station.commandStateId || station.commandObjectId;
128
+ if (raw === undefined || raw === null || raw === '')
129
+ continue;
130
+ if (typeof raw !== 'string' || raw.length > 2048 || /[\u0000-\u001f\u007f]/.test(raw))
131
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
132
+ const stationKey = scalarText(station.stationKey || station.infrastructureStationKey || '').trim();
133
+ const automatic = rows.flatMap((row, i) => row.enabled !== false && stationKey && row.stationKey === stationKey ? [`lp${i + 1}`] : []);
134
+ const manual = Array.isArray(station.assignedChargepoints) ? station.assignedChargepoints : Array.isArray(station.chargepoints) ? station.chargepoints : Array.isArray(station.lps) ? station.lps : [];
135
+ if (manual.length > MAX_ROWS)
136
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
137
+ const normalized = manual.map(value => {
138
+ const match = /^(?:lp|ladepunkt|connector|evcs)?\s*([0-9]+)$/i.exec(scalarText(value).trim());
139
+ return match ? `lp${Math.max(1, Math.round(Number(match[1]) || 1))}` : '';
140
+ });
141
+ const mode = scalarText(station.assignmentMode || station.assignmentSource || (stationKey ? 'station' : 'manual')).trim().toLowerCase();
142
+ if (!(mode !== 'manual' && automatic.length ? automatic : normalized).includes(lp))
143
+ continue;
144
+ const id = safeId(station.id || station.key || station.stationId || stationKey || `dc_station_${index + 1}`);
145
+ const target = raw.trim().replace(/\{lp\}/g, lp).replace(/\{stationId\}|\{station\}/g, id);
146
+ if (target)
147
+ targets.push(JSON.stringify([target, id, lp]));
148
+ }
149
+ return [...new Set(targets)].sort();
150
+ }
151
+ function chargingPointLayout(input, kiosk, namespace = 'eos-admin.0') {
152
+ const rows = rowsOf(input);
153
+ const layout = rows.map((row, index) => {
154
+ const slot = index + 1, bridges = bridgeTargets(rows, slot, kiosk);
155
+ // An unmapped row has no physical device identifier. Bind its explicit
156
+ // bridge and configured label conservatively; renaming it requires refresh.
157
+ const physical = identity(row, slot, namespace);
158
+ const fallback = bridges.length ? (0, node_crypto_1.createHash)('sha256').update(JSON.stringify(['bridge', bridges, scalarText(row.name || `Ladepunkt ${slot}`).trim()])).digest('hex') : null;
159
+ return { slot, identity: physical || fallback, commands: commandIdentity(row, slot, namespace, bridges) };
160
+ });
161
+ const identities = layout.map(item => item.identity).filter(item => item !== null);
162
+ if (new Set(identities).size !== identities.length)
163
+ throw fail('EOS_EVCS_IDENTITY_AMBIGUOUS');
164
+ return layout;
165
+ }
166
+ /** Move only a carried-forward, proven own default mirror with its device. */
167
+ function remapChargingPointDefaultModes(previous, next, namespace) {
168
+ const oldRows = rowsOf(previous), nextRows = rowsOf(next);
169
+ const oldByIdentity = new Map(oldRows.flatMap((row, index) => {
170
+ const key = identity(row, index + 1, namespace);
171
+ return key ? [[key, { row, slot: index + 1 }]] : [];
172
+ }));
173
+ let changed = false;
174
+ const mapped = nextRows.map((row, index) => {
175
+ const key = identity(row, index + 1, namespace), old = key ? oldByIdentity.get(key) : undefined;
176
+ if (!old || old.slot === index + 1 || old.row.modeId !== `${namespace}.evcs.${old.slot}.mode` || row.modeId !== old.row.modeId)
177
+ return row;
178
+ changed = true;
179
+ return { ...row, modeId: `${namespace}.evcs.${index + 1}.mode` };
180
+ });
181
+ return changed ? mapped : nextRows;
182
+ }
183
+ function chargingPointLayoutChanged(previous, next, previousKiosk, nextKiosk, namespace = 'eos-admin.0') {
184
+ return JSON.stringify(chargingPointLayout(previous, previousKiosk, namespace)) !== JSON.stringify(chargingPointLayout(next, nextKiosk, namespace));
185
+ }
186
+ function sameLayout(previous, next) {
187
+ return previous.length === next.length && previous.every((slot, index) => slot.slot === next[index]?.slot && slot.identity === next[index]?.identity && slot.commands === next[index]?.commands);
188
+ }
189
+ function changedSlots(previous, next) {
190
+ return Array.from({ length: Math.max(previous.length, next.length) }, (_, index) => index + 1)
191
+ .filter(slot => !previous[slot - 1] || !next[slot - 1] || previous[slot - 1]?.identity !== next[slot - 1]?.identity || previous[slot - 1]?.commands !== next[slot - 1]?.commands);
192
+ }
193
+ function bindLayout(next, previous = []) {
194
+ return next.map(slot => ({ ...slot, token: slot.identity === null ? null : previous[slot.slot - 1]?.identity === slot.identity && previous[slot.slot - 1]?.commands === slot.commands
195
+ ? previous[slot.slot - 1]?.token || (0, node_crypto_1.randomUUID)() : (0, node_crypto_1.randomUUID)() }));
196
+ }
197
+ /** Only a confirmed layout can be paired with displayed points and commands. */
198
+ function publicChargingControlIdentity(adapter, rows) {
199
+ const value = confirmed.get(adapter);
200
+ if (!value || adapter._nwEvcsIdentityTransitionPending)
201
+ return { revision: '', slots: {} };
202
+ if (rows !== undefined) {
203
+ try {
204
+ if (!sameLayout(value.layout, chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace)))
205
+ return { revision: '', slots: {} };
206
+ }
207
+ catch {
208
+ return { revision: '', slots: {} };
209
+ }
210
+ }
211
+ return { revision: value.revision, slots: Object.fromEntries(value.layout.flatMap(slot => slot.token ? [[`lp${slot.slot}`, slot.token]] : [])) };
212
+ }
213
+ exports.getChargingControlIdentity = publicChargingControlIdentity;
214
+ /** Old clients remain compatible only where their index has never been reused. */
215
+ function assertChargingControlIdentity(adapter, slot, request) {
216
+ const value = confirmed.get(adapter);
217
+ if (!value || adapter._nwEvcsIdentityTransitionPending || !record(request))
218
+ throw fail('EOS_EVCS_IDENTITY_CHANGED');
219
+ const suppliedLayout = request.expectedChargingLayoutRevision;
220
+ if (suppliedLayout !== undefined && suppliedLayout !== value.revision)
221
+ throw fail('EOS_EVCS_IDENTITY_CHANGED');
222
+ if (slot === null) {
223
+ if (value.layoutChanged && suppliedLayout !== value.revision)
224
+ throw fail('EOS_EVCS_IDENTITY_CHANGED');
225
+ return;
226
+ }
227
+ const match = /^lp([1-9]\d?)$/.exec(slot);
228
+ const index = match ? Number(match[1]) : 0;
229
+ const target = value.layout[index - 1];
230
+ if (!target?.token || !target.identity)
231
+ throw fail('EOS_EVCS_IDENTITY_CHANGED');
232
+ const supplied = request.expectedChargingIdentity;
233
+ if (supplied !== undefined ? supplied !== target.token : value.protectedSlots.includes(index))
234
+ throw fail('EOS_EVCS_IDENTITY_CHANGED');
235
+ }
236
+ function validLayout(value) {
237
+ if (!Array.isArray(value) || value.length > MAX_ROWS)
238
+ return false;
239
+ const seen = new Set(), tokens = new Set();
240
+ return value.every((entry, index) => {
241
+ if (!record(entry) || Object.keys(entry).sort().join(',') !== 'commands,identity,slot,token' || entry.slot !== index + 1 ||
242
+ typeof entry.commands !== 'string' || !/^[a-f0-9]{64}$/.test(entry.commands))
243
+ return false;
244
+ if (entry.identity === null)
245
+ return entry.token === null;
246
+ if (typeof entry.identity !== 'string' || !/^[a-f0-9]{64}$/.test(entry.identity) || seen.has(entry.identity))
247
+ return false;
248
+ if (typeof entry.token !== 'string' || !/^[a-f0-9-]{36}$/.test(entry.token) || tokens.has(entry.token))
249
+ return false;
250
+ tokens.add(entry.token);
251
+ seen.add(entry.identity);
252
+ return true;
253
+ });
254
+ }
255
+ function validValue(field, value) {
256
+ if (field === 'boostActive')
257
+ return typeof value === 'boolean';
258
+ if (field === 'boostRemainingMin')
259
+ return typeof value === 'number' && Number.isFinite(value) && value >= 0 && value <= 1000000;
260
+ if (field === 'chargingSince' || field === 'boostSince' || field === 'boostUntil') {
261
+ return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 && value <= 8640000000000000;
262
+ }
263
+ return (0, ems_control_values_1.validEmsControlValue)(field, value);
264
+ }
265
+ function validValues(value) {
266
+ return record(value) && Object.keys(value).length === fields.length && fields.every(field => Object.hasOwn(value, field) && validValue(field, value[field]));
267
+ }
268
+ function parseRegistry(state) {
269
+ if (state === null || state === undefined || (record(state) && (state.val === null || state.val === undefined || state.val === '')))
270
+ return null;
271
+ if (!record(state) || typeof state.val !== 'string' || Buffer.byteLength(state.val) > MAX_BYTES)
272
+ throw fail('EOS_EVCS_IDENTITY_REGISTRY_INVALID');
273
+ let value;
274
+ try {
275
+ value = JSON.parse(state.val);
276
+ }
277
+ catch {
278
+ throw fail('EOS_EVCS_IDENTITY_REGISTRY_INVALID');
279
+ }
280
+ if (!record(value) || value.schema !== 1 || typeof value.revision !== 'string' || !/^[a-f0-9-]{36}$/.test(value.revision) ||
281
+ !validLayout(value.layout) || typeof value.layoutChanged !== 'boolean' || !Array.isArray(value.protectedSlots) ||
282
+ value.protectedSlots.length > MAX_ROWS || !value.protectedSlots.every(slot => typeof slot === 'number' && Number.isInteger(slot) && slot >= 1 && slot <= MAX_ROWS) ||
283
+ new Set(value.protectedSlots).size !== value.protectedSlots.length || (value.layoutChanged === false && value.protectedSlots.length > 0) ||
284
+ Object.keys(value).some(key => !['schema', 'revision', 'layout', 'journal', 'protectedSlots', 'layoutChanged'].includes(key))) {
285
+ throw fail('EOS_EVCS_IDENTITY_REGISTRY_INVALID');
286
+ }
287
+ const registry = { schema: 1, revision: value.revision, layout: value.layout, protectedSlots: value.protectedSlots, layoutChanged: value.layoutChanged };
288
+ if (value.journal !== undefined) {
289
+ const journal = value.journal;
290
+ if (!record(journal) || Object.keys(journal).sort().join(',') !== 'sourceRevision,target,targetRevision,writes' ||
291
+ journal.sourceRevision !== value.revision || typeof journal.targetRevision !== 'string' || !/^[a-f0-9-]{36}$/.test(journal.targetRevision) ||
292
+ !validLayout(journal.target) || !Array.isArray(journal.writes) || journal.writes.length > MAX_ROWS)
293
+ throw fail('EOS_EVCS_IDENTITY_JOURNAL_INVALID');
294
+ const writes = [], seen = new Set();
295
+ for (const item of journal.writes) {
296
+ if (!record(item) || Object.keys(item).sort().join(',') !== 'slot,values' || typeof item.slot !== 'number' ||
297
+ !Number.isInteger(item.slot) || item.slot < 1 || item.slot > MAX_ROWS || seen.has(item.slot) || !validValues(item.values)) {
298
+ throw fail('EOS_EVCS_IDENTITY_JOURNAL_INVALID');
299
+ }
300
+ seen.add(item.slot);
301
+ writes.push({ slot: item.slot, values: item.values });
302
+ }
303
+ const required = changedSlots(registry.layout, journal.target);
304
+ if (!required.length || required.length !== writes.length || required.some(slot => !seen.has(slot)))
305
+ throw fail('EOS_EVCS_IDENTITY_JOURNAL_INVALID');
306
+ for (const slot of journal.target) {
307
+ const previous = registry.layout[slot.slot - 1];
308
+ if (previous?.identity === slot.identity && previous.commands === slot.commands ? previous.token !== slot.token : !!slot.token && registry.layout.some(old => old.token === slot.token)) {
309
+ throw fail('EOS_EVCS_IDENTITY_JOURNAL_INVALID');
310
+ }
311
+ }
312
+ registry.journal = { sourceRevision: journal.sourceRevision, targetRevision: journal.targetRevision, target: journal.target, writes };
313
+ }
314
+ return registry;
315
+ }
316
+ function stateId(slot, field) {
317
+ return field === 'legacyMode' ? `evcs.${slot}.mode` : `chargingManagement.wallboxes.lp${slot}.${field}`;
318
+ }
319
+ function defaults(row) {
320
+ const mode = row && (0, ems_control_values_1.validEmsControlValue)('userMode', row.userMode) && row.userMode !== '' ? String(row.userMode) : 'auto';
321
+ const phase = row && (0, ems_control_values_1.validEmsControlValue)('userPhaseMode', row.phaseMode) && row.phaseMode !== '' ? String(row.phaseMode) : '';
322
+ return { userMode: mode, userAutoSource: 'standard', userPhaseMode: phase,
323
+ userEnabled: !!row, userStationEnabled: !!row, userStorageAssistEnabled: false,
324
+ goalEnabled: false, goalTargetSocPct: 100, goalFinishTs: 0, goalBatteryKwh: 0,
325
+ chargingSince: 0, boostSince: 0, boostUntil: 0, boostRemainingMin: 0, boostActive: false,
326
+ legacyMode: mode === 'boost' ? 1 : mode === 'minpv' ? 2 : mode === 'pv' ? 3 : 0 };
327
+ }
328
+ async function drained(state) {
329
+ if (!state.pending.size)
330
+ return;
331
+ let timer;
332
+ try {
333
+ await Promise.race([Promise.all([...state.pending]), new Promise((_resolve, reject) => {
334
+ timer = setTimeout(() => reject(fail('EOS_EVCS_IDENTITY_DRAIN_TIMEOUT')), 5000);
335
+ })]);
336
+ }
337
+ finally {
338
+ if (timer)
339
+ clearTimeout(timer);
340
+ }
341
+ }
342
+ async function writeConfirmed(adapter, id, value) {
343
+ if (adapter._nwShuttingDown)
344
+ throw fail('EOS_EVCS_IDENTITY_STOPPED');
345
+ await adapter.setStateAsync(id, { val: value, ack: true });
346
+ const stored = await adapter.getStateAsync(id);
347
+ if (!record(stored) || stored.val !== value || stored.ack !== true)
348
+ throw fail('EOS_EVCS_IDENTITY_COMMIT_UNCONFIRMED');
349
+ const now = Date.now();
350
+ if (adapter.stateCache) {
351
+ adapter.stateCache[id] = { value, ts: now };
352
+ adapter.stateCache[`${adapter.namespace}.${id}`] = { value, ts: now };
353
+ }
354
+ adapter.updateValue?.(id, value, now);
355
+ }
356
+ async function saveRegistry(adapter, registry) {
357
+ const encoded = JSON.stringify(registry);
358
+ if (Buffer.byteLength(encoded) > MAX_BYTES)
359
+ throw fail('EOS_EVCS_IDENTITY_JOURNAL_LIMIT');
360
+ await writeConfirmed(adapter, exports.CHARGING_IDENTITY_STATE, encoded);
361
+ if (!registry.journal)
362
+ confirmed.set(adapter, registry);
363
+ }
364
+ async function copyJournal(adapter, registry) {
365
+ const journal = registry.journal;
366
+ if (!journal)
367
+ throw fail('EOS_EVCS_IDENTITY_JOURNAL_INVALID');
368
+ // Four in-flight state writes at most; complete the accepted batch even
369
+ // after one failure. A replacement engine cannot run against partial data.
370
+ const writes = journal.writes.flatMap(item => fields.map(field => ({ id: stateId(item.slot, field), field, value: item.values[field] })));
371
+ for (let index = 0; index < writes.length; index += 4) {
372
+ const settled = await Promise.allSettled(writes.slice(index, index + 4).map(async (write) => {
373
+ await adapter.setObjectNotExistsAsync(write.id, { type: 'state', common: { name: write.field,
374
+ type: typeof write.value, role: 'state', read: true, write: !timers.some(field => field === write.field) }, native: {} });
375
+ await writeConfirmed(adapter, write.id, write.value);
376
+ }));
377
+ const failed = settled.find(result => result.status === 'rejected');
378
+ if (failed?.status === 'rejected')
379
+ throw failed.reason;
380
+ }
381
+ const protectedSlots = [...new Set([...registry.protectedSlots,
382
+ ...changedSlots(registry.layout, journal.target).filter(slot => !!registry.layout[slot - 1])])].sort((a, b) => a - b);
383
+ await saveRegistry(adapter, { schema: 1, revision: journal.targetRevision, layout: journal.target, protectedSlots, layoutChanged: true });
384
+ }
385
+ async function synchronize(adapter, input, state, baseline, desired, desiredKiosk) {
386
+ await drained(state);
387
+ const rows = rowsOf(input), target = chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace);
388
+ await adapter.setObjectNotExistsAsync(exports.CHARGING_IDENTITY_STATE, { type: 'state', common: {
389
+ name: 'Ladepunkt-Bedienwerte: Identitätsregister', type: 'string', role: 'json', read: true, write: false
390
+ }, native: {},
391
+ acl: { owner: 'system.user.admin', ownerGroup: 'system.group.administrator', object: 0x600, state: 0x600 } });
392
+ const registry = parseRegistry(await adapter.getStateAsync(exports.CHARGING_IDENTITY_STATE));
393
+ if (!registry) {
394
+ // First upgrade binds existing wishes to the currently configured points.
395
+ // Never guess an earlier layout or erase an operator's chosen mode.
396
+ await saveRegistry(adapter, { schema: 1, revision: (0, node_crypto_1.randomUUID)(), layout: bindLayout(target), protectedSlots: [], layoutChanged: false });
397
+ return true;
398
+ }
399
+ if (baseline) {
400
+ if (registry.journal) {
401
+ if (!sameLayout(registry.journal.target, chargingPointLayout(desired === undefined ? input : desired, desired === undefined ? adapter.config?.chargeKiosk : desiredKiosk, adapter.namespace)))
402
+ throw fail('EOS_EVCS_IDENTITY_RECOVERY_LAYOUT_MISMATCH');
403
+ return false;
404
+ }
405
+ confirmed.set(adapter, registry);
406
+ return true;
407
+ }
408
+ if (registry.journal) {
409
+ if (!sameLayout(registry.journal.target, target))
410
+ throw fail('EOS_EVCS_IDENTITY_RECOVERY_LAYOUT_MISMATCH');
411
+ await copyJournal(adapter, registry);
412
+ return true;
413
+ }
414
+ if (sameLayout(registry.layout, target)) {
415
+ confirmed.set(adapter, registry);
416
+ return true;
417
+ }
418
+ const writes = [];
419
+ for (let slot = 1; slot <= Math.max(registry.layout.length, target.length); slot++) {
420
+ const previous = registry.layout[slot - 1], next = target[slot - 1];
421
+ if (previous && next && previous.identity === next.identity && previous.commands === next.commands)
422
+ continue;
423
+ const source = next?.identity ? registry.layout.find(item => item.identity === next.identity) : undefined;
424
+ const values = defaults(rows[slot - 1]);
425
+ if (source) {
426
+ for (const field of fields) {
427
+ const old = await adapter.getStateAsync(stateId(source.slot, field));
428
+ if (old === null || old === undefined || (record(old) && (old.val === null || old.val === undefined)))
429
+ continue;
430
+ if (!record(old) || !validValue(field, old.val))
431
+ throw fail('EOS_EVCS_IDENTITY_CONTROL_INVALID');
432
+ values[field] = old.val;
433
+ }
434
+ }
435
+ writes.push({ slot, values });
436
+ }
437
+ const prepared = { ...registry, journal: { sourceRevision: registry.revision, targetRevision: (0, node_crypto_1.randomUUID)(), target: bindLayout(target, registry.layout), writes } };
438
+ await saveRegistry(adapter, prepared);
439
+ await copyJournal(adapter, prepared);
440
+ return true;
441
+ }
442
+ /** Called after old engine drain, before any replacement module initializes. */
443
+ function run(adapter, rows, baseline, desired, desiredKiosk) {
444
+ const state = reservation(adapter);
445
+ adapter._nwEvcsIdentityTransitionPending = true;
446
+ const target = JSON.stringify([baseline, chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace), desired === undefined ? null : chargingPointLayout(desired, desiredKiosk, adapter.namespace)]);
447
+ if (state.operation)
448
+ return state.target === target ? state.operation : Promise.reject(fail('EOS_EVCS_IDENTITY_BUSY'));
449
+ const operation = synchronize(adapter, rows, state, baseline, desired, desiredKiosk).then(completed => { adapter._nwEvcsIdentityTransitionPending = !completed; });
450
+ state.operation = operation;
451
+ state.target = target;
452
+ const complete = () => { if (state.operation === operation) {
453
+ delete state.operation;
454
+ delete state.target;
455
+ } };
456
+ void operation.then(complete, complete);
457
+ return operation;
458
+ }
459
+ function synchronizeChargingPointIdentity(adapter, rows) {
460
+ return run(adapter, rows, false);
461
+ }
462
+ /** Seed only a previously missing registry before the first configuration commit. */
463
+ function bindChargingPointIdentityBaseline(adapter, rows, desired, desiredKiosk) {
464
+ return run(adapter, rows, true, desired, desiredKiosk);
465
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
+ *
4
+ * Quelle: src-ts/runtime-executables/lib/charging-station-identity.ts
5
+ * Quell-Hash: sha256:1487f615a02c5e53230267c8b13d06347a3459eda54814bb23cbb8a4f46ba1b6
6
+ * Erzeugung: npm run sync:ts-runtime-executables
7
+ *
8
+ * Zweck:
9
+ * Diese JavaScript-Datei ist das ausführbare Build-Artefakt für lib/charging-station-identity.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
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.remapChargingStationAssignments = remapChargingStationAssignments;
21
+ /** Keep an existing station URL bound to its physical chargepoints on reindex. */
22
+ const charging_point_identity_1 = require("./charging-point-identity");
23
+ const record = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
24
+ const invalid = () => Object.assign(new Error('EOS_EVCS_STATION_ASSIGNMENTS_INVALID'), { code: 'EOS_EVCS_STATION_ASSIGNMENTS_INVALID' });
25
+ function safeId(value) {
26
+ if (value !== undefined && value !== null && typeof value !== 'string' && typeof value !== 'number')
27
+ throw invalid();
28
+ return String(value || '').trim().toLowerCase().replace(/[^a-z0-9_\-]+/g, '_').replace(/^_+|_+$/g, '').slice(0, 64) || 'station';
29
+ }
30
+ function stationId(row, index) {
31
+ const rawStationKey = row.stationKey || row.infrastructureStationKey || '';
32
+ if (typeof rawStationKey !== 'string' && typeof rawStationKey !== 'number')
33
+ throw invalid();
34
+ const stationKey = String(rawStationKey).trim();
35
+ return safeId(row.id || row.key || row.stationId || stationKey || `dc_station_${index + 1}`);
36
+ }
37
+ function stations(value) {
38
+ if (!record(value) || value.stations === undefined)
39
+ return [];
40
+ if (!Array.isArray(value.stations) || value.stations.length > 100 || !value.stations.every(record))
41
+ throw invalid();
42
+ const ids = value.stations.map(stationId);
43
+ if (new Set(ids).size !== ids.length)
44
+ throw invalid();
45
+ return value.stations;
46
+ }
47
+ function manual(row) {
48
+ const values = Array.isArray(row.assignedChargepoints) ? row.assignedChargepoints
49
+ : Array.isArray(row.chargepoints) ? row.chargepoints : Array.isArray(row.lps) ? row.lps : [];
50
+ if (values.length > 50)
51
+ throw invalid();
52
+ const result = [];
53
+ for (const value of values) {
54
+ if (typeof value !== 'string' && typeof value !== 'number')
55
+ throw invalid();
56
+ const text = String(value).trim().toLowerCase();
57
+ if (text.length > 64)
58
+ throw invalid();
59
+ const match = /^(?:lp|ladepunkt|connector|evcs)?\s*([0-9]+)$/i.exec(text);
60
+ const slot = match ? `lp${Math.max(1, Math.round(Number(match[1]) || 1))}` : safeId(text);
61
+ if (!result.includes(slot))
62
+ result.push(slot);
63
+ }
64
+ return result;
65
+ }
66
+ function same(values, other) {
67
+ return values.length === other.length && values.every((value, index) => value === other[index]);
68
+ }
69
+ function samePermissions(values, other) {
70
+ return values.length === other.length && values.every(value => other.includes(value));
71
+ }
72
+ /** Explicitly edited/new lists belong to the new layout. Unchanged lists,
73
+ * including automatic-mode manual fallbacks, retain their previous devices.
74
+ * Pure and bounded: at most 50 chargepoints and 100 station records. */
75
+ function remapChargingStationAssignments(previousRows, nextRows, previousKiosk, nextKiosk, namespace = 'eos-admin.0') {
76
+ const previous = (0, charging_point_identity_1.chargingPointLayout)(previousRows, previousKiosk, namespace), next = (0, charging_point_identity_1.chargingPointLayout)(nextRows, nextKiosk, namespace);
77
+ if (previous.length === next.length && previous.every((slot, index) => slot.identity === next[index]?.identity))
78
+ return nextKiosk;
79
+ if (!record(nextKiosk))
80
+ return nextKiosk;
81
+ const oldStations = stations(previousKiosk), nextStations = stations(nextKiosk);
82
+ const oldById = new Map(oldStations.map((station, index) => [stationId(station, index), station]));
83
+ const nextByIdentity = new Map(next.flatMap(slot => slot.identity ? [[slot.identity, `lp${slot.slot}`]] : []));
84
+ let changed = false;
85
+ const mapped = nextStations.map((station, index) => {
86
+ const old = oldById.get(stationId(station, index));
87
+ if (!old)
88
+ return station;
89
+ const before = manual(old), submitted = manual(station);
90
+ // UI sorting does not authorize a different physical connector. Only a
91
+ // changed permission set is an explicit assignment to the new layout.
92
+ if (!samePermissions(before, submitted))
93
+ return station;
94
+ const assigned = [];
95
+ for (const oldSlot of submitted) {
96
+ const match = /^lp([1-9]\d?)$/.exec(oldSlot);
97
+ const identity = match ? previous[Number(match[1]) - 1]?.identity : null;
98
+ const target = identity ? nextByIdentity.get(identity) : undefined;
99
+ if (target && !assigned.includes(target))
100
+ assigned.push(target);
101
+ }
102
+ if (same(assigned, submitted))
103
+ return station;
104
+ changed = true;
105
+ const result = { ...station, assignedChargepoints: assigned };
106
+ delete result.chargepoints;
107
+ delete result.lps;
108
+ return result;
109
+ });
110
+ return changed ? { ...nextKiosk, stations: mapped } : nextKiosk;
111
+ }
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/lib/ocpp-auto-discovery.ts
10
- * Quell-Hash: sha256:e68a9d3f1cd8d5f1d5096f12d1de05ac217fe507cb921343d695cfb6f8c462bb
10
+ * Quell-Hash: sha256:1fcb9a8e0a1874f7872def460ff56cc6930da725a7a1292a7a38009dc94eff90
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -28,6 +28,7 @@ exports.ocppRootInScope = ocppRootInScope;
28
28
  exports.ocppNamespace = ocppNamespace;
29
29
  exports.ocppDiscoveryPatterns = ocppDiscoveryPatterns;
30
30
  exports.collectOcppStations = collectOcppStations;
31
+ exports.filterOcppDiscoverySources = filterOcppDiscoverySources;
31
32
  exports.normalizeOcppDiscovery = normalizeOcppDiscovery;
32
33
  exports.planOcppDiscovery = planOcppDiscovery;
33
34
  exports.OCPP_NATIVE_CONTRACT = 'nexowatt-ocpp21-0.4-native';
@@ -163,6 +164,32 @@ function collectOcppStations(objectInput, stateInput, hostNamespace) {
163
164
  }
164
165
  return stations;
165
166
  }
167
+ /** Retained state objects do not prove that their standalone adapter still exists.
168
+ * A hosted legacy namespace is admitted only from the owning parent's current
169
+ * configuration, never from stale alive/hosted marker states. Offline configured
170
+ * adapters remain discoverable; source lifecycle is separate from station health. */
171
+ function filterOcppDiscoverySources(stations, sourceInput, hostNamespace) {
172
+ const source = record(sourceInput);
173
+ const rows = record(source.instances).rows;
174
+ if (!Array.isArray(rows) || rows.length > MAX_STATIONS)
175
+ throw fail('EOS_OCPP_DISCOVERY_SOURCE_INVENTORY');
176
+ const namespaces = new Set();
177
+ for (const row of rows) {
178
+ const instance = record(record(row).value);
179
+ const id = text(instance._id, 120);
180
+ if (instance.type !== 'instance' || !/^system\.adapter\.ocpp21\.\d{1,8}$/.test(id)) {
181
+ throw fail('EOS_OCPP_DISCOVERY_SOURCE_INVENTORY');
182
+ }
183
+ namespaces.add(id.slice('system.adapter.'.length));
184
+ }
185
+ if (typeof hostNamespace === 'string' && /^eos-admin\.\d+$/.test(hostNamespace)) {
186
+ namespaces.add(`${hostNamespace}.ocpp`);
187
+ const hosted = text(source.hostedNamespace, 120);
188
+ if (/^ocpp21\.\d{1,8}$/.test(hosted))
189
+ namespaces.add(hosted);
190
+ }
191
+ return stations.filter(station => namespaces.has(station.adapterInstance));
192
+ }
166
193
  function rootsOf(row) {
167
194
  return [...new Set([...ID_FIELDS.map(key => ocppStationRoot(row[key])), ocppStationRoot(record(row.ocppDiscovery).stationRoot)].filter(Boolean))];
168
195
  }
@@ -357,10 +384,14 @@ class OcppAutoDiscovery {
357
384
  return;
358
385
  }
359
386
  try {
360
- const [objects, states] = await Promise.all([this.readBounded(this.options.readObjects()), this.readBounded(this.options.readMetadata())]);
387
+ const [objects, states, sources] = await Promise.all([this.readBounded(this.options.readObjects()),
388
+ this.readBounded(this.options.readMetadata()),
389
+ this.options.readSources ? this.readBounded(this.options.readSources()) : Promise.resolve(undefined)]);
361
390
  if (this.stopped || !this.options.canRun())
362
391
  return;
363
- const stations = collectOcppStations(objects, states, this.options.hostNamespace);
392
+ const collected = collectOcppStations(objects, states, this.options.hostNamespace);
393
+ const stations = this.options.readSources
394
+ ? filterOcppDiscoverySources(collected, sources, this.options.hostNamespace) : collected;
364
395
  const plan = await this.options.reconcile(stations);
365
396
  if (this.stopped)
366
397
  return;