@nodefony/studio 10.0.0-alpha.6 → 10.0.0-alpha.8

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 (169) hide show
  1. package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/decorate.js +1 -1
  2. package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/decorateMetadata.js +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/decorateParam.js +1 -1
  4. package/dist/frontend/assets/{Accordion-C9IINbNl.js → Accordion-BZratQ5I.js} +1 -1
  5. package/dist/frontend/assets/{ActionsLiveGraph-Do_UHAiS.js → ActionsLiveGraph-XrF4dBJH.js} +1 -1
  6. package/dist/frontend/assets/{ApiKeys-BpeOM6zu.js → ApiKeys-Bcrxjcfz.js} +2 -2
  7. package/dist/frontend/assets/{ArchitectureLiveGraph-wJ58pSKK.js → ArchitectureLiveGraph-DFHtvAox.js} +1 -1
  8. package/dist/frontend/assets/{Audit-C4YFzQRy.js → Audit-BJwdii8i.js} +1 -1
  9. package/dist/frontend/assets/{BackplaneLiveGraph-ChvZZWdo.js → BackplaneLiveGraph-BMpvFXRW.js} +1 -1
  10. package/dist/frontend/assets/{Breadcrumbs-4bv1GHWO.js → Breadcrumbs-YIw_WVM5.js} +1 -1
  11. package/dist/frontend/assets/{BrickStoreChip-BtiG99lz.js → BrickStoreChip-CoCfESC2.js} +1 -1
  12. package/dist/frontend/assets/{Chat-DjbG7eSv.js → Chat-_ZDG8n7S.js} +1 -1
  13. package/dist/frontend/assets/{Chip-DUBEzfSp.js → Chip-DVZYQhdH.js} +1 -1
  14. package/dist/frontend/assets/{Cluster-C_TSC_3_.js → Cluster-ZlNV3WC0.js} +1 -1
  15. package/dist/frontend/assets/{Collapse-BdzfO7PU.js → Collapse-BZxw8zmw.js} +1 -1
  16. package/dist/frontend/assets/{ConfigPage-Da8SVX0R.js → ConfigPage-CuIKar0T.js} +1 -1
  17. package/dist/frontend/assets/{ConnectorCard-DOKtRiVP.js → ConnectorCard-rSwtCZFu.js} +1 -1
  18. package/dist/frontend/assets/{Create-vyihNeeE.js → Create-B4_XnFjp.js} +2 -2
  19. package/dist/frontend/assets/{DashboardSupervision-CxSpNAsK.js → DashboardSupervision-ogJPDjon.js} +1 -1
  20. package/dist/frontend/assets/{Database-D0AiIyrs.js → Database-CBJF2zmF.js} +1 -1
  21. package/dist/frontend/assets/{DbLogo-B4TwNH6H.js → DbLogo-odCHhQZM.js} +1 -1
  22. package/dist/frontend/assets/{Documentation-CmIZeRoB.js → Documentation-BPxNaAjQ.js} +1 -1
  23. package/dist/frontend/assets/{FanOutLiveGraph-JTYLv77d.js → FanOutLiveGraph-C34ysvYA.js} +1 -1
  24. package/dist/frontend/assets/{Firewall-DHvfx-wn.js → Firewall-DR1gfzdX.js} +1 -1
  25. package/dist/frontend/assets/{IconAdjustments-B042o6Le.js → IconAdjustments-BoboURIj.js} +1 -1
  26. package/dist/frontend/assets/{IconAdjustmentsAlt-BmgZVo5M.js → IconAdjustmentsAlt-B7iftM9z.js} +1 -1
  27. package/dist/frontend/assets/{IconAdjustmentsHorizontal-BIF-EgYG.js → IconAdjustmentsHorizontal-7IiBbPem.js} +1 -1
  28. package/dist/frontend/assets/{IconAffiliate-PkjISh3s.js → IconAffiliate-BDcNyaq_.js} +1 -1
  29. package/dist/frontend/assets/{IconApps-2nW1Qtkd.js → IconApps-7aIl1P4i.js} +1 -1
  30. package/dist/frontend/assets/{IconArchive-CyeHZASU.js → IconArchive-B4MbH2D6.js} +1 -1
  31. package/dist/frontend/assets/{IconArrowDown-CRJ1x8hy.js → IconArrowDown-5CK-FwRl.js} +1 -1
  32. package/dist/frontend/assets/{IconArrowLeft-7ehg9XYP.js → IconArrowLeft-CGbdeI78.js} +1 -1
  33. package/dist/frontend/assets/{IconArrowUp-CWUGvcnj.js → IconArrowUp-OUaF7Sbz.js} +1 -1
  34. package/dist/frontend/assets/IconArrowsExchange-BaNV8SFD.js +1 -0
  35. package/dist/frontend/assets/{IconArrowsSplit2-D6oEboxp.js → IconArrowsSplit2-C6G8tQXY.js} +1 -1
  36. package/dist/frontend/assets/IconBan-sHfiqzWA.js +1 -0
  37. package/dist/frontend/assets/{IconBook-CFhZJJ0F.js → IconBook-NYou6bAm.js} +1 -1
  38. package/dist/frontend/assets/{IconCircleCheck-vTUIJ1YM.js → IconCircleCheck-LdYSHGNV.js} +1 -1
  39. package/dist/frontend/assets/{IconCircleDot-Cw7O7RFw.js → IconCircleDot-DDZDGUv7.js} +1 -1
  40. package/dist/frontend/assets/IconCircuitResistor-u8z8rLke.js +1 -0
  41. package/dist/frontend/assets/{IconCode-Bp8-3f_0.js → IconCode-8A2Vc3mV.js} +1 -1
  42. package/dist/frontend/assets/{IconDeviceDesktop-CI8a1zbE.js → IconDeviceDesktop-DQMJAeIX.js} +1 -1
  43. package/dist/frontend/assets/{IconDots-DNiAUhiO.js → IconDots-DHONC_eR.js} +1 -1
  44. package/dist/frontend/assets/{IconDownload-CTLQCk0R.js → IconDownload-CskHkiEP.js} +1 -1
  45. package/dist/frontend/assets/{IconEye-D80bz7c_.js → IconEye-CmFgWb6A.js} +1 -1
  46. package/dist/frontend/assets/{IconFile-vc7KG4Rf.js → IconFile-DUvYig0W.js} +1 -1
  47. package/dist/frontend/assets/{IconFolder-DGoYanMO.js → IconFolder-BeoB9Wy3.js} +1 -1
  48. package/dist/frontend/assets/{IconGitBranch-ClVGboyH.js → IconGitBranch-k-8cnuLS.js} +1 -1
  49. package/dist/frontend/assets/{IconHeartRateMonitor-upfL_t5M.js → IconHeartRateMonitor-D5gSRuQz.js} +1 -1
  50. package/dist/frontend/assets/{IconHelpCircle-BoSiqXIY.js → IconHelpCircle-Cp-YIdsR.js} +1 -1
  51. package/dist/frontend/assets/{IconLayoutGrid-B6L6txBS.js → IconLayoutGrid-DiIAz7S1.js} +1 -1
  52. package/dist/frontend/assets/{IconNetwork-BakBlNUv.js → IconNetwork-DJdaK61I.js} +1 -1
  53. package/dist/frontend/assets/{IconPackages-DZHwNbfL.js → IconPackages-a59KQceL.js} +1 -1
  54. package/dist/frontend/assets/{IconPencil-B-pO6nfU.js → IconPencil-DvkftTgJ.js} +1 -1
  55. package/dist/frontend/assets/{IconPlayerPause-CmDKLlIs.js → IconPlayerPause-C9Eve-DV.js} +1 -1
  56. package/dist/frontend/assets/IconPlayerPlay-Cl4K6MPS.js +1 -0
  57. package/dist/frontend/assets/IconPlus-D8uJUhjM.js +1 -0
  58. package/dist/frontend/assets/{IconPuzzle-CslQPiCN.js → IconPuzzle-AO4L5bjR.js} +1 -1
  59. package/dist/frontend/assets/{IconRecycle-DABPgUVk.js → IconRecycle-WAqlmRWN.js} +1 -1
  60. package/dist/frontend/assets/{IconSend-MV_iN0wK.js → IconSend-BPiCAzpg.js} +1 -1
  61. package/dist/frontend/assets/{IconServer2-CRutQdmm.js → IconServer2-rVjD6-MC.js} +1 -1
  62. package/dist/frontend/assets/{IconShieldOff-Iriep3yk.js → IconShieldOff-GF00f0aB.js} +1 -1
  63. package/dist/frontend/assets/{IconSitemap-CqkVZPOt.js → IconSitemap-BnfvAqMK.js} +1 -1
  64. package/dist/frontend/assets/{IconStack2-DA4YUbMC.js → IconStack2-BRfnzl41.js} +1 -1
  65. package/dist/frontend/assets/{IconTerminal2-CWTGfiEn.js → IconTerminal2-3V__c4-m.js} +1 -1
  66. package/dist/frontend/assets/{IconUserOff-D99nKohi.js → IconUserOff-DFt0HHh9.js} +1 -1
  67. package/dist/frontend/assets/{IconWorld-BRgStXMv.js → IconWorld-C4h6SKIG.js} +1 -1
  68. package/dist/frontend/assets/{List-Da8UU6lg.js → List-ERCyqEPq.js} +1 -1
  69. package/dist/frontend/assets/{LogVisuals-BGUY8-_R.js → LogVisuals-BwL1Txqf.js} +1 -1
  70. package/dist/frontend/assets/{Logs-DZCQkQXw.js → Logs-st_U3Pr2.js} +1 -1
  71. package/dist/frontend/assets/{Migrations-Bun03S4a.js → Migrations-D4SSjDpM.js} +1 -1
  72. package/dist/frontend/assets/{ModuleDetail-DsZ7jPqr.js → ModuleDetail-cImsLGSy.js} +1 -1
  73. package/dist/frontend/assets/{Modules-C7G10G7J.js → Modules-Bef_ZNzn.js} +1 -1
  74. package/dist/frontend/assets/{OrmEntity-Drw9PhAO.js → OrmEntity-zs0NzVc9.js} +1 -1
  75. package/dist/frontend/assets/{OrmOverview-BzTzmCFr.js → OrmOverview-CPchV-_w.js} +1 -1
  76. package/dist/frontend/assets/{OrmWorker-D6m8aLoC.js → OrmWorker-QEbxTZ7w.js} +1 -1
  77. package/dist/frontend/assets/{Playground-ku4WxRVF.js → Playground-DsosA7Yd.js} +1 -1
  78. package/dist/frontend/assets/{ProbesLiveGraph-LGl0Vt3c.js → ProbesLiveGraph-CpZWxaAZ.js} +1 -1
  79. package/dist/frontend/assets/{Profile-CIC1v8ye.js → Profile-NdEGmZYV.js} +1 -1
  80. package/dist/frontend/assets/{ProfileFields-BA4k5xVH.js → ProfileFields-D6_5Er1B.js} +1 -1
  81. package/dist/frontend/assets/{Progress-ctKVb0y-.js → Progress-BxSLYIgD.js} +1 -1
  82. package/dist/frontend/assets/{ProtocoleLiveGraph-Ct7VbuWa.js → ProtocoleLiveGraph-BwQBzE9W.js} +1 -1
  83. package/dist/frontend/assets/{RealtimeConsole-CUwlc-WS.js → RealtimeConsole-N11Uie_n.js} +1 -1
  84. package/dist/frontend/assets/{RingProgress-CHMtGKds.js → RingProgress-CdgTmA2j.js} +1 -1
  85. package/dist/frontend/assets/{Roadmap-yZY1WJHu.js → Roadmap-By6HzZwV.js} +1 -1
  86. package/dist/frontend/assets/{RoleSwitch-DzEHDHLA.js → RoleSwitch-B83joCHG.js} +1 -1
  87. package/dist/frontend/assets/Roles-CMIEqZIJ.js +1 -0
  88. package/dist/frontend/assets/{RoutesView-E8ca6Zft.js → RoutesView-D7345bN_.js} +1 -1
  89. package/dist/frontend/assets/{Runtime-DhpEGVfL.js → Runtime-C312wEbD.js} +1 -1
  90. package/dist/frontend/assets/{Sessions-CXTgHqDM.js → Sessions-HOFd6af3.js} +1 -1
  91. package/dist/frontend/assets/{Skeleton-DybgHU9E.js → Skeleton-coYonGf_.js} +1 -1
  92. package/dist/frontend/assets/{Slider-BoAxGS1L.js → Slider-Ds-U37rL.js} +1 -1
  93. package/dist/frontend/assets/{StoresView-DoWAf-jh.js → StoresView-FHdXwtpS.js} +1 -1
  94. package/dist/frontend/assets/{System-DDEZt9W5.js → System-CbN-EOSC.js} +1 -1
  95. package/dist/frontend/assets/{TagsInput-CvH7XFRB.js → TagsInput-COivjma9.js} +1 -1
  96. package/dist/frontend/assets/{Textarea-C4dBiWye.js → Textarea-9n-r0dhs.js} +1 -1
  97. package/dist/frontend/assets/{TraceView-D8fl7TGg.js → TraceView-DNjPJJ7p.js} +1 -1
  98. package/dist/frontend/assets/{Twin-B9_yDKs5.js → Twin-BfFLhE0A.js} +1 -1
  99. package/dist/frontend/assets/{UserProfile-y8I6wSTh.js → UserProfile-BBeksYzW.js} +1 -1
  100. package/dist/frontend/assets/Users-B4mV1aqm.js +1 -0
  101. package/dist/frontend/assets/{Webhooks-L-17Yi5A.js → Webhooks-Cl8PKA4v.js} +1 -1
  102. package/dist/frontend/assets/{Workspace-BbU7y0F1.js → Workspace-Drv35J6V.js} +1 -1
  103. package/dist/frontend/assets/{abnfDiagram-O67JEVCF-B8pam94f.js → abnfDiagram-O67JEVCF-eVuPuZ-l.js} +1 -1
  104. package/dist/frontend/assets/{apiKeysModel-C53i4AfO.js → apiKeysModel-Bg3XAZ1j.js} +1 -1
  105. package/dist/frontend/assets/{architectureDiagram-NJMV4G6O-6gmizkIP.js → architectureDiagram-NJMV4G6O-CowFfXXj.js} +1 -1
  106. package/dist/frontend/assets/{auditFormat-lxo0qiYp.js → auditFormat-n5lhA4OX.js} +1 -1
  107. package/dist/frontend/assets/{auditModel-CxUfDlvX.js → auditModel-H62868Ky.js} +1 -1
  108. package/dist/frontend/assets/{chunk-3FUC2YCW-TJIJwE1t.js → chunk-3FUC2YCW-Dtc7u5wE.js} +2 -2
  109. package/dist/frontend/assets/{chunk-7M6MHVWA-DRzYiIPp.js → chunk-7M6MHVWA-lvMKwiVM.js} +1 -1
  110. package/dist/frontend/assets/{chunk-GTNCS2PH-DZtp2P9b.js → chunk-GTNCS2PH-B_uA79q-.js} +1 -1
  111. package/dist/frontend/assets/{classDiagram-v2-NBCMYWYE-BtmMp0Pl.js → classDiagram-v2-NBCMYWYE-BNpOjB-G.js} +1 -1
  112. package/dist/frontend/assets/{configModel-vPcx16aO.js → configModel-VUzK2g6s.js} +1 -1
  113. package/dist/frontend/assets/{cynefinDiagram-VND7K2PF-DAC6UAuW.js → cynefinDiagram-VND7K2PF-BlomyrQB.js} +1 -1
  114. package/dist/frontend/assets/{dagre-6A5THRUB-CO85D-6G.js → dagre-6A5THRUB-BWzsXnLW.js} +1 -1
  115. package/dist/frontend/assets/{diagram-22UHCM2B-BOX3CQqS.js → diagram-22UHCM2B-CVjDv9s9.js} +1 -1
  116. package/dist/frontend/assets/{diagram-3UASUU5V-CxvH61Hb.js → diagram-3UASUU5V-DVDv1FGj.js} +1 -1
  117. package/dist/frontend/assets/{diagram-CDSNMT55-BKs0JPfD.js → diagram-CDSNMT55-Bp8iVPRM.js} +1 -1
  118. package/dist/frontend/assets/{diagram-MLGK6HIB-D9BjufDu.js → diagram-MLGK6HIB-tvdCXGvD.js} +1 -1
  119. package/dist/frontend/assets/{diagram-MPIPVDR6-CAjYxIoY.js → diagram-MPIPVDR6-BhXeqdXO.js} +1 -1
  120. package/dist/frontend/assets/{ebnfDiagram-ZINNZB2B-DyFbyGL9.js → ebnfDiagram-ZINNZB2B-DA_f0Sur.js} +1 -1
  121. package/dist/frontend/assets/{elk-276RUBZZ-De_z70FL.js → elk-276RUBZZ-D-2pxfms.js} +1 -1
  122. package/dist/frontend/assets/{erDiagram-OPXOYQCR-N61HA9T0.js → erDiagram-OPXOYQCR-IXwXFRE7.js} +1 -1
  123. package/dist/frontend/assets/{eventFlow-Dtt06FYi.js → eventFlow-Cm0aJnfI.js} +1 -1
  124. package/dist/frontend/assets/{flowDiagram-KWPJA3E3-BubqL8R4.js → flowDiagram-KWPJA3E3-BwS9Cpl0.js} +1 -1
  125. package/dist/frontend/assets/hooks-DMHLQNUe.js +1 -0
  126. package/dist/frontend/assets/index-BwkdF4pp.js +28 -0
  127. package/dist/frontend/assets/{infoDiagram-VRGFBTTK-jzkh5hxl.js → infoDiagram-VRGFBTTK-D4h7Bn9y.js} +1 -1
  128. package/dist/frontend/assets/{ishikawaDiagram-OU5B5YK6-C-80YGTU.js → ishikawaDiagram-OU5B5YK6-B08gE1Ts.js} +1 -1
  129. package/dist/frontend/assets/{kanban-definition-PNTS6WVX-CNUWj3n8.js → kanban-definition-PNTS6WVX-BRAjenaA.js} +1 -1
  130. package/dist/frontend/assets/{mermaid.core-bi0KWxzD.js → mermaid.core-B83stVmA.js} +4 -4
  131. package/dist/frontend/assets/{mindmap-definition-NLK3R4M7-BpydpKOL.js → mindmap-definition-NLK3R4M7-DVQlIVXh.js} +1 -1
  132. package/dist/frontend/assets/{pegDiagram-GJSIUBJH-B8r97QN1.js → pegDiagram-GJSIUBJH-BDiYV_0C.js} +1 -1
  133. package/dist/frontend/assets/{pieDiagram-5QR66LMP-kyKeYg-Q.js → pieDiagram-5QR66LMP-DauEH_sI.js} +1 -1
  134. package/dist/frontend/assets/{profileVisuals-BE_m4Ey1.js → profileVisuals-CdDZ-G5o.js} +1 -1
  135. package/dist/frontend/assets/{railroadDiagram-XR7U4H2S-UqD2ngrA.js → railroadDiagram-XR7U4H2S-VGu1Om2v.js} +1 -1
  136. package/dist/frontend/assets/{requirementDiagram-PLB6GJNP-BCf1UDbg.js → requirementDiagram-PLB6GJNP-BIeT2fsT.js} +1 -1
  137. package/dist/frontend/assets/rolesModel-BqkpwhLp.js +1 -0
  138. package/dist/frontend/assets/{sequenceDiagram-PO4LG4MO-BtmJQCMb.js → sequenceDiagram-PO4LG4MO-xFeJgcfs.js} +1 -1
  139. package/dist/frontend/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
  140. package/dist/frontend/assets/{stateDiagram-v2-GCMORJYK-KOfXhGJl.js → stateDiagram-v2-GCMORJYK-Zn0sg5eC.js} +1 -1
  141. package/dist/frontend/assets/stores-fG-e-IP-.js +1 -0
  142. package/dist/frontend/assets/{swimlanes-2SLR337P-CbhPYBmu.js → swimlanes-2SLR337P-BtnI5Ts1.js} +1 -1
  143. package/dist/frontend/assets/{swimlanesDiagram-TC7HE7FX-DERYN-sv.js → swimlanesDiagram-TC7HE7FX-DmKuTkpK.js} +1 -1
  144. package/dist/frontend/assets/{timeline-definition-EJHVYXUP-DyFLwqcy.js → timeline-definition-EJHVYXUP-CAwjjT68.js} +1 -1
  145. package/dist/frontend/assets/{ui-Dy8y0zPl.js → ui-BlRFVRfl.js} +29 -29
  146. package/dist/frontend/assets/{useBlockSource-DBTXt3Bd.js → useBlockSource-IO5xGNWM.js} +1 -1
  147. package/dist/frontend/assets/{useSocketLiveData-n5suTFQT.js → useSocketLiveData-z0fKymfg.js} +1 -1
  148. package/dist/frontend/assets/{usecaseDiagram-POWQR4AR-DrNt0E-k.js → usecaseDiagram-POWQR4AR-Bk94oIx0.js} +1 -1
  149. package/dist/frontend/assets/{usersFormat-C33NWJaO.js → usersFormat-9M7K71Og.js} +1 -1
  150. package/dist/frontend/assets/{vennDiagram-UO4OBE2U-CdTyOHVa.js → vennDiagram-UO4OBE2U-_ylubyXd.js} +1 -1
  151. package/dist/frontend/assets/{wardleyDiagram-VNRHLVJA-D8xJmOUJ.js → wardleyDiagram-VNRHLVJA-BAnG4zJi.js} +1 -1
  152. package/dist/frontend/assets/{xychartDiagram-PMCCYNJV-BwyKdA55.js → xychartDiagram-PMCCYNJV-Cl7hfbtt.js} +1 -1
  153. package/dist/frontend/index.html +11 -11
  154. package/dist/index.js +2 -2
  155. package/dist/nodefony/controller/StudioController.js +2 -2
  156. package/dist/nodefony/controller/StudioCreateController.js +3 -3
  157. package/dist/nodefony/controller/StudioRealtimeController.js +2 -2
  158. package/package.json +17 -17
  159. package/dist/frontend/assets/IconArrowsExchange-C0a0grm7.js +0 -1
  160. package/dist/frontend/assets/IconBan-Qgw-SmZw.js +0 -1
  161. package/dist/frontend/assets/IconCircuitResistor-DFVNZSyj.js +0 -1
  162. package/dist/frontend/assets/IconPlayerPlay-CYA71UO2.js +0 -1
  163. package/dist/frontend/assets/IconPlus-Dh1SmA8Q.js +0 -1
  164. package/dist/frontend/assets/Roles-hy1gMeEh.js +0 -1
  165. package/dist/frontend/assets/Users-DLPi2ne7.js +0 -1
  166. package/dist/frontend/assets/hooks-C4XxBzBx.js +0 -1
  167. package/dist/frontend/assets/index-wfxUl83u.js +0 -28
  168. package/dist/frontend/assets/sizeCapture-INFHLROL-B0uUizjq.js +0 -1
  169. package/dist/frontend/assets/stores-DIccV-P5.js +0 -1
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{$ as t,$t as n,Bt as r,Et as i,Fn as a,Gt as o,H as s,Hn as c,J as l,Kt as u,L as d,Lt as f,M as p,Mn as m,N as h,Pn as g,Q as _,Rt as v,Ut as y,Vt as b,W as ee,Wn as x,an as S,b as C,ct as w,di as T,ei as te,et as E,gt as D,it as O,n as k,nn as A,o as ne,on as j,or as re,p as ie,q as ae,s as oe,sn as M,tn as N,ut as se,vn as P,wt as F,yn as I,z as L,zn as R,zt as ce}from"./ui-Dy8y0zPl.js";import{t as le}from"./Progress-ctKVb0y-.js";import{t as z}from"./RingProgress-CHMtGKds.js";import{t as B}from"./Skeleton-DybgHU9E.js";import{c as V,j as H}from"./stores-DIccV-P5.js";import{a as ue,c as de}from"./hooks-C4XxBzBx.js";import{t as fe}from"./IconAffiliate-PkjISh3s.js";import{n as pe,t as me}from"./IconPackages-DZHwNbfL.js";import{t as he}from"./IconArrowLeft-7ehg9XYP.js";import{t as ge}from"./IconBook-CFhZJJ0F.js";import{t as _e}from"./IconCircleDot-Cw7O7RFw.js";import{t as ve}from"./IconCode-Bp8-3f_0.js";import{t as U}from"./IconPlayerPlay-CYA71UO2.js";import{t as ye}from"./IconPuzzle-CslQPiCN.js";import{t as be}from"./IconSitemap-CqkVZPOt.js";import{t as xe}from"./IconStack2-DA4YUbMC.js";import{J as W,K as Se,dt as Ce,gt as G,j as we,k as Te,nt as Ee,pt as K,vt as q}from"./index-wfxUl83u.js";import{t as De}from"./dayjs.min-G0uPySEd.js";import{t as J}from"./RoleSwitch-DzEHDHLA.js";import{i as Oe,n as ke,r as Ae}from"./configModel-vPcx16aO.js";var je=i(`outline`,`hexagon`,`Hexagon`,[[`path`,{d:`M19.875 6.27a2.225 2.225 0 0 1 1.125 1.948v7.284c0 .809 -.443 1.555 -1.158 1.948l-6.75 4.27a2.269 2.269 0 0 1 -2.184 0l-6.75 -4.27a2.225 2.225 0 0 1 -1.158 -1.948v-7.285c0 -.809 .443 -1.554 1.158 -1.947l6.75 -3.98a2.33 2.33 0 0 1 2.25 0l6.75 3.98h-.033`,key:`svg-0`}]]),Me=i(`outline`,`package`,`Package`,[[`path`,{d:`M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5`,key:`svg-0`}],[`path`,{d:`M12 12l8 -4.5`,key:`svg-1`}],[`path`,{d:`M12 12l0 9`,key:`svg-2`}],[`path`,{d:`M12 12l-8 -4.5`,key:`svg-3`}],[`path`,{d:`M16 5.25l-8 4.5`,key:`svg-4`}]]),Y=e(T(),1),X=re(),Ne={app:{label:`app`,color:`grape`},env:{label:`env`,color:`teal`},runtime:{label:`runtime`,color:`cyan`}};function Pe({value:e,label:t,hint:n,color:r}){return(0,X.jsxs)(m,{gap:8,wrap:`nowrap`,children:[(0,X.jsx)(P,{fz:22,fw:700,lh:1,c:e>0?r:`dimmed`,children:e}),(0,X.jsxs)(m,{gap:4,wrap:`nowrap`,children:[(0,X.jsx)(P,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:700,children:t}),n]})]})}function Fe({value:e}){return(0,X.jsxs)(m,{gap:4,wrap:`nowrap`,children:[(0,X.jsx)(A,{style:{fontSize:11},children:e}),(0,X.jsx)(N,{value:e,timeout:1500,children:({copied:t,copy:n})=>(0,X.jsx)(u,{label:t?`Copié`:`Copier`,withArrow:!0,children:(0,X.jsx)(g,{size:`sm`,variant:`subtle`,color:t?`teal`:`gray`,"aria-label":`Copier ${e}`,onClick:n,children:t?(0,X.jsx)(D,{size:14}):(0,X.jsx)(se,{size:14})})})})]})}var Ie=[{key:`field`,header:`Réglage`,sortable:!0,filterable:!0,value:e=>e.field,render:e=>(0,X.jsx)(A,{style:{fontSize:12},children:e.field})},{key:`source`,header:`Provenance`,sortable:!0,filterable:!0,filterType:`select`,filterOptions:Object.keys(Ne),value:e=>e.source,render:e=>(0,X.jsx)(M,{size:`sm`,variant:`light`,color:Ne[e.source].color,tt:`none`,children:Ne[e.source].label}),size:130},{key:`where`,header:`Surchargé par / recette`,sortable:!0,filterable:!0,value:e=>e.where,render:e=>e.source===`runtime`?(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:e.where}):(0,X.jsx)(Fe,{value:e.overrideKey})}];function Le({overrides:e}){return(0,X.jsxs)(R,{withBorder:!0,p:`md`,radius:`md`,children:[(0,X.jsxs)(m,{gap:6,mb:`sm`,children:[(0,X.jsx)(P,{fw:600,size:`sm`,children:`Surcharges actives`}),(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[e.length,` réglage(s) ≠ défaut`]}),(0,X.jsx)(s,{title:`Surcharges actives`,summary:`Les réglages de ce module qui DIFFÈRENT du défaut du framework — d'où vient la valeur (app/env/runtime) et la recette 12-factor pour la piloter. C'est l'identité de ce module dans CE déploiement.`})]}),(0,X.jsx)(k,{mode:`client`,data:e,columns:Ie,getRowId:e=>e.field,initialSort:{key:`field`,dir:`asc`},searchable:!0,searchPlaceholder:`Rechercher un réglage…`,emptyMessage:`Aucune surcharge : ce module tourne entièrement sur les défauts du framework.`})]})}function Re({module:e,seg:t,schema:n,sections:r,editable:i=!1,onEdit:a}){let o=(0,Y.useMemo)(()=>ke(r,t),[r,t]),{live:c,secrets:l}=(0,Y.useMemo)(()=>{let e=0,t=0;for(let n of r)for(let r of n.fields)r.mutability===`live`&&e++,r.secret&&t++;return{live:e,secrets:t}},[r]);return(0,X.jsxs)(y,{gap:`lg`,children:[(0,X.jsx)(S,{withBorder:!0,radius:`md`,p:`md`,children:(0,X.jsxs)(m,{gap:`xl`,wrap:`wrap`,children:[(0,X.jsx)(Pe,{value:o.length,label:`Surcharges`,color:`grape`,hint:(0,X.jsx)(s,{title:`Surcharges`,summary:`Réglages dont la valeur effective diffère du défaut du framework (app, env, ou édition à chaud). 0 = ce module tourne en config stock.`,width:260})}),(0,X.jsx)(Pe,{value:c,label:`À chaud (dev)`,color:`teal`,hint:(0,X.jsx)(s,{title:`Éditables à chaud`,summary:`Réglages relus à chaque requête (ou recalculés via un seam) : modifiables en développement sans redémarrage, figés en production.`,width:280})}),(0,X.jsx)(Pe,{value:l,label:`Secrets`,color:`orange`,hint:(0,X.jsx)(s,{title:`Secrets`,summary:`Champs sensibles masqués ici et rédigés dans les logs (redaction côté serveur). Jamais éditables via l'API (recette *_FILE).`,width:260})})]})}),o.length>0?(0,X.jsx)(Le,{overrides:o}):(0,X.jsx)(ee,{title:`Module en configuration par défaut`,summary:`Aucun réglage ne diffère du défaut du framework — rien n'est surchargé par l'app, l'environnement ni une édition à chaud. État sain (config stock).`,children:(0,X.jsx)(M,{variant:`light`,color:`gray`,tt:`none`,children:`aucune surcharge`})}),(0,X.jsx)(oe,{module:e,schema:n,sections:r,editable:i,onEdit:a})]})}var ze=e(De(),1),Be=64,Ve={class:`indigo`,interface:`cyan`,type:`grape`,function:`teal`,enum:`orange`};function He(e){switch(e){case`class`:return(0,X.jsx)(Ee,{size:20});case`interface`:return(0,X.jsx)(je,{size:20});case`type`:case`enum`:return(0,X.jsx)(_e,{size:20});default:return(0,X.jsx)(ve,{size:20})}}function Ue({symbols:e,height:t=520}){let{nodes:n,edges:r,total:i,truncated:a}=(0,Y.useMemo)(()=>{let t=new Map(e.map(e=>[e.name,e])),n=[];for(let t of e){t.extends&&n.push({source:t.name,target:t.extends,label:`extends`,color:`indigo`});for(let e of t.implements??[])n.push({source:t.name,target:e,label:`implements`,color:`cyan`,dashed:!0})}let r=new Set;n.forEach(e=>{r.add(e.source),r.add(e.target)});let i=[...r],a=i.length>Be,o=new Set(i.slice(0,Be)),s=n.filter(e=>o.has(e.source)&&o.has(e.target));return{nodes:[...o].map(e=>{let n=t.get(e),r=!n,i=n?.kind??`externe`,a=r?`gray`:Ve[i]??`blue`;return{id:e,data:{label:e,sub:r?`externe (hors module)`:i,icon:He(i),color:a,emphasis:!!n?.decorators?.length}}}),edges:s,total:i.length,truncated:a}},[e]);return r.length?(0,X.jsxs)(y,{gap:`xs`,children:[(0,X.jsxs)(m,{gap:`sm`,children:[(0,X.jsxs)(P,{size:`sm`,c:`dimmed`,children:[`Héritage & implémentation — `,n.length,` symbole(s),`,` `,r.length,` relation(s).`]}),(0,X.jsx)(M,{variant:`dot`,color:`indigo`,children:`extends`}),(0,X.jsx)(M,{variant:`dot`,color:`cyan`,children:`implements`}),(0,X.jsx)(M,{variant:`dot`,color:`gray`,children:`externe`}),a&&(0,X.jsxs)(M,{color:`orange`,variant:`light`,children:[`tronqué à `,Be,`/`,i]})]}),(0,X.jsx)(C,{nodes:n,edges:r,dir:`LR`,height:t,ariaLabel:`Graphe de classes du module (extends / implements)`})]}):(0,X.jsxs)(I,{color:`gray`,variant:`light`,icon:(0,X.jsx)(O,{size:18}),children:[`Aucune relation `,(0,X.jsx)(`b`,{children:`extends`}),`/`,(0,X.jsx)(`b`,{children:`implements`}),` détectée dans ce module — rien à représenter en graphe de classes. (Le graphe se nourrit du même`,` `,(0,X.jsx)(`code`,{children:`symbols.json`}),` que l'onglet API.)`]})}var We={GET:`teal`,POST:`blue`,PUT:`yellow`,PATCH:`grape`,DELETE:`red`,WEBSOCKET:`cyan`,ANY:`gray`},Ge={stable:`teal`,draft:`gray`,deprecated:`red`},Ke={class:`orange`,interface:`blue`,function:`teal`,type:`grape`,enum:`yellow`},qe=[{key:`methods`,header:`Méthodes`,filterable:!0,filterType:`multiselect`,value:e=>e.methods.join(`,`),render:e=>(0,X.jsx)(m,{gap:4,children:e.methods.map(e=>(0,X.jsx)(M,{size:`xs`,color:We[e]??`gray`,variant:`light`,children:e},e))})},{key:`path`,header:`Chemin`,sortable:!0,value:e=>e.path??``,render:e=>(0,X.jsx)(A,{children:e.path})},{key:`controller`,header:`Controller`,sortable:!0,value:e=>e.controller??``,render:e=>(0,X.jsx)(P,{size:`xs`,children:e.controller??`—`})},{key:`action`,header:`Action`,sortable:!0,value:e=>e.action??``,render:e=>(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:e.action??`—`})}],Je=[{key:`kind`,header:`Kind`,size:110,sortable:!0,filterable:!0,filterType:`multiselect`,value:e=>e.kind,render:e=>(0,X.jsx)(M,{size:`xs`,variant:`light`,color:Ke[e.kind]??`gray`,children:e.kind})},{key:`name`,header:`Nom`,sortable:!0,value:e=>e.name,render:e=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{children:e.name}),e.extends&&(0,X.jsxs)(P,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:[`extends `,e.extends]})]})},{key:`description`,header:`Description`,value:e=>e.description??``,render:e=>(0,X.jsx)(P,{size:`xs`,c:e.description?void 0:`dimmed`,children:e.description??`—`})}],Ye=[{key:`file`,header:`Fichier`,sortable:!0,value:e=>e.file,render:e=>(0,X.jsx)(A,{children:e.file})},{key:`lines`,header:`Lines`,sortable:!0,size:190,value:e=>e.lines,render:e=>(0,X.jsxs)(m,{gap:`xs`,wrap:`nowrap`,children:[(0,X.jsx)(le,{value:e.lines,color:Q(e.lines),w:110,size:`sm`}),(0,X.jsxs)(P,{size:`xs`,w:34,ta:`right`,children:[Math.round(e.lines),`%`]})]})},{key:`functions`,header:`Funcs`,sortable:!0,size:80,value:e=>e.functions,render:e=>(0,X.jsxs)(P,{size:`xs`,c:Q(e.functions),children:[Math.round(e.functions),`%`]})},{key:`branches`,header:`Branches`,sortable:!0,size:90,value:e=>e.branches,render:e=>(0,X.jsxs)(P,{size:`xs`,c:Q(e.branches),children:[Math.round(e.branches),`%`]})}];function Xe(e){if(e instanceof H){let t=e.body,n=t?.message??t?.error??e.message;return t?.recipe?`${n} — recette : ${t.recipe}`:n}return e instanceof Error?e.message:String(e)}var Ze=q(()=>{let{name:e=``}=de(),t=ue(),i=V(),[a,o]=(0,Y.useState)(null),[s,u]=(0,Y.useState)([]),[p,h]=(0,Y.useState)([]),[g,ee]=(0,Y.useState)([]),[C,w]=(0,Y.useState)({available:!1}),[T,te]=(0,Y.useState)({files:[],devMode:!1}),[E,D]=(0,Y.useState)(null),[re,oe]=(0,Y.useState)(!0),[N]=Ce(),[se,R]=(0,Y.useState)(()=>N.get(`tab`));(0,Y.useEffect)(()=>{R(N.get(`tab`))},[e,N]),(0,Y.useEffect)(()=>{let t=!1;return oe(!0),D(null),Promise.all([i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}`),i.api.getAbsolute(`/nodefony/framework/api/routes`).catch(()=>[]),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/docs`).then(e=>e.docs??[]).catch(()=>[]),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/symbols`).then(e=>e.symbols??[]).catch(()=>[]),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/coverage`).catch(()=>({available:!1})),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/tests`).catch(()=>({files:[],devMode:!1}))]).then(([n,r,i,a,s,c])=>{t||(o(n),u(r.filter(t=>t.module===e)),h(i),ee(a),w(s),te(c))}).catch(e=>{t||D(e instanceof Error?e.message:String(e))}).finally(()=>{t||oe(!1)}),()=>{t=!0}},[i,e]);let ce=(0,Y.useCallback)(async()=>{try{let t=await i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}`);o(t)}catch{}},[i,e]),le=(0,Y.useCallback)(async(t,n)=>{try{return await i.api.patchAbsolute(`/nodefony/kernel/api/config/${encodeURIComponent(e)}`,{path:t.key,value:n}),i.notifications.notify(`success`,`${t.key} mis à jour (à chaud)`,{title:`Configuration`}),await ce(),{ok:!0}}catch(e){let t=Xe(e);return i.notifications.notify(`error`,t,{title:`Édition refusée`}),{ok:!1,error:t}}},[i,e,ce]);if(re)return(0,X.jsx)(Qe,{});if(E||!a)return(0,X.jsxs)(y,{gap:`md`,children:[(0,X.jsx)(j,{variant:`subtle`,leftSection:(0,X.jsx)(he,{size:16}),onClick:()=>t(`/nodefony/modules`),w:`fit-content`,children:`Modules`}),(0,X.jsx)(I,{color:`red`,icon:(0,X.jsx)(F,{size:16}),title:`Module introuvable`,children:E??`Aucun module "${e}".`})]});let z=p.length>0,B=g.length>0,H=C.available===!0,_e=T.files.length>0,U=a.dependencies.length>0,W=s.length>0,G=a.services.length>0,Ee=Ae(Oe(a.configSchema??null,a.config,a.provenance??null),a.seg??e),q=Ee.length?Ee:null,De=a.configSchema?`zod`:`none`,J=!!q||!!a.config&&Object.keys(a.config).length>0;return(0,X.jsx)(ae,{icon:(0,X.jsx)(v,{variant:`light`,color:e===`core`?`grape`:a.isApp?`brand`:`gray`,size:36,radius:`md`,children:e===`core`?(0,X.jsx)(xe,{size:22}):a.isApp?(0,X.jsx)(pe,{size:22}):(0,X.jsx)(ye,{size:22})}),title:e===`core`?`Nodefony Core`:a.name,subtitle:(0,X.jsxs)(m,{gap:`sm`,align:`center`,children:[a.version&&(0,X.jsxs)(M,{variant:`default`,children:[`v`,a.version]}),(0,X.jsx)(M,{variant:`light`,color:e===`core`?`grape`:a.isApp?`brand`:`gray`,children:e===`core`?`socle du framework`:a.isApp?`application`:`package`}),(0,X.jsxs)(P,{c:`dimmed`,size:`sm`,ff:`monospace`,children:[e===`core`?`@nodefony/core · `:``,a.path??`—`]})]}),actions:(0,X.jsx)(j,{variant:`subtle`,leftSection:(0,X.jsx)(he,{size:16}),onClick:()=>t(`/nodefony/modules`),children:`Modules`}),children:(0,X.jsxs)(r,{value:se??`overview`,onChange:R,children:[(0,X.jsxs)(l,{children:[(0,X.jsx)(r.Tab,{value:`overview`,leftSection:(0,X.jsx)(O,{size:16}),children:`Vue d'ensemble`}),z&&(0,X.jsx)(r.Tab,{value:`docs`,leftSection:(0,X.jsx)(ge,{size:16}),rightSection:(0,X.jsx)($,{n:p.length}),children:`Docs`}),B&&(0,X.jsx)(r.Tab,{value:`api`,leftSection:(0,X.jsx)(ve,{size:16}),rightSection:(0,X.jsx)($,{n:g.length}),children:`API`}),B&&(0,X.jsx)(r.Tab,{value:`graph`,leftSection:(0,X.jsx)(be,{size:16}),children:`Graphe`}),H&&(0,X.jsx)(r.Tab,{value:`coverage`,leftSection:(0,X.jsx)(Te,{size:16}),rightSection:(0,X.jsxs)(M,{size:`xs`,variant:`light`,color:Q(C.total?.lines??0),children:[Math.round(C.total?.lines??0),`%`]}),children:`Coverage`}),_e&&(0,X.jsx)(r.Tab,{value:`tests`,leftSection:(0,X.jsx)(Se,{size:16}),rightSection:(0,X.jsx)($,{n:T.files.length}),children:`Tests`}),U&&(0,X.jsx)(r.Tab,{value:`deps`,leftSection:(0,X.jsx)(me,{size:16}),rightSection:(0,X.jsx)($,{n:a.dependencies.length}),children:`Dépendances`}),W&&(0,X.jsx)(r.Tab,{value:`routes`,leftSection:(0,X.jsx)(we,{size:16}),rightSection:(0,X.jsx)($,{n:s.length}),children:`Routes`}),G&&(0,X.jsx)(r.Tab,{value:`services`,leftSection:(0,X.jsx)(fe,{size:16}),rightSection:(0,X.jsx)($,{n:a.services.length}),children:`Services`}),J&&(0,X.jsx)(r.Tab,{value:`config`,leftSection:(0,X.jsx)(_,{size:16}),children:`Config`})]}),(0,X.jsxs)(x,{p:`lg`,children:[(0,X.jsx)(r.Panel,{value:`overview`,children:(0,X.jsxs)(y,{gap:`lg`,children:[(0,X.jsxs)(K,{cols:{base:2,sm:3,lg:5},spacing:`md`,children:[z&&(0,X.jsx)(Z,{label:`Docs`,value:p.length,color:`cyan`,icon:(0,X.jsx)(ge,{size:22}),onClick:()=>R(`docs`)}),B&&(0,X.jsx)(Z,{label:`API`,value:g.length,color:`grape`,icon:(0,X.jsx)(ve,{size:22}),onClick:()=>R(`api`)}),H&&(0,X.jsx)(Z,{label:`Coverage`,value:`${Math.round(C.total?.lines??0)}%`,color:Q(C.total?.lines??0),icon:(0,X.jsx)(Te,{size:22}),onClick:()=>R(`coverage`)}),U&&(0,X.jsx)(Z,{label:`Dépendances`,value:a.dependencies.length,color:`orange`,icon:(0,X.jsx)(me,{size:22}),onClick:()=>R(`deps`)}),W&&(0,X.jsx)(Z,{label:`Routes`,value:s.length,color:`teal`,icon:(0,X.jsx)(we,{size:22}),onClick:()=>R(`routes`)}),G&&(0,X.jsx)(Z,{label:`Services`,value:a.services.length,color:`blue`,icon:(0,X.jsx)(fe,{size:22}),onClick:()=>R(`services`)})]}),(0,X.jsxs)(n,{children:[(0,X.jsx)(n.Col,{span:{base:12,md:J?6:12},children:(0,X.jsxs)(S,{withBorder:!0,radius:`md`,p:`lg`,h:`100%`,children:[(0,X.jsxs)(m,{gap:6,mb:`sm`,children:[(0,X.jsx)(O,{size:18}),(0,X.jsx)(f,{order:5,children:`Identité`})]}),(0,X.jsxs)(y,{gap:`xs`,children:[(0,X.jsx)(L,{k:`Clé`,v:a.key,mono:!0}),(0,X.jsx)(L,{k:`Package`,v:a.name}),(0,X.jsx)(L,{k:`Version`,v:a.version??`—`}),(0,X.jsx)(L,{k:`Type`,v:a.isApp?`application`:`package`}),(0,X.jsx)(L,{k:`Services`,v:String(a.services.length)}),(0,X.jsx)(L,{k:`Routes`,v:String(s.length)}),(0,X.jsx)(L,{k:`Chemin`,v:a.path??`—`,mono:!0})]})]})}),J&&(0,X.jsx)(n.Col,{span:{base:12,md:6},children:q?(0,X.jsx)(ne,{module:a.name,schema:De,sections:q,onOpen:()=>R(`config`)}):(0,X.jsxs)(S,{withBorder:!0,radius:`md`,p:`lg`,h:`100%`,children:[(0,X.jsxs)(m,{justify:`space-between`,mb:`sm`,children:[(0,X.jsxs)(m,{gap:6,children:[(0,X.jsx)(_,{size:18}),(0,X.jsx)(f,{order:5,children:`Configuration`})]}),(0,X.jsx)(j,{variant:`light`,size:`xs`,onClick:()=>R(`config`),children:`Tout voir`})]}),(0,X.jsx)(c,{h:260,type:`auto`,offsetScrollbars:!0,children:(0,X.jsx)(ie,{value:a.config})})]})})]})]})}),z&&(0,X.jsx)(r.Panel,{value:`docs`,children:(0,X.jsx)(et,{moduleKey:e,version:a.version,docs:p})}),B&&(0,X.jsx)(r.Panel,{value:`api`,children:(0,X.jsx)(tt,{symbols:g})}),B&&(0,X.jsx)(r.Panel,{value:`graph`,children:(0,X.jsx)(Ue,{symbols:g,height:d})}),H&&(0,X.jsx)(r.Panel,{value:`coverage`,children:(0,X.jsx)(st,{report:C})}),_e&&(0,X.jsx)(r.Panel,{value:`tests`,children:(0,X.jsx)(at,{moduleKey:e,tests:T})}),U&&(0,X.jsx)(r.Panel,{value:`deps`,children:(0,X.jsx)(rt,{moduleKey:e,onNavigate:e=>t(`/nodefony/modules/${e}`)})}),W&&(0,X.jsx)(r.Panel,{value:`routes`,children:(0,X.jsx)(k,{mode:`client`,data:s,columns:qe,getRowId:e=>e.name,searchable:!0,searchPlaceholder:`Rechercher une route…`})}),G&&(0,X.jsx)(r.Panel,{value:`services`,children:(0,X.jsx)(b.ScrollContainer,{minWidth:420,children:(0,X.jsxs)(b,{striped:!0,highlightOnHover:!0,withRowBorders:!1,children:[(0,X.jsx)(b.Thead,{children:(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Th,{children:`Nom (DI)`}),(0,X.jsx)(b.Th,{children:`Classe`})]})}),(0,X.jsx)(b.Tbody,{children:a.services.map(e=>(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Td,{children:(0,X.jsx)(A,{children:e.name})}),(0,X.jsx)(b.Td,{children:(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:e.class??`—`})})]},e.name))})]})})}),J&&(0,X.jsx)(r.Panel,{value:`config`,children:q?(0,X.jsx)(Re,{module:a.name,seg:a.seg??e,schema:De,sections:q,editable:!1,onEdit:le}):(0,X.jsx)(c,{h:520,type:`auto`,offsetScrollbars:!0,children:(0,X.jsx)(ie,{value:a.config})})})]})]})})});function Qe(){return(0,X.jsxs)(y,{gap:`md`,"aria-busy":`true`,children:[(0,X.jsx)(B,{height:28,width:90,radius:`sm`}),(0,X.jsxs)(m,{gap:`md`,wrap:`nowrap`,children:[(0,X.jsx)(B,{height:54,width:54,radius:`md`}),(0,X.jsxs)(y,{gap:8,style:{flex:1},children:[(0,X.jsx)(B,{height:26,width:`38%`,radius:`sm`}),(0,X.jsx)(B,{height:13,width:`55%`,radius:`sm`})]})]}),(0,X.jsxs)(S,{withBorder:!0,radius:`md`,p:`md`,children:[(0,X.jsx)(m,{gap:`xs`,mb:`lg`,children:Array.from({length:5}).map((e,t)=>(0,X.jsx)(B,{height:30,width:104,radius:`sm`},t))}),(0,X.jsx)(K,{cols:{base:2,sm:3,lg:5},spacing:`md`,mb:`lg`,children:Array.from({length:5}).map((e,t)=>(0,X.jsx)(B,{height:84,radius:`md`},t))}),(0,X.jsxs)(n,{children:[(0,X.jsx)(n.Col,{span:{base:12,md:6},children:(0,X.jsx)(B,{height:220,radius:`md`})}),(0,X.jsx)(n.Col,{span:{base:12,md:6},children:(0,X.jsx)(B,{height:220,radius:`md`})})]})]})]})}var $e=d;function et({moduleKey:e,version:n,docs:r}){let i=V(),[o,s]=(0,Y.useState)(r[0]?.slug??null),[c,l]=(0,Y.useState)(null),[d,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(null),[b,ee]=(0,Y.useState)(`admin`),[x,S]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{if(!o)return;let t=!1;return g(!0),v(null),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/docs/${encodeURIComponent(o)}`).then(e=>{t||l(e)}).catch(e=>{t||v(e instanceof Error?e.message:String(e))}).finally(()=>{t||g(!1)}),()=>{t=!0}},[i,e,o]);let C=r.find(e=>e.slug===o),w=x.trim().length===0?r:r.filter(e=>`${e.navTitle??``} ${e.title}`.toLowerCase().includes(x.trim().toLowerCase())),T=(0,X.jsxs)(y,{gap:2,children:[w.map(e=>(0,X.jsx)(G,{active:e.slug===o,label:e.navTitle??e.title,title:e.title,leftSection:(0,X.jsx)(W,{size:16}),onClick:()=>s(e.slug),styles:{label:{fontSize:te(13)}}},e.slug)),!w.length&&(0,X.jsx)(P,{size:`xs`,c:`dimmed`,px:`xs`,children:`Aucune page ne correspond.`})]}),E=r.length>6?(0,X.jsx)(ce,{size:`xs`,mb:6,placeholder:`Rechercher une page…`,value:x,onChange:e=>S(e.currentTarget.value),leftSection:(0,X.jsx)(t,{size:13}),"aria-label":`Rechercher une page de doc`}):void 0,D=C&&(0,X.jsxs)(m,{gap:`xs`,wrap:`nowrap`,children:[(0,X.jsx)(f,{order:3,style:{minWidth:0},lineClamp:1,children:C.title}),(0,X.jsx)(J,{value:b,onChange:ee}),n&&(0,X.jsxs)(M,{variant:`default`,size:`sm`,children:[`v`,n]}),C.status&&(0,X.jsx)(M,{size:`sm`,color:Ge[C.status]??`gray`,variant:`light`,children:C.status}),(c?.gitUpdated??C.gitUpdated)&&(0,X.jsx)(u,{label:`Dernier commit git de ce fichier (détecte la dérive doc↔code)`,children:(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[`maj`,` `,(0,ze.default)(c?.gitUpdated??C.gitUpdated).format(`YYYY-MM-DD`)]})})]}),O=d?(0,X.jsx)(m,{justify:`center`,py:`xl`,children:(0,X.jsx)(a,{size:`sm`})}):_?(0,X.jsx)(I,{color:`red`,icon:(0,X.jsx)(F,{size:16}),children:_}):c?(0,X.jsx)(h,{markdown:c.markdown,onInternalLink:e=>r.some(t=>t.slug===e)?(s(e),!0):!1}):null;return(0,X.jsx)(p,{navTitle:`Pages`,navSearch:E,nav:T,title:D,tocMarkdown:c?.markdown,mode:`container`,height:$e,children:O})}function tt({symbols:e}){return(0,X.jsx)(k,{mode:`client`,data:e,columns:Je,getRowId:e=>`${e.kind}:${e.name}`,searchable:!0,searchPlaceholder:`Rechercher un symbole…`})}function Z({label:e,value:t,color:n,icon:r,onClick:i}){return(0,X.jsx)(S,{withBorder:!0,radius:`md`,p:`md`,onClick:i,style:{cursor:i?`pointer`:`default`},children:(0,X.jsxs)(m,{justify:`space-between`,wrap:`nowrap`,children:[(0,X.jsxs)(y,{gap:2,children:[(0,X.jsx)(P,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:700,children:e}),(0,X.jsx)(P,{fz:28,fw:700,lh:1,children:t})]}),(0,X.jsx)(v,{variant:`light`,color:n,size:44,radius:`md`,children:r})]})})}function nt({dep:e,out:t,onClick:n}){return(0,X.jsx)(S,{withBorder:!0,radius:`md`,p:`sm`,onClick:n,style:{cursor:`pointer`},children:(0,X.jsxs)(m,{gap:`sm`,wrap:`nowrap`,children:[(0,X.jsx)(v,{variant:`light`,color:e.kind===`nodefony`?`brand`:`gray`,size:34,radius:`md`,children:(0,X.jsx)(Me,{size:18})}),(0,X.jsxs)(y,{gap:3,style:{minWidth:0,flex:1},children:[(0,X.jsx)(P,{size:`sm`,fw:500,truncate:!0,children:e.name}),(0,X.jsxs)(m,{gap:6,wrap:`nowrap`,children:[e.installed?(0,X.jsxs)(M,{size:`xs`,variant:`default`,children:[`v`,e.installed]}):(0,X.jsx)(M,{size:`xs`,variant:`light`,color:`gray`,children:`non installé`}),e.range&&(0,X.jsx)(P,{size:`xs`,c:`dimmed`,truncate:!0,children:e.range})]})]}),t&&(t.outdated?(0,X.jsx)(u,{label:`Dernière version npm : ${t.latest}`,children:(0,X.jsxs)(M,{size:`xs`,color:`orange`,variant:`filled`,style:{flexShrink:0},children:[`↑ `,t.latest]})}):t.latest?(0,X.jsx)(M,{size:`xs`,color:`teal`,variant:`light`,style:{flexShrink:0},children:`à jour`}):null),e.kind===`external`&&!t&&(0,X.jsx)(w,{size:13,style:{opacity:.4,flexShrink:0}})]})})}function rt({moduleKey:e,onNavigate:t}){let n=V(),[r,i]=(0,Y.useState)([]),[o,s]=(0,Y.useState)(!0),[c,l]=(0,Y.useState)({}),[u,d]=(0,Y.useState)(!1),f=`/nodefony/kernel/api/module/${encodeURIComponent(e)}/dependencies`;(0,Y.useEffect)(()=>{let e=!1;return s(!0),l({}),n.api.getAbsolute(f).then(t=>{e||i(t.deps??[])}).catch(()=>{e||i([])}).finally(()=>{e||s(!1)}),()=>{e=!0}},[n,f]);let p=async()=>{d(!0);try{let e=await n.api.getAbsolute(`${f}/outdated`),t={};(e.outdated??[]).forEach(e=>{t[e.name]=e}),l(t)}catch{}finally{d(!1)}};if(o)return(0,X.jsx)(m,{justify:`center`,py:`xl`,children:(0,X.jsx)(a,{size:`sm`})});let h=r.filter(e=>e.kind===`nodefony`),g=r.filter(e=>e.kind===`external`),_=e=>e===`nodefony`?`core`:e.replace(`@nodefony/`,``),v=Object.values(c).filter(e=>e.outdated).length,b=Object.keys(c).length>0;return(0,X.jsxs)(y,{gap:`xl`,children:[(0,X.jsxs)(m,{justify:`space-between`,wrap:`nowrap`,children:[(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:`Versions installées (node_modules). Le check interroge le registry npm (deps externes).`}),(0,X.jsx)(j,{size:`xs`,variant:`light`,color:v>0?`orange`:void 0,leftSection:(0,X.jsx)(E,{size:14}),loading:u,onClick:p,children:b?v>0?`${v} MAJ dispo`:`Tout à jour`:`Vérifier les MAJ`})]}),h.length>0&&(0,X.jsxs)(y,{gap:`sm`,children:[(0,X.jsxs)(m,{gap:`xs`,children:[(0,X.jsx)(P,{size:`sm`,fw:700,children:`Nodefony`}),(0,X.jsx)(M,{size:`sm`,variant:`light`,color:`brand`,children:h.length})]}),(0,X.jsx)(K,{cols:{base:1,sm:2,lg:3},spacing:`sm`,children:h.map(e=>(0,X.jsx)(nt,{dep:e,onClick:()=>t(_(e.name))},e.name))})]}),g.length>0&&(0,X.jsxs)(y,{gap:`sm`,children:[(0,X.jsxs)(m,{gap:`xs`,children:[(0,X.jsx)(P,{size:`sm`,fw:700,children:`Externes`}),(0,X.jsx)(M,{size:`sm`,variant:`light`,color:`gray`,children:g.length})]}),(0,X.jsx)(K,{cols:{base:1,sm:2,lg:3},spacing:`sm`,children:g.map(e=>(0,X.jsx)(nt,{dep:e,out:c[e.name],onClick:()=>window.open(`https://www.npmjs.com/package/${e.name}`,`_blank`,`noopener`)},e.name))})]})]})}function it({res:e}){return(0,X.jsxs)(m,{gap:6,wrap:`nowrap`,children:[(0,X.jsxs)(M,{color:e.ok?`teal`:`red`,variant:`light`,children:[e.ok?`✓`:`✗`,` `,e.passed,` passed`,e.failed?` / ${e.failed} failed`:``]}),(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[(e.durationMs/1e3).toFixed(1),`s`]})]})}function at({moduleKey:e,tests:t}){let n=V(),r=`__all__`,[i,a]=(0,Y.useState)({}),s=t.groups&&t.groups.length>0?t.groups:t.files.length>0?[{category:`unit`,files:t.files,runnable:!0}]:[],[l,u]=(0,Y.useState)(`unit`),d=s.find(e=>e.category===l)??s[0],f=(e,t)=>a(n=>({...n,[e]:{ok:!1,code:null,passed:0,failed:0,durationMs:0,output:t,mode:``}})),p=async t=>{let i=t??r,o=`/nodefony/kernel/api/module/${encodeURIComponent(e)}/test/run`;a(e=>({...e,[i]:`running`}));try{let e=(await n.api.postAbsolute(o,t?{file:t}:{})).jobId;if(!e)return f(i,`pas de jobId renvoyé`);for(let t=0;t<120;t++){await new Promise(e=>setTimeout(e,1500));let t=await n.api.getAbsolute(`${o}?jobId=${encodeURIComponent(e)}`);if(t.done){a(e=>({...e,[i]:t}));return}}f(i,`timeout (run trop long)`)}catch(e){f(i,e instanceof Error?e.message:String(e))}};if(!t.devMode)return(0,X.jsxs)(I,{color:`yellow`,icon:(0,X.jsx)(F,{size:16}),title:`Lancement désactivé`,children:[`Le lancement des tests depuis Studio n'est autorisé qu'en mode`,` `,(0,X.jsx)(A,{children:`development`}),`.`]});let h=i[r],g=Object.entries(i).filter(([,e])=>e!==`running`&&!e.ok);return(0,X.jsxs)(y,{gap:`md`,children:[s.length>0&&(0,X.jsx)(o,{value:d?.category??l,onChange:u,data:s.map(e=>({value:e.category,label:`${ot[e.category]??e.category} (${e.files.length})`}))}),d?.runnable?(0,X.jsxs)(y,{gap:`md`,children:[(0,X.jsxs)(m,{children:[(0,X.jsx)(j,{leftSection:(0,X.jsx)(U,{size:16}),loading:h===`running`,onClick:()=>p(),children:`Lancer tous (+ coverage)`}),h&&h!==`running`&&(0,X.jsx)(it,{res:h}),(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:`« Lancer tous » régénère aussi le coverage (recharge la page pour le voir à jour).`})]}),(0,X.jsx)(b.ScrollContainer,{minWidth:560,children:(0,X.jsxs)(b,{striped:!0,highlightOnHover:!0,withRowBorders:!1,children:[(0,X.jsx)(b.Thead,{children:(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Th,{children:`Fichier de test`}),(0,X.jsx)(b.Th,{w:90,children:`Action`}),(0,X.jsx)(b.Th,{children:`Résultat`})]})}),(0,X.jsx)(b.Tbody,{children:d.files.map(e=>{let t=i[e];return(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Td,{children:(0,X.jsx)(A,{children:e})}),(0,X.jsx)(b.Td,{children:(0,X.jsx)(j,{size:`xs`,variant:`light`,leftSection:(0,X.jsx)(U,{size:14}),loading:t===`running`,onClick:()=>p(e),children:`Run`})}),(0,X.jsx)(b.Td,{children:t&&t!==`running`?(0,X.jsx)(it,{res:t}):null})]},e)})})]})}),g.map(([e,t])=>(0,X.jsx)(I,{color:`red`,icon:(0,X.jsx)(F,{size:16}),title:`Échec : ${e===r?`suite complète`:e}`,children:(0,X.jsx)(c.Autosize,{mah:240,children:(0,X.jsx)(A,{block:!0,children:t.output||`(pas de sortie)`})})},e))]}):d?(0,X.jsxs)(y,{gap:`xs`,children:[(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[`Suite « `,ot[d.category]??d.category,` » — lecture seule. Lancée en CLI (serveur live / base / config dédiée requis), pas depuis Studio.`]}),(0,X.jsx)(y,{gap:2,children:d.files.map(e=>(0,X.jsx)(A,{style:{fontSize:11},children:e},e))})]}):(0,X.jsx)(P,{size:`sm`,c:`dimmed`,children:`Aucune suite de tests.`})]})}var ot={unit:`Unit`,integration:`Intégration`,e2e:`E2E`,websockets:`WebSockets`,routing:`Routing`,load:`Charge`,memory:`Mémoire`,other:`Autre`};function Q(e){return e>=80?`teal`:e>=50?`yellow`:`red`}function st({report:e}){let t=e.total,n=e.files??[],r=(e,t)=>(0,X.jsxs)(y,{gap:4,align:`center`,children:[(0,X.jsx)(z,{size:92,thickness:8,roundCaps:!0,sections:[{value:e,color:Q(e)}],label:(0,X.jsxs)(P,{ta:`center`,fw:700,size:`sm`,children:[Math.round(e),`%`]})}),(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:t})]});return(0,X.jsxs)(y,{gap:`md`,children:[(0,X.jsxs)(m,{gap:`xl`,wrap:`wrap`,align:`flex-start`,children:[r(t?.lines??0,`Lines`),r(t?.statements??0,`Statements`),r(t?.functions??0,`Functions`),r(t?.branches??0,`Branches`),e.generated&&(0,X.jsx)(u,{label:`Date du dernier rapport (npm run coverage)`,children:(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,mt:`md`,children:[`généré `,(0,ze.default)(e.generated).format(`YYYY-MM-DD HH:mm`)]})})]}),(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[`Couverture des tests `,(0,X.jsx)(`b`,{children:`unit`}),` (vitest + @vitest/coverage-v8). L'intégration tape un serveur séparé → non mesurée ici.`]}),(0,X.jsx)(k,{mode:`client`,data:n,columns:Ye,getRowId:e=>e.file,searchable:!0,searchPlaceholder:`Rechercher un fichier…`})]})}function $({n:e}){return(0,X.jsx)(M,{size:`xs`,variant:`light`,color:`gray`,children:e})}export{Ze as ModuleDetail,Ze as default};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{$ as t,$t as n,Bt as r,Et as i,Fn as a,Gt as o,H as s,Hn as c,J as l,Kt as u,L as d,Lt as f,M as p,Mn as m,N as h,Pn as g,Q as _,Rt as v,Ut as y,Vt as b,W as ee,Wn as x,an as S,b as C,ct as w,di as T,ei as te,et as E,gt as D,it as O,n as k,nn as A,o as ne,on as j,or as re,p as ie,q as ae,s as oe,sn as M,tn as N,ut as se,vn as P,wt as F,yn as I,z as L,zn as R,zt as ce}from"./ui-BlRFVRfl.js";import{t as le}from"./Progress-BxSLYIgD.js";import{t as z}from"./RingProgress-CdgTmA2j.js";import{t as B}from"./Skeleton-coYonGf_.js";import{A as V,c as H}from"./stores-fG-e-IP-.js";import{f as ue,l as de}from"./hooks-DMHLQNUe.js";import{t as fe}from"./IconAffiliate-BDcNyaq_.js";import{n as pe,t as me}from"./IconPackages-a59KQceL.js";import{t as he}from"./IconArrowLeft-CGbdeI78.js";import{t as ge}from"./IconBook-NYou6bAm.js";import{t as _e}from"./IconCircleDot-DDZDGUv7.js";import{t as ve}from"./IconCode-8A2Vc3mV.js";import{t as U}from"./IconPlayerPlay-Cl4K6MPS.js";import{t as ye}from"./IconPuzzle-AO4L5bjR.js";import{t as be}from"./IconSitemap-BnfvAqMK.js";import{t as xe}from"./IconStack2-BRfnzl41.js";import{J as W,K as Se,dt as Ce,gt as G,j as we,k as Te,nt as Ee,pt as K,vt as q}from"./index-BwkdF4pp.js";import{t as De}from"./dayjs.min-G0uPySEd.js";import{t as J}from"./RoleSwitch-B83joCHG.js";import{i as Oe,n as ke,r as Ae}from"./configModel-VUzK2g6s.js";var je=i(`outline`,`hexagon`,`Hexagon`,[[`path`,{d:`M19.875 6.27a2.225 2.225 0 0 1 1.125 1.948v7.284c0 .809 -.443 1.555 -1.158 1.948l-6.75 4.27a2.269 2.269 0 0 1 -2.184 0l-6.75 -4.27a2.225 2.225 0 0 1 -1.158 -1.948v-7.285c0 -.809 .443 -1.554 1.158 -1.947l6.75 -3.98a2.33 2.33 0 0 1 2.25 0l6.75 3.98h-.033`,key:`svg-0`}]]),Me=i(`outline`,`package`,`Package`,[[`path`,{d:`M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5`,key:`svg-0`}],[`path`,{d:`M12 12l8 -4.5`,key:`svg-1`}],[`path`,{d:`M12 12l0 9`,key:`svg-2`}],[`path`,{d:`M12 12l-8 -4.5`,key:`svg-3`}],[`path`,{d:`M16 5.25l-8 4.5`,key:`svg-4`}]]),Y=e(T(),1),X=re(),Ne={app:{label:`app`,color:`grape`},env:{label:`env`,color:`teal`},runtime:{label:`runtime`,color:`cyan`}};function Pe({value:e,label:t,hint:n,color:r}){return(0,X.jsxs)(m,{gap:8,wrap:`nowrap`,children:[(0,X.jsx)(P,{fz:22,fw:700,lh:1,c:e>0?r:`dimmed`,children:e}),(0,X.jsxs)(m,{gap:4,wrap:`nowrap`,children:[(0,X.jsx)(P,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:700,children:t}),n]})]})}function Fe({value:e}){return(0,X.jsxs)(m,{gap:4,wrap:`nowrap`,children:[(0,X.jsx)(A,{style:{fontSize:11},children:e}),(0,X.jsx)(N,{value:e,timeout:1500,children:({copied:t,copy:n})=>(0,X.jsx)(u,{label:t?`Copié`:`Copier`,withArrow:!0,children:(0,X.jsx)(g,{size:`sm`,variant:`subtle`,color:t?`teal`:`gray`,"aria-label":`Copier ${e}`,onClick:n,children:t?(0,X.jsx)(D,{size:14}):(0,X.jsx)(se,{size:14})})})})]})}var Ie=[{key:`field`,header:`Réglage`,sortable:!0,filterable:!0,value:e=>e.field,render:e=>(0,X.jsx)(A,{style:{fontSize:12},children:e.field})},{key:`source`,header:`Provenance`,sortable:!0,filterable:!0,filterType:`select`,filterOptions:Object.keys(Ne),value:e=>e.source,render:e=>(0,X.jsx)(M,{size:`sm`,variant:`light`,color:Ne[e.source].color,tt:`none`,children:Ne[e.source].label}),size:130},{key:`where`,header:`Surchargé par / recette`,sortable:!0,filterable:!0,value:e=>e.where,render:e=>e.source===`runtime`?(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:e.where}):(0,X.jsx)(Fe,{value:e.overrideKey})}];function Le({overrides:e}){return(0,X.jsxs)(R,{withBorder:!0,p:`md`,radius:`md`,children:[(0,X.jsxs)(m,{gap:6,mb:`sm`,children:[(0,X.jsx)(P,{fw:600,size:`sm`,children:`Surcharges actives`}),(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[e.length,` réglage(s) ≠ défaut`]}),(0,X.jsx)(s,{title:`Surcharges actives`,summary:`Les réglages de ce module qui DIFFÈRENT du défaut du framework — d'où vient la valeur (app/env/runtime) et la recette 12-factor pour la piloter. C'est l'identité de ce module dans CE déploiement.`})]}),(0,X.jsx)(k,{mode:`client`,data:e,columns:Ie,getRowId:e=>e.field,initialSort:{key:`field`,dir:`asc`},searchable:!0,searchPlaceholder:`Rechercher un réglage…`,emptyMessage:`Aucune surcharge : ce module tourne entièrement sur les défauts du framework.`})]})}function Re({module:e,seg:t,schema:n,sections:r,editable:i=!1,onEdit:a}){let o=(0,Y.useMemo)(()=>ke(r,t),[r,t]),{live:c,secrets:l}=(0,Y.useMemo)(()=>{let e=0,t=0;for(let n of r)for(let r of n.fields)r.mutability===`live`&&e++,r.secret&&t++;return{live:e,secrets:t}},[r]);return(0,X.jsxs)(y,{gap:`lg`,children:[(0,X.jsx)(S,{withBorder:!0,radius:`md`,p:`md`,children:(0,X.jsxs)(m,{gap:`xl`,wrap:`wrap`,children:[(0,X.jsx)(Pe,{value:o.length,label:`Surcharges`,color:`grape`,hint:(0,X.jsx)(s,{title:`Surcharges`,summary:`Réglages dont la valeur effective diffère du défaut du framework (app, env, ou édition à chaud). 0 = ce module tourne en config stock.`,width:260})}),(0,X.jsx)(Pe,{value:c,label:`À chaud (dev)`,color:`teal`,hint:(0,X.jsx)(s,{title:`Éditables à chaud`,summary:`Réglages relus à chaque requête (ou recalculés via un seam) : modifiables en développement sans redémarrage, figés en production.`,width:280})}),(0,X.jsx)(Pe,{value:l,label:`Secrets`,color:`orange`,hint:(0,X.jsx)(s,{title:`Secrets`,summary:`Champs sensibles masqués ici et rédigés dans les logs (redaction côté serveur). Jamais éditables via l'API (recette *_FILE).`,width:260})})]})}),o.length>0?(0,X.jsx)(Le,{overrides:o}):(0,X.jsx)(ee,{title:`Module en configuration par défaut`,summary:`Aucun réglage ne diffère du défaut du framework — rien n'est surchargé par l'app, l'environnement ni une édition à chaud. État sain (config stock).`,children:(0,X.jsx)(M,{variant:`light`,color:`gray`,tt:`none`,children:`aucune surcharge`})}),(0,X.jsx)(oe,{module:e,schema:n,sections:r,editable:i,onEdit:a})]})}var ze=e(De(),1),Be=64,Ve={class:`indigo`,interface:`cyan`,type:`grape`,function:`teal`,enum:`orange`};function He(e){switch(e){case`class`:return(0,X.jsx)(Ee,{size:20});case`interface`:return(0,X.jsx)(je,{size:20});case`type`:case`enum`:return(0,X.jsx)(_e,{size:20});default:return(0,X.jsx)(ve,{size:20})}}function Ue({symbols:e,height:t=520}){let{nodes:n,edges:r,total:i,truncated:a}=(0,Y.useMemo)(()=>{let t=new Map(e.map(e=>[e.name,e])),n=[];for(let t of e){t.extends&&n.push({source:t.name,target:t.extends,label:`extends`,color:`indigo`});for(let e of t.implements??[])n.push({source:t.name,target:e,label:`implements`,color:`cyan`,dashed:!0})}let r=new Set;n.forEach(e=>{r.add(e.source),r.add(e.target)});let i=[...r],a=i.length>Be,o=new Set(i.slice(0,Be)),s=n.filter(e=>o.has(e.source)&&o.has(e.target));return{nodes:[...o].map(e=>{let n=t.get(e),r=!n,i=n?.kind??`externe`,a=r?`gray`:Ve[i]??`blue`;return{id:e,data:{label:e,sub:r?`externe (hors module)`:i,icon:He(i),color:a,emphasis:!!n?.decorators?.length}}}),edges:s,total:i.length,truncated:a}},[e]);return r.length?(0,X.jsxs)(y,{gap:`xs`,children:[(0,X.jsxs)(m,{gap:`sm`,children:[(0,X.jsxs)(P,{size:`sm`,c:`dimmed`,children:[`Héritage & implémentation — `,n.length,` symbole(s),`,` `,r.length,` relation(s).`]}),(0,X.jsx)(M,{variant:`dot`,color:`indigo`,children:`extends`}),(0,X.jsx)(M,{variant:`dot`,color:`cyan`,children:`implements`}),(0,X.jsx)(M,{variant:`dot`,color:`gray`,children:`externe`}),a&&(0,X.jsxs)(M,{color:`orange`,variant:`light`,children:[`tronqué à `,Be,`/`,i]})]}),(0,X.jsx)(C,{nodes:n,edges:r,dir:`LR`,height:t,ariaLabel:`Graphe de classes du module (extends / implements)`})]}):(0,X.jsxs)(I,{color:`gray`,variant:`light`,icon:(0,X.jsx)(O,{size:18}),children:[`Aucune relation `,(0,X.jsx)(`b`,{children:`extends`}),`/`,(0,X.jsx)(`b`,{children:`implements`}),` détectée dans ce module — rien à représenter en graphe de classes. (Le graphe se nourrit du même`,` `,(0,X.jsx)(`code`,{children:`symbols.json`}),` que l'onglet API.)`]})}var We={GET:`teal`,POST:`blue`,PUT:`yellow`,PATCH:`grape`,DELETE:`red`,WEBSOCKET:`cyan`,ANY:`gray`},Ge={stable:`teal`,draft:`gray`,deprecated:`red`},Ke={class:`orange`,interface:`blue`,function:`teal`,type:`grape`,enum:`yellow`},qe=[{key:`methods`,header:`Méthodes`,filterable:!0,filterType:`multiselect`,value:e=>e.methods.join(`,`),render:e=>(0,X.jsx)(m,{gap:4,children:e.methods.map(e=>(0,X.jsx)(M,{size:`xs`,color:We[e]??`gray`,variant:`light`,children:e},e))})},{key:`path`,header:`Chemin`,sortable:!0,value:e=>e.path??``,render:e=>(0,X.jsx)(A,{children:e.path})},{key:`controller`,header:`Controller`,sortable:!0,value:e=>e.controller??``,render:e=>(0,X.jsx)(P,{size:`xs`,children:e.controller??`—`})},{key:`action`,header:`Action`,sortable:!0,value:e=>e.action??``,render:e=>(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:e.action??`—`})}],Je=[{key:`kind`,header:`Kind`,size:110,sortable:!0,filterable:!0,filterType:`multiselect`,value:e=>e.kind,render:e=>(0,X.jsx)(M,{size:`xs`,variant:`light`,color:Ke[e.kind]??`gray`,children:e.kind})},{key:`name`,header:`Nom`,sortable:!0,value:e=>e.name,render:e=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{children:e.name}),e.extends&&(0,X.jsxs)(P,{span:!0,size:`xs`,c:`dimmed`,ml:6,children:[`extends `,e.extends]})]})},{key:`description`,header:`Description`,value:e=>e.description??``,render:e=>(0,X.jsx)(P,{size:`xs`,c:e.description?void 0:`dimmed`,children:e.description??`—`})}],Ye=[{key:`file`,header:`Fichier`,sortable:!0,value:e=>e.file,render:e=>(0,X.jsx)(A,{children:e.file})},{key:`lines`,header:`Lines`,sortable:!0,size:190,value:e=>e.lines,render:e=>(0,X.jsxs)(m,{gap:`xs`,wrap:`nowrap`,children:[(0,X.jsx)(le,{value:e.lines,color:Q(e.lines),w:110,size:`sm`}),(0,X.jsxs)(P,{size:`xs`,w:34,ta:`right`,children:[Math.round(e.lines),`%`]})]})},{key:`functions`,header:`Funcs`,sortable:!0,size:80,value:e=>e.functions,render:e=>(0,X.jsxs)(P,{size:`xs`,c:Q(e.functions),children:[Math.round(e.functions),`%`]})},{key:`branches`,header:`Branches`,sortable:!0,size:90,value:e=>e.branches,render:e=>(0,X.jsxs)(P,{size:`xs`,c:Q(e.branches),children:[Math.round(e.branches),`%`]})}];function Xe(e){if(e instanceof V){let t=e.body,n=t?.message??t?.error??e.message;return t?.recipe?`${n} — recette : ${t.recipe}`:n}return e instanceof Error?e.message:String(e)}var Ze=q(()=>{let{name:e=``}=ue(),t=de(),i=H(),[a,o]=(0,Y.useState)(null),[s,u]=(0,Y.useState)([]),[p,h]=(0,Y.useState)([]),[g,ee]=(0,Y.useState)([]),[C,w]=(0,Y.useState)({available:!1}),[T,te]=(0,Y.useState)({files:[],devMode:!1}),[E,D]=(0,Y.useState)(null),[re,oe]=(0,Y.useState)(!0),[N]=Ce(),[se,R]=(0,Y.useState)(()=>N.get(`tab`));(0,Y.useEffect)(()=>{R(N.get(`tab`))},[e,N]),(0,Y.useEffect)(()=>{let t=!1;return oe(!0),D(null),Promise.all([i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}`),i.api.getAbsolute(`/nodefony/framework/api/routes`).catch(()=>[]),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/docs`).then(e=>e.docs??[]).catch(()=>[]),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/symbols`).then(e=>e.symbols??[]).catch(()=>[]),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/coverage`).catch(()=>({available:!1})),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/tests`).catch(()=>({files:[],devMode:!1}))]).then(([n,r,i,a,s,c])=>{t||(o(n),u(r.filter(t=>t.module===e)),h(i),ee(a),w(s),te(c))}).catch(e=>{t||D(e instanceof Error?e.message:String(e))}).finally(()=>{t||oe(!1)}),()=>{t=!0}},[i,e]);let ce=(0,Y.useCallback)(async()=>{try{let t=await i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}`);o(t)}catch{}},[i,e]),le=(0,Y.useCallback)(async(t,n)=>{try{return await i.api.patchAbsolute(`/nodefony/kernel/api/config/${encodeURIComponent(e)}`,{path:t.key,value:n}),i.notifications.notify(`success`,`${t.key} mis à jour (à chaud)`,{title:`Configuration`}),await ce(),{ok:!0}}catch(e){let t=Xe(e);return i.notifications.notify(`error`,t,{title:`Édition refusée`}),{ok:!1,error:t}}},[i,e,ce]);if(re)return(0,X.jsx)(Qe,{});if(E||!a)return(0,X.jsxs)(y,{gap:`md`,children:[(0,X.jsx)(j,{variant:`subtle`,leftSection:(0,X.jsx)(he,{size:16}),onClick:()=>t(`/nodefony/modules`),w:`fit-content`,children:`Modules`}),(0,X.jsx)(I,{color:`red`,icon:(0,X.jsx)(F,{size:16}),title:`Module introuvable`,children:E??`Aucun module "${e}".`})]});let z=p.length>0,B=g.length>0,V=C.available===!0,_e=T.files.length>0,U=a.dependencies.length>0,W=s.length>0,G=a.services.length>0,Ee=Ae(Oe(a.configSchema??null,a.config,a.provenance??null),a.seg??e),q=Ee.length?Ee:null,De=a.configSchema?`zod`:`none`,J=!!q||!!a.config&&Object.keys(a.config).length>0;return(0,X.jsx)(ae,{icon:(0,X.jsx)(v,{variant:`light`,color:e===`core`?`grape`:a.isApp?`brand`:`gray`,size:36,radius:`md`,children:e===`core`?(0,X.jsx)(xe,{size:22}):a.isApp?(0,X.jsx)(pe,{size:22}):(0,X.jsx)(ye,{size:22})}),title:e===`core`?`Nodefony Core`:a.name,subtitle:(0,X.jsxs)(m,{gap:`sm`,align:`center`,children:[a.version&&(0,X.jsxs)(M,{variant:`default`,children:[`v`,a.version]}),(0,X.jsx)(M,{variant:`light`,color:e===`core`?`grape`:a.isApp?`brand`:`gray`,children:e===`core`?`socle du framework`:a.isApp?`application`:`package`}),(0,X.jsxs)(P,{c:`dimmed`,size:`sm`,ff:`monospace`,children:[e===`core`?`@nodefony/core · `:``,a.path??`—`]})]}),actions:(0,X.jsx)(j,{variant:`subtle`,leftSection:(0,X.jsx)(he,{size:16}),onClick:()=>t(`/nodefony/modules`),children:`Modules`}),children:(0,X.jsxs)(r,{value:se??`overview`,onChange:R,children:[(0,X.jsxs)(l,{children:[(0,X.jsx)(r.Tab,{value:`overview`,leftSection:(0,X.jsx)(O,{size:16}),children:`Vue d'ensemble`}),z&&(0,X.jsx)(r.Tab,{value:`docs`,leftSection:(0,X.jsx)(ge,{size:16}),rightSection:(0,X.jsx)($,{n:p.length}),children:`Docs`}),B&&(0,X.jsx)(r.Tab,{value:`api`,leftSection:(0,X.jsx)(ve,{size:16}),rightSection:(0,X.jsx)($,{n:g.length}),children:`API`}),B&&(0,X.jsx)(r.Tab,{value:`graph`,leftSection:(0,X.jsx)(be,{size:16}),children:`Graphe`}),V&&(0,X.jsx)(r.Tab,{value:`coverage`,leftSection:(0,X.jsx)(Te,{size:16}),rightSection:(0,X.jsxs)(M,{size:`xs`,variant:`light`,color:Q(C.total?.lines??0),children:[Math.round(C.total?.lines??0),`%`]}),children:`Coverage`}),_e&&(0,X.jsx)(r.Tab,{value:`tests`,leftSection:(0,X.jsx)(Se,{size:16}),rightSection:(0,X.jsx)($,{n:T.files.length}),children:`Tests`}),U&&(0,X.jsx)(r.Tab,{value:`deps`,leftSection:(0,X.jsx)(me,{size:16}),rightSection:(0,X.jsx)($,{n:a.dependencies.length}),children:`Dépendances`}),W&&(0,X.jsx)(r.Tab,{value:`routes`,leftSection:(0,X.jsx)(we,{size:16}),rightSection:(0,X.jsx)($,{n:s.length}),children:`Routes`}),G&&(0,X.jsx)(r.Tab,{value:`services`,leftSection:(0,X.jsx)(fe,{size:16}),rightSection:(0,X.jsx)($,{n:a.services.length}),children:`Services`}),J&&(0,X.jsx)(r.Tab,{value:`config`,leftSection:(0,X.jsx)(_,{size:16}),children:`Config`})]}),(0,X.jsxs)(x,{p:`lg`,children:[(0,X.jsx)(r.Panel,{value:`overview`,children:(0,X.jsxs)(y,{gap:`lg`,children:[(0,X.jsxs)(K,{cols:{base:2,sm:3,lg:5},spacing:`md`,children:[z&&(0,X.jsx)(Z,{label:`Docs`,value:p.length,color:`cyan`,icon:(0,X.jsx)(ge,{size:22}),onClick:()=>R(`docs`)}),B&&(0,X.jsx)(Z,{label:`API`,value:g.length,color:`grape`,icon:(0,X.jsx)(ve,{size:22}),onClick:()=>R(`api`)}),V&&(0,X.jsx)(Z,{label:`Coverage`,value:`${Math.round(C.total?.lines??0)}%`,color:Q(C.total?.lines??0),icon:(0,X.jsx)(Te,{size:22}),onClick:()=>R(`coverage`)}),U&&(0,X.jsx)(Z,{label:`Dépendances`,value:a.dependencies.length,color:`orange`,icon:(0,X.jsx)(me,{size:22}),onClick:()=>R(`deps`)}),W&&(0,X.jsx)(Z,{label:`Routes`,value:s.length,color:`teal`,icon:(0,X.jsx)(we,{size:22}),onClick:()=>R(`routes`)}),G&&(0,X.jsx)(Z,{label:`Services`,value:a.services.length,color:`blue`,icon:(0,X.jsx)(fe,{size:22}),onClick:()=>R(`services`)})]}),(0,X.jsxs)(n,{children:[(0,X.jsx)(n.Col,{span:{base:12,md:J?6:12},children:(0,X.jsxs)(S,{withBorder:!0,radius:`md`,p:`lg`,h:`100%`,children:[(0,X.jsxs)(m,{gap:6,mb:`sm`,children:[(0,X.jsx)(O,{size:18}),(0,X.jsx)(f,{order:5,children:`Identité`})]}),(0,X.jsxs)(y,{gap:`xs`,children:[(0,X.jsx)(L,{k:`Clé`,v:a.key,mono:!0}),(0,X.jsx)(L,{k:`Package`,v:a.name}),(0,X.jsx)(L,{k:`Version`,v:a.version??`—`}),(0,X.jsx)(L,{k:`Type`,v:a.isApp?`application`:`package`}),(0,X.jsx)(L,{k:`Services`,v:String(a.services.length)}),(0,X.jsx)(L,{k:`Routes`,v:String(s.length)}),(0,X.jsx)(L,{k:`Chemin`,v:a.path??`—`,mono:!0})]})]})}),J&&(0,X.jsx)(n.Col,{span:{base:12,md:6},children:q?(0,X.jsx)(ne,{module:a.name,schema:De,sections:q,onOpen:()=>R(`config`)}):(0,X.jsxs)(S,{withBorder:!0,radius:`md`,p:`lg`,h:`100%`,children:[(0,X.jsxs)(m,{justify:`space-between`,mb:`sm`,children:[(0,X.jsxs)(m,{gap:6,children:[(0,X.jsx)(_,{size:18}),(0,X.jsx)(f,{order:5,children:`Configuration`})]}),(0,X.jsx)(j,{variant:`light`,size:`xs`,onClick:()=>R(`config`),children:`Tout voir`})]}),(0,X.jsx)(c,{h:260,type:`auto`,offsetScrollbars:!0,children:(0,X.jsx)(ie,{value:a.config})})]})})]})]})}),z&&(0,X.jsx)(r.Panel,{value:`docs`,children:(0,X.jsx)(et,{moduleKey:e,version:a.version,docs:p})}),B&&(0,X.jsx)(r.Panel,{value:`api`,children:(0,X.jsx)(tt,{symbols:g})}),B&&(0,X.jsx)(r.Panel,{value:`graph`,children:(0,X.jsx)(Ue,{symbols:g,height:d})}),V&&(0,X.jsx)(r.Panel,{value:`coverage`,children:(0,X.jsx)(st,{report:C})}),_e&&(0,X.jsx)(r.Panel,{value:`tests`,children:(0,X.jsx)(at,{moduleKey:e,tests:T})}),U&&(0,X.jsx)(r.Panel,{value:`deps`,children:(0,X.jsx)(rt,{moduleKey:e,onNavigate:e=>t(`/nodefony/modules/${e}`)})}),W&&(0,X.jsx)(r.Panel,{value:`routes`,children:(0,X.jsx)(k,{mode:`client`,data:s,columns:qe,getRowId:e=>e.name,searchable:!0,searchPlaceholder:`Rechercher une route…`})}),G&&(0,X.jsx)(r.Panel,{value:`services`,children:(0,X.jsx)(b.ScrollContainer,{minWidth:420,children:(0,X.jsxs)(b,{striped:!0,highlightOnHover:!0,withRowBorders:!1,children:[(0,X.jsx)(b.Thead,{children:(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Th,{children:`Nom (DI)`}),(0,X.jsx)(b.Th,{children:`Classe`})]})}),(0,X.jsx)(b.Tbody,{children:a.services.map(e=>(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Td,{children:(0,X.jsx)(A,{children:e.name})}),(0,X.jsx)(b.Td,{children:(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:e.class??`—`})})]},e.name))})]})})}),J&&(0,X.jsx)(r.Panel,{value:`config`,children:q?(0,X.jsx)(Re,{module:a.name,seg:a.seg??e,schema:De,sections:q,editable:!1,onEdit:le}):(0,X.jsx)(c,{h:520,type:`auto`,offsetScrollbars:!0,children:(0,X.jsx)(ie,{value:a.config})})})]})]})})});function Qe(){return(0,X.jsxs)(y,{gap:`md`,"aria-busy":`true`,children:[(0,X.jsx)(B,{height:28,width:90,radius:`sm`}),(0,X.jsxs)(m,{gap:`md`,wrap:`nowrap`,children:[(0,X.jsx)(B,{height:54,width:54,radius:`md`}),(0,X.jsxs)(y,{gap:8,style:{flex:1},children:[(0,X.jsx)(B,{height:26,width:`38%`,radius:`sm`}),(0,X.jsx)(B,{height:13,width:`55%`,radius:`sm`})]})]}),(0,X.jsxs)(S,{withBorder:!0,radius:`md`,p:`md`,children:[(0,X.jsx)(m,{gap:`xs`,mb:`lg`,children:Array.from({length:5}).map((e,t)=>(0,X.jsx)(B,{height:30,width:104,radius:`sm`},t))}),(0,X.jsx)(K,{cols:{base:2,sm:3,lg:5},spacing:`md`,mb:`lg`,children:Array.from({length:5}).map((e,t)=>(0,X.jsx)(B,{height:84,radius:`md`},t))}),(0,X.jsxs)(n,{children:[(0,X.jsx)(n.Col,{span:{base:12,md:6},children:(0,X.jsx)(B,{height:220,radius:`md`})}),(0,X.jsx)(n.Col,{span:{base:12,md:6},children:(0,X.jsx)(B,{height:220,radius:`md`})})]})]})]})}var $e=d;function et({moduleKey:e,version:n,docs:r}){let i=H(),[o,s]=(0,Y.useState)(r[0]?.slug??null),[c,l]=(0,Y.useState)(null),[d,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(null),[b,ee]=(0,Y.useState)(`admin`),[x,S]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{if(!o)return;let t=!1;return g(!0),v(null),i.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(e)}/docs/${encodeURIComponent(o)}`).then(e=>{t||l(e)}).catch(e=>{t||v(e instanceof Error?e.message:String(e))}).finally(()=>{t||g(!1)}),()=>{t=!0}},[i,e,o]);let C=r.find(e=>e.slug===o),w=x.trim().length===0?r:r.filter(e=>`${e.navTitle??``} ${e.title}`.toLowerCase().includes(x.trim().toLowerCase())),T=(0,X.jsxs)(y,{gap:2,children:[w.map(e=>(0,X.jsx)(G,{active:e.slug===o,label:e.navTitle??e.title,title:e.title,leftSection:(0,X.jsx)(W,{size:16}),onClick:()=>s(e.slug),styles:{label:{fontSize:te(13)}}},e.slug)),!w.length&&(0,X.jsx)(P,{size:`xs`,c:`dimmed`,px:`xs`,children:`Aucune page ne correspond.`})]}),E=r.length>6?(0,X.jsx)(ce,{size:`xs`,mb:6,placeholder:`Rechercher une page…`,value:x,onChange:e=>S(e.currentTarget.value),leftSection:(0,X.jsx)(t,{size:13}),"aria-label":`Rechercher une page de doc`}):void 0,D=C&&(0,X.jsxs)(m,{gap:`xs`,wrap:`nowrap`,children:[(0,X.jsx)(f,{order:3,style:{minWidth:0},lineClamp:1,children:C.title}),(0,X.jsx)(J,{value:b,onChange:ee}),n&&(0,X.jsxs)(M,{variant:`default`,size:`sm`,children:[`v`,n]}),C.status&&(0,X.jsx)(M,{size:`sm`,color:Ge[C.status]??`gray`,variant:`light`,children:C.status}),(c?.gitUpdated??C.gitUpdated)&&(0,X.jsx)(u,{label:`Dernier commit git de ce fichier (détecte la dérive doc↔code)`,children:(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[`maj`,` `,(0,ze.default)(c?.gitUpdated??C.gitUpdated).format(`YYYY-MM-DD`)]})})]}),O=d?(0,X.jsx)(m,{justify:`center`,py:`xl`,children:(0,X.jsx)(a,{size:`sm`})}):_?(0,X.jsx)(I,{color:`red`,icon:(0,X.jsx)(F,{size:16}),children:_}):c?(0,X.jsx)(h,{markdown:c.markdown,onInternalLink:e=>r.some(t=>t.slug===e)?(s(e),!0):!1}):null;return(0,X.jsx)(p,{navTitle:`Pages`,navSearch:E,nav:T,title:D,tocMarkdown:c?.markdown,mode:`container`,height:$e,children:O})}function tt({symbols:e}){return(0,X.jsx)(k,{mode:`client`,data:e,columns:Je,getRowId:e=>`${e.kind}:${e.name}`,searchable:!0,searchPlaceholder:`Rechercher un symbole…`})}function Z({label:e,value:t,color:n,icon:r,onClick:i}){return(0,X.jsx)(S,{withBorder:!0,radius:`md`,p:`md`,onClick:i,style:{cursor:i?`pointer`:`default`},children:(0,X.jsxs)(m,{justify:`space-between`,wrap:`nowrap`,children:[(0,X.jsxs)(y,{gap:2,children:[(0,X.jsx)(P,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:700,children:e}),(0,X.jsx)(P,{fz:28,fw:700,lh:1,children:t})]}),(0,X.jsx)(v,{variant:`light`,color:n,size:44,radius:`md`,children:r})]})})}function nt({dep:e,out:t,onClick:n}){return(0,X.jsx)(S,{withBorder:!0,radius:`md`,p:`sm`,onClick:n,style:{cursor:`pointer`},children:(0,X.jsxs)(m,{gap:`sm`,wrap:`nowrap`,children:[(0,X.jsx)(v,{variant:`light`,color:e.kind===`nodefony`?`brand`:`gray`,size:34,radius:`md`,children:(0,X.jsx)(Me,{size:18})}),(0,X.jsxs)(y,{gap:3,style:{minWidth:0,flex:1},children:[(0,X.jsx)(P,{size:`sm`,fw:500,truncate:!0,children:e.name}),(0,X.jsxs)(m,{gap:6,wrap:`nowrap`,children:[e.installed?(0,X.jsxs)(M,{size:`xs`,variant:`default`,children:[`v`,e.installed]}):(0,X.jsx)(M,{size:`xs`,variant:`light`,color:`gray`,children:`non installé`}),e.range&&(0,X.jsx)(P,{size:`xs`,c:`dimmed`,truncate:!0,children:e.range})]})]}),t&&(t.outdated?(0,X.jsx)(u,{label:`Dernière version npm : ${t.latest}`,children:(0,X.jsxs)(M,{size:`xs`,color:`orange`,variant:`filled`,style:{flexShrink:0},children:[`↑ `,t.latest]})}):t.latest?(0,X.jsx)(M,{size:`xs`,color:`teal`,variant:`light`,style:{flexShrink:0},children:`à jour`}):null),e.kind===`external`&&!t&&(0,X.jsx)(w,{size:13,style:{opacity:.4,flexShrink:0}})]})})}function rt({moduleKey:e,onNavigate:t}){let n=H(),[r,i]=(0,Y.useState)([]),[o,s]=(0,Y.useState)(!0),[c,l]=(0,Y.useState)({}),[u,d]=(0,Y.useState)(!1),f=`/nodefony/kernel/api/module/${encodeURIComponent(e)}/dependencies`;(0,Y.useEffect)(()=>{let e=!1;return s(!0),l({}),n.api.getAbsolute(f).then(t=>{e||i(t.deps??[])}).catch(()=>{e||i([])}).finally(()=>{e||s(!1)}),()=>{e=!0}},[n,f]);let p=async()=>{d(!0);try{let e=await n.api.getAbsolute(`${f}/outdated`),t={};(e.outdated??[]).forEach(e=>{t[e.name]=e}),l(t)}catch{}finally{d(!1)}};if(o)return(0,X.jsx)(m,{justify:`center`,py:`xl`,children:(0,X.jsx)(a,{size:`sm`})});let h=r.filter(e=>e.kind===`nodefony`),g=r.filter(e=>e.kind===`external`),_=e=>e===`nodefony`?`core`:e.replace(`@nodefony/`,``),v=Object.values(c).filter(e=>e.outdated).length,b=Object.keys(c).length>0;return(0,X.jsxs)(y,{gap:`xl`,children:[(0,X.jsxs)(m,{justify:`space-between`,wrap:`nowrap`,children:[(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:`Versions installées (node_modules). Le check interroge le registry npm (deps externes).`}),(0,X.jsx)(j,{size:`xs`,variant:`light`,color:v>0?`orange`:void 0,leftSection:(0,X.jsx)(E,{size:14}),loading:u,onClick:p,children:b?v>0?`${v} MAJ dispo`:`Tout à jour`:`Vérifier les MAJ`})]}),h.length>0&&(0,X.jsxs)(y,{gap:`sm`,children:[(0,X.jsxs)(m,{gap:`xs`,children:[(0,X.jsx)(P,{size:`sm`,fw:700,children:`Nodefony`}),(0,X.jsx)(M,{size:`sm`,variant:`light`,color:`brand`,children:h.length})]}),(0,X.jsx)(K,{cols:{base:1,sm:2,lg:3},spacing:`sm`,children:h.map(e=>(0,X.jsx)(nt,{dep:e,onClick:()=>t(_(e.name))},e.name))})]}),g.length>0&&(0,X.jsxs)(y,{gap:`sm`,children:[(0,X.jsxs)(m,{gap:`xs`,children:[(0,X.jsx)(P,{size:`sm`,fw:700,children:`Externes`}),(0,X.jsx)(M,{size:`sm`,variant:`light`,color:`gray`,children:g.length})]}),(0,X.jsx)(K,{cols:{base:1,sm:2,lg:3},spacing:`sm`,children:g.map(e=>(0,X.jsx)(nt,{dep:e,out:c[e.name],onClick:()=>window.open(`https://www.npmjs.com/package/${e.name}`,`_blank`,`noopener`)},e.name))})]})]})}function it({res:e}){return(0,X.jsxs)(m,{gap:6,wrap:`nowrap`,children:[(0,X.jsxs)(M,{color:e.ok?`teal`:`red`,variant:`light`,children:[e.ok?`✓`:`✗`,` `,e.passed,` passed`,e.failed?` / ${e.failed} failed`:``]}),(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[(e.durationMs/1e3).toFixed(1),`s`]})]})}function at({moduleKey:e,tests:t}){let n=H(),r=`__all__`,[i,a]=(0,Y.useState)({}),s=t.groups&&t.groups.length>0?t.groups:t.files.length>0?[{category:`unit`,files:t.files,runnable:!0}]:[],[l,u]=(0,Y.useState)(`unit`),d=s.find(e=>e.category===l)??s[0],f=(e,t)=>a(n=>({...n,[e]:{ok:!1,code:null,passed:0,failed:0,durationMs:0,output:t,mode:``}})),p=async t=>{let i=t??r,o=`/nodefony/kernel/api/module/${encodeURIComponent(e)}/test/run`;a(e=>({...e,[i]:`running`}));try{let e=(await n.api.postAbsolute(o,t?{file:t}:{})).jobId;if(!e)return f(i,`pas de jobId renvoyé`);for(let t=0;t<120;t++){await new Promise(e=>setTimeout(e,1500));let t=await n.api.getAbsolute(`${o}?jobId=${encodeURIComponent(e)}`);if(t.done){a(e=>({...e,[i]:t}));return}}f(i,`timeout (run trop long)`)}catch(e){f(i,e instanceof Error?e.message:String(e))}};if(!t.devMode)return(0,X.jsxs)(I,{color:`yellow`,icon:(0,X.jsx)(F,{size:16}),title:`Lancement désactivé`,children:[`Le lancement des tests depuis Studio n'est autorisé qu'en mode`,` `,(0,X.jsx)(A,{children:`development`}),`.`]});let h=i[r],g=Object.entries(i).filter(([,e])=>e!==`running`&&!e.ok);return(0,X.jsxs)(y,{gap:`md`,children:[s.length>0&&(0,X.jsx)(o,{value:d?.category??l,onChange:u,data:s.map(e=>({value:e.category,label:`${ot[e.category]??e.category} (${e.files.length})`}))}),d?.runnable?(0,X.jsxs)(y,{gap:`md`,children:[(0,X.jsxs)(m,{children:[(0,X.jsx)(j,{leftSection:(0,X.jsx)(U,{size:16}),loading:h===`running`,onClick:()=>p(),children:`Lancer tous (+ coverage)`}),h&&h!==`running`&&(0,X.jsx)(it,{res:h}),(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:`« Lancer tous » régénère aussi le coverage (recharge la page pour le voir à jour).`})]}),(0,X.jsx)(b.ScrollContainer,{minWidth:560,children:(0,X.jsxs)(b,{striped:!0,highlightOnHover:!0,withRowBorders:!1,children:[(0,X.jsx)(b.Thead,{children:(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Th,{children:`Fichier de test`}),(0,X.jsx)(b.Th,{w:90,children:`Action`}),(0,X.jsx)(b.Th,{children:`Résultat`})]})}),(0,X.jsx)(b.Tbody,{children:d.files.map(e=>{let t=i[e];return(0,X.jsxs)(b.Tr,{children:[(0,X.jsx)(b.Td,{children:(0,X.jsx)(A,{children:e})}),(0,X.jsx)(b.Td,{children:(0,X.jsx)(j,{size:`xs`,variant:`light`,leftSection:(0,X.jsx)(U,{size:14}),loading:t===`running`,onClick:()=>p(e),children:`Run`})}),(0,X.jsx)(b.Td,{children:t&&t!==`running`?(0,X.jsx)(it,{res:t}):null})]},e)})})]})}),g.map(([e,t])=>(0,X.jsx)(I,{color:`red`,icon:(0,X.jsx)(F,{size:16}),title:`Échec : ${e===r?`suite complète`:e}`,children:(0,X.jsx)(c.Autosize,{mah:240,children:(0,X.jsx)(A,{block:!0,children:t.output||`(pas de sortie)`})})},e))]}):d?(0,X.jsxs)(y,{gap:`xs`,children:[(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[`Suite « `,ot[d.category]??d.category,` » — lecture seule. Lancée en CLI (serveur live / base / config dédiée requis), pas depuis Studio.`]}),(0,X.jsx)(y,{gap:2,children:d.files.map(e=>(0,X.jsx)(A,{style:{fontSize:11},children:e},e))})]}):(0,X.jsx)(P,{size:`sm`,c:`dimmed`,children:`Aucune suite de tests.`})]})}var ot={unit:`Unit`,integration:`Intégration`,e2e:`E2E`,websockets:`WebSockets`,routing:`Routing`,load:`Charge`,memory:`Mémoire`,other:`Autre`};function Q(e){return e>=80?`teal`:e>=50?`yellow`:`red`}function st({report:e}){let t=e.total,n=e.files??[],r=(e,t)=>(0,X.jsxs)(y,{gap:4,align:`center`,children:[(0,X.jsx)(z,{size:92,thickness:8,roundCaps:!0,sections:[{value:e,color:Q(e)}],label:(0,X.jsxs)(P,{ta:`center`,fw:700,size:`sm`,children:[Math.round(e),`%`]})}),(0,X.jsx)(P,{size:`xs`,c:`dimmed`,children:t})]});return(0,X.jsxs)(y,{gap:`md`,children:[(0,X.jsxs)(m,{gap:`xl`,wrap:`wrap`,align:`flex-start`,children:[r(t?.lines??0,`Lines`),r(t?.statements??0,`Statements`),r(t?.functions??0,`Functions`),r(t?.branches??0,`Branches`),e.generated&&(0,X.jsx)(u,{label:`Date du dernier rapport (npm run coverage)`,children:(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,mt:`md`,children:[`généré `,(0,ze.default)(e.generated).format(`YYYY-MM-DD HH:mm`)]})})]}),(0,X.jsxs)(P,{size:`xs`,c:`dimmed`,children:[`Couverture des tests `,(0,X.jsx)(`b`,{children:`unit`}),` (vitest + @vitest/coverage-v8). L'intégration tape un serveur séparé → non mesurée ici.`]}),(0,X.jsx)(k,{mode:`client`,data:n,columns:Ye,getRowId:e=>e.file,searchable:!0,searchPlaceholder:`Rechercher un fichier…`})]})}function $({n:e}){return(0,X.jsx)(M,{size:`xs`,variant:`light`,color:`gray`,children:e})}export{Ze as ModuleDetail,Ze as default};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{$ as t,$t as n,Kt as r,Mn as i,Rt as a,Ut as o,an as s,di as c,et as l,on as u,or as d,q as f,sn as p,vn as m,wt as h,yn as g,zt as _}from"./ui-Dy8y0zPl.js";import{t as v}from"./Skeleton-DybgHU9E.js";import{c as y}from"./stores-DIccV-P5.js";import{a as b}from"./hooks-C4XxBzBx.js";import{t as x}from"./IconAffiliate-PkjISh3s.js";import{n as S,t as C}from"./IconPackages-DZHwNbfL.js";import{t as w}from"./IconBook-CFhZJJ0F.js";import{t as T}from"./IconCode-Bp8-3f_0.js";import{t as E}from"./IconFolder-DGoYanMO.js";import{t as D}from"./IconPuzzle-CslQPiCN.js";import{t as O}from"./IconStack2-DA4YUbMC.js";import{j as k,k as A,nt as j,vt as M}from"./index-wfxUl83u.js";var N=e(c(),1),P=d(),F={app:{label:`Application`,color:`brand`,Icon:S,order:0},core:{label:`Core`,color:`grape`,Icon:O,order:1},framework:{label:`Framework`,color:`blue`,Icon:j,order:2},module:{label:`Module`,color:`teal`,Icon:D,order:3}};function I(e){if(e.key===`core`)return`core`;if(e.isApp)return`app`;let t=e.path??``;return t.includes(`src/modules/`)?`module`:t.includes(`src/packages/`)||e.name.startsWith(`@nodefony/`)?`framework`:`module`}function L(e){return e>=80?`teal`:e>=50?`yellow`:`red`}function R({icon:e,value:t,label:n,color:r}){return(0,P.jsxs)(i,{justify:`space-between`,wrap:`nowrap`,gap:`sm`,children:[(0,P.jsxs)(i,{gap:8,wrap:`nowrap`,children:[(0,P.jsx)(`span`,{style:{opacity:.65,display:`flex`},children:e}),(0,P.jsx)(m,{size:`sm`,c:`dimmed`,children:n})]}),(0,P.jsx)(m,{size:`sm`,fw:700,c:r,children:t??`…`})]})}var z=M(()=>{let e=y(),r=b(),[a,s]=(0,N.useState)([]),[c,d]=(0,N.useState)({}),[p,x]=(0,N.useState)({}),[S,C]=(0,N.useState)(!1),[w,T]=(0,N.useState)(null),[E,D]=(0,N.useState)(``),O=async()=>{C(!0),T(null);try{let t=await e.api.getAbsolute(`/nodefony/kernel/api/modules`);s(Array.isArray(t)?t:[]),e.api.getAbsolute(`/nodefony/framework/api/routes`).then(e=>{let t={};(e??[]).forEach(e=>{e.module&&(t[e.module]=(t[e.module]??0)+1)}),x(t)}).catch(()=>x({}));let n=await Promise.all((t??[]).map(async t=>{try{let n=await e.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(t.key)}`);return[t.key,n]}catch{return null}}));d(Object.fromEntries(n.filter(e=>e!==null)))}catch(e){T(e instanceof Error?e.message:String(e))}finally{C(!1)}};(0,N.useEffect)(()=>{O()},[e]);let k=(0,N.useMemo)(()=>{let e=E.trim().toLowerCase();return e?a.filter(t=>t.key.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)):a},[a,E]),A=(0,N.useMemo)(()=>{let e={app:0,core:0,framework:0,module:0};return a.forEach(t=>e[I(t)]+=1),e},[a]);return(0,P.jsxs)(f,{title:`Modules`,subtitle:`${a.length} chargé(s) · ${A.framework} framework · ${A.module} module(s) · ${A.app} app · ${A.core} core`,actions:(0,P.jsxs)(i,{gap:`sm`,children:[(0,P.jsx)(_,{placeholder:`Filtrer…`,leftSection:(0,P.jsx)(t,{size:16}),value:E,onChange:e=>D(e.currentTarget.value),w:220}),(0,P.jsx)(u,{variant:`light`,leftSection:(0,P.jsx)(l,{size:16}),loading:S,onClick:()=>void O(),children:`Recharger`})]}),children:[w&&(0,P.jsx)(g,{color:`red`,icon:(0,P.jsx)(h,{size:16}),title:`Erreur`,children:w}),S&&a.length===0?(0,P.jsx)(n,{children:Array.from({length:6}).map((e,t)=>(0,P.jsx)(n.Col,{span:{base:12,sm:6,lg:4},children:(0,P.jsx)(v,{h:190,radius:`md`})},t))}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{children:[`app`,`core`].map(e=>{let t=k.filter(t=>I(t)===e);return t.length?(0,P.jsx)(n.Col,{span:{base:12,sm:6},children:(0,P.jsxs)(o,{gap:`sm`,children:[(0,P.jsx)(V,{cat:e,count:t.length}),t.map(t=>(0,P.jsx)(H,{m:t,cat:e,detail:c[t.key],routeCount:p[t.key]??0,onOpen:()=>r(`/nodefony/modules/${encodeURIComponent(t.key)}`)},t.key))]})},e):null})}),[`framework`,`module`].map(e=>{let t=k.filter(t=>I(t)===e);return t.length?(0,P.jsxs)(o,{gap:`sm`,children:[(0,P.jsx)(V,{cat:e,count:t.length}),(0,P.jsx)(n,{children:t.map(t=>(0,P.jsx)(n.Col,{span:{base:12,sm:6,lg:4},children:(0,P.jsx)(H,{m:t,cat:e,detail:c[t.key],routeCount:p[t.key]??0,onOpen:()=>r(`/nodefony/modules/${encodeURIComponent(t.key)}`)})},t.key))})]},e):null})]}),!S&&k.length===0&&(0,P.jsxs)(m,{c:`dimmed`,ta:`center`,py:`xl`,children:[`Aucun module ne correspond à « `,E,` ».`]})]})});function B({cat:e,size:t}){let n=F[e].Icon;return(0,P.jsx)(n,{size:t})}function V({cat:e,count:t}){return(0,P.jsxs)(i,{gap:`xs`,children:[(0,P.jsx)(a,{variant:`light`,color:F[e].color,size:`sm`,radius:`sm`,children:(0,P.jsx)(B,{cat:e,size:14})}),(0,P.jsx)(m,{size:`sm`,fw:700,children:F[e].label}),(0,P.jsx)(p,{size:`sm`,variant:`light`,color:F[e].color,children:t})]})}function H({m:e,cat:t,detail:n,routeCount:c,onOpen:l}){let u=F[t].color,d=t===`core`?`Nodefony Core`:e.name,f=t===`core`?`socle du framework`:F[t].label;return(0,P.jsxs)(s,{withBorder:!0,radius:`md`,padding:`md`,h:`100%`,onClick:l,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&l()},style:{display:`flex`,flexDirection:`column`,cursor:`pointer`,borderLeft:`4px solid var(--mantine-color-${u}-6)`,transition:`border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`var(--mantine-color-${u}-5)`,e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`var(--mantine-shadow-sm)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=``,e.currentTarget.style.boxShadow=``,e.currentTarget.style.transform=``},children:[(0,P.jsx)(s.Section,{withBorder:!0,inheritPadding:!0,py:`sm`,style:{background:`var(--mantine-color-default-hover)`},children:(0,P.jsxs)(i,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,children:[(0,P.jsxs)(i,{gap:`sm`,wrap:`nowrap`,style:{minWidth:0},children:[(0,P.jsx)(a,{variant:`light`,color:u,size:`lg`,radius:`md`,children:(0,P.jsx)(B,{cat:t,size:20})}),(0,P.jsxs)(o,{gap:0,style:{minWidth:0},children:[(0,P.jsx)(m,{fw:600,truncate:!0,title:e.name,children:d}),(0,P.jsx)(m,{size:`xs`,c:u,fw:600,children:f})]})]}),e.version&&(0,P.jsxs)(p,{variant:`default`,size:`sm`,style:{flexShrink:0},children:[`v`,e.version]})]})}),(0,P.jsxs)(o,{gap:`sm`,mt:`md`,style:{flex:1},children:[(0,P.jsxs)(i,{gap:6,wrap:`nowrap`,c:`dimmed`,children:[(0,P.jsx)(E,{size:14,style:{flexShrink:0}}),(0,P.jsx)(r,{label:e.path??`—`,disabled:!e.path,multiline:!0,w:360,children:(0,P.jsx)(m,{size:`xs`,ff:`monospace`,truncate:!0,children:e.path??`—`})})]}),(0,P.jsxs)(o,{gap:7,mt:`auto`,pt:`xs`,children:[(0,P.jsx)(R,{icon:(0,P.jsx)(k,{size:15}),value:c,label:`Routes`}),(0,P.jsx)(R,{icon:(0,P.jsx)(x,{size:15}),value:n?n.services?.length??0:void 0,label:`Services`}),(0,P.jsx)(R,{icon:(0,P.jsx)(C,{size:15}),value:n?n.dependencies.length:void 0,label:`Dépendances`}),(0,P.jsx)(R,{icon:(0,P.jsx)(w,{size:15}),value:n?n.docsCount??0:void 0,label:`Docs`}),(0,P.jsx)(R,{icon:(0,P.jsx)(T,{size:15}),value:n?n.symbolsCount??0:void 0,label:`API`}),(0,P.jsx)(R,{icon:(0,P.jsx)(A,{size:15}),value:n?n.coverageLines==null?`—`:`${Math.round(n.coverageLines)}%`:void 0,label:`Couverture`,color:n&&n.coverageLines!=null?L(n.coverageLines):void 0})]})]})]})}export{z as Modules,z as default};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{$ as t,$t as n,Kt as r,Mn as i,Rt as a,Ut as o,an as s,di as c,et as l,on as u,or as d,q as f,sn as p,vn as m,wt as h,yn as g,zt as _}from"./ui-BlRFVRfl.js";import{t as v}from"./Skeleton-coYonGf_.js";import{c as y}from"./stores-fG-e-IP-.js";import{l as b}from"./hooks-DMHLQNUe.js";import{t as x}from"./IconAffiliate-BDcNyaq_.js";import{n as S,t as C}from"./IconPackages-a59KQceL.js";import{t as w}from"./IconBook-NYou6bAm.js";import{t as T}from"./IconCode-8A2Vc3mV.js";import{t as E}from"./IconFolder-BeoB9Wy3.js";import{t as D}from"./IconPuzzle-AO4L5bjR.js";import{t as O}from"./IconStack2-BRfnzl41.js";import{j as k,k as A,nt as j,vt as M}from"./index-BwkdF4pp.js";var N=e(c(),1),P=d(),F={app:{label:`Application`,color:`brand`,Icon:S,order:0},core:{label:`Core`,color:`grape`,Icon:O,order:1},framework:{label:`Framework`,color:`blue`,Icon:j,order:2},module:{label:`Module`,color:`teal`,Icon:D,order:3}};function I(e){if(e.key===`core`)return`core`;if(e.isApp)return`app`;let t=e.path??``;return t.includes(`src/modules/`)?`module`:t.includes(`src/packages/`)||e.name.startsWith(`@nodefony/`)?`framework`:`module`}function L(e){return e>=80?`teal`:e>=50?`yellow`:`red`}function R({icon:e,value:t,label:n,color:r}){return(0,P.jsxs)(i,{justify:`space-between`,wrap:`nowrap`,gap:`sm`,children:[(0,P.jsxs)(i,{gap:8,wrap:`nowrap`,children:[(0,P.jsx)(`span`,{style:{opacity:.65,display:`flex`},children:e}),(0,P.jsx)(m,{size:`sm`,c:`dimmed`,children:n})]}),(0,P.jsx)(m,{size:`sm`,fw:700,c:r,children:t??`…`})]})}var z=M(()=>{let e=y(),r=b(),[a,s]=(0,N.useState)([]),[c,d]=(0,N.useState)({}),[p,x]=(0,N.useState)({}),[S,C]=(0,N.useState)(!1),[w,T]=(0,N.useState)(null),[E,D]=(0,N.useState)(``),O=async()=>{C(!0),T(null);try{let t=await e.api.getAbsolute(`/nodefony/kernel/api/modules`);s(Array.isArray(t)?t:[]),e.api.getAbsolute(`/nodefony/framework/api/routes`).then(e=>{let t={};(e??[]).forEach(e=>{e.module&&(t[e.module]=(t[e.module]??0)+1)}),x(t)}).catch(()=>x({}));let n=await Promise.all((t??[]).map(async t=>{try{let n=await e.api.getAbsolute(`/nodefony/kernel/api/module/${encodeURIComponent(t.key)}`);return[t.key,n]}catch{return null}}));d(Object.fromEntries(n.filter(e=>e!==null)))}catch(e){T(e instanceof Error?e.message:String(e))}finally{C(!1)}};(0,N.useEffect)(()=>{O()},[e]);let k=(0,N.useMemo)(()=>{let e=E.trim().toLowerCase();return e?a.filter(t=>t.key.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)):a},[a,E]),A=(0,N.useMemo)(()=>{let e={app:0,core:0,framework:0,module:0};return a.forEach(t=>e[I(t)]+=1),e},[a]);return(0,P.jsxs)(f,{title:`Modules`,subtitle:`${a.length} chargé(s) · ${A.framework} framework · ${A.module} module(s) · ${A.app} app · ${A.core} core`,actions:(0,P.jsxs)(i,{gap:`sm`,children:[(0,P.jsx)(_,{placeholder:`Filtrer…`,leftSection:(0,P.jsx)(t,{size:16}),value:E,onChange:e=>D(e.currentTarget.value),w:220}),(0,P.jsx)(u,{variant:`light`,leftSection:(0,P.jsx)(l,{size:16}),loading:S,onClick:()=>void O(),children:`Recharger`})]}),children:[w&&(0,P.jsx)(g,{color:`red`,icon:(0,P.jsx)(h,{size:16}),title:`Erreur`,children:w}),S&&a.length===0?(0,P.jsx)(n,{children:Array.from({length:6}).map((e,t)=>(0,P.jsx)(n.Col,{span:{base:12,sm:6,lg:4},children:(0,P.jsx)(v,{h:190,radius:`md`})},t))}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{children:[`app`,`core`].map(e=>{let t=k.filter(t=>I(t)===e);return t.length?(0,P.jsx)(n.Col,{span:{base:12,sm:6},children:(0,P.jsxs)(o,{gap:`sm`,children:[(0,P.jsx)(V,{cat:e,count:t.length}),t.map(t=>(0,P.jsx)(H,{m:t,cat:e,detail:c[t.key],routeCount:p[t.key]??0,onOpen:()=>r(`/nodefony/modules/${encodeURIComponent(t.key)}`)},t.key))]})},e):null})}),[`framework`,`module`].map(e=>{let t=k.filter(t=>I(t)===e);return t.length?(0,P.jsxs)(o,{gap:`sm`,children:[(0,P.jsx)(V,{cat:e,count:t.length}),(0,P.jsx)(n,{children:t.map(t=>(0,P.jsx)(n.Col,{span:{base:12,sm:6,lg:4},children:(0,P.jsx)(H,{m:t,cat:e,detail:c[t.key],routeCount:p[t.key]??0,onOpen:()=>r(`/nodefony/modules/${encodeURIComponent(t.key)}`)})},t.key))})]},e):null})]}),!S&&k.length===0&&(0,P.jsxs)(m,{c:`dimmed`,ta:`center`,py:`xl`,children:[`Aucun module ne correspond à « `,E,` ».`]})]})});function B({cat:e,size:t}){let n=F[e].Icon;return(0,P.jsx)(n,{size:t})}function V({cat:e,count:t}){return(0,P.jsxs)(i,{gap:`xs`,children:[(0,P.jsx)(a,{variant:`light`,color:F[e].color,size:`sm`,radius:`sm`,children:(0,P.jsx)(B,{cat:e,size:14})}),(0,P.jsx)(m,{size:`sm`,fw:700,children:F[e].label}),(0,P.jsx)(p,{size:`sm`,variant:`light`,color:F[e].color,children:t})]})}function H({m:e,cat:t,detail:n,routeCount:c,onOpen:l}){let u=F[t].color,d=t===`core`?`Nodefony Core`:e.name,f=t===`core`?`socle du framework`:F[t].label;return(0,P.jsxs)(s,{withBorder:!0,radius:`md`,padding:`md`,h:`100%`,onClick:l,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&l()},style:{display:`flex`,flexDirection:`column`,cursor:`pointer`,borderLeft:`4px solid var(--mantine-color-${u}-6)`,transition:`border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`var(--mantine-color-${u}-5)`,e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`var(--mantine-shadow-sm)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=``,e.currentTarget.style.boxShadow=``,e.currentTarget.style.transform=``},children:[(0,P.jsx)(s.Section,{withBorder:!0,inheritPadding:!0,py:`sm`,style:{background:`var(--mantine-color-default-hover)`},children:(0,P.jsxs)(i,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,children:[(0,P.jsxs)(i,{gap:`sm`,wrap:`nowrap`,style:{minWidth:0},children:[(0,P.jsx)(a,{variant:`light`,color:u,size:`lg`,radius:`md`,children:(0,P.jsx)(B,{cat:t,size:20})}),(0,P.jsxs)(o,{gap:0,style:{minWidth:0},children:[(0,P.jsx)(m,{fw:600,truncate:!0,title:e.name,children:d}),(0,P.jsx)(m,{size:`xs`,c:u,fw:600,children:f})]})]}),e.version&&(0,P.jsxs)(p,{variant:`default`,size:`sm`,style:{flexShrink:0},children:[`v`,e.version]})]})}),(0,P.jsxs)(o,{gap:`sm`,mt:`md`,style:{flex:1},children:[(0,P.jsxs)(i,{gap:6,wrap:`nowrap`,c:`dimmed`,children:[(0,P.jsx)(E,{size:14,style:{flexShrink:0}}),(0,P.jsx)(r,{label:e.path??`—`,disabled:!e.path,multiline:!0,w:360,children:(0,P.jsx)(m,{size:`xs`,ff:`monospace`,truncate:!0,children:e.path??`—`})})]}),(0,P.jsxs)(o,{gap:7,mt:`auto`,pt:`xs`,children:[(0,P.jsx)(R,{icon:(0,P.jsx)(k,{size:15}),value:c,label:`Routes`}),(0,P.jsx)(R,{icon:(0,P.jsx)(x,{size:15}),value:n?n.services?.length??0:void 0,label:`Services`}),(0,P.jsx)(R,{icon:(0,P.jsx)(C,{size:15}),value:n?n.dependencies.length:void 0,label:`Dépendances`}),(0,P.jsx)(R,{icon:(0,P.jsx)(w,{size:15}),value:n?n.docsCount??0:void 0,label:`Docs`}),(0,P.jsx)(R,{icon:(0,P.jsx)(T,{size:15}),value:n?n.symbolsCount??0:void 0,label:`API`}),(0,P.jsx)(R,{icon:(0,P.jsx)(A,{size:15}),value:n?n.coverageLines==null?`—`:`${Math.round(n.coverageLines)}%`:void 0,label:`Couverture`,color:n&&n.coverageLines!=null?L(n.coverageLines):void 0})]})]})]})}export{z as Modules,z as default};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{H as t,K as n,Mn as r,Ut as i,Vt as a,_n as o,an as s,di as c,on as l,or as u,q as d,sn as f,vn as p}from"./ui-Dy8y0zPl.js";import{c as m}from"./stores-DIccV-P5.js";import{a as h}from"./hooks-C4XxBzBx.js";import{t as g}from"./IconArrowLeft-7ehg9XYP.js";import{H as _,Y as v,dt as y,vt as b,y as x}from"./index-wfxUl83u.js";var S=e(c(),1),C=u(),w=`v1.0`,T=b(()=>{let e=m(),c=h(),[u]=y(),b=u.get(`name`)??``,T=u.get(`connector`)??``,E=(0,S.useCallback)(()=>e.api.getAbsolute(`/nodefony/orm/api/entity/${encodeURIComponent(b)}${T?`?connector=${encodeURIComponent(T)}`:``}`),[e,b,T]),{data:D,loading:O,error:k,reload:A}=x(E),j=e=>c(`/nodefony/orm-entity?name=${encodeURIComponent(e)}&connector=${encodeURIComponent(D?.connector??T)}`),M=new Set((D?.relations??[]).filter(e=>e.type===`many-to-one`||e.type===`one-to-one`).map(e=>e.foreignKey??e.field));return(0,C.jsx)(d,{title:b||`Entité`,subtitle:D?`domaine : ${D.domain||`—`} · module : ${D.module||`—`} · connecteur : ${D.connector}`:T,icon:(0,C.jsx)(v,{size:22}),actions:(0,C.jsx)(l,{variant:`light`,leftSection:(0,C.jsx)(g,{size:16}),onClick:()=>c(`/nodefony/databases`),children:`Retour à l'ERD`}),children:(0,C.jsx)(n,{loading:O,error:k,empty:!D,onRetry:A,emptyMessage:`Entité « ${b} » introuvable.`,children:D&&(0,C.jsxs)(i,{gap:`lg`,children:[(0,C.jsxs)(s,{withBorder:!0,radius:`md`,p:`md`,children:[(0,C.jsxs)(r,{justify:`space-between`,mb:`sm`,children:[(0,C.jsxs)(r,{gap:6,children:[(0,C.jsx)(p,{fw:600,children:`Colonnes`}),(0,C.jsx)(t,{title:`Colonnes`,version:w,summary:`${D.columns.length} colonne(s) de la table.`,sections:[{label:`Légende`,body:`🔑 = clé primaire, FK = clé étrangère (relation), ◦ = unique, « ? » sur le type = nullable.`}]})]}),(0,C.jsx)(f,{variant:`light`,children:D.columns.length})]}),D.columns.length===0?(0,C.jsx)(p,{c:`dimmed`,size:`sm`,children:`Colonnes non introspectées (ORM non connecté ?).`}):(0,C.jsxs)(a,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[(0,C.jsx)(a.Thead,{children:(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Th,{children:`Colonne`}),(0,C.jsx)(a.Th,{children:`Type`}),(0,C.jsx)(a.Th,{children:`Clé`}),(0,C.jsx)(a.Th,{children:`Nullable`})]})}),(0,C.jsx)(a.Tbody,{children:D.columns.map(e=>(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Td,{children:(0,C.jsxs)(r,{gap:6,wrap:`nowrap`,children:[e.primaryKey?(0,C.jsx)(_,{size:13,color:`var(--mantine-color-yellow-6)`}):M.has(e.name)?(0,C.jsx)(p,{size:`xs`,fw:700,c:`blue`,children:`FK`}):(0,C.jsx)(`span`,{style:{width:13}}),(0,C.jsxs)(p,{size:`sm`,children:[e.name,e.unique&&!e.primaryKey?` ◦`:``]})]})}),(0,C.jsx)(a.Td,{children:(0,C.jsxs)(p,{c:`dimmed`,size:`sm`,children:[e.type,e.nullable?`?`:``]})}),(0,C.jsx)(a.Td,{children:e.primaryKey?(0,C.jsx)(f,{size:`xs`,color:`yellow`,children:`PK`}):e.unique?(0,C.jsx)(f,{size:`xs`,variant:`outline`,children:`unique`}):``}),(0,C.jsx)(a.Td,{children:(0,C.jsx)(p,{size:`sm`,c:`dimmed`,children:e.nullable?`oui`:`non`})})]},e.name))})]})]}),(0,C.jsxs)(s,{withBorder:!0,radius:`md`,p:`md`,children:[(0,C.jsxs)(r,{justify:`space-between`,mb:`sm`,children:[(0,C.jsxs)(r,{gap:6,children:[(0,C.jsx)(p,{fw:600,children:`Relations`}),(0,C.jsx)(t,{title:`Relations`,version:w,summary:`${D.relations.length} relation(s) déclarée(s).`,sections:[{label:`Navigation`,body:`Clique une cible pour ouvrir cette table (navigation de proche en proche dans le modèle).`}]})]}),(0,C.jsx)(f,{variant:`light`,children:D.relations.length})]}),D.relations.length===0?(0,C.jsx)(p,{c:`dimmed`,size:`sm`,children:`Aucune relation déclarée.`}):(0,C.jsxs)(a,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[(0,C.jsx)(a.Thead,{children:(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Th,{children:`Champ (FK)`}),(0,C.jsx)(a.Th,{children:`Cardinalité`}),(0,C.jsx)(a.Th,{children:`Table cible`})]})}),(0,C.jsx)(a.Tbody,{children:D.relations.map(e=>(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Td,{children:(0,C.jsx)(p,{size:`sm`,children:e.foreignKey??e.field})}),(0,C.jsx)(a.Td,{children:(0,C.jsx)(f,{size:`xs`,variant:`light`,children:e.type})}),(0,C.jsx)(a.Td,{children:(0,C.jsx)(o,{component:`button`,type:`button`,size:`sm`,onClick:()=>j(e.target),children:e.target})})]},`${e.field}>${e.target}`))})]})]})]})})})});export{T as OrmEntity};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{H as t,K as n,Mn as r,Ut as i,Vt as a,_n as o,an as s,di as c,on as l,or as u,q as d,sn as f,vn as p}from"./ui-BlRFVRfl.js";import{c as m}from"./stores-fG-e-IP-.js";import{l as h}from"./hooks-DMHLQNUe.js";import{t as g}from"./IconArrowLeft-CGbdeI78.js";import{H as _,Y as v,dt as y,vt as b,y as x}from"./index-BwkdF4pp.js";var S=e(c(),1),C=u(),w=`v1.0`,T=b(()=>{let e=m(),c=h(),[u]=y(),b=u.get(`name`)??``,T=u.get(`connector`)??``,E=(0,S.useCallback)(()=>e.api.getAbsolute(`/nodefony/orm/api/entity/${encodeURIComponent(b)}${T?`?connector=${encodeURIComponent(T)}`:``}`),[e,b,T]),{data:D,loading:O,error:k,reload:A}=x(E),j=e=>c(`/nodefony/orm-entity?name=${encodeURIComponent(e)}&connector=${encodeURIComponent(D?.connector??T)}`),M=new Set((D?.relations??[]).filter(e=>e.type===`many-to-one`||e.type===`one-to-one`).map(e=>e.foreignKey??e.field));return(0,C.jsx)(d,{title:b||`Entité`,subtitle:D?`domaine : ${D.domain||`—`} · module : ${D.module||`—`} · connecteur : ${D.connector}`:T,icon:(0,C.jsx)(v,{size:22}),actions:(0,C.jsx)(l,{variant:`light`,leftSection:(0,C.jsx)(g,{size:16}),onClick:()=>c(`/nodefony/databases`),children:`Retour à l'ERD`}),children:(0,C.jsx)(n,{loading:O,error:k,empty:!D,onRetry:A,emptyMessage:`Entité « ${b} » introuvable.`,children:D&&(0,C.jsxs)(i,{gap:`lg`,children:[(0,C.jsxs)(s,{withBorder:!0,radius:`md`,p:`md`,children:[(0,C.jsxs)(r,{justify:`space-between`,mb:`sm`,children:[(0,C.jsxs)(r,{gap:6,children:[(0,C.jsx)(p,{fw:600,children:`Colonnes`}),(0,C.jsx)(t,{title:`Colonnes`,version:w,summary:`${D.columns.length} colonne(s) de la table.`,sections:[{label:`Légende`,body:`🔑 = clé primaire, FK = clé étrangère (relation), ◦ = unique, « ? » sur le type = nullable.`}]})]}),(0,C.jsx)(f,{variant:`light`,children:D.columns.length})]}),D.columns.length===0?(0,C.jsx)(p,{c:`dimmed`,size:`sm`,children:`Colonnes non introspectées (ORM non connecté ?).`}):(0,C.jsxs)(a,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[(0,C.jsx)(a.Thead,{children:(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Th,{children:`Colonne`}),(0,C.jsx)(a.Th,{children:`Type`}),(0,C.jsx)(a.Th,{children:`Clé`}),(0,C.jsx)(a.Th,{children:`Nullable`})]})}),(0,C.jsx)(a.Tbody,{children:D.columns.map(e=>(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Td,{children:(0,C.jsxs)(r,{gap:6,wrap:`nowrap`,children:[e.primaryKey?(0,C.jsx)(_,{size:13,color:`var(--mantine-color-yellow-6)`}):M.has(e.name)?(0,C.jsx)(p,{size:`xs`,fw:700,c:`blue`,children:`FK`}):(0,C.jsx)(`span`,{style:{width:13}}),(0,C.jsxs)(p,{size:`sm`,children:[e.name,e.unique&&!e.primaryKey?` ◦`:``]})]})}),(0,C.jsx)(a.Td,{children:(0,C.jsxs)(p,{c:`dimmed`,size:`sm`,children:[e.type,e.nullable?`?`:``]})}),(0,C.jsx)(a.Td,{children:e.primaryKey?(0,C.jsx)(f,{size:`xs`,color:`yellow`,children:`PK`}):e.unique?(0,C.jsx)(f,{size:`xs`,variant:`outline`,children:`unique`}):``}),(0,C.jsx)(a.Td,{children:(0,C.jsx)(p,{size:`sm`,c:`dimmed`,children:e.nullable?`oui`:`non`})})]},e.name))})]})]}),(0,C.jsxs)(s,{withBorder:!0,radius:`md`,p:`md`,children:[(0,C.jsxs)(r,{justify:`space-between`,mb:`sm`,children:[(0,C.jsxs)(r,{gap:6,children:[(0,C.jsx)(p,{fw:600,children:`Relations`}),(0,C.jsx)(t,{title:`Relations`,version:w,summary:`${D.relations.length} relation(s) déclarée(s).`,sections:[{label:`Navigation`,body:`Clique une cible pour ouvrir cette table (navigation de proche en proche dans le modèle).`}]})]}),(0,C.jsx)(f,{variant:`light`,children:D.relations.length})]}),D.relations.length===0?(0,C.jsx)(p,{c:`dimmed`,size:`sm`,children:`Aucune relation déclarée.`}):(0,C.jsxs)(a,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[(0,C.jsx)(a.Thead,{children:(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Th,{children:`Champ (FK)`}),(0,C.jsx)(a.Th,{children:`Cardinalité`}),(0,C.jsx)(a.Th,{children:`Table cible`})]})}),(0,C.jsx)(a.Tbody,{children:D.relations.map(e=>(0,C.jsxs)(a.Tr,{children:[(0,C.jsx)(a.Td,{children:(0,C.jsx)(p,{size:`sm`,children:e.foreignKey??e.field})}),(0,C.jsx)(a.Td,{children:(0,C.jsx)(f,{size:`xs`,variant:`light`,children:e.type})}),(0,C.jsx)(a.Td,{children:(0,C.jsx)(o,{component:`button`,type:`button`,size:`sm`,onClick:()=>j(e.target),children:e.target})})]},`${e.field}>${e.target}`))})]})]})]})})})});export{T as OrmEntity};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{$t as t,Bt as n,Et as r,Fn as i,H as a,J as o,K as s,Kt as c,Mn as l,Rt as u,Ut as d,Vn as f,Y as p,Zt as m,_n as h,a as g,an as _,d as v,di as y,en as ee,it as te,mt as b,on as ne,or as x,sn as S,vn as C,yn as re}from"./ui-Dy8y0zPl.js";import{t as w}from"./Progress-ctKVb0y-.js";import{t as T}from"./RingProgress-CHMtGKds.js";import{c as ie,l as ae}from"./stores-DIccV-P5.js";import{a as oe}from"./hooks-C4XxBzBx.js";import{t as E}from"./IconAffiliate-PkjISh3s.js";import{_ as se,a as ce,c as D,d as le,f as O,g as ue,h as de,l as fe,m as pe,p as k,r as me,s as he,u as ge,v as A}from"./ConnectorCard-DOKtRiVP.js";import{t as _e}from"./IconDownload-CTLQCk0R.js";import{t as ve}from"./IconHeartRateMonitor-upfL_t5M.js";import{t as ye}from"./IconStack2-DA4YUbMC.js";import{A as be,I as xe,L as Se,Q as Ce,Y as j,pt as M,rt as we,ut as Te,vt as N,y as P}from"./index-wfxUl83u.js";import{n as Ee}from"./realtimeHealth-CEJDxl45.js";import{r as De}from"./health-D8eXYj6Q.js";import{n as F,t as I}from"./DbLogo-B4TwNH6H.js";import{t as Oe}from"./orm-CL-WJRcX.js";var ke=r(`outline`,`list-search`,`ListSearch`,[[`path`,{d:`M11 15a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M18.5 18.5l2.5 2.5`,key:`svg-1`}],[`path`,{d:`M4 6h16`,key:`svg-2`}],[`path`,{d:`M4 12h4`,key:`svg-3`}],[`path`,{d:`M4 18h4`,key:`svg-4`}]]),L=e(y(),1),R=x();function z({items:e,color:t=`brand`,empty:n=`Aucune donnée.`}){let r=Math.max(1,...e.map(e=>e.value<0?0:e.value));return e.length?(0,R.jsx)(d,{gap:10,children:e.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(l,{justify:`space-between`,gap:`xs`,wrap:`nowrap`,mb:3,children:[e.href?(0,R.jsx)(h,{component:Te,to:e.href,size:`xs`,truncate:!0,children:e.label}):(0,R.jsx)(C,{size:`xs`,truncate:!0,children:e.label}),(0,R.jsx)(C,{size:`xs`,c:`dimmed`,ff:`monospace`,style:{flexShrink:0},children:k(e.value)})]}),(0,R.jsx)(w,{value:e.value<0?0:e.value/r*100,color:t,size:`sm`,radius:`sm`})]},e.key))}):(0,R.jsx)(C,{size:`sm`,c:`dimmed`,children:n})}function B({title:e,icon:t,hint:n,info:r,right:i,children:o}){return(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,mb:`sm`,children:[(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[t,(0,R.jsx)(C,{fw:600,children:e}),r??(n?(0,R.jsx)(a,{title:e,version:`v1.2`,summary:n}):null)]}),i]}),o]})}function V({icon:e,label:n,hint:r,info:i,value:o,accent:s=`brand`,footer:c,onClick:d,active:f,pulse:p}){return(0,R.jsx)(t.Col,{span:{base:12,sm:6,lg:3},children:(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,className:p?`nf-live-card`:void 0,onClick:d,role:d?`button`:void 0,tabIndex:d?0:void 0,"aria-pressed":d?f:void 0,onKeyDown:d?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d())}:void 0,style:{cursor:d?`pointer`:void 0,borderColor:f?`var(--mantine-color-${s}-filled)`:void 0,transition:`border-color 120ms ease`},children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,mb:8,align:`flex-start`,children:[(0,R.jsxs)(l,{gap:6,wrap:`nowrap`,c:`dimmed`,style:{minWidth:0},children:[(0,R.jsx)(C,{size:`xs`,fw:600,tt:`uppercase`,style:{letterSpacing:.3},truncate:!0,children:n}),i??(r?(0,R.jsx)(a,{title:n,version:`v1.2`,summary:r}):null)]}),(0,R.jsx)(u,{variant:`light`,color:s,size:34,radius:`md`,children:e})]}),(0,R.jsx)(C,{fw:700,style:{fontSize:30,lineHeight:1.05},children:o}),c?(0,R.jsx)(`div`,{style:{marginTop:10},children:c}):null]})})}function H({label:e,value:t,color:n}){return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:e}),(0,R.jsx)(C,{fw:700,c:n,style:{fontVariantNumeric:`tabular-nums`},children:t})]})}function Ae({workers:e,ratesByPid:t,qSeriesByPid:n,podOrm:r,verdict:i,live:o,onSelect:s}){let c=e.flatMap(e=>e.orm?[{w:e,o:e.orm}]:[]);if(!c.length)return null;let p=i.result,m=c.length>1;return(0,R.jsxs)(d,{gap:`md`,children:[p&&m?(0,R.jsx)(_,{withBorder:!0,radius:`md`,p:`md`,style:{contain:`content`},children:(0,R.jsxs)(l,{wrap:`nowrap`,align:`center`,gap:`lg`,children:[(0,R.jsx)(T,{size:92,thickness:10,roundCaps:!0,sections:[{value:p.score??0,color:p.color}],label:(0,R.jsx)(C,{ta:`center`,fw:800,fz:22,style:{fontVariantNumeric:`tabular-nums`},children:p.score})}),(0,R.jsxs)(`div`,{style:{minWidth:0},children:[(0,R.jsxs)(l,{gap:`xs`,mb:4,children:[(0,R.jsx)(C,{fw:700,children:`Santé ORM`}),(0,R.jsx)(S,{color:p.color,variant:`light`,children:p.label}),(0,R.jsx)(a,{title:`Santé ORM (pod)`,version:D,summary:`Verdict 3 états agrégé des sondes ORM (Derringer-Suich) — même brique que la santé du framework. Rollup = PIRE worker.`,sections:[{label:`Signaux`,body:`Connecteurs coupés & taux d'erreurs = PANNE (→ 0). Latence EWMA, requêtes lentes & reconnexions = SATURATION (planché « Dégradé »).`},{label:`Taux, pas cumul`,body:`Erreurs & reconnexions en delta/min (après 2 mesures live). Requêtes lentes & EWMA = flux ORM (NF_ORM_FLOW=1).`}]})]}),(0,R.jsxs)(C,{size:`sm`,c:`dimmed`,children:[`Pod de `,c.length,` workers — rollup = `,(0,R.jsx)(`b`,{children:`pire worker`}),i.worstPid?` (pid ${i.worstPid}`:``,i.worstPid&&p.worst?`, facteur ${p.worst})`:``,i.worstPid&&!p.worst?`)`:``,`.`]}),(0,R.jsx)(C,{size:`xs`,c:`dimmed`,mt:4,children:`Sonde lean agrégée par le master (cohérente, ≠ /orm/api/* round-robin). Détail riche par connecteur → clique une carte.`})]}),r?(0,R.jsxs)(l,{gap:`xl`,ml:`auto`,wrap:`wrap`,visibleFrom:`sm`,children:[(0,R.jsx)(H,{label:`Connecteurs`,value:`${r.connected}/${r.connectors}`,color:r.connected<r.connectors?`orange`:void 0}),(0,R.jsx)(H,{label:`Requêtes pod`,value:k(r.queryTotal)}),(0,R.jsx)(H,{label:`Lentes`,value:String(r.slowTotal),color:r.slowTotal>0?`orange`:void 0}),(0,R.jsx)(H,{label:`Erreurs ORM`,value:String(r.errorTotal),color:r.errorTotal>0?`red`:void 0}),(0,R.jsx)(H,{label:`EWMA max`,value:r.maxEwmaMs==null?`—`:O(r.maxEwmaMs)})]}):null]})}):null,(0,R.jsx)(M,{cols:{base:1,md:2,xl:3},spacing:`md`,children:c.map(({w:e,o:r},i)=>{let a=De(ue(r,t.get(e.instanceId)??{errPerMin:null,reconPerMin:null})),c=n.get(e.instanceId)??[];return(0,R.jsx)(f,{onClick:()=>s(e.instanceId),"aria-label":`détail ORM du worker ${i+1} (pid ${e.instanceId})`,style:{display:`block`},children:(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,className:o?`nf-live-card`:void 0,style:{contain:`content`},children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,mb:`sm`,children:[(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(u,{variant:`light`,color:`brand`,radius:`md`,children:(0,R.jsx)(j,{size:18})}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(l,{gap:4,wrap:`nowrap`,children:[(0,R.jsx)(C,{fw:600,children:m?`worker ${i+1}`:`ce process`}),(0,R.jsx)(b,{size:14,style:{opacity:.5}})]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`pid `,e.instanceId]})]})]}),a.score==null?null:(0,R.jsx)(S,{variant:`light`,color:a.color,style:{fontVariantNumeric:`tabular-nums`},children:a.score})]}),(0,R.jsxs)(l,{grow:!0,mb:`sm`,gap:`xs`,children:[(0,R.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`Requêtes`}),(0,R.jsx)(C,{fw:800,fz:28,lh:1.1,style:{fontVariantNumeric:`tabular-nums`},children:(0,R.jsx)(v,{value:r.queryTotal,children:k(r.queryTotal)})})]}),(0,R.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`Connecteurs`}),(0,R.jsxs)(C,{fw:800,fz:28,lh:1.1,c:r.connected<r.connectors?`orange`:void 0,style:{fontVariantNumeric:`tabular-nums`},children:[r.connected,`/`,r.connectors]})]})]}),(0,R.jsx)(C,{size:`xs`,c:`dimmed`,mb:2,children:`Requêtes/s`}),(0,R.jsx)(g,{series:[{data:c.length?c:[0],color:`var(--mantine-color-grape-5)`,label:`req/s`}],height:64}),(0,R.jsxs)(l,{justify:`space-between`,mt:`sm`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsxs)(C,{size:`xs`,c:r.slowTotal>0?`orange`:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`lentes `,r.slowTotal]}),(0,R.jsxs)(C,{size:`xs`,c:r.errorTotal>0?`red`:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`err `,r.errorTotal]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`EWMA `,r.maxEwmaMs==null?`—`:O(r.maxEwmaMs)]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`recon `,r.reconnectTotal]})]})]})},e.instanceId)})})]})}var U=N(({embedded:e=!1})=>{let r=ie(),u=ae(),f=oe(),h=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/orm/api/orms`),[r])),g=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/orm/api/graph`),[r])),v=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/orm/api/counts`),[r])),y=h.data??[],b=(0,L.useMemo)(()=>g.data?.entities??[],[g.data]),x=(0,L.useMemo)(()=>v.data??{},[v.data]),w=y.filter(e=>e.connected).length,[T,O]=(0,L.useState)(`*`),M=(0,L.useMemo)(()=>T===`*`?b:b.filter(e=>e.connector===T),[b,T]),N=(0,L.useMemo)(()=>fe(b,x),[b,x]),H=(0,L.useMemo)(()=>fe(M,x),[M,x]),U=T===`*`?`tous connecteurs`:T,[W,G]=(0,L.useState)(`connecteurs`);(0,L.useEffect)(le,[]);let K=u.realtimeLive,[q,je]=(0,L.useState)(()=>Number(pe(`nf.orm.liveMs`))||5e3),Me=u.adaptiveCadence,[Ne,Pe]=(0,L.useState)(q),Fe=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/realtime/api/health`),[r])),[Ie,Le]=(0,L.useState)(null),Re=K?Ie??Fe.data:Fe.data,J=(0,L.useMemo)(()=>Ee(Re),[Re]),Y=J?.cluster??!1,X=(0,L.useMemo)(()=>J?.instances??[],[J]),Z=J?.totals.orm??null,ze=(0,L.useMemo)(()=>X.some(e=>!!e.orm),[X]),{ratesByPid:Be,qSeriesByPid:Ve}=he(J,K),Q=(0,L.useMemo)(()=>{let e=null,t=null;for(let n of X){if(!n.orm)continue;let r=De(ue(n.orm,Be.get(n.instanceId)??{errPerMin:null,reconPerMin:null}));r.score!=null&&(!e||r.score<e.score)&&(e=r,t=n.instanceId)}return{result:e,worstPid:t}},[X,Be]);(0,L.useEffect)(()=>{K||Le(null)},[K]),(0,L.useEffect)(()=>de(`nf.orm.liveMs`,String(q)),[q]);let $=(0,L.useMemo)(()=>{let e=0,t=``,n=0;for(let r of b){let i=x[r.name];typeof i==`number`&&i>0&&(e+=1,i>n&&(n=i,t=r.name))}return{populated:e,topName:t,topRows:n}},[b,x]),He=(0,L.useMemo)(()=>M.map(e=>({key:`${e.connector}:${e.name}`,label:e.name,value:x[e.name]??-1,href:`/nodefony/orm-entity?name=${encodeURIComponent(e.name)}&connector=${encodeURIComponent(e.connector)}`})).filter(e=>e.value>0).sort((e,t)=>t.value-e.value).slice(0,12),[M,x]),Ue=(0,L.useMemo)(()=>Object.entries(H.entitiesByDomain).map(([e,t])=>({key:e,label:e,value:t})).sort((e,t)=>t.value-e.value).slice(0,12),[H.entitiesByDomain]),We=(0,L.useMemo)(()=>Object.entries(H.rowsByDomain).map(([e,t])=>({key:e,label:e,value:t})).sort((e,t)=>t.value-e.value).slice(0,12),[H.rowsByDomain]),Ge=(0,L.useCallback)(async e=>{let t=await r.api.getAbsolute(`/nodefony/orm/api/export/${e}`),n=e===`dbml`?`dbml`:`json`,i=new Blob([t.content],{type:`text/plain;charset=utf-8`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=`nodefony-model.${n}`,o.click(),URL.revokeObjectURL(a)},[r]),Ke=h.loading&&!y.length,qe=(0,R.jsxs)(l,{gap:`xs`,children:[(0,R.jsx)(me,{live:K,onToggle:e=>u.setRealtimeLive(e),liveMs:q,setLiveMs:je,auto:Me,effectiveMs:Ne,ariaLabel:`abonnement temps réel (socket Nodefony) de la santé ORM par worker`}),(0,R.jsx)(ne,{component:Te,to:`/nodefony/databases`,variant:`light`,leftSection:(0,R.jsx)(E,{size:16}),children:`Schéma ERD`}),(0,R.jsxs)(m,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(m.Target,{children:(0,R.jsx)(ne,{variant:`subtle`,color:`gray`,leftSection:(0,R.jsx)(_e,{size:16}),children:`Exporter`})}),(0,R.jsxs)(m.Dropdown,{children:[(0,R.jsx)(m.Label,{children:`Modèle de données`}),(0,R.jsx)(m.Item,{onClick:()=>void Ge(`dbml`),children:`DBML (dbdiagram.io)`}),(0,R.jsx)(m.Item,{onClick:()=>void Ge(`jsonschema`),children:`JSON Schema (2020-12)`})]})]})]});return(0,R.jsxs)(d,{gap:`lg`,children:[e?(0,R.jsx)(l,{justify:`flex-end`,children:qe}):(0,R.jsx)(p,{sticky:!0,title:`Dashboard ORM`,subtitle:Y?`Cluster — ${X.length} worker(s) · schéma identique, runtime agrégé`:`Connecteurs, modèle de données & volumes réels`,actions:qe}),K&&(0,R.jsx)(ce,{intervalMs:q,adaptive:Me,onData:Le,onRate:Pe}),(0,R.jsxs)(t,{children:[(0,R.jsx)(V,{label:`Connecteurs`,accent:`brand`,icon:(0,R.jsx)(j,{size:20}),hint:`ORM enregistrés dans le registre process-wide. Clic → onglet Connecteurs.`,value:y.length||`—`,active:W===`connecteurs`,onClick:()=>G(`connecteurs`),footer:(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,children:[(0,R.jsx)(l,{gap:4,wrap:`nowrap`,children:[...new Set(y.map(e=>e.vendor).filter(Boolean))].map(e=>F(e)?(0,R.jsx)(I,{name:e,size:16,title:e},e):null)}),(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:w===y.length?`teal`:w===0?`red`:`orange`,children:[w,`/`,y.length,` up`]})]})}),(0,R.jsx)(V,{label:`Santé ORM`,accent:Q.result?.color??`gray`,icon:(0,R.jsx)(ve,{size:20}),value:Q.result?(0,R.jsx)(C,{span:!0,inherit:!0,c:Q.result.color,children:Q.result.score}):`—`,active:W===`connecteurs`,pulse:K,onClick:()=>G(`connecteurs`),info:(0,R.jsx)(a,{title:`Santé ORM`,version:D,summary:`Verdict 3 états (OK / à surveiller / dégradé) agrégé des sondes ORM par la méthode Derringer-Suich — même brique que la santé du framework.`,sections:[{label:`Signaux`,body:`Connecteurs coupés & taux d'erreurs ORM = PANNE (peuvent tirer l'indice à 0). Latence EWMA, part de requêtes lentes & reconnexions = SATURATION (ralentit mais sert → « Dégradé » au pire, jamais « Critique » seul).`},{label:`Taux, pas cumul`,body:`Erreurs & reconnexions lues en delta/minute (apparaissent après 2 mesures live) — un cumul ferait paraître un vieux pod malade.`},{label:Y?`Cluster`:`Mono-process`,body:Y?`Pod = PIRE worker (rollup) sur ${X.length} worker(s). Source = sonde lean agrégée par le master (cohérente, ≠ /orm/api/* en round-robin).`:`1 process : la latence EWMA & la part de requêtes lentes n'apparaissent que si le flux ORM est actif (NF_ORM_FLOW=1).`}]}),footer:(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(S,{size:`sm`,variant:`light`,color:Q.result?.color??`gray`,children:Q.result?.label??`—`}),Z&&(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:Z.connected<Z.connectors?`orange`:`teal`,leftSection:(0,R.jsx)(Se,{size:11}),children:[Z.connected,`/`,Z.connectors]}),Q.result?.worst&&(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,truncate:!0,title:`Facteur limitant : ${Q.result.worst}`,children:[`↓ `,Q.result.worst]}),Y&&Q.worstPid&&(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{flexShrink:0},children:[`pire : pid `,Q.worstPid]})]})}),(0,R.jsx)(V,{label:`Entités`,accent:`indigo`,icon:(0,R.jsx)(se,{size:20}),hint:`Entités mappées tous connecteurs. Clic → onglet Modèle de données.`,value:b.length||`—`,active:W===`modele`,onClick:()=>G(`modele`),footer:(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:`indigo`,leftSection:(0,R.jsx)(E,{size:11}),children:[N.relationTotal,` rel.`]}),(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:`grape`,leftSection:(0,R.jsx)(A,{size:11}),children:[N.domainCount,` dom.`]})]})}),(0,R.jsx)(V,{label:`Lignes (réelles)`,accent:`teal`,icon:(0,R.jsx)(Ce,{size:20}),hint:`Total des lignes en base (COUNT(*) par table) + table la plus volumineuse. Clic → onglet Modèle de données.`,value:v.loading?(0,R.jsx)(i,{size:`sm`}):N.rowsTotal?k(N.rowsTotal):`—`,active:W===`modele`,onClick:()=>G(`modele`),footer:v.loading?(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`comptage…`}):$.topName?(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,children:[(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,truncate:!0,title:$.topName,children:[`↑ `,$.topName]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,ff:`monospace`,style:{flexShrink:0},children:[k($.topRows),` · `,$.populated,` tables`]})]}):(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`aucune table peuplée`})})]}),(0,R.jsx)(s,{loading:Ke,error:h.error??g.error,empty:!y.length,onRetry:()=>{h.reload(),g.reload()},emptyMessage:`Aucun connecteur ORM enregistré au runtime.`,children:(0,R.jsxs)(n,{value:W,onChange:e=>G(e??`connecteurs`),keepMounted:!1,children:[(0,R.jsxs)(o,{mb:`md`,children:[(0,R.jsxs)(n.Tab,{value:`connecteurs`,leftSection:(0,R.jsx)(j,{size:16}),children:[`Connecteurs (`,y.length,`)`]}),(0,R.jsx)(n.Tab,{value:`modele`,leftSection:(0,R.jsx)(E,{size:16}),children:`Modèle de données`})]}),(0,R.jsx)(n.Panel,{value:`connecteurs`,children:(0,R.jsxs)(d,{gap:`md`,children:[(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,children:[(0,R.jsxs)(l,{gap:`xs`,mb:`sm`,children:[(0,R.jsx)(j,{size:18}),(0,R.jsx)(C,{fw:600,children:`Connecteurs`}),(0,R.jsx)(S,{variant:`light`,color:`gray`,size:`sm`,children:y.length}),Y&&(0,R.jsxs)(S,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,R.jsx)(be,{size:11}),children:[`schéma identique · `,X.length,` workers`]}),(0,R.jsx)(a,{title:`Connecteurs`,version:D,summary:`${y.length} connecteur(s) enregistré(s) · ${w} connecté(s).`,sections:[{label:`Définition`,body:`Un connecteur = une instance ORM (Drizzle, Mongoose…) reliée à une base, enregistrée dans le registre process-wide.`},{label:`Détail riche`,body:`Ping, latence, pool, stockage, flux SQL : dans le drill par worker (clique une carte ci-dessous → /nodefony/orm/<pid>).`},...Y?[{label:`Cluster`,body:`Le schéma (entités, relations, base) est IDENTIQUE sur tous les workers (même code) — invariant. Seuls le runtime (santé, flux) varient par worker.`}]:[]]})]}),(0,R.jsx)(l,{gap:`sm`,children:y.map(e=>{let t=ge(e);return(0,R.jsxs)(l,{gap:4,wrap:`nowrap`,children:[(0,R.jsx)(S,{variant:`default`,size:`lg`,leftSection:F(e.connection?.driver??e.vendor)?(0,R.jsx)(I,{name:e.connection?.driver??e.vendor??``,size:14}):(0,R.jsx)(j,{size:13}),rightSection:e.connected?(0,R.jsx)(Se,{size:12,color:`teal`}):(0,R.jsx)(xe,{size:12,color:`gray`}),children:e.name}),(0,R.jsx)(c,{label:t.hint,multiline:!0,w:280,withArrow:!0,children:(0,R.jsx)(S,{size:`sm`,variant:`light`,color:t.color,style:{textTransform:`none`,cursor:`help`},children:t.label})})]},e.name)})})]}),ze?(0,R.jsx)(Ae,{workers:X,ratesByPid:Be,qSeriesByPid:Ve,podOrm:Z,verdict:Q,live:K,onSelect:e=>f(`/nodefony/orm/${e}`)}):Fe.loading?(0,R.jsxs)(l,{justify:`center`,p:`xl`,children:[(0,R.jsx)(i,{size:`sm`}),(0,R.jsx)(C,{size:`sm`,c:`dimmed`,children:`Chargement de la santé ORM…`})]}):(0,R.jsx)(re,{variant:`light`,color:`gray`,icon:(0,R.jsx)(te,{size:18}),title:`Santé ORM par worker indisponible`,children:"La sonde lean ORM (`nodefony:socket`) n'est pas remontée par ce pod. Le diagnostic riche reste accessible par worker via le drill (clique un connecteur), ou active le flux ORM (`NF_ORM_FLOW=1`) pour animer débit & latence."}),Y&&(0,R.jsxs)(re,{variant:`light`,color:`blue`,icon:(0,R.jsx)(te,{size:18}),title:`Diagnostic détaillé = 1 worker`,children:[`Le diagnostic riche par connecteur (ping, latence, pool, stockage, flux SQL) est `,(0,R.jsx)(`b`,{children:`per-worker`}),` : ouvre une carte worker ci-dessus pour le détail de ce process (pid). La vue pod cohérente = la carte « Santé ORM » + la grille worker.`]})]})}),(0,R.jsx)(n.Panel,{value:`modele`,children:(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,children:[(0,R.jsxs)(l,{gap:`xs`,mb:`sm`,children:[(0,R.jsx)(E,{size:18}),(0,R.jsx)(C,{fw:600,children:`Modèle de données`}),Y&&(0,R.jsxs)(S,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,R.jsx)(be,{size:11}),children:[`identique · `,X.length,` workers`]}),(0,R.jsx)(a,{title:`Modèle de données`,version:D,summary:`${b.length} entité(s) · ${N.relationTotal} relation(s) · ${N.domainCount} domaine(s).`,sections:[{label:`Navigation`,body:`Chaque sous-onglet filtre le modèle par connecteur.`},...Y?[{label:`Cluster`,body:`Le modèle (schéma) est invariant : même code → mêmes tables sur les N workers. Aucun besoin de l'agréger.`}]:[]]})]}),(0,R.jsxs)(n,{value:T,onChange:e=>O(e??`*`),variant:`pills`,children:[(0,R.jsxs)(n.List,{mb:`md`,children:[(0,R.jsx)(n.Tab,{value:`*`,leftSection:(0,R.jsx)(ye,{size:14}),children:`Tous`}),y.map(e=>(0,R.jsx)(n.Tab,{value:e.name,leftSection:F(e.vendor)?(0,R.jsx)(I,{name:e.vendor,size:14}):(0,R.jsx)(j,{size:14}),children:e.name},e.name))]}),(0,R.jsx)(n.Panel,{value:T,children:(0,R.jsxs)(t,{children:[(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Top tables par volume`,icon:(0,R.jsx)(Ce,{size:18}),hint:`${He.length} table(s) peuplée(s) — top 12 par COUNT(*) · ${U}.`,right:v.loading?(0,R.jsx)(i,{size:`xs`}):(0,R.jsx)(S,{variant:`light`,color:`gray`,size:`sm`,children:`COUNT(*)`}),children:(0,R.jsx)(z,{items:He,color:`brand`,empty:v.loading?`Comptage en cours…`:`Aucune table peuplée.`})})}),(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Entités par domaine`,icon:(0,R.jsx)(A,{size:18}),hint:`${M.length} entité(s) classée(s) sur ${H.domainCount} domaine(s) · ${U}.`,right:(0,R.jsx)(S,{variant:`light`,color:`gray`,size:`sm`,children:H.domainCount}),children:(0,R.jsx)(z,{items:Ue,color:`indigo`})})}),(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Lignes par domaine`,icon:(0,R.jsx)(A,{size:18}),hint:`${k(H.rowsTotal)} ligne(s) réparties sur ${Object.keys(H.rowsByDomain).length} domaine(s) peuplé(s) · ${U}.`,children:(0,R.jsx)(z,{items:We,color:`teal`,empty:v.loading?`Comptage en cours…`:`Aucune donnée.`})})}),(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Santé du modèle`,icon:(0,R.jsx)(we,{size:18}),hint:`${H.orphans} entité(s) sans relation · ${H.relationTotal} relation(s) sur ${M.length} entité(s) · ${U}.`,right:(0,R.jsx)(ne,{component:Te,to:`/nodefony/databases`,variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(ke,{size:14}),children:`Explorer`}),children:(0,R.jsxs)(d,{gap:`sm`,children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsx)(C,{size:`sm`,children:`Entités orphelines (0 relation)`}),(0,R.jsx)(S,{variant:`light`,color:H.orphans?`orange`:`teal`,children:H.orphans})]}),(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsx)(C,{size:`sm`,children:`Colonnes non introspectées`}),(0,R.jsx)(S,{variant:`light`,color:H.noColumns?`yellow`:`teal`,children:H.noColumns})]}),(0,R.jsx)(ee,{label:`Relations par type`,labelPosition:`left`}),Object.keys(H.relByType).length?(0,R.jsx)(l,{gap:`xs`,children:Object.entries(H.relByType).sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,R.jsxs)(S,{variant:`light`,color:`brand`,size:`lg`,children:[Oe[e]??e,` · `,t]},e))}):(0,R.jsx)(C,{size:`sm`,c:`dimmed`,children:`Aucune relation déclarée.`})]})})})]})})]})]})})]})})]})});export{U as OrmOverview,U as default};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{$t as t,Bt as n,Et as r,Fn as i,H as a,J as o,K as s,Kt as c,Mn as l,Rt as u,Ut as d,Vn as f,Y as p,Zt as m,_n as h,a as g,an as _,d as v,di as y,en as ee,it as te,mt as b,on as ne,or as x,sn as S,vn as C,yn as re}from"./ui-BlRFVRfl.js";import{t as w}from"./Progress-BxSLYIgD.js";import{t as T}from"./RingProgress-CdgTmA2j.js";import{c as ie,l as ae}from"./stores-fG-e-IP-.js";import{l as oe}from"./hooks-DMHLQNUe.js";import{t as E}from"./IconAffiliate-BDcNyaq_.js";import{_ as se,a as ce,c as D,d as le,f as O,g as ue,h as de,l as fe,m as pe,p as k,r as me,s as he,u as ge,v as A}from"./ConnectorCard-rSwtCZFu.js";import{t as _e}from"./IconDownload-CskHkiEP.js";import{t as ve}from"./IconHeartRateMonitor-D5gSRuQz.js";import{t as ye}from"./IconStack2-BRfnzl41.js";import{A as be,I as xe,L as Se,Q as Ce,Y as j,pt as M,rt as we,ut as Te,vt as N,y as P}from"./index-BwkdF4pp.js";import{n as Ee}from"./realtimeHealth-CEJDxl45.js";import{r as De}from"./health-D8eXYj6Q.js";import{n as F,t as I}from"./DbLogo-odCHhQZM.js";import{t as Oe}from"./orm-CL-WJRcX.js";var ke=r(`outline`,`list-search`,`ListSearch`,[[`path`,{d:`M11 15a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M18.5 18.5l2.5 2.5`,key:`svg-1`}],[`path`,{d:`M4 6h16`,key:`svg-2`}],[`path`,{d:`M4 12h4`,key:`svg-3`}],[`path`,{d:`M4 18h4`,key:`svg-4`}]]),L=e(y(),1),R=x();function z({items:e,color:t=`brand`,empty:n=`Aucune donnée.`}){let r=Math.max(1,...e.map(e=>e.value<0?0:e.value));return e.length?(0,R.jsx)(d,{gap:10,children:e.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(l,{justify:`space-between`,gap:`xs`,wrap:`nowrap`,mb:3,children:[e.href?(0,R.jsx)(h,{component:Te,to:e.href,size:`xs`,truncate:!0,children:e.label}):(0,R.jsx)(C,{size:`xs`,truncate:!0,children:e.label}),(0,R.jsx)(C,{size:`xs`,c:`dimmed`,ff:`monospace`,style:{flexShrink:0},children:k(e.value)})]}),(0,R.jsx)(w,{value:e.value<0?0:e.value/r*100,color:t,size:`sm`,radius:`sm`})]},e.key))}):(0,R.jsx)(C,{size:`sm`,c:`dimmed`,children:n})}function B({title:e,icon:t,hint:n,info:r,right:i,children:o}){return(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,mb:`sm`,children:[(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[t,(0,R.jsx)(C,{fw:600,children:e}),r??(n?(0,R.jsx)(a,{title:e,version:`v1.2`,summary:n}):null)]}),i]}),o]})}function V({icon:e,label:n,hint:r,info:i,value:o,accent:s=`brand`,footer:c,onClick:d,active:f,pulse:p}){return(0,R.jsx)(t.Col,{span:{base:12,sm:6,lg:3},children:(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,className:p?`nf-live-card`:void 0,onClick:d,role:d?`button`:void 0,tabIndex:d?0:void 0,"aria-pressed":d?f:void 0,onKeyDown:d?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d())}:void 0,style:{cursor:d?`pointer`:void 0,borderColor:f?`var(--mantine-color-${s}-filled)`:void 0,transition:`border-color 120ms ease`},children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,mb:8,align:`flex-start`,children:[(0,R.jsxs)(l,{gap:6,wrap:`nowrap`,c:`dimmed`,style:{minWidth:0},children:[(0,R.jsx)(C,{size:`xs`,fw:600,tt:`uppercase`,style:{letterSpacing:.3},truncate:!0,children:n}),i??(r?(0,R.jsx)(a,{title:n,version:`v1.2`,summary:r}):null)]}),(0,R.jsx)(u,{variant:`light`,color:s,size:34,radius:`md`,children:e})]}),(0,R.jsx)(C,{fw:700,style:{fontSize:30,lineHeight:1.05},children:o}),c?(0,R.jsx)(`div`,{style:{marginTop:10},children:c}):null]})})}function H({label:e,value:t,color:n}){return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:e}),(0,R.jsx)(C,{fw:700,c:n,style:{fontVariantNumeric:`tabular-nums`},children:t})]})}function Ae({workers:e,ratesByPid:t,qSeriesByPid:n,podOrm:r,verdict:i,live:o,onSelect:s}){let c=e.flatMap(e=>e.orm?[{w:e,o:e.orm}]:[]);if(!c.length)return null;let p=i.result,m=c.length>1;return(0,R.jsxs)(d,{gap:`md`,children:[p&&m?(0,R.jsx)(_,{withBorder:!0,radius:`md`,p:`md`,style:{contain:`content`},children:(0,R.jsxs)(l,{wrap:`nowrap`,align:`center`,gap:`lg`,children:[(0,R.jsx)(T,{size:92,thickness:10,roundCaps:!0,sections:[{value:p.score??0,color:p.color}],label:(0,R.jsx)(C,{ta:`center`,fw:800,fz:22,style:{fontVariantNumeric:`tabular-nums`},children:p.score})}),(0,R.jsxs)(`div`,{style:{minWidth:0},children:[(0,R.jsxs)(l,{gap:`xs`,mb:4,children:[(0,R.jsx)(C,{fw:700,children:`Santé ORM`}),(0,R.jsx)(S,{color:p.color,variant:`light`,children:p.label}),(0,R.jsx)(a,{title:`Santé ORM (pod)`,version:D,summary:`Verdict 3 états agrégé des sondes ORM (Derringer-Suich) — même brique que la santé du framework. Rollup = PIRE worker.`,sections:[{label:`Signaux`,body:`Connecteurs coupés & taux d'erreurs = PANNE (→ 0). Latence EWMA, requêtes lentes & reconnexions = SATURATION (planché « Dégradé »).`},{label:`Taux, pas cumul`,body:`Erreurs & reconnexions en delta/min (après 2 mesures live). Requêtes lentes & EWMA = flux ORM (NF_ORM_FLOW=1).`}]})]}),(0,R.jsxs)(C,{size:`sm`,c:`dimmed`,children:[`Pod de `,c.length,` workers — rollup = `,(0,R.jsx)(`b`,{children:`pire worker`}),i.worstPid?` (pid ${i.worstPid}`:``,i.worstPid&&p.worst?`, facteur ${p.worst})`:``,i.worstPid&&!p.worst?`)`:``,`.`]}),(0,R.jsx)(C,{size:`xs`,c:`dimmed`,mt:4,children:`Sonde lean agrégée par le master (cohérente, ≠ /orm/api/* round-robin). Détail riche par connecteur → clique une carte.`})]}),r?(0,R.jsxs)(l,{gap:`xl`,ml:`auto`,wrap:`wrap`,visibleFrom:`sm`,children:[(0,R.jsx)(H,{label:`Connecteurs`,value:`${r.connected}/${r.connectors}`,color:r.connected<r.connectors?`orange`:void 0}),(0,R.jsx)(H,{label:`Requêtes pod`,value:k(r.queryTotal)}),(0,R.jsx)(H,{label:`Lentes`,value:String(r.slowTotal),color:r.slowTotal>0?`orange`:void 0}),(0,R.jsx)(H,{label:`Erreurs ORM`,value:String(r.errorTotal),color:r.errorTotal>0?`red`:void 0}),(0,R.jsx)(H,{label:`EWMA max`,value:r.maxEwmaMs==null?`—`:O(r.maxEwmaMs)})]}):null]})}):null,(0,R.jsx)(M,{cols:{base:1,md:2,xl:3},spacing:`md`,children:c.map(({w:e,o:r},i)=>{let a=De(ue(r,t.get(e.instanceId)??{errPerMin:null,reconPerMin:null})),c=n.get(e.instanceId)??[];return(0,R.jsx)(f,{onClick:()=>s(e.instanceId),"aria-label":`détail ORM du worker ${i+1} (pid ${e.instanceId})`,style:{display:`block`},children:(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,className:o?`nf-live-card`:void 0,style:{contain:`content`},children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,mb:`sm`,children:[(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(u,{variant:`light`,color:`brand`,radius:`md`,children:(0,R.jsx)(j,{size:18})}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(l,{gap:4,wrap:`nowrap`,children:[(0,R.jsx)(C,{fw:600,children:m?`worker ${i+1}`:`ce process`}),(0,R.jsx)(b,{size:14,style:{opacity:.5}})]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`pid `,e.instanceId]})]})]}),a.score==null?null:(0,R.jsx)(S,{variant:`light`,color:a.color,style:{fontVariantNumeric:`tabular-nums`},children:a.score})]}),(0,R.jsxs)(l,{grow:!0,mb:`sm`,gap:`xs`,children:[(0,R.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`Requêtes`}),(0,R.jsx)(C,{fw:800,fz:28,lh:1.1,style:{fontVariantNumeric:`tabular-nums`},children:(0,R.jsx)(v,{value:r.queryTotal,children:k(r.queryTotal)})})]}),(0,R.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`Connecteurs`}),(0,R.jsxs)(C,{fw:800,fz:28,lh:1.1,c:r.connected<r.connectors?`orange`:void 0,style:{fontVariantNumeric:`tabular-nums`},children:[r.connected,`/`,r.connectors]})]})]}),(0,R.jsx)(C,{size:`xs`,c:`dimmed`,mb:2,children:`Requêtes/s`}),(0,R.jsx)(g,{series:[{data:c.length?c:[0],color:`var(--mantine-color-grape-5)`,label:`req/s`}],height:64}),(0,R.jsxs)(l,{justify:`space-between`,mt:`sm`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsxs)(C,{size:`xs`,c:r.slowTotal>0?`orange`:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`lentes `,r.slowTotal]}),(0,R.jsxs)(C,{size:`xs`,c:r.errorTotal>0?`red`:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`err `,r.errorTotal]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`EWMA `,r.maxEwmaMs==null?`—`:O(r.maxEwmaMs)]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`recon `,r.reconnectTotal]})]})]})},e.instanceId)})})]})}var U=N(({embedded:e=!1})=>{let r=ie(),u=ae(),f=oe(),h=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/orm/api/orms`),[r])),g=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/orm/api/graph`),[r])),v=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/orm/api/counts`),[r])),y=h.data??[],b=(0,L.useMemo)(()=>g.data?.entities??[],[g.data]),x=(0,L.useMemo)(()=>v.data??{},[v.data]),w=y.filter(e=>e.connected).length,[T,O]=(0,L.useState)(`*`),M=(0,L.useMemo)(()=>T===`*`?b:b.filter(e=>e.connector===T),[b,T]),N=(0,L.useMemo)(()=>fe(b,x),[b,x]),H=(0,L.useMemo)(()=>fe(M,x),[M,x]),U=T===`*`?`tous connecteurs`:T,[W,G]=(0,L.useState)(`connecteurs`);(0,L.useEffect)(le,[]);let K=u.realtimeLive,[q,je]=(0,L.useState)(()=>Number(pe(`nf.orm.liveMs`))||5e3),Me=u.adaptiveCadence,[Ne,Pe]=(0,L.useState)(q),Fe=P((0,L.useCallback)(()=>r.api.getAbsolute(`/nodefony/realtime/api/health`),[r])),[Ie,Le]=(0,L.useState)(null),Re=K?Ie??Fe.data:Fe.data,J=(0,L.useMemo)(()=>Ee(Re),[Re]),Y=J?.cluster??!1,X=(0,L.useMemo)(()=>J?.instances??[],[J]),Z=J?.totals.orm??null,ze=(0,L.useMemo)(()=>X.some(e=>!!e.orm),[X]),{ratesByPid:Be,qSeriesByPid:Ve}=he(J,K),Q=(0,L.useMemo)(()=>{let e=null,t=null;for(let n of X){if(!n.orm)continue;let r=De(ue(n.orm,Be.get(n.instanceId)??{errPerMin:null,reconPerMin:null}));r.score!=null&&(!e||r.score<e.score)&&(e=r,t=n.instanceId)}return{result:e,worstPid:t}},[X,Be]);(0,L.useEffect)(()=>{K||Le(null)},[K]),(0,L.useEffect)(()=>de(`nf.orm.liveMs`,String(q)),[q]);let $=(0,L.useMemo)(()=>{let e=0,t=``,n=0;for(let r of b){let i=x[r.name];typeof i==`number`&&i>0&&(e+=1,i>n&&(n=i,t=r.name))}return{populated:e,topName:t,topRows:n}},[b,x]),He=(0,L.useMemo)(()=>M.map(e=>({key:`${e.connector}:${e.name}`,label:e.name,value:x[e.name]??-1,href:`/nodefony/orm-entity?name=${encodeURIComponent(e.name)}&connector=${encodeURIComponent(e.connector)}`})).filter(e=>e.value>0).sort((e,t)=>t.value-e.value).slice(0,12),[M,x]),Ue=(0,L.useMemo)(()=>Object.entries(H.entitiesByDomain).map(([e,t])=>({key:e,label:e,value:t})).sort((e,t)=>t.value-e.value).slice(0,12),[H.entitiesByDomain]),We=(0,L.useMemo)(()=>Object.entries(H.rowsByDomain).map(([e,t])=>({key:e,label:e,value:t})).sort((e,t)=>t.value-e.value).slice(0,12),[H.rowsByDomain]),Ge=(0,L.useCallback)(async e=>{let t=await r.api.getAbsolute(`/nodefony/orm/api/export/${e}`),n=e===`dbml`?`dbml`:`json`,i=new Blob([t.content],{type:`text/plain;charset=utf-8`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=`nodefony-model.${n}`,o.click(),URL.revokeObjectURL(a)},[r]),Ke=h.loading&&!y.length,qe=(0,R.jsxs)(l,{gap:`xs`,children:[(0,R.jsx)(me,{live:K,onToggle:e=>u.setRealtimeLive(e),liveMs:q,setLiveMs:je,auto:Me,effectiveMs:Ne,ariaLabel:`abonnement temps réel (socket Nodefony) de la santé ORM par worker`}),(0,R.jsx)(ne,{component:Te,to:`/nodefony/databases`,variant:`light`,leftSection:(0,R.jsx)(E,{size:16}),children:`Schéma ERD`}),(0,R.jsxs)(m,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(m.Target,{children:(0,R.jsx)(ne,{variant:`subtle`,color:`gray`,leftSection:(0,R.jsx)(_e,{size:16}),children:`Exporter`})}),(0,R.jsxs)(m.Dropdown,{children:[(0,R.jsx)(m.Label,{children:`Modèle de données`}),(0,R.jsx)(m.Item,{onClick:()=>void Ge(`dbml`),children:`DBML (dbdiagram.io)`}),(0,R.jsx)(m.Item,{onClick:()=>void Ge(`jsonschema`),children:`JSON Schema (2020-12)`})]})]})]});return(0,R.jsxs)(d,{gap:`lg`,children:[e?(0,R.jsx)(l,{justify:`flex-end`,children:qe}):(0,R.jsx)(p,{sticky:!0,title:`Dashboard ORM`,subtitle:Y?`Cluster — ${X.length} worker(s) · schéma identique, runtime agrégé`:`Connecteurs, modèle de données & volumes réels`,actions:qe}),K&&(0,R.jsx)(ce,{intervalMs:q,adaptive:Me,onData:Le,onRate:Pe}),(0,R.jsxs)(t,{children:[(0,R.jsx)(V,{label:`Connecteurs`,accent:`brand`,icon:(0,R.jsx)(j,{size:20}),hint:`ORM enregistrés dans le registre process-wide. Clic → onglet Connecteurs.`,value:y.length||`—`,active:W===`connecteurs`,onClick:()=>G(`connecteurs`),footer:(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,children:[(0,R.jsx)(l,{gap:4,wrap:`nowrap`,children:[...new Set(y.map(e=>e.vendor).filter(Boolean))].map(e=>F(e)?(0,R.jsx)(I,{name:e,size:16,title:e},e):null)}),(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:w===y.length?`teal`:w===0?`red`:`orange`,children:[w,`/`,y.length,` up`]})]})}),(0,R.jsx)(V,{label:`Santé ORM`,accent:Q.result?.color??`gray`,icon:(0,R.jsx)(ve,{size:20}),value:Q.result?(0,R.jsx)(C,{span:!0,inherit:!0,c:Q.result.color,children:Q.result.score}):`—`,active:W===`connecteurs`,pulse:K,onClick:()=>G(`connecteurs`),info:(0,R.jsx)(a,{title:`Santé ORM`,version:D,summary:`Verdict 3 états (OK / à surveiller / dégradé) agrégé des sondes ORM par la méthode Derringer-Suich — même brique que la santé du framework.`,sections:[{label:`Signaux`,body:`Connecteurs coupés & taux d'erreurs ORM = PANNE (peuvent tirer l'indice à 0). Latence EWMA, part de requêtes lentes & reconnexions = SATURATION (ralentit mais sert → « Dégradé » au pire, jamais « Critique » seul).`},{label:`Taux, pas cumul`,body:`Erreurs & reconnexions lues en delta/minute (apparaissent après 2 mesures live) — un cumul ferait paraître un vieux pod malade.`},{label:Y?`Cluster`:`Mono-process`,body:Y?`Pod = PIRE worker (rollup) sur ${X.length} worker(s). Source = sonde lean agrégée par le master (cohérente, ≠ /orm/api/* en round-robin).`:`1 process : la latence EWMA & la part de requêtes lentes n'apparaissent que si le flux ORM est actif (NF_ORM_FLOW=1).`}]}),footer:(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(S,{size:`sm`,variant:`light`,color:Q.result?.color??`gray`,children:Q.result?.label??`—`}),Z&&(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:Z.connected<Z.connectors?`orange`:`teal`,leftSection:(0,R.jsx)(Se,{size:11}),children:[Z.connected,`/`,Z.connectors]}),Q.result?.worst&&(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,truncate:!0,title:`Facteur limitant : ${Q.result.worst}`,children:[`↓ `,Q.result.worst]}),Y&&Q.worstPid&&(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,style:{flexShrink:0},children:[`pire : pid `,Q.worstPid]})]})}),(0,R.jsx)(V,{label:`Entités`,accent:`indigo`,icon:(0,R.jsx)(se,{size:20}),hint:`Entités mappées tous connecteurs. Clic → onglet Modèle de données.`,value:b.length||`—`,active:W===`modele`,onClick:()=>G(`modele`),footer:(0,R.jsxs)(l,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:`indigo`,leftSection:(0,R.jsx)(E,{size:11}),children:[N.relationTotal,` rel.`]}),(0,R.jsxs)(S,{size:`sm`,variant:`light`,color:`grape`,leftSection:(0,R.jsx)(A,{size:11}),children:[N.domainCount,` dom.`]})]})}),(0,R.jsx)(V,{label:`Lignes (réelles)`,accent:`teal`,icon:(0,R.jsx)(Ce,{size:20}),hint:`Total des lignes en base (COUNT(*) par table) + table la plus volumineuse. Clic → onglet Modèle de données.`,value:v.loading?(0,R.jsx)(i,{size:`sm`}):N.rowsTotal?k(N.rowsTotal):`—`,active:W===`modele`,onClick:()=>G(`modele`),footer:v.loading?(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`comptage…`}):$.topName?(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,gap:`xs`,children:[(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,truncate:!0,title:$.topName,children:[`↑ `,$.topName]}),(0,R.jsxs)(C,{size:`xs`,c:`dimmed`,ff:`monospace`,style:{flexShrink:0},children:[k($.topRows),` · `,$.populated,` tables`]})]}):(0,R.jsx)(C,{size:`xs`,c:`dimmed`,children:`aucune table peuplée`})})]}),(0,R.jsx)(s,{loading:Ke,error:h.error??g.error,empty:!y.length,onRetry:()=>{h.reload(),g.reload()},emptyMessage:`Aucun connecteur ORM enregistré au runtime.`,children:(0,R.jsxs)(n,{value:W,onChange:e=>G(e??`connecteurs`),keepMounted:!1,children:[(0,R.jsxs)(o,{mb:`md`,children:[(0,R.jsxs)(n.Tab,{value:`connecteurs`,leftSection:(0,R.jsx)(j,{size:16}),children:[`Connecteurs (`,y.length,`)`]}),(0,R.jsx)(n.Tab,{value:`modele`,leftSection:(0,R.jsx)(E,{size:16}),children:`Modèle de données`})]}),(0,R.jsx)(n.Panel,{value:`connecteurs`,children:(0,R.jsxs)(d,{gap:`md`,children:[(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,children:[(0,R.jsxs)(l,{gap:`xs`,mb:`sm`,children:[(0,R.jsx)(j,{size:18}),(0,R.jsx)(C,{fw:600,children:`Connecteurs`}),(0,R.jsx)(S,{variant:`light`,color:`gray`,size:`sm`,children:y.length}),Y&&(0,R.jsxs)(S,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,R.jsx)(be,{size:11}),children:[`schéma identique · `,X.length,` workers`]}),(0,R.jsx)(a,{title:`Connecteurs`,version:D,summary:`${y.length} connecteur(s) enregistré(s) · ${w} connecté(s).`,sections:[{label:`Définition`,body:`Un connecteur = une instance ORM (Drizzle, Mongoose…) reliée à une base, enregistrée dans le registre process-wide.`},{label:`Détail riche`,body:`Ping, latence, pool, stockage, flux SQL : dans le drill par worker (clique une carte ci-dessous → /nodefony/orm/<pid>).`},...Y?[{label:`Cluster`,body:`Le schéma (entités, relations, base) est IDENTIQUE sur tous les workers (même code) — invariant. Seuls le runtime (santé, flux) varient par worker.`}]:[]]})]}),(0,R.jsx)(l,{gap:`sm`,children:y.map(e=>{let t=ge(e);return(0,R.jsxs)(l,{gap:4,wrap:`nowrap`,children:[(0,R.jsx)(S,{variant:`default`,size:`lg`,leftSection:F(e.connection?.driver??e.vendor)?(0,R.jsx)(I,{name:e.connection?.driver??e.vendor??``,size:14}):(0,R.jsx)(j,{size:13}),rightSection:e.connected?(0,R.jsx)(Se,{size:12,color:`teal`}):(0,R.jsx)(xe,{size:12,color:`gray`}),children:e.name}),(0,R.jsx)(c,{label:t.hint,multiline:!0,w:280,withArrow:!0,children:(0,R.jsx)(S,{size:`sm`,variant:`light`,color:t.color,style:{textTransform:`none`,cursor:`help`},children:t.label})})]},e.name)})})]}),ze?(0,R.jsx)(Ae,{workers:X,ratesByPid:Be,qSeriesByPid:Ve,podOrm:Z,verdict:Q,live:K,onSelect:e=>f(`/nodefony/orm/${e}`)}):Fe.loading?(0,R.jsxs)(l,{justify:`center`,p:`xl`,children:[(0,R.jsx)(i,{size:`sm`}),(0,R.jsx)(C,{size:`sm`,c:`dimmed`,children:`Chargement de la santé ORM…`})]}):(0,R.jsx)(re,{variant:`light`,color:`gray`,icon:(0,R.jsx)(te,{size:18}),title:`Santé ORM par worker indisponible`,children:"La sonde lean ORM (`nodefony:socket`) n'est pas remontée par ce pod. Le diagnostic riche reste accessible par worker via le drill (clique un connecteur), ou active le flux ORM (`NF_ORM_FLOW=1`) pour animer débit & latence."}),Y&&(0,R.jsxs)(re,{variant:`light`,color:`blue`,icon:(0,R.jsx)(te,{size:18}),title:`Diagnostic détaillé = 1 worker`,children:[`Le diagnostic riche par connecteur (ping, latence, pool, stockage, flux SQL) est `,(0,R.jsx)(`b`,{children:`per-worker`}),` : ouvre une carte worker ci-dessus pour le détail de ce process (pid). La vue pod cohérente = la carte « Santé ORM » + la grille worker.`]})]})}),(0,R.jsx)(n.Panel,{value:`modele`,children:(0,R.jsxs)(_,{withBorder:!0,radius:`md`,p:`md`,children:[(0,R.jsxs)(l,{gap:`xs`,mb:`sm`,children:[(0,R.jsx)(E,{size:18}),(0,R.jsx)(C,{fw:600,children:`Modèle de données`}),Y&&(0,R.jsxs)(S,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,R.jsx)(be,{size:11}),children:[`identique · `,X.length,` workers`]}),(0,R.jsx)(a,{title:`Modèle de données`,version:D,summary:`${b.length} entité(s) · ${N.relationTotal} relation(s) · ${N.domainCount} domaine(s).`,sections:[{label:`Navigation`,body:`Chaque sous-onglet filtre le modèle par connecteur.`},...Y?[{label:`Cluster`,body:`Le modèle (schéma) est invariant : même code → mêmes tables sur les N workers. Aucun besoin de l'agréger.`}]:[]]})]}),(0,R.jsxs)(n,{value:T,onChange:e=>O(e??`*`),variant:`pills`,children:[(0,R.jsxs)(n.List,{mb:`md`,children:[(0,R.jsx)(n.Tab,{value:`*`,leftSection:(0,R.jsx)(ye,{size:14}),children:`Tous`}),y.map(e=>(0,R.jsx)(n.Tab,{value:e.name,leftSection:F(e.vendor)?(0,R.jsx)(I,{name:e.vendor,size:14}):(0,R.jsx)(j,{size:14}),children:e.name},e.name))]}),(0,R.jsx)(n.Panel,{value:T,children:(0,R.jsxs)(t,{children:[(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Top tables par volume`,icon:(0,R.jsx)(Ce,{size:18}),hint:`${He.length} table(s) peuplée(s) — top 12 par COUNT(*) · ${U}.`,right:v.loading?(0,R.jsx)(i,{size:`xs`}):(0,R.jsx)(S,{variant:`light`,color:`gray`,size:`sm`,children:`COUNT(*)`}),children:(0,R.jsx)(z,{items:He,color:`brand`,empty:v.loading?`Comptage en cours…`:`Aucune table peuplée.`})})}),(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Entités par domaine`,icon:(0,R.jsx)(A,{size:18}),hint:`${M.length} entité(s) classée(s) sur ${H.domainCount} domaine(s) · ${U}.`,right:(0,R.jsx)(S,{variant:`light`,color:`gray`,size:`sm`,children:H.domainCount}),children:(0,R.jsx)(z,{items:Ue,color:`indigo`})})}),(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Lignes par domaine`,icon:(0,R.jsx)(A,{size:18}),hint:`${k(H.rowsTotal)} ligne(s) réparties sur ${Object.keys(H.rowsByDomain).length} domaine(s) peuplé(s) · ${U}.`,children:(0,R.jsx)(z,{items:We,color:`teal`,empty:v.loading?`Comptage en cours…`:`Aucune donnée.`})})}),(0,R.jsx)(t.Col,{span:{base:12,lg:6},children:(0,R.jsx)(B,{title:`Santé du modèle`,icon:(0,R.jsx)(we,{size:18}),hint:`${H.orphans} entité(s) sans relation · ${H.relationTotal} relation(s) sur ${M.length} entité(s) · ${U}.`,right:(0,R.jsx)(ne,{component:Te,to:`/nodefony/databases`,variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(ke,{size:14}),children:`Explorer`}),children:(0,R.jsxs)(d,{gap:`sm`,children:[(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsx)(C,{size:`sm`,children:`Entités orphelines (0 relation)`}),(0,R.jsx)(S,{variant:`light`,color:H.orphans?`orange`:`teal`,children:H.orphans})]}),(0,R.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsx)(C,{size:`sm`,children:`Colonnes non introspectées`}),(0,R.jsx)(S,{variant:`light`,color:H.noColumns?`yellow`:`teal`,children:H.noColumns})]}),(0,R.jsx)(ee,{label:`Relations par type`,labelPosition:`left`}),Object.keys(H.relByType).length?(0,R.jsx)(l,{gap:`xs`,children:Object.entries(H.relByType).sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,R.jsxs)(S,{variant:`light`,color:`brand`,size:`lg`,children:[Oe[e]??e,` · `,t]},e))}):(0,R.jsx)(C,{size:`sm`,c:`dimmed`,children:`Aucune relation déclarée.`})]})})})]})})]})]})})]})})]})});export{U as OrmOverview,U as default};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{Fn as t,H as n,K as ee,Mn as r,a as i,an as a,di as o,it as s,on as te,or as c,q as l,sn as u,vn as d,wt as f,xt as p,yn as m}from"./ui-Dy8y0zPl.js";import{t as h}from"./RingProgress-CHMtGKds.js";import{c as g,l as _}from"./stores-DIccV-P5.js";import{c as v}from"./hooks-C4XxBzBx.js";import{t as ne}from"./IconArrowLeft-7ehg9XYP.js";import{a as re,c as ie,d as ae,f as oe,g as se,h as ce,i as le,m as ue,n as y,o as de,p as fe,r as pe,s as me,t as he}from"./ConnectorCard-DOKtRiVP.js";import{A as ge,L as _e,P as ve,Y as b,pt as x,rt as S,ut as C,vt as w,y as T}from"./index-wfxUl83u.js";import{n as E}from"./realtimeHealth-CEJDxl45.js";import{r as D}from"./health-D8eXYj6Q.js";var O=e(o(),1),k=c(),A=w(()=>{let{pid:e=``}=v(),o=g(),c=_();(0,O.useEffect)(ae,[]);let w=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/orms`),[o])),A=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/graph`),[o])),j=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/counts`),[o])),M=w.data??[],N=(0,O.useMemo)(()=>A.data?.entities??[],[A.data]),P=(0,O.useMemo)(()=>j.data??{},[j.data]),F=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/connection/health`),[o])),[I,L]=(0,O.useState)(null),[ye,R]=(0,O.useState)(!1),z=(0,O.useMemo)(()=>I??F.data??[],[I,F.data]),be=(0,O.useMemo)(()=>{let e={};for(let t of z)e[t.name]=t;return e},[z]),B=z[0]?.instanceId??null,{flowByName:xe,onFlow:Se,reset:V}=de(),H=c.realtimeLive,U=c.adaptiveCadence,[W,Ce]=(0,O.useState)(()=>Number(ue(`nf.orm.liveMs`))||5e3),[we,Te]=(0,O.useState)(W);(0,O.useEffect)(()=>ce(`nf.orm.liveMs`,String(W)),[W]);let G=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/realtime/api/health`),[o])),[Ee,K]=(0,O.useState)(null),q=H?Ee??G.data:G.data,J=(0,O.useMemo)(()=>E(q),[q]),Y=J?.cluster??!1,X=(0,O.useMemo)(()=>J?.instances.find(t=>t.instanceId===e)??null,[J,e])?.orm??null,{ratesByPid:De,qSeriesByPid:Oe}=me(J,H),Z=De.get(e)??{errPerMin:null,reconPerMin:null},Q=(0,O.useMemo)(()=>X?D(se(X,Z)):null,[X,Z]),$=Oe.get(e)??[];(0,O.useEffect)(()=>{H||(L(null),K(null),R(!1),V())},[H,V]);let ke=!Y||B==null||B===e,Ae=w.loading&&!M.length;return(0,k.jsxs)(l,{gap:`lg`,title:`Connecteur ORM — worker pid ${e}`,subtitle:Y?`Drill d'un worker du cluster — santé lean exacte + diagnostic riche par connecteur`:`Détail du process — santé ORM + diagnostic riche par connecteur`,actions:(0,k.jsxs)(r,{gap:`xs`,children:[(0,k.jsx)(pe,{live:H,onToggle:e=>c.setRealtimeLive(e),liveMs:W,setLiveMs:Ce,auto:U,effectiveMs:we,ariaLabel:`abonnement temps réel (socket Nodefony) du worker pid ${e}`}),(0,k.jsx)(te,{component:C,to:`/nodefony/orm`,variant:`default`,leftSection:(0,k.jsx)(ne,{size:16}),children:`Vue d'ensemble`})]}),children:[H&&(0,k.jsx)(le,{pid:e,intervalMs:W,adaptive:U,onHealth:L,onFlow:Se,onPending:R}),H&&(0,k.jsx)(re,{intervalMs:W,adaptive:U,onData:K,onRate:Te}),(0,k.jsx)(a,{withBorder:!0,radius:`md`,p:`md`,className:H?`nf-live-card`:void 0,style:{contain:`content`},children:X?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(r,{wrap:`nowrap`,align:`center`,gap:`lg`,children:[(0,k.jsx)(h,{size:92,thickness:10,roundCaps:!0,sections:[{value:Q?.score??0,color:Q?.color??`gray`}],label:(0,k.jsx)(d,{ta:`center`,fw:800,fz:22,style:{fontVariantNumeric:`tabular-nums`},children:Q?.score??`—`})}),(0,k.jsxs)(`div`,{style:{minWidth:0},children:[(0,k.jsxs)(r,{gap:`xs`,mb:4,children:[(0,k.jsx)(d,{fw:700,children:`Santé ORM (ce worker)`}),Q&&(0,k.jsx)(u,{color:Q.color,variant:`light`,children:Q.label}),(0,k.jsxs)(u,{variant:`default`,leftSection:(0,k.jsx)(ge,{size:11}),style:{fontVariantNumeric:`tabular-nums`},children:[`pid `,e]}),(0,k.jsx)(n,{title:`Santé ORM (worker)`,version:ie,summary:`Verdict 3 états du SEUL worker demandé (Derringer-Suich), extrait par pid de la sonde lean pod — donc EXACT pour ce process.`,sections:[{label:`Signaux`,body:`Connecteurs coupés & taux d'erreurs = PANNE (→ 0). Latence EWMA, requêtes lentes & reconnexions = SATURATION (planché « Dégradé »).`},{label:`Taux, pas cumul`,body:`Erreurs & reconnexions en delta/min (après 2 mesures live). Débit & EWMA = flux ORM (NF_ORM_FLOW=1).`}]})]}),(0,k.jsxs)(d,{size:`sm`,c:`dimmed`,children:[`Sonde lean EXACTE de ce process (extraite de nodefony:socket par pid).`,Q?.worst?` Facteur limitant : ${Q.worst}.`:``]})]})]}),(0,k.jsxs)(x,{cols:{base:2,sm:3,lg:6},spacing:`sm`,mt:`md`,children:[(0,k.jsx)(y,{icon:(0,k.jsx)(b,{size:16}),label:`Requêtes`,value:fe(X.queryTotal),flashKey:X.queryTotal,hint:`Total des requêtes SQL exécutées par ce process depuis le boot.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(_e,{size:16}),label:`Connecteurs`,value:`${X.connected}/${X.connectors}`,color:X.connected<X.connectors?`orange`:void 0,hint:`Connecteurs ORM connectés / enregistrés sur ce process.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(p,{size:16}),label:`Requêtes lentes`,value:X.slowTotal,color:X.slowTotal>0?`orange`:void 0,hint:`Requêtes au-delà du seuil de lenteur (flux ORM).`}),(0,k.jsx)(y,{icon:(0,k.jsx)(f,{size:16}),label:`Erreurs ORM`,value:X.errorTotal,color:X.errorTotal>0?`red`:void 0,hint:`Erreurs ORM cumulées sur ce process. La couleur du verdict se base sur le TAUX (delta/min), pas ce cumul.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(S,{size:16}),label:`EWMA max`,value:X.maxEwmaMs==null?`—`:oe(X.maxEwmaMs),hint:`Latence lissée du pire connecteur (flux ORM). À lire à l'aune de l'event-loop lag sous charge.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(ve,{size:16}),label:`Reconnexions`,value:X.reconnectTotal,color:X.reconnectTotal>0?`orange`:void 0,hint:`Rétablissements de connexion sur ce process (instabilité).`})]}),(0,k.jsx)(d,{size:`xs`,c:`dimmed`,mt:`md`,mb:2,children:`Requêtes/s`}),(0,k.jsx)(i,{series:[{data:$.length?$:[0],color:`var(--mantine-color-grape-5)`,label:`req/s`}],height:70})]}):G.loading?(0,k.jsxs)(r,{justify:`center`,p:`md`,children:[(0,k.jsx)(t,{size:`sm`}),(0,k.jsx)(d,{size:`sm`,c:`dimmed`,children:`Chargement de la santé ORM…`})]}):(0,k.jsxs)(m,{variant:`light`,color:`gray`,icon:(0,k.jsx)(s,{size:18}),title:`Aucune sonde lean pour ce worker`,children:[`Le worker pid `,e,` ne remonte pas (ou plus) la sonde ORM lean — process disparu (respawn), temps réel coupé, ou aucun driver ORM sur ce process. Le diagnostic riche par connecteur reste affiché ci-dessous (worker répondant).`]})}),Y&&H&&ye&&(0,k.jsxs)(m,{variant:`light`,color:`blue`,icon:(0,k.jsx)(t,{size:14}),title:`Préparation du diagnostic riche…`,children:[`Activation de la sonde ORM riche sur le worker `,(0,k.jsxs)(`b`,{children:[`pid `,e]}),` via le master (relais ciblé). Le diagnostic détaillé arrive au prochain cycle.`]}),Y&&!H&&!ke&&(0,k.jsxs)(m,{variant:`light`,color:`orange`,icon:(0,k.jsx)(s,{size:18}),title:`Diagnostic riche : fourni par un autre worker`,children:[`Hors temps réel, le diagnostic détaillé par connecteur ci-dessous (ping, latence, pool, stockage, flux SQL) provient du worker`,` `,(0,k.jsxs)(`b`,{children:[`pid `,B]}),` (choisi au hasard par le load-balancer, reusePort), pas du worker `,e,` demandé. `,(0,k.jsx)(`b`,{children:`Active le temps réel`}),` `,`pour obtenir le diagnostic riche EXACT de ce pid (relais ciblé`,` `,(0,k.jsxs)(`code`,{children:[`nodefony:orm:rich@`,e]}),` master→worker). La santé lean ci-dessus est déjà exacte pour le pid `,e,`.`]}),(0,k.jsx)(ee,{loading:Ae,error:w.error??A.error,empty:!M.length,onRetry:()=>{w.reload(),A.reload()},emptyMessage:`Aucun connecteur ORM enregistré au runtime.`,children:(0,k.jsx)(x,{cols:M.length>1?{base:1,xl:2}:1,children:M.map(e=>(0,k.jsx)(he,{orm:e,entities:N,countMap:P,health:be[e.name],flow:xe[e.name]},e.name))})})]})});export{A as OrmWorker,A as default};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{Fn as t,H as n,K as ee,Mn as r,a as i,an as a,di as o,it as s,on as te,or as c,q as l,sn as u,vn as d,wt as f,xt as p,yn as m}from"./ui-BlRFVRfl.js";import{t as h}from"./RingProgress-CdgTmA2j.js";import{c as g,l as _}from"./stores-fG-e-IP-.js";import{f as v}from"./hooks-DMHLQNUe.js";import{t as ne}from"./IconArrowLeft-CGbdeI78.js";import{a as re,c as ie,d as ae,f as oe,g as se,h as ce,i as le,m as ue,n as y,o as de,p as fe,r as pe,s as me,t as he}from"./ConnectorCard-rSwtCZFu.js";import{A as ge,L as _e,P as ve,Y as b,pt as x,rt as S,ut as C,vt as w,y as T}from"./index-BwkdF4pp.js";import{n as E}from"./realtimeHealth-CEJDxl45.js";import{r as D}from"./health-D8eXYj6Q.js";var O=e(o(),1),k=c(),A=w(()=>{let{pid:e=``}=v(),o=g(),c=_();(0,O.useEffect)(ae,[]);let w=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/orms`),[o])),A=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/graph`),[o])),j=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/counts`),[o])),M=w.data??[],N=(0,O.useMemo)(()=>A.data?.entities??[],[A.data]),P=(0,O.useMemo)(()=>j.data??{},[j.data]),F=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/orm/api/connection/health`),[o])),[I,L]=(0,O.useState)(null),[ye,R]=(0,O.useState)(!1),z=(0,O.useMemo)(()=>I??F.data??[],[I,F.data]),be=(0,O.useMemo)(()=>{let e={};for(let t of z)e[t.name]=t;return e},[z]),B=z[0]?.instanceId??null,{flowByName:xe,onFlow:Se,reset:V}=de(),H=c.realtimeLive,U=c.adaptiveCadence,[W,Ce]=(0,O.useState)(()=>Number(ue(`nf.orm.liveMs`))||5e3),[we,Te]=(0,O.useState)(W);(0,O.useEffect)(()=>ce(`nf.orm.liveMs`,String(W)),[W]);let G=T((0,O.useCallback)(()=>o.api.getAbsolute(`/nodefony/realtime/api/health`),[o])),[Ee,K]=(0,O.useState)(null),q=H?Ee??G.data:G.data,J=(0,O.useMemo)(()=>E(q),[q]),Y=J?.cluster??!1,X=(0,O.useMemo)(()=>J?.instances.find(t=>t.instanceId===e)??null,[J,e])?.orm??null,{ratesByPid:De,qSeriesByPid:Oe}=me(J,H),Z=De.get(e)??{errPerMin:null,reconPerMin:null},Q=(0,O.useMemo)(()=>X?D(se(X,Z)):null,[X,Z]),$=Oe.get(e)??[];(0,O.useEffect)(()=>{H||(L(null),K(null),R(!1),V())},[H,V]);let ke=!Y||B==null||B===e,Ae=w.loading&&!M.length;return(0,k.jsxs)(l,{gap:`lg`,title:`Connecteur ORM — worker pid ${e}`,subtitle:Y?`Drill d'un worker du cluster — santé lean exacte + diagnostic riche par connecteur`:`Détail du process — santé ORM + diagnostic riche par connecteur`,actions:(0,k.jsxs)(r,{gap:`xs`,children:[(0,k.jsx)(pe,{live:H,onToggle:e=>c.setRealtimeLive(e),liveMs:W,setLiveMs:Ce,auto:U,effectiveMs:we,ariaLabel:`abonnement temps réel (socket Nodefony) du worker pid ${e}`}),(0,k.jsx)(te,{component:C,to:`/nodefony/orm`,variant:`default`,leftSection:(0,k.jsx)(ne,{size:16}),children:`Vue d'ensemble`})]}),children:[H&&(0,k.jsx)(le,{pid:e,intervalMs:W,adaptive:U,onHealth:L,onFlow:Se,onPending:R}),H&&(0,k.jsx)(re,{intervalMs:W,adaptive:U,onData:K,onRate:Te}),(0,k.jsx)(a,{withBorder:!0,radius:`md`,p:`md`,className:H?`nf-live-card`:void 0,style:{contain:`content`},children:X?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(r,{wrap:`nowrap`,align:`center`,gap:`lg`,children:[(0,k.jsx)(h,{size:92,thickness:10,roundCaps:!0,sections:[{value:Q?.score??0,color:Q?.color??`gray`}],label:(0,k.jsx)(d,{ta:`center`,fw:800,fz:22,style:{fontVariantNumeric:`tabular-nums`},children:Q?.score??`—`})}),(0,k.jsxs)(`div`,{style:{minWidth:0},children:[(0,k.jsxs)(r,{gap:`xs`,mb:4,children:[(0,k.jsx)(d,{fw:700,children:`Santé ORM (ce worker)`}),Q&&(0,k.jsx)(u,{color:Q.color,variant:`light`,children:Q.label}),(0,k.jsxs)(u,{variant:`default`,leftSection:(0,k.jsx)(ge,{size:11}),style:{fontVariantNumeric:`tabular-nums`},children:[`pid `,e]}),(0,k.jsx)(n,{title:`Santé ORM (worker)`,version:ie,summary:`Verdict 3 états du SEUL worker demandé (Derringer-Suich), extrait par pid de la sonde lean pod — donc EXACT pour ce process.`,sections:[{label:`Signaux`,body:`Connecteurs coupés & taux d'erreurs = PANNE (→ 0). Latence EWMA, requêtes lentes & reconnexions = SATURATION (planché « Dégradé »).`},{label:`Taux, pas cumul`,body:`Erreurs & reconnexions en delta/min (après 2 mesures live). Débit & EWMA = flux ORM (NF_ORM_FLOW=1).`}]})]}),(0,k.jsxs)(d,{size:`sm`,c:`dimmed`,children:[`Sonde lean EXACTE de ce process (extraite de nodefony:socket par pid).`,Q?.worst?` Facteur limitant : ${Q.worst}.`:``]})]})]}),(0,k.jsxs)(x,{cols:{base:2,sm:3,lg:6},spacing:`sm`,mt:`md`,children:[(0,k.jsx)(y,{icon:(0,k.jsx)(b,{size:16}),label:`Requêtes`,value:fe(X.queryTotal),flashKey:X.queryTotal,hint:`Total des requêtes SQL exécutées par ce process depuis le boot.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(_e,{size:16}),label:`Connecteurs`,value:`${X.connected}/${X.connectors}`,color:X.connected<X.connectors?`orange`:void 0,hint:`Connecteurs ORM connectés / enregistrés sur ce process.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(p,{size:16}),label:`Requêtes lentes`,value:X.slowTotal,color:X.slowTotal>0?`orange`:void 0,hint:`Requêtes au-delà du seuil de lenteur (flux ORM).`}),(0,k.jsx)(y,{icon:(0,k.jsx)(f,{size:16}),label:`Erreurs ORM`,value:X.errorTotal,color:X.errorTotal>0?`red`:void 0,hint:`Erreurs ORM cumulées sur ce process. La couleur du verdict se base sur le TAUX (delta/min), pas ce cumul.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(S,{size:16}),label:`EWMA max`,value:X.maxEwmaMs==null?`—`:oe(X.maxEwmaMs),hint:`Latence lissée du pire connecteur (flux ORM). À lire à l'aune de l'event-loop lag sous charge.`}),(0,k.jsx)(y,{icon:(0,k.jsx)(ve,{size:16}),label:`Reconnexions`,value:X.reconnectTotal,color:X.reconnectTotal>0?`orange`:void 0,hint:`Rétablissements de connexion sur ce process (instabilité).`})]}),(0,k.jsx)(d,{size:`xs`,c:`dimmed`,mt:`md`,mb:2,children:`Requêtes/s`}),(0,k.jsx)(i,{series:[{data:$.length?$:[0],color:`var(--mantine-color-grape-5)`,label:`req/s`}],height:70})]}):G.loading?(0,k.jsxs)(r,{justify:`center`,p:`md`,children:[(0,k.jsx)(t,{size:`sm`}),(0,k.jsx)(d,{size:`sm`,c:`dimmed`,children:`Chargement de la santé ORM…`})]}):(0,k.jsxs)(m,{variant:`light`,color:`gray`,icon:(0,k.jsx)(s,{size:18}),title:`Aucune sonde lean pour ce worker`,children:[`Le worker pid `,e,` ne remonte pas (ou plus) la sonde ORM lean — process disparu (respawn), temps réel coupé, ou aucun driver ORM sur ce process. Le diagnostic riche par connecteur reste affiché ci-dessous (worker répondant).`]})}),Y&&H&&ye&&(0,k.jsxs)(m,{variant:`light`,color:`blue`,icon:(0,k.jsx)(t,{size:14}),title:`Préparation du diagnostic riche…`,children:[`Activation de la sonde ORM riche sur le worker `,(0,k.jsxs)(`b`,{children:[`pid `,e]}),` via le master (relais ciblé). Le diagnostic détaillé arrive au prochain cycle.`]}),Y&&!H&&!ke&&(0,k.jsxs)(m,{variant:`light`,color:`orange`,icon:(0,k.jsx)(s,{size:18}),title:`Diagnostic riche : fourni par un autre worker`,children:[`Hors temps réel, le diagnostic détaillé par connecteur ci-dessous (ping, latence, pool, stockage, flux SQL) provient du worker`,` `,(0,k.jsxs)(`b`,{children:[`pid `,B]}),` (choisi au hasard par le load-balancer, reusePort), pas du worker `,e,` demandé. `,(0,k.jsx)(`b`,{children:`Active le temps réel`}),` `,`pour obtenir le diagnostic riche EXACT de ce pid (relais ciblé`,` `,(0,k.jsxs)(`code`,{children:[`nodefony:orm:rich@`,e]}),` master→worker). La santé lean ci-dessus est déjà exacte pour le pid `,e,`.`]}),(0,k.jsx)(ee,{loading:Ae,error:w.error??A.error,empty:!M.length,onRetry:()=>{w.reload(),A.reload()},emptyMessage:`Aucun connecteur ORM enregistré au runtime.`,children:(0,k.jsx)(x,{cols:M.length>1?{base:1,xl:2}:1,children:M.map(e=>(0,k.jsx)(he,{orm:e,entities:N,countMap:P,health:be[e.name],flow:xe[e.name]},e.name))})})]})});export{A as OrmWorker,A as default};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{$t as t,Ar as n,Dr as r,Et as i,Fn as a,H as o,K as s,Kt as c,Mn as l,Nn as u,Sn as d,Ut as f,W as p,_n as m,an as h,di as g,en as _,et as v,h as y,nn as b,nr as ee,on as x,or as S,q as C,qn as w,sn as T,tr as E,vn as D,xn as O,xt as k,yn as A,zn as j,zt as M}from"./ui-Dy8y0zPl.js";import{t as N}from"./Accordion-C9IINbNl.js";import{t as P}from"./Textarea-C4dBiWye.js";import{c as F}from"./stores-DIccV-P5.js";import{a as I,c as L}from"./hooks-C4XxBzBx.js";import{t as R}from"./IconSend-MV_iN0wK.js";import{K as z,_t as B,gt as V,it as te,k as H,vt as U,y as W}from"./index-wfxUl83u.js";import{i as ne,n as re,o as ie}from"./profileVisuals-BE_m4Ey1.js";var G=e(g(),1),K=S(),ae={valueComponent:({value:e})=>(0,K.jsx)(`div`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Array.isArray(e)?e.map(e=>e.name).join(`, `):e?.name}),size:`sm`},q=w(e=>{let t=ee([`Input`,`InputWrapper`,`FileInput`],ae,e),{unstyled:i,vars:a,onChange:o,value:s,defaultValue:c,multiple:l,accept:f,name:p,form:m,valueComponent:h,clearable:g,clearSectionMode:_,clearButtonProps:v,readOnly:y,capture:b,fileInputProps:x,rightSection:S,size:C,placeholder:w,component:T,resetRef:D,classNames:k,styles:A,attributes:j,...M}=t,N=(0,G.useRef)(null),{resolvedClassNames:P,resolvedStyles:F}=E({classNames:k,styles:A,props:t}),[I,L]=r({value:s,defaultValue:c,onChange:o,finalValue:l?[]:null}),R=Array.isArray(I)?I.length!==0:I!==null,z=(0,K.jsx)(u,{...v,variant:`subtle`,onClick:()=>L(l?[]:null),size:C,unstyled:i}),V=g&&R&&!y;return(0,G.useEffect)(()=>{(Array.isArray(I)&&I.length===0||I===null)&&N.current?.()},[I]),(0,K.jsx)(B,{onChange:L,multiple:l,accept:f,name:p,form:m,resetRef:n(N,D),disabled:y,capture:b,inputProps:x,children:e=>(0,K.jsx)(O,{component:T||`button`,rightSection:S,__clearSection:z,__clearable:V,__clearSectionMode:_,...e,...M,__staticSelector:`FileInput`,multiline:!0,type:`button`,pointer:!0,__stylesApiProps:t,unstyled:i,size:C,classNames:k,styles:A,attributes:j,children:R?(0,K.jsx)(h,{value:I}):(0,K.jsx)(d.Placeholder,{__staticSelector:`FileInput`,classNames:P,styles:F,attributes:j,children:w})})})});q.classes=O.classes,q.displayName=`@mantine/core/FileInput`;var J=i(`outline`,`radar-2`,`Radar2`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M15.51 15.56a5 5 0 1 0 -3.51 1.44`,key:`svg-1`}],[`path`,{d:`M18.832 17.86a9 9 0 1 0 -6.832 3.14`,key:`svg-2`}],[`path`,{d:`M12 12v9`,key:`svg-3`}]]),Y=i(`outline`,`repeat`,`Repeat`,[[`path`,{d:`M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3`,key:`svg-0`}],[`path`,{d:`M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3`,key:`svg-1`}]]),oe=i(`outline`,`shield-x`,`ShieldX`,[[`path`,{d:`M13.252 20.601c-.408 .155 -.826 .288 -1.252 .399a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.19 7.357`,key:`svg-0`}],[`path`,{d:`M22 22l-5 -5`,key:`svg-1`}],[`path`,{d:`M17 22l5 -5`,key:`svg-2`}]]),se=i(`outline`,`upload`,`Upload`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 9l5 -5l5 5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]);function ce(e){return e.methods.filter(e=>e!==`WEBSOCKET`&&e!==`ANY`)}function X(e){return e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`}function le(e,t,n){let r=e.replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(t[n]??``)),i=Object.entries(n).filter(([,e])=>e!==``).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`);return i&&(r+=`${r.includes(`?`)?`&`:`?`}${i}`),r}function Z(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`idem-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function ue(e){let t=e.status;return t===404?`Playground non monté : cette console n'existe qu'en développement (elle exécute des actions réelles).`:t===401?`Session expirée — reconnectez-vous.`:t===403?`Accès refusé : le playground exige ROLE_NODEFONY_ADMIN.`:e instanceof Error?e.message:`Erreur inattendue.`}function de(e){switch(e){case`user`:return`identité du firewall (ALS)`;case`session`:return`session serveur`;case`cookie`:return`cookie de la requête`;case`req`:case`res`:return`objet requête/réponse`;case`file`:case`files`:return`upload multipart`;default:return e}}var fe={GET:`teal`,POST:`blue`,PUT:`grape`,PATCH:`violet`,DELETE:`red`,OPTIONS:`gray`,HEAD:`gray`,WEBSOCKET:`orange`,ANY:`gray`};function Q({method:e}){return(0,K.jsx)(T,{size:`sm`,variant:`light`,color:fe[e]??`gray`,radius:`sm`,children:e})}function pe({action:e}){let t=e.guards,n=[];if(t.security){let e=t.security.clauses.flatMap(e=>e.anyOf);n.push((0,K.jsx)(c,{label:`@IsGranted — exige ${e.join(` ou `)} (403 sinon)`,children:(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`yellow`,radius:`sm`,children:[`🔒 `,e.join(` | `)]})},`granted`))}return t.scopes.length>0&&n.push((0,K.jsx)(c,{label:`@RequireScope — ne bride que les jetons machine (clé API / JWT)`,children:(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`cyan`,radius:`sm`,children:[`scope `,t.scopes.join(`, `)]})},`scopes`)),t.idempotent&&n.push((0,K.jsx)(c,{label:t.idempotent.required?`@Idempotent strict — mutation sans Idempotency-Key rejetée (400) ; rejeu même clé = réponse mémorisée, 0 ré-exécution`:`@Idempotent souple — la clé est honorée si présente`,children:(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`indigo`,radius:`sm`,children:[`idempotent`,t.idempotent.required?``:` (souple)`]})},`idem`)),t.csrfProtect&&n.push((0,K.jsx)(c,{label:`@CsrfProtect — exige le synchronizer token sur la mutation`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`orange`,radius:`sm`,children:`CSRF`})},`csrf`)),t.csrfExempt&&n.push((0,K.jsx)(c,{label:`@CsrfExempt — hors défense CSRF (auth conservée)`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`gray`,radius:`sm`,children:`CSRF exempt`})},`csrf-exempt`)),t.session!==null&&t.session!==void 0&&n.push((0,K.jsx)(c,{label:`@UseSession — session serveur activée`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`green`,radius:`sm`,children:`session`})},`session`)),t.bypassFirewall&&n.push((0,K.jsx)(c,{label:`bypassFirewall — route hors firewall (mécanisme d'auth lui-même)`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`red`,radius:`sm`,children:`hors firewall`})},`bypass`)),n.length===0?null:(0,K.jsx)(l,{gap:6,children:n})}function me({status:e}){return(0,K.jsx)(T,{size:`lg`,variant:`light`,color:e===null?`red`:e<300?`teal`:e<500?`yellow`:`red`,radius:`sm`,children:e===null?`transport KO`:`HTTP ${e}`})}var he=150,ge={granted:`identité authentifiée`,anonymous:`anonyme accepté (la zone l'autorise explicitement)`,denied:`refusé — aucune preuve d'identité présentée`,failure:`refusé — preuve présentée mais invalide`,throttled:`ralenti — trop de tentatives (backoff NIST)`,bypass:`zone traversée sans authentification (route exemptée)`,public:`zone publique — aucune identité exigée`},_e={no_credentials:`aucun credential envoyé`,invalid_credentials:`credential invalide`,unauthenticated:`token non authentifié`,throttled:`trop de tentatives`};function ve(e){return e===`granted`||e===`anonymous`||e===`public`||e===`bypass`}function ye(e){let t=F(),[n,r]=(0,G.useState)(null),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(!1),c=(0,G.useCallback)(async()=>{if(!e)return;s(!0),a(null);let n=()=>t.api.getAbsolute(`/nodefony/profiler/api/${encodeURIComponent(e)}`);try{let e;try{e=await n()}catch(t){if(t.status!==404)throw t;await new Promise(e=>setTimeout(e,he)),e=await n()}r(e)}catch(e){let t=e.status;a(t===404?`Profil introuvable : le profiler n'est actif qu'en développement (et ne garde que les 500 dernières requêtes).`:e instanceof Error?e.message:`Erreur inattendue.`)}finally{s(!1)}},[e,t]);return(0,G.useEffect)(()=>{r(null),c()},[c]),{profile:n,error:i,loading:o}}function be({security:e}){let t=ve(e.outcome),n=e.outcome?ge[e.outcome]??e.outcome:`—`;return(0,K.jsxs)(h,{withBorder:!0,padding:`sm`,radius:`sm`,children:[(0,K.jsxs)(l,{gap:`xs`,mb:6,children:[t?(0,K.jsx)(H,{size:16,color:`var(--mantine-color-teal-6)`}):(0,K.jsx)(oe,{size:16,color:`var(--mantine-color-red-6)`}),(0,K.jsx)(D,{size:`sm`,fw:600,children:`Firewall`}),(0,K.jsx)(T,{size:`sm`,variant:`light`,color:t?`teal`:`red`,children:e.outcome??`—`}),e.zone&&(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`gray`,children:[`zone `,e.zone]}),!e.protected&&(0,K.jsx)(T,{size:`sm`,variant:`light`,color:`gray`,children:`non protégée`})]}),(0,K.jsxs)(D,{size:`sm`,mb:4,children:[n,e.reason&&(0,K.jsxs)(D,{span:!0,c:`red`,size:`sm`,children:[` `,`— `,_e[e.reason]??e.reason]})]}),e.candidates.length>0&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[`Authenticators acceptés (`,e.mode??`first`,`) :`,` `,e.candidates.map(t=>(0,K.jsx)(T,{size:`xs`,mr:4,variant:t===e.authenticator?`filled`:`default`,color:t===e.authenticator?`teal`:`gray`,children:t},t)),e.authenticator?` — le maillon plein a résolu l'identité.`:` — aucun n'a abouti.`]}),e.roles&&e.roles.length>0&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,mt:4,children:[`Rôles :`,` `,e.roles.map(e=>(0,K.jsx)(T,{size:`xs`,mr:4,variant:`light`,color:`blue`,children:e},e))]})]})}function $({requestId:e,transport:t}){let{profile:n,error:r,loading:i}=ye(e);if(!e)return(0,K.jsxs)(A,{variant:`light`,color:`gray`,icon:(0,K.jsx)(J,{size:16}),title:`Radiographie indisponible : aucune réponse tracée`,children:[`La traversée s'indexe sur l'identifiant du profil serveur (`,(0,K.jsx)(`code`,{children:`x-request-id`}),` en HTTP, id de frame rendu par le pont en socket). Une requête qui n'aboutit pas (erreur réseau) n'a rien à tracer, et une frame refusée `,(0,K.jsx)(`em`,{children:`avant`}),` le pont (firewall de frame,`,` `,(0,K.jsx)(`code`,{children:`-32001`}),`) n'a jamais été exécutée : il n'y a pas de traversée à montrer. Rejouez la requête.`]});if(i&&!n)return(0,K.jsxs)(l,{gap:`xs`,py:`xs`,children:[(0,K.jsx)(a,{size:`xs`}),(0,K.jsx)(D,{size:`sm`,c:`dimmed`,children:`Lecture du profil serveur…`})]});if(r)return(0,K.jsx)(A,{variant:`light`,color:`yellow`,icon:(0,K.jsx)(J,{size:16}),children:r});if(!n)return null;let o=n.queries??[];return(0,K.jsxs)(h,{withBorder:!0,padding:`sm`,radius:`sm`,children:[(0,K.jsxs)(l,{gap:`xs`,mb:`xs`,children:[(0,K.jsx)(J,{size:16}),(0,K.jsxs)(D,{size:`sm`,fw:600,children:[`Radiographie`,t===`socket`?` · porte Socket`:t===`http`?` · porte HTTP`:``]}),(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[ie(n.durationMs),` serveur · `,n.user??`anonyme`]})]}),(0,K.jsxs)(f,{gap:`sm`,children:[n.security?(0,K.jsx)(be,{security:n.security}):(0,K.jsx)(D,{size:`xs`,c:`dimmed`,children:`Aucune zone firewall traversée (route hors zone).`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,mb:4,children:[`Où le temps est passé`,o.length>0?` (les requêtes ORM sont DANS l'action)`:``]}),(0,K.jsx)(re,{profile:n,withQueries:!0})]}),o.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_,{}),(0,K.jsx)(ne,{queries:o})]}),(0,K.jsx)(m,{size:`xs`,href:`/nodefony/logs/trace/${encodeURIComponent(n.requestId)}`,target:`_blank`,children:`Ouvrir le suivi de requête complet (logs corrélés, audit) →`})]})]})}async function xe(e,t,n,r){let i=performance.now();try{let a=new Headers(r);a.set(`Accept`,`application/json`),typeof n==`string`&&a.set(`Content-Type`,`application/json`);let o=await fetch(t,{method:e,headers:a,body:n,credentials:`same-origin`}),s=(o.headers.get(`Content-Type`)??``).includes(`application/json`)?await o.json():await o.text();return{transport:`http`,status:o.status,ok:o.ok,durationMs:performance.now()-i,body:s,error:null,instance:o.headers.get(`x-nodefony-instance`),requestId:o.headers.get(`x-request-id`)}}catch(e){return{transport:`http`,status:null,ok:!1,durationMs:performance.now()-i,body:null,error:e instanceof Error?e.message:String(e),instance:null,requestId:null}}}async function Se(e,t,n,r,i){let a=performance.now();try{let{result:o,requestId:s}=await e.call(n,t===`GET`?void 0:{method:t,body:r,idempotencyKey:i??Z()});return{transport:`socket`,status:200,ok:!0,durationMs:performance.now()-a,body:o,error:null,instance:null,requestId:s}}catch(e){let t=e;return{transport:`socket`,status:t.name===`RpcError`?t.data?.status??null:null,ok:!1,durationMs:performance.now()-a,body:t.data?.body??null,error:t.message??String(e),instance:null,requestId:t.data?.requestId??null}}}function Ce({result:e}){return(0,K.jsxs)(h,{withBorder:!0,padding:`sm`,children:[(0,K.jsxs)(l,{justify:`space-between`,mb:`xs`,children:[(0,K.jsxs)(l,{gap:`xs`,children:[(0,K.jsx)(D,{size:`sm`,fw:600,children:e.transport===`http`?`Porte HTTP`:`Porte Socket`}),(0,K.jsx)(me,{status:e.status})]}),(0,K.jsxs)(D,{size:`sm`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[e.durationMs.toFixed(1),` ms`,e.instance?` · ${e.instance}`:``]})]}),e.error!==null&&(0,K.jsx)(D,{size:`sm`,c:`red`,role:`alert`,mb:`xs`,children:e.error}),e.body!==null&&e.body!==void 0&&(0,K.jsx)(y,{value:e.body,maxHeight:260})]})}function we({action:e}){let n=te(),r=ce(e),[i,a]=(0,G.useState)(r[0]??`GET`),[o,s]=(0,G.useState)(()=>{let t={};for(let n of e.variables){let r=e.defaults[n];t[n]=r==null?``:String(r)}return t}),[u,d]=(0,G.useState)({}),[m,h]=(0,G.useState)({}),[g,_]=(0,G.useState)(`{}`),[y,ee]=(0,G.useState)([]),[S,C]=(0,G.useState)(Z),[w,T]=(0,G.useState)(!1),[E,O]=(0,G.useState)(null),[A,j]=(0,G.useState)(null),N=(0,G.useMemo)(()=>e.params.filter(e=>e.source===`query`&&e.key).map(e=>e.key),[e]),F=(0,G.useMemo)(()=>e.params.filter(e=>e.source===`headers`&&e.key).map(e=>e.key),[e]),I=(0,G.useMemo)(()=>e.params.find(e=>e.source===`file`||e.source===`files`)??null,[e]),L=(0,G.useMemo)(()=>e.params.some(e=>e.source===`body`&&e.stream),[e]),z=(0,G.useMemo)(()=>e.params.filter(e=>![`param`,`body`,`query`,`headers`,`file`,`files`].includes(e.source)),[e]),B=!I&&!L&&(X(i)||e.params.some(e=>e.source===`body`)),V=X(i),H=e.path?le(e.path,o,u):``,U=()=>{if(!B||g.trim()===``)return{ok:!0,value:void 0};try{return{ok:!0,value:JSON.parse(g)}}catch{return{ok:!1}}},W=async(t,r)=>{if(I&&t===`socket`){j({transport:t,status:null,ok:!1,durationMs:0,body:null,error:`Upload multipart : porte HTTP uniquement (le pont api.request transporte du JSON).`,instance:null,requestId:null});return}if(I&&y.length===0){O({transport:`http`,status:null,ok:!1,durationMs:0,body:null,error:`Choisissez un fichier avant d'envoyer.`,instance:null,requestId:null});return}let a=U();if(!a.ok){(t===`http`?O:j)({transport:t,status:null,ok:!1,durationMs:0,body:null,error:`Body : JSON invalide (corrigez avant d'envoyer).`,instance:null,requestId:null});return}let o=r?S:Z();!r&&V&&C(o),T(!0);try{if(t===`http`){let t={...m};for(let e of Object.keys(t))t[e]===``&&delete t[e];V&&e.guards.idempotent&&(t[`Idempotency-Key`]=o);let n;if(I){let e=new FormData,t=I.key??(I.source===`files`?`files`:`file`);for(let n of y)e.append(t,n,n.name);n=e}else B&&a.value!==void 0&&(n=JSON.stringify(a.value));O(await xe(i,H,n,t))}else j(await Se(n,i,H,a.value,V?o:void 0))}finally{T(!1)}};return(0,K.jsxs)(f,{gap:`sm`,children:[(0,K.jsxs)(l,{gap:`xs`,wrap:`wrap`,children:[e.methods.map(e=>(0,K.jsx)(Q,{method:e},e)),(0,K.jsx)(b,{children:e.path??`—`}),(0,K.jsx)(pe,{action:e})]}),r.length>1&&(0,K.jsx)(l,{gap:`xs`,children:r.map(e=>(0,K.jsx)(x,{size:`compact-xs`,variant:e===i?`filled`:`default`,onClick:()=>a(e),children:e},e))}),(0,K.jsxs)(t,{gap:`xs`,children:[e.variables.map(e=>(0,K.jsx)(t.Col,{span:{base:12,sm:4},children:(0,K.jsx)(M,{label:`{${e}}`,description:`variable de path`,value:o[e]??``,onChange:t=>s({...o,[e]:t.currentTarget.value})})},e)),N.map(e=>(0,K.jsx)(t.Col,{span:{base:12,sm:4},children:(0,K.jsx)(M,{label:e,description:`@Query`,value:u[e]??``,onChange:t=>d({...u,[e]:t.currentTarget.value})})},e)),F.map(e=>(0,K.jsx)(t.Col,{span:{base:12,sm:4},children:(0,K.jsx)(M,{label:e,description:`@Headers`,value:m[e]??``,onChange:t=>h({...m,[e]:t.currentTarget.value})})},e))]}),I&&(0,K.jsx)(q,{label:I.source===`files`?`Fichiers (@UploadedFiles)`:`Fichier (@UploadedFile)`,description:`Envoyé en multipart/form-data — porte HTTP uniquement`,placeholder:`Choisir…`,leftSection:(0,K.jsx)(se,{size:16}),multiple:I.source===`files`,clearable:!0,value:I.source===`files`?y:y[0]??null,onChange:e=>ee(Array.isArray(e)?e:e===null?[]:[e])}),L&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[`@Body(stream) — flux brut (`,`IncomingMessage`,`) : non rejouable depuis un formulaire (piper un vrai client, ex. curl --data-binary).`]}),B&&(0,K.jsx)(P,{label:`Body (JSON)`,autosize:!0,minRows:3,maxRows:10,value:g,onChange:e=>_(e.currentTarget.value),styles:{input:{fontFamily:`var(--mantine-font-family-monospace)`}}}),z.length>0&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[`Injecté par le serveur :`,` `,z.map(e=>`@${e.source}${e.key?`(${e.key})`:``} — ${de(e.source)}`).join(` · `)]}),(0,K.jsxs)(l,{gap:`xs`,wrap:`wrap`,children:[(0,K.jsx)(x,{leftSection:(0,K.jsx)(R,{size:16}),loading:w,onClick:()=>void W(`http`,!1),children:`Envoyer HTTP`}),(0,K.jsx)(c,{label:I?`Upload multipart : porte HTTP uniquement (le pont api.request transporte du JSON)`:e.duplex?`La même action, par la socket Nodefony (pont api.request)`:`Cette route ne déclare pas le transport WEBSOCKET — le pont répondra 405 (démonstration honnête)`,children:(0,K.jsx)(x,{variant:e.duplex?`light`:`default`,leftSection:(0,K.jsx)(k,{size:16}),loading:w,disabled:I!==null,onClick:()=>void W(`socket`,!1),children:`Envoyer Socket`})}),V&&e.guards.idempotent&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(x,{variant:`outline`,color:`indigo`,leftSection:(0,K.jsx)(Y,{size:16}),loading:w,onClick:()=>void W(`socket`,!0),children:`Rejouer même clé (socket)`}),(0,K.jsx)(x,{variant:`outline`,color:`indigo`,leftSection:(0,K.jsx)(Y,{size:16}),loading:w,onClick:()=>void W(`http`,!0),children:`Rejouer même clé (HTTP)`}),(0,K.jsxs)(l,{gap:4,children:[(0,K.jsx)(b,{style:{fontSize:11},children:S}),(0,K.jsx)(c,{label:`Régénérer la clé d'idempotence`,children:(0,K.jsx)(x,{size:`compact-xs`,variant:`subtle`,"aria-label":`Régénérer la clé d'idempotence`,onClick:()=>C(Z()),children:(0,K.jsx)(v,{size:14})})}),(0,K.jsx)(p,{title:`Idempotence visible`,summary:`Envoyer exécute l'action avec une clé NEUVE. « Rejouer même clé » renvoie la réponse MÉMORISÉE par le serveur : même payload (mêmes ids), zéro ré-exécution — comparez avec un envoi neuf.`})]})]})]}),(E||A)&&(0,K.jsxs)(t,{gap:`sm`,children:[E&&(0,K.jsx)(t.Col,{span:{base:12,md:A?6:12},children:(0,K.jsx)(Ce,{result:E})}),A&&(0,K.jsx)(t.Col,{span:{base:12,md:E?6:12},children:(0,K.jsx)(Ce,{result:A})})]}),E&&(0,K.jsx)($,{requestId:E.requestId,transport:`http`}),A&&(0,K.jsx)($,{requestId:A.requestId,transport:`socket`})]})}var Te=U(()=>{let e=F(),t=I(),{controller:n}=L(),r=(0,G.useCallback)(async()=>{try{return await e.api.getAbsolute(`/nodefony/framework/api/playground/routes`)}catch(e){throw Error(ue(e),{cause:e})}},[e]),{data:i,loading:a,error:c,reload:u}=W(r),d=(0,G.useMemo)(()=>i?.controllers??[],[i]),p=(0,G.useMemo)(()=>{let e=new Map;for(let t of d){let n=t.module??`(sans module)`,r=e.get(n);r?r.push(t):e.set(n,[t])}return e},[d]),m=d.find(e=>e.name===n)??d[0]??null;return(0,K.jsx)(C,{title:`Playground`,subtitle:`Console vivante des controllers — exécute chaque action par HTTP ou par la socket Nodefony`,icon:(0,K.jsx)(z,{size:28}),actions:(0,K.jsx)(o,{title:`Playground (dev)`,summary:`Les formulaires sont construits depuis les métadonnées des décorateurs (routes, transports, @Query/@Body, gardes). Une action « duplex » répond par HTTP ET par la socket (pont api.request) — la même action controller, deux transports.`,sections:[{label:`Sécurité`,body:`Cette console exécute des actions RÉELLES avec votre session : elle n'est montée qu'en développement. Les refus (401/403/405) s'affichent tels que le serveur les rend.`}]}),children:(0,K.jsx)(s,{loading:a&&!d.length,error:c,empty:!a&&!d.length,emptyMessage:`Aucun controller enregistré.`,onRetry:u,children:(0,K.jsxs)(l,{align:`flex-start`,gap:`md`,wrap:`nowrap`,children:[(0,K.jsx)(j,{withBorder:!0,p:`xs`,w:280,style:{flexShrink:0},children:(0,K.jsx)(f,{gap:4,children:[...p.entries()].map(([e,n])=>(0,K.jsxs)(f,{gap:2,children:[(0,K.jsx)(D,{size:`xs`,c:`dimmed`,fw:600,tt:`uppercase`,px:`xs`,children:e}),n.map(e=>(0,K.jsx)(V,{active:m?.name===e.name,label:e.name,description:`${e.actions.length} action(s)`,onClick:()=>void t(`/nodefony/playground/${e.name}`)},e.name))]},e))})}),(0,K.jsx)(f,{gap:`md`,style:{flex:1,minWidth:0},children:m&&(0,K.jsx)(N,{variant:`separated`,multiple:!1,defaultValue:m.actions[0]?.route??null,children:m.actions.map(e=>(0,K.jsxs)(N.Item,{value:e.route,children:[(0,K.jsx)(N.Control,{children:(0,K.jsxs)(l,{gap:`xs`,wrap:`wrap`,children:[e.methods.filter(e=>e!==`WEBSOCKET`).map(e=>(0,K.jsx)(Q,{method:e},e)),e.duplex&&(0,K.jsx)(T,{size:`sm`,variant:`light`,color:`orange`,radius:`sm`,children:`duplex`}),(0,K.jsx)(D,{size:`sm`,ff:`monospace`,children:e.path}),(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[m.name,`.`,e.action,`()`]})]})}),(0,K.jsx)(N.Panel,{children:(0,K.jsx)(we,{action:e})})]},e.route))})})]})})})});export{Te as Playground};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{$t as t,Ar as n,Dr as r,Et as i,Fn as a,H as o,K as s,Kt as c,Mn as l,Nn as u,Sn as d,Ut as f,W as p,_n as m,an as h,di as g,en as _,et as v,h as y,nn as b,nr as ee,on as x,or as S,q as C,qn as w,sn as T,tr as E,vn as D,xn as O,xt as k,yn as A,zn as j,zt as M}from"./ui-BlRFVRfl.js";import{t as N}from"./Accordion-BZratQ5I.js";import{t as P}from"./Textarea-9n-r0dhs.js";import{c as F}from"./stores-fG-e-IP-.js";import{f as I,l as L}from"./hooks-DMHLQNUe.js";import{t as R}from"./IconSend-BPiCAzpg.js";import{K as z,_t as B,gt as V,it as te,k as H,vt as U,y as W}from"./index-BwkdF4pp.js";import{i as ne,n as re,o as ie}from"./profileVisuals-CdDZ-G5o.js";var G=e(g(),1),K=S(),ae={valueComponent:({value:e})=>(0,K.jsx)(`div`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Array.isArray(e)?e.map(e=>e.name).join(`, `):e?.name}),size:`sm`},q=w(e=>{let t=ee([`Input`,`InputWrapper`,`FileInput`],ae,e),{unstyled:i,vars:a,onChange:o,value:s,defaultValue:c,multiple:l,accept:f,name:p,form:m,valueComponent:h,clearable:g,clearSectionMode:_,clearButtonProps:v,readOnly:y,capture:b,fileInputProps:x,rightSection:S,size:C,placeholder:w,component:T,resetRef:D,classNames:k,styles:A,attributes:j,...M}=t,N=(0,G.useRef)(null),{resolvedClassNames:P,resolvedStyles:F}=E({classNames:k,styles:A,props:t}),[I,L]=r({value:s,defaultValue:c,onChange:o,finalValue:l?[]:null}),R=Array.isArray(I)?I.length!==0:I!==null,z=(0,K.jsx)(u,{...v,variant:`subtle`,onClick:()=>L(l?[]:null),size:C,unstyled:i}),V=g&&R&&!y;return(0,G.useEffect)(()=>{(Array.isArray(I)&&I.length===0||I===null)&&N.current?.()},[I]),(0,K.jsx)(B,{onChange:L,multiple:l,accept:f,name:p,form:m,resetRef:n(N,D),disabled:y,capture:b,inputProps:x,children:e=>(0,K.jsx)(O,{component:T||`button`,rightSection:S,__clearSection:z,__clearable:V,__clearSectionMode:_,...e,...M,__staticSelector:`FileInput`,multiline:!0,type:`button`,pointer:!0,__stylesApiProps:t,unstyled:i,size:C,classNames:k,styles:A,attributes:j,children:R?(0,K.jsx)(h,{value:I}):(0,K.jsx)(d.Placeholder,{__staticSelector:`FileInput`,classNames:P,styles:F,attributes:j,children:w})})})});q.classes=O.classes,q.displayName=`@mantine/core/FileInput`;var J=i(`outline`,`radar-2`,`Radar2`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M15.51 15.56a5 5 0 1 0 -3.51 1.44`,key:`svg-1`}],[`path`,{d:`M18.832 17.86a9 9 0 1 0 -6.832 3.14`,key:`svg-2`}],[`path`,{d:`M12 12v9`,key:`svg-3`}]]),Y=i(`outline`,`repeat`,`Repeat`,[[`path`,{d:`M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3`,key:`svg-0`}],[`path`,{d:`M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3`,key:`svg-1`}]]),oe=i(`outline`,`shield-x`,`ShieldX`,[[`path`,{d:`M13.252 20.601c-.408 .155 -.826 .288 -1.252 .399a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.19 7.357`,key:`svg-0`}],[`path`,{d:`M22 22l-5 -5`,key:`svg-1`}],[`path`,{d:`M17 22l5 -5`,key:`svg-2`}]]),se=i(`outline`,`upload`,`Upload`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 9l5 -5l5 5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]);function ce(e){return e.methods.filter(e=>e!==`WEBSOCKET`&&e!==`ANY`)}function X(e){return e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`}function le(e,t,n){let r=e.replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(t[n]??``)),i=Object.entries(n).filter(([,e])=>e!==``).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`);return i&&(r+=`${r.includes(`?`)?`&`:`?`}${i}`),r}function Z(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`idem-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function ue(e){let t=e.status;return t===404?`Playground non monté : cette console n'existe qu'en développement (elle exécute des actions réelles).`:t===401?`Session expirée — reconnectez-vous.`:t===403?`Accès refusé : le playground exige ROLE_NODEFONY_ADMIN.`:e instanceof Error?e.message:`Erreur inattendue.`}function de(e){switch(e){case`user`:return`identité du firewall (ALS)`;case`session`:return`session serveur`;case`cookie`:return`cookie de la requête`;case`req`:case`res`:return`objet requête/réponse`;case`file`:case`files`:return`upload multipart`;default:return e}}var fe={GET:`teal`,POST:`blue`,PUT:`grape`,PATCH:`violet`,DELETE:`red`,OPTIONS:`gray`,HEAD:`gray`,WEBSOCKET:`orange`,ANY:`gray`};function Q({method:e}){return(0,K.jsx)(T,{size:`sm`,variant:`light`,color:fe[e]??`gray`,radius:`sm`,children:e})}function pe({action:e}){let t=e.guards,n=[];if(t.security){let e=t.security.clauses.flatMap(e=>e.anyOf);n.push((0,K.jsx)(c,{label:`@IsGranted — exige ${e.join(` ou `)} (403 sinon)`,children:(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`yellow`,radius:`sm`,children:[`🔒 `,e.join(` | `)]})},`granted`))}return t.scopes.length>0&&n.push((0,K.jsx)(c,{label:`@RequireScope — ne bride que les jetons machine (clé API / JWT)`,children:(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`cyan`,radius:`sm`,children:[`scope `,t.scopes.join(`, `)]})},`scopes`)),t.idempotent&&n.push((0,K.jsx)(c,{label:t.idempotent.required?`@Idempotent strict — mutation sans Idempotency-Key rejetée (400) ; rejeu même clé = réponse mémorisée, 0 ré-exécution`:`@Idempotent souple — la clé est honorée si présente`,children:(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`indigo`,radius:`sm`,children:[`idempotent`,t.idempotent.required?``:` (souple)`]})},`idem`)),t.csrfProtect&&n.push((0,K.jsx)(c,{label:`@CsrfProtect — exige le synchronizer token sur la mutation`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`orange`,radius:`sm`,children:`CSRF`})},`csrf`)),t.csrfExempt&&n.push((0,K.jsx)(c,{label:`@CsrfExempt — hors défense CSRF (auth conservée)`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`gray`,radius:`sm`,children:`CSRF exempt`})},`csrf-exempt`)),t.session!==null&&t.session!==void 0&&n.push((0,K.jsx)(c,{label:`@UseSession — session serveur activée`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`green`,radius:`sm`,children:`session`})},`session`)),t.bypassFirewall&&n.push((0,K.jsx)(c,{label:`bypassFirewall — route hors firewall (mécanisme d'auth lui-même)`,children:(0,K.jsx)(T,{size:`sm`,variant:`outline`,color:`red`,radius:`sm`,children:`hors firewall`})},`bypass`)),n.length===0?null:(0,K.jsx)(l,{gap:6,children:n})}function me({status:e}){return(0,K.jsx)(T,{size:`lg`,variant:`light`,color:e===null?`red`:e<300?`teal`:e<500?`yellow`:`red`,radius:`sm`,children:e===null?`transport KO`:`HTTP ${e}`})}var he=150,ge={granted:`identité authentifiée`,anonymous:`anonyme accepté (la zone l'autorise explicitement)`,denied:`refusé — aucune preuve d'identité présentée`,failure:`refusé — preuve présentée mais invalide`,throttled:`ralenti — trop de tentatives (backoff NIST)`,bypass:`zone traversée sans authentification (route exemptée)`,public:`zone publique — aucune identité exigée`},_e={no_credentials:`aucun credential envoyé`,invalid_credentials:`credential invalide`,unauthenticated:`token non authentifié`,throttled:`trop de tentatives`};function ve(e){return e===`granted`||e===`anonymous`||e===`public`||e===`bypass`}function ye(e){let t=F(),[n,r]=(0,G.useState)(null),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(!1),c=(0,G.useCallback)(async()=>{if(!e)return;s(!0),a(null);let n=()=>t.api.getAbsolute(`/nodefony/profiler/api/${encodeURIComponent(e)}`);try{let e;try{e=await n()}catch(t){if(t.status!==404)throw t;await new Promise(e=>setTimeout(e,he)),e=await n()}r(e)}catch(e){let t=e.status;a(t===404?`Profil introuvable : le profiler n'est actif qu'en développement (et ne garde que les 500 dernières requêtes).`:e instanceof Error?e.message:`Erreur inattendue.`)}finally{s(!1)}},[e,t]);return(0,G.useEffect)(()=>{r(null),c()},[c]),{profile:n,error:i,loading:o}}function be({security:e}){let t=ve(e.outcome),n=e.outcome?ge[e.outcome]??e.outcome:`—`;return(0,K.jsxs)(h,{withBorder:!0,padding:`sm`,radius:`sm`,children:[(0,K.jsxs)(l,{gap:`xs`,mb:6,children:[t?(0,K.jsx)(H,{size:16,color:`var(--mantine-color-teal-6)`}):(0,K.jsx)(oe,{size:16,color:`var(--mantine-color-red-6)`}),(0,K.jsx)(D,{size:`sm`,fw:600,children:`Firewall`}),(0,K.jsx)(T,{size:`sm`,variant:`light`,color:t?`teal`:`red`,children:e.outcome??`—`}),e.zone&&(0,K.jsxs)(T,{size:`sm`,variant:`outline`,color:`gray`,children:[`zone `,e.zone]}),!e.protected&&(0,K.jsx)(T,{size:`sm`,variant:`light`,color:`gray`,children:`non protégée`})]}),(0,K.jsxs)(D,{size:`sm`,mb:4,children:[n,e.reason&&(0,K.jsxs)(D,{span:!0,c:`red`,size:`sm`,children:[` `,`— `,_e[e.reason]??e.reason]})]}),e.candidates.length>0&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[`Authenticators acceptés (`,e.mode??`first`,`) :`,` `,e.candidates.map(t=>(0,K.jsx)(T,{size:`xs`,mr:4,variant:t===e.authenticator?`filled`:`default`,color:t===e.authenticator?`teal`:`gray`,children:t},t)),e.authenticator?` — le maillon plein a résolu l'identité.`:` — aucun n'a abouti.`]}),e.roles&&e.roles.length>0&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,mt:4,children:[`Rôles :`,` `,e.roles.map(e=>(0,K.jsx)(T,{size:`xs`,mr:4,variant:`light`,color:`blue`,children:e},e))]})]})}function $({requestId:e,transport:t}){let{profile:n,error:r,loading:i}=ye(e);if(!e)return(0,K.jsxs)(A,{variant:`light`,color:`gray`,icon:(0,K.jsx)(J,{size:16}),title:`Radiographie indisponible : aucune réponse tracée`,children:[`La traversée s'indexe sur l'identifiant du profil serveur (`,(0,K.jsx)(`code`,{children:`x-request-id`}),` en HTTP, id de frame rendu par le pont en socket). Une requête qui n'aboutit pas (erreur réseau) n'a rien à tracer, et une frame refusée `,(0,K.jsx)(`em`,{children:`avant`}),` le pont (firewall de frame,`,` `,(0,K.jsx)(`code`,{children:`-32001`}),`) n'a jamais été exécutée : il n'y a pas de traversée à montrer. Rejouez la requête.`]});if(i&&!n)return(0,K.jsxs)(l,{gap:`xs`,py:`xs`,children:[(0,K.jsx)(a,{size:`xs`}),(0,K.jsx)(D,{size:`sm`,c:`dimmed`,children:`Lecture du profil serveur…`})]});if(r)return(0,K.jsx)(A,{variant:`light`,color:`yellow`,icon:(0,K.jsx)(J,{size:16}),children:r});if(!n)return null;let o=n.queries??[];return(0,K.jsxs)(h,{withBorder:!0,padding:`sm`,radius:`sm`,children:[(0,K.jsxs)(l,{gap:`xs`,mb:`xs`,children:[(0,K.jsx)(J,{size:16}),(0,K.jsxs)(D,{size:`sm`,fw:600,children:[`Radiographie`,t===`socket`?` · porte Socket`:t===`http`?` · porte HTTP`:``]}),(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[ie(n.durationMs),` serveur · `,n.user??`anonyme`]})]}),(0,K.jsxs)(f,{gap:`sm`,children:[n.security?(0,K.jsx)(be,{security:n.security}):(0,K.jsx)(D,{size:`xs`,c:`dimmed`,children:`Aucune zone firewall traversée (route hors zone).`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,mb:4,children:[`Où le temps est passé`,o.length>0?` (les requêtes ORM sont DANS l'action)`:``]}),(0,K.jsx)(re,{profile:n,withQueries:!0})]}),o.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_,{}),(0,K.jsx)(ne,{queries:o})]}),(0,K.jsx)(m,{size:`xs`,href:`/nodefony/logs/trace/${encodeURIComponent(n.requestId)}`,target:`_blank`,children:`Ouvrir le suivi de requête complet (logs corrélés, audit) →`})]})]})}async function xe(e,t,n,r){let i=performance.now();try{let a=new Headers(r);a.set(`Accept`,`application/json`),typeof n==`string`&&a.set(`Content-Type`,`application/json`);let o=await fetch(t,{method:e,headers:a,body:n,credentials:`same-origin`}),s=(o.headers.get(`Content-Type`)??``).includes(`application/json`)?await o.json():await o.text();return{transport:`http`,status:o.status,ok:o.ok,durationMs:performance.now()-i,body:s,error:null,instance:o.headers.get(`x-nodefony-instance`),requestId:o.headers.get(`x-request-id`)}}catch(e){return{transport:`http`,status:null,ok:!1,durationMs:performance.now()-i,body:null,error:e instanceof Error?e.message:String(e),instance:null,requestId:null}}}async function Se(e,t,n,r,i){let a=performance.now();try{let{result:o,requestId:s}=await e.call(n,t===`GET`?void 0:{method:t,body:r,idempotencyKey:i??Z()});return{transport:`socket`,status:200,ok:!0,durationMs:performance.now()-a,body:o,error:null,instance:null,requestId:s}}catch(e){let t=e;return{transport:`socket`,status:t.name===`RpcError`?t.data?.status??null:null,ok:!1,durationMs:performance.now()-a,body:t.data?.body??null,error:t.message??String(e),instance:null,requestId:t.data?.requestId??null}}}function Ce({result:e}){return(0,K.jsxs)(h,{withBorder:!0,padding:`sm`,children:[(0,K.jsxs)(l,{justify:`space-between`,mb:`xs`,children:[(0,K.jsxs)(l,{gap:`xs`,children:[(0,K.jsx)(D,{size:`sm`,fw:600,children:e.transport===`http`?`Porte HTTP`:`Porte Socket`}),(0,K.jsx)(me,{status:e.status})]}),(0,K.jsxs)(D,{size:`sm`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[e.durationMs.toFixed(1),` ms`,e.instance?` · ${e.instance}`:``]})]}),e.error!==null&&(0,K.jsx)(D,{size:`sm`,c:`red`,role:`alert`,mb:`xs`,children:e.error}),e.body!==null&&e.body!==void 0&&(0,K.jsx)(y,{value:e.body,maxHeight:260})]})}function we({action:e}){let n=te(),r=ce(e),[i,a]=(0,G.useState)(r[0]??`GET`),[o,s]=(0,G.useState)(()=>{let t={};for(let n of e.variables){let r=e.defaults[n];t[n]=r==null?``:String(r)}return t}),[u,d]=(0,G.useState)({}),[m,h]=(0,G.useState)({}),[g,_]=(0,G.useState)(`{}`),[y,ee]=(0,G.useState)([]),[S,C]=(0,G.useState)(Z),[w,T]=(0,G.useState)(!1),[E,O]=(0,G.useState)(null),[A,j]=(0,G.useState)(null),N=(0,G.useMemo)(()=>e.params.filter(e=>e.source===`query`&&e.key).map(e=>e.key),[e]),F=(0,G.useMemo)(()=>e.params.filter(e=>e.source===`headers`&&e.key).map(e=>e.key),[e]),I=(0,G.useMemo)(()=>e.params.find(e=>e.source===`file`||e.source===`files`)??null,[e]),L=(0,G.useMemo)(()=>e.params.some(e=>e.source===`body`&&e.stream),[e]),z=(0,G.useMemo)(()=>e.params.filter(e=>![`param`,`body`,`query`,`headers`,`file`,`files`].includes(e.source)),[e]),B=!I&&!L&&(X(i)||e.params.some(e=>e.source===`body`)),V=X(i),H=e.path?le(e.path,o,u):``,U=()=>{if(!B||g.trim()===``)return{ok:!0,value:void 0};try{return{ok:!0,value:JSON.parse(g)}}catch{return{ok:!1}}},W=async(t,r)=>{if(I&&t===`socket`){j({transport:t,status:null,ok:!1,durationMs:0,body:null,error:`Upload multipart : porte HTTP uniquement (le pont api.request transporte du JSON).`,instance:null,requestId:null});return}if(I&&y.length===0){O({transport:`http`,status:null,ok:!1,durationMs:0,body:null,error:`Choisissez un fichier avant d'envoyer.`,instance:null,requestId:null});return}let a=U();if(!a.ok){(t===`http`?O:j)({transport:t,status:null,ok:!1,durationMs:0,body:null,error:`Body : JSON invalide (corrigez avant d'envoyer).`,instance:null,requestId:null});return}let o=r?S:Z();!r&&V&&C(o),T(!0);try{if(t===`http`){let t={...m};for(let e of Object.keys(t))t[e]===``&&delete t[e];V&&e.guards.idempotent&&(t[`Idempotency-Key`]=o);let n;if(I){let e=new FormData,t=I.key??(I.source===`files`?`files`:`file`);for(let n of y)e.append(t,n,n.name);n=e}else B&&a.value!==void 0&&(n=JSON.stringify(a.value));O(await xe(i,H,n,t))}else j(await Se(n,i,H,a.value,V?o:void 0))}finally{T(!1)}};return(0,K.jsxs)(f,{gap:`sm`,children:[(0,K.jsxs)(l,{gap:`xs`,wrap:`wrap`,children:[e.methods.map(e=>(0,K.jsx)(Q,{method:e},e)),(0,K.jsx)(b,{children:e.path??`—`}),(0,K.jsx)(pe,{action:e})]}),r.length>1&&(0,K.jsx)(l,{gap:`xs`,children:r.map(e=>(0,K.jsx)(x,{size:`compact-xs`,variant:e===i?`filled`:`default`,onClick:()=>a(e),children:e},e))}),(0,K.jsxs)(t,{gap:`xs`,children:[e.variables.map(e=>(0,K.jsx)(t.Col,{span:{base:12,sm:4},children:(0,K.jsx)(M,{label:`{${e}}`,description:`variable de path`,value:o[e]??``,onChange:t=>s({...o,[e]:t.currentTarget.value})})},e)),N.map(e=>(0,K.jsx)(t.Col,{span:{base:12,sm:4},children:(0,K.jsx)(M,{label:e,description:`@Query`,value:u[e]??``,onChange:t=>d({...u,[e]:t.currentTarget.value})})},e)),F.map(e=>(0,K.jsx)(t.Col,{span:{base:12,sm:4},children:(0,K.jsx)(M,{label:e,description:`@Headers`,value:m[e]??``,onChange:t=>h({...m,[e]:t.currentTarget.value})})},e))]}),I&&(0,K.jsx)(q,{label:I.source===`files`?`Fichiers (@UploadedFiles)`:`Fichier (@UploadedFile)`,description:`Envoyé en multipart/form-data — porte HTTP uniquement`,placeholder:`Choisir…`,leftSection:(0,K.jsx)(se,{size:16}),multiple:I.source===`files`,clearable:!0,value:I.source===`files`?y:y[0]??null,onChange:e=>ee(Array.isArray(e)?e:e===null?[]:[e])}),L&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[`@Body(stream) — flux brut (`,`IncomingMessage`,`) : non rejouable depuis un formulaire (piper un vrai client, ex. curl --data-binary).`]}),B&&(0,K.jsx)(P,{label:`Body (JSON)`,autosize:!0,minRows:3,maxRows:10,value:g,onChange:e=>_(e.currentTarget.value),styles:{input:{fontFamily:`var(--mantine-font-family-monospace)`}}}),z.length>0&&(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[`Injecté par le serveur :`,` `,z.map(e=>`@${e.source}${e.key?`(${e.key})`:``} — ${de(e.source)}`).join(` · `)]}),(0,K.jsxs)(l,{gap:`xs`,wrap:`wrap`,children:[(0,K.jsx)(x,{leftSection:(0,K.jsx)(R,{size:16}),loading:w,onClick:()=>void W(`http`,!1),children:`Envoyer HTTP`}),(0,K.jsx)(c,{label:I?`Upload multipart : porte HTTP uniquement (le pont api.request transporte du JSON)`:e.duplex?`La même action, par la socket Nodefony (pont api.request)`:`Cette route ne déclare pas le transport WEBSOCKET — le pont répondra 405 (démonstration honnête)`,children:(0,K.jsx)(x,{variant:e.duplex?`light`:`default`,leftSection:(0,K.jsx)(k,{size:16}),loading:w,disabled:I!==null,onClick:()=>void W(`socket`,!1),children:`Envoyer Socket`})}),V&&e.guards.idempotent&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(x,{variant:`outline`,color:`indigo`,leftSection:(0,K.jsx)(Y,{size:16}),loading:w,onClick:()=>void W(`socket`,!0),children:`Rejouer même clé (socket)`}),(0,K.jsx)(x,{variant:`outline`,color:`indigo`,leftSection:(0,K.jsx)(Y,{size:16}),loading:w,onClick:()=>void W(`http`,!0),children:`Rejouer même clé (HTTP)`}),(0,K.jsxs)(l,{gap:4,children:[(0,K.jsx)(b,{style:{fontSize:11},children:S}),(0,K.jsx)(c,{label:`Régénérer la clé d'idempotence`,children:(0,K.jsx)(x,{size:`compact-xs`,variant:`subtle`,"aria-label":`Régénérer la clé d'idempotence`,onClick:()=>C(Z()),children:(0,K.jsx)(v,{size:14})})}),(0,K.jsx)(p,{title:`Idempotence visible`,summary:`Envoyer exécute l'action avec une clé NEUVE. « Rejouer même clé » renvoie la réponse MÉMORISÉE par le serveur : même payload (mêmes ids), zéro ré-exécution — comparez avec un envoi neuf.`})]})]})]}),(E||A)&&(0,K.jsxs)(t,{gap:`sm`,children:[E&&(0,K.jsx)(t.Col,{span:{base:12,md:A?6:12},children:(0,K.jsx)(Ce,{result:E})}),A&&(0,K.jsx)(t.Col,{span:{base:12,md:E?6:12},children:(0,K.jsx)(Ce,{result:A})})]}),E&&(0,K.jsx)($,{requestId:E.requestId,transport:`http`}),A&&(0,K.jsx)($,{requestId:A.requestId,transport:`socket`})]})}var Te=U(()=>{let e=F(),t=L(),{controller:n}=I(),r=(0,G.useCallback)(async()=>{try{return await e.api.getAbsolute(`/nodefony/framework/api/playground/routes`)}catch(e){throw Error(ue(e),{cause:e})}},[e]),{data:i,loading:a,error:c,reload:u}=W(r),d=(0,G.useMemo)(()=>i?.controllers??[],[i]),p=(0,G.useMemo)(()=>{let e=new Map;for(let t of d){let n=t.module??`(sans module)`,r=e.get(n);r?r.push(t):e.set(n,[t])}return e},[d]),m=d.find(e=>e.name===n)??d[0]??null;return(0,K.jsx)(C,{title:`Playground`,subtitle:`Console vivante des controllers — exécute chaque action par HTTP ou par la socket Nodefony`,icon:(0,K.jsx)(z,{size:28}),actions:(0,K.jsx)(o,{title:`Playground (dev)`,summary:`Les formulaires sont construits depuis les métadonnées des décorateurs (routes, transports, @Query/@Body, gardes). Une action « duplex » répond par HTTP ET par la socket (pont api.request) — la même action controller, deux transports.`,sections:[{label:`Sécurité`,body:`Cette console exécute des actions RÉELLES avec votre session : elle n'est montée qu'en développement. Les refus (401/403/405) s'affichent tels que le serveur les rend.`}]}),children:(0,K.jsx)(s,{loading:a&&!d.length,error:c,empty:!a&&!d.length,emptyMessage:`Aucun controller enregistré.`,onRetry:u,children:(0,K.jsxs)(l,{align:`flex-start`,gap:`md`,wrap:`nowrap`,children:[(0,K.jsx)(j,{withBorder:!0,p:`xs`,w:280,style:{flexShrink:0},children:(0,K.jsx)(f,{gap:4,children:[...p.entries()].map(([e,n])=>(0,K.jsxs)(f,{gap:2,children:[(0,K.jsx)(D,{size:`xs`,c:`dimmed`,fw:600,tt:`uppercase`,px:`xs`,children:e}),n.map(e=>(0,K.jsx)(V,{active:m?.name===e.name,label:e.name,description:`${e.actions.length} action(s)`,onClick:()=>void t(`/nodefony/playground/${e.name}`)},e.name))]},e))})}),(0,K.jsx)(f,{gap:`md`,style:{flex:1,minWidth:0},children:m&&(0,K.jsx)(N,{variant:`separated`,multiple:!1,defaultValue:m.actions[0]?.route??null,children:m.actions.map(e=>(0,K.jsxs)(N.Item,{value:e.route,children:[(0,K.jsx)(N.Control,{children:(0,K.jsxs)(l,{gap:`xs`,wrap:`wrap`,children:[e.methods.filter(e=>e!==`WEBSOCKET`).map(e=>(0,K.jsx)(Q,{method:e},e)),e.duplex&&(0,K.jsx)(T,{size:`sm`,variant:`light`,color:`orange`,radius:`sm`,children:`duplex`}),(0,K.jsx)(D,{size:`sm`,ff:`monospace`,children:e.path}),(0,K.jsxs)(D,{size:`xs`,c:`dimmed`,children:[m.name,`.`,e.action,`()`]})]})}),(0,K.jsx)(N.Panel,{children:(0,K.jsx)(we,{action:e})})]},e.route))})})]})})})});export{Te as Playground};
@@ -1 +1 @@
1
- import{k as e}from"./src-Dvwdl2PF.js";import{_t as t,b as n,di as r,dt as i,or as a}from"./ui-Dy8y0zPl.js";import{t as o}from"./IconDeviceDesktop-CI8a1zbE.js";import{et as s,j as c,rt as l,vt as u}from"./index-wfxUl83u.js";import{c as d,o as f}from"./useSocketLiveData-n5suTFQT.js";var p=e(r(),1),m=a(),h=[{id:`probe`,data:{label:`I<X>Probe`,sub:`Sonde dans le service métier · probe() best-effort`,icon:(0,m.jsx)(l,{size:20}),color:`violet`}},{id:`health`,data:{label:`build<X>Health()`,sub:`Agrégateur pur · ajoute status + dérivés`,icon:(0,m.jsx)(t,{size:20}),color:`grape`}},{id:`endpoint`,data:{label:`GET /nodefony/<x>/api/health`,sub:`Endpoint HTTP · 1er paint sans attendre le tick`,icon:(0,m.jsx)(c,{size:20}),color:`cyan`}},{id:`ticker`,data:{label:`Provider ticker`,sub:`setInterval(cadence).unref() · publish(<x>:health, …)`,icon:(0,m.jsx)(i,{size:20}),color:`orange`}},{id:`channel`,data:{label:`Canal <x>:health`,sub:`RealtimeHub · cadence PAR CANAL (500 ms – 60 s), AIMD-aware`,icon:(0,m.jsx)(s,{size:20}),color:`indigo`,emphasis:!0}},{id:`studio`,data:{label:`Panneau Studio`,sub:`Générique · broker + useNodefonyChannel("<x>:health")`,icon:(0,m.jsx)(o,{size:20}),color:`blue`}}],g=[{source:`probe`,target:`health`,label:`métriques`,color:`violet`},{source:`health`,target:`endpoint`,label:`snapshot`,color:`cyan`},{source:`health`,target:`ticker`,label:`live`,color:`orange`},{source:`endpoint`,target:`studio`,label:`1er paint (HTTP)`,color:`cyan`},{source:`ticker`,target:`channel`,label:`push (cadence du canal)`,color:`orange`},{source:`channel`,target:`studio`,label:`abonnement (ref-compté)`,color:`indigo`}],_=u(({height:e})=>{let t=d(),r=(0,p.useMemo)(()=>f(t),[t]);return(0,m.jsx)(n,{nodes:h,edges:g,dir:`LR`,height:e,ariaLabel:`Patron des sondes Nodefony — temps réel actif`,liveNodeData:r})});function v({live:e=!1,height:t=540}){return e?(0,m.jsx)(_,{height:t}):(0,m.jsx)(n,{nodes:h,edges:g,dir:`LR`,height:t,ariaLabel:`Patron des sondes Nodefony (statique)`})}export{v as ProbesLiveGraph,v as default};
1
+ import{k as e}from"./src-Dvwdl2PF.js";import{_t as t,b as n,di as r,dt as i,or as a}from"./ui-BlRFVRfl.js";import{t as o}from"./IconDeviceDesktop-DQMJAeIX.js";import{et as s,j as c,rt as l,vt as u}from"./index-BwkdF4pp.js";import{c as d,o as f}from"./useSocketLiveData-z0fKymfg.js";var p=e(r(),1),m=a(),h=[{id:`probe`,data:{label:`I<X>Probe`,sub:`Sonde dans le service métier · probe() best-effort`,icon:(0,m.jsx)(l,{size:20}),color:`violet`}},{id:`health`,data:{label:`build<X>Health()`,sub:`Agrégateur pur · ajoute status + dérivés`,icon:(0,m.jsx)(t,{size:20}),color:`grape`}},{id:`endpoint`,data:{label:`GET /nodefony/<x>/api/health`,sub:`Endpoint HTTP · 1er paint sans attendre le tick`,icon:(0,m.jsx)(c,{size:20}),color:`cyan`}},{id:`ticker`,data:{label:`Provider ticker`,sub:`setInterval(cadence).unref() · publish(<x>:health, …)`,icon:(0,m.jsx)(i,{size:20}),color:`orange`}},{id:`channel`,data:{label:`Canal <x>:health`,sub:`RealtimeHub · cadence PAR CANAL (500 ms – 60 s), AIMD-aware`,icon:(0,m.jsx)(s,{size:20}),color:`indigo`,emphasis:!0}},{id:`studio`,data:{label:`Panneau Studio`,sub:`Générique · broker + useNodefonyChannel("<x>:health")`,icon:(0,m.jsx)(o,{size:20}),color:`blue`}}],g=[{source:`probe`,target:`health`,label:`métriques`,color:`violet`},{source:`health`,target:`endpoint`,label:`snapshot`,color:`cyan`},{source:`health`,target:`ticker`,label:`live`,color:`orange`},{source:`endpoint`,target:`studio`,label:`1er paint (HTTP)`,color:`cyan`},{source:`ticker`,target:`channel`,label:`push (cadence du canal)`,color:`orange`},{source:`channel`,target:`studio`,label:`abonnement (ref-compté)`,color:`indigo`}],_=u(({height:e})=>{let t=d(),r=(0,p.useMemo)(()=>f(t),[t]);return(0,m.jsx)(n,{nodes:h,edges:g,dir:`LR`,height:e,ariaLabel:`Patron des sondes Nodefony — temps réel actif`,liveNodeData:r})});function v({live:e=!1,height:t=540}){return e?(0,m.jsx)(_,{height:t}):(0,m.jsx)(n,{nodes:h,edges:g,dir:`LR`,height:t,ariaLabel:`Patron des sondes Nodefony (statique)`})}export{v as ProbesLiveGraph,v as default};