@cyberismo/backend 1.1.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/app.d.ts +5 -15
- package/dist/app.js +46 -44
- package/dist/app.js.map +1 -1
- package/dist/auth/index.d.ts +1 -13
- package/dist/auth/index.js +3 -13
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/keycloak.d.ts +2 -15
- package/dist/auth/keycloak.js +8 -12
- package/dist/auth/keycloak.js.map +1 -1
- package/dist/auth/mock.d.ts +12 -20
- package/dist/auth/mock.js +121 -43
- package/dist/auth/mock.js.map +1 -1
- package/dist/auth/types.d.ts +7 -13
- package/dist/auth/types.js +2 -12
- package/dist/auth/types.js.map +1 -1
- package/dist/common/errors.d.ts +12 -0
- package/dist/common/errors.js +31 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/validationSchemas.d.ts +0 -12
- package/dist/common/validationSchemas.js +2 -12
- package/dist/common/validationSchemas.js.map +1 -1
- package/dist/domain/auth/index.d.ts +0 -12
- package/dist/domain/auth/index.js +2 -12
- package/dist/domain/auth/index.js.map +1 -1
- package/dist/domain/calculations/index.d.ts +0 -12
- package/dist/domain/calculations/index.js +4 -14
- package/dist/domain/calculations/index.js.map +1 -1
- package/dist/domain/calculations/schema.d.ts +0 -12
- package/dist/domain/calculations/schema.js +2 -12
- package/dist/domain/calculations/schema.js.map +1 -1
- package/dist/domain/calculations/service.d.ts +2 -14
- package/dist/domain/calculations/service.js +7 -17
- package/dist/domain/calculations/service.js.map +1 -1
- package/dist/domain/cardTypes/index.d.ts +0 -12
- package/dist/domain/cardTypes/index.js +10 -20
- package/dist/domain/cardTypes/index.js.map +1 -1
- package/dist/domain/cardTypes/schema.d.ts +0 -12
- package/dist/domain/cardTypes/schema.js +2 -12
- package/dist/domain/cardTypes/schema.js.map +1 -1
- package/dist/domain/cardTypes/service.d.ts +4 -16
- package/dist/domain/cardTypes/service.js +17 -25
- package/dist/domain/cardTypes/service.js.map +1 -1
- package/dist/domain/cards/index.d.ts +0 -12
- package/dist/domain/cards/index.js +120 -175
- package/dist/domain/cards/index.js.map +1 -1
- package/dist/domain/cards/lib.d.ts +6 -23
- package/dist/domain/cards/lib.js +7 -135
- package/dist/domain/cards/lib.js.map +1 -1
- package/dist/domain/cards/mermaid.d.ts +8 -0
- package/dist/domain/cards/mermaid.js +23 -0
- package/dist/domain/cards/mermaid.js.map +1 -0
- package/dist/domain/cards/schema.d.ts +6 -12
- package/dist/domain/cards/schema.js +15 -15
- package/dist/domain/cards/schema.js.map +1 -1
- package/dist/domain/cards/service.d.ts +29 -36
- package/dist/domain/cards/service.js +119 -90
- package/dist/domain/cards/service.js.map +1 -1
- package/dist/domain/connectors/index.d.ts +0 -12
- package/dist/domain/connectors/index.js +4 -14
- package/dist/domain/connectors/index.js.map +1 -1
- package/dist/domain/connectors/service.d.ts +2 -14
- package/dist/domain/connectors/service.js +4 -14
- package/dist/domain/connectors/service.js.map +1 -1
- package/dist/domain/events/events-by-project.d.ts +19 -0
- package/dist/domain/events/events-by-project.js +57 -0
- package/dist/domain/events/events-by-project.js.map +1 -0
- package/dist/domain/events/index.d.ts +3 -0
- package/dist/domain/events/index.js +84 -0
- package/dist/domain/events/index.js.map +1 -0
- package/dist/domain/events/lifetime.d.ts +2 -0
- package/dist/domain/events/lifetime.js +15 -0
- package/dist/domain/events/lifetime.js.map +1 -0
- package/dist/domain/events/project-events.d.ts +63 -0
- package/dist/domain/events/project-events.js +204 -0
- package/dist/domain/events/project-events.js.map +1 -0
- package/dist/domain/events/schema.d.ts +10 -0
- package/dist/domain/events/schema.js +10 -0
- package/dist/domain/events/schema.js.map +1 -0
- package/dist/domain/fieldTypes/index.d.ts +0 -12
- package/dist/domain/fieldTypes/index.js +6 -16
- package/dist/domain/fieldTypes/index.js.map +1 -1
- package/dist/domain/fieldTypes/schema.d.ts +0 -12
- package/dist/domain/fieldTypes/schema.js +2 -12
- package/dist/domain/fieldTypes/schema.js.map +1 -1
- package/dist/domain/fieldTypes/service.d.ts +4 -16
- package/dist/domain/fieldTypes/service.js +7 -17
- package/dist/domain/fieldTypes/service.js.map +1 -1
- package/dist/domain/graphModels/index.d.ts +0 -12
- package/dist/domain/graphModels/index.js +4 -14
- package/dist/domain/graphModels/index.js.map +1 -1
- package/dist/domain/graphModels/schema.d.ts +0 -12
- package/dist/domain/graphModels/schema.js +2 -12
- package/dist/domain/graphModels/schema.js.map +1 -1
- package/dist/domain/graphModels/service.d.ts +2 -14
- package/dist/domain/graphModels/service.js +4 -14
- package/dist/domain/graphModels/service.js.map +1 -1
- package/dist/domain/graphViews/index.d.ts +0 -12
- package/dist/domain/graphViews/index.js +4 -14
- package/dist/domain/graphViews/index.js.map +1 -1
- package/dist/domain/graphViews/schema.js +2 -0
- package/dist/domain/graphViews/schema.js.map +1 -1
- package/dist/domain/graphViews/service.d.ts +2 -14
- package/dist/domain/graphViews/service.js +4 -14
- package/dist/domain/graphViews/service.js.map +1 -1
- package/dist/domain/labels/index.d.ts +0 -12
- package/dist/domain/labels/index.js +4 -14
- package/dist/domain/labels/index.js.map +1 -1
- package/dist/domain/labels/service.d.ts +3 -15
- package/dist/domain/labels/service.js +5 -15
- package/dist/domain/labels/service.js.map +1 -1
- package/dist/domain/linkTypes/index.d.ts +0 -12
- package/dist/domain/linkTypes/index.js +6 -16
- package/dist/domain/linkTypes/index.js.map +1 -1
- package/dist/domain/linkTypes/schema.d.ts +0 -12
- package/dist/domain/linkTypes/schema.js +2 -12
- package/dist/domain/linkTypes/schema.js.map +1 -1
- package/dist/domain/linkTypes/service.d.ts +3 -15
- package/dist/domain/linkTypes/service.js +7 -17
- package/dist/domain/linkTypes/service.js.map +1 -1
- package/dist/domain/logicPrograms/index.d.ts +0 -12
- package/dist/domain/logicPrograms/index.js +4 -14
- package/dist/domain/logicPrograms/index.js.map +1 -1
- package/dist/domain/logicPrograms/service.d.ts +2 -14
- package/dist/domain/logicPrograms/service.js +5 -3
- package/dist/domain/logicPrograms/service.js.map +1 -1
- package/dist/domain/mcp/index.d.ts +3 -15
- package/dist/domain/mcp/index.js +27 -21
- package/dist/domain/mcp/index.js.map +1 -1
- package/dist/domain/project/index.d.ts +0 -12
- package/dist/domain/project/index.js +41 -39
- package/dist/domain/project/index.js.map +1 -1
- package/dist/domain/project/schema.d.ts +8 -12
- package/dist/domain/project/schema.js +36 -18
- package/dist/domain/project/schema.js.map +1 -1
- package/dist/domain/project/service.d.ts +20 -28
- package/dist/domain/project/service.js +56 -60
- package/dist/domain/project/service.js.map +1 -1
- package/dist/domain/projects/index.d.ts +2 -14
- package/dist/domain/projects/index.js +23 -36
- package/dist/domain/projects/index.js.map +1 -1
- package/dist/domain/projects/schema.d.ts +1 -12
- package/dist/domain/projects/schema.js +3 -12
- package/dist/domain/projects/schema.js.map +1 -1
- package/dist/domain/projects/service.d.ts +9 -35
- package/dist/domain/projects/service.js +12 -48
- package/dist/domain/projects/service.js.map +1 -1
- package/dist/domain/reports/index.d.ts +0 -12
- package/dist/domain/reports/index.js +4 -14
- package/dist/domain/reports/index.js.map +1 -1
- package/dist/domain/reports/schema.d.ts +0 -12
- package/dist/domain/reports/schema.js +2 -12
- package/dist/domain/reports/schema.js.map +1 -1
- package/dist/domain/reports/service.d.ts +2 -14
- package/dist/domain/reports/service.js +4 -14
- package/dist/domain/reports/service.js.map +1 -1
- package/dist/domain/resources/index.d.ts +0 -12
- package/dist/domain/resources/index.js +91 -26
- package/dist/domain/resources/index.js.map +1 -1
- package/dist/domain/resources/schema.d.ts +8 -2
- package/dist/domain/resources/schema.js +8 -1
- package/dist/domain/resources/schema.js.map +1 -1
- package/dist/domain/resources/service.d.ts +23 -23
- package/dist/domain/resources/service.js +83 -51
- package/dist/domain/resources/service.js.map +1 -1
- package/dist/domain/skills/index.d.ts +3 -0
- package/dist/domain/skills/index.js +42 -0
- package/dist/domain/skills/index.js.map +1 -0
- package/dist/domain/skills/schema.d.ts +4 -0
- package/dist/domain/skills/schema.js +8 -0
- package/dist/domain/skills/schema.js.map +1 -0
- package/dist/domain/skills/service.d.ts +2 -0
- package/dist/domain/skills/service.js +6 -0
- package/dist/domain/skills/service.js.map +1 -0
- package/dist/domain/templates/index.d.ts +0 -12
- package/dist/domain/templates/index.js +8 -18
- package/dist/domain/templates/index.js.map +1 -1
- package/dist/domain/templates/schema.d.ts +0 -12
- package/dist/domain/templates/schema.js +2 -12
- package/dist/domain/templates/schema.js.map +1 -1
- package/dist/domain/templates/service.d.ts +4 -16
- package/dist/domain/templates/service.js +8 -18
- package/dist/domain/templates/service.js.map +1 -1
- package/dist/domain/tree/index.d.ts +0 -12
- package/dist/domain/tree/index.js +4 -14
- package/dist/domain/tree/index.js.map +1 -1
- package/dist/domain/tree/service.d.ts +3 -15
- package/dist/domain/tree/service.js +8 -15
- package/dist/domain/tree/service.js.map +1 -1
- package/dist/domain/workflows/index.d.ts +0 -12
- package/dist/domain/workflows/index.js +4 -14
- package/dist/domain/workflows/index.js.map +1 -1
- package/dist/domain/workflows/schema.d.ts +0 -12
- package/dist/domain/workflows/schema.js +2 -12
- package/dist/domain/workflows/schema.js.map +1 -1
- package/dist/domain/workflows/service.d.ts +2 -14
- package/dist/domain/workflows/service.js +4 -14
- package/dist/domain/workflows/service.js.map +1 -1
- package/dist/export.d.ts +8 -21
- package/dist/export.js +71 -66
- package/dist/export.js.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +20 -41
- package/dist/index.js.map +1 -1
- package/dist/main.js +36 -32
- package/dist/main.js.map +1 -1
- package/dist/middleware/auth.d.ts +5 -12
- package/dist/middleware/auth.js +22 -16
- package/dist/middleware/auth.js.map +1 -1
- package/dist/middleware/commandManager.d.ts +17 -20
- package/dist/middleware/commandManager.js +27 -35
- package/dist/middleware/commandManager.js.map +1 -1
- package/dist/middleware/tree.js +2 -0
- package/dist/middleware/tree.js.map +1 -1
- package/dist/middleware/zvalidator.js +2 -0
- package/dist/middleware/zvalidator.js.map +1 -1
- package/dist/overlay.d.ts +33 -0
- package/dist/overlay.js +162 -0
- package/dist/overlay.js.map +1 -0
- package/dist/public/THIRD-PARTY.txt +1892 -688
- package/dist/public/assets/__vite-browser-external-DGgK3jMU.js +1 -0
- package/dist/public/assets/abnfDiagram-WEYOIA3C-B3qq7PKv.js +1 -0
- package/dist/public/assets/architecture-WOLXFQ4H-Bzau2LI0.js +1 -0
- package/dist/public/assets/architectureDiagram-ZHVYKT53-Bg0cUwdb.js +36 -0
- package/dist/public/assets/blockDiagram-RJAE7QA3-0RJB-ra-.js +140 -0
- package/dist/public/assets/c4Diagram-XDPPPE54-BzoQcLvf.js +38 -0
- package/dist/public/assets/channel-6BNdw4Ax.js +1 -0
- package/dist/public/assets/{chunk-MOJQB5TN-D1shKbMs.js → chunk-2E7WHVMD-6aqPk-Hk.js} +4 -4
- package/dist/public/assets/chunk-4EMNKR2T-vovNSAaE.js +1 -0
- package/dist/public/assets/chunk-55XCU76K-DXkKnt2y.js +1 -0
- package/dist/public/assets/chunk-7S6XSTFO-B9bfO0l3.js +2 -0
- package/dist/public/assets/chunk-AQDTSKZB-ilLy_cYP.js +72 -0
- package/dist/public/assets/chunk-DSNLSHJZ-DAudglXu.js +129 -0
- package/dist/public/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/public/assets/chunk-HAGFOTED-CSKFgs6b.js +62 -0
- package/dist/public/assets/chunk-HNE4Q36P-Cu5gPBVk.js +1 -0
- package/dist/public/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/dist/public/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +136 -0
- package/dist/public/assets/chunk-NQOKRVIF-Bpcvhq1n.js +213 -0
- package/dist/public/assets/chunk-UHW7PFBP-BDjvOaTH.js +1 -0
- package/dist/public/assets/chunk-VQ5W62QI-DHTcO93W.js +1 -0
- package/dist/public/assets/chunk-WQQL4CDK-H6nAhuck.js +10 -0
- package/dist/public/assets/chunk-XXDRQBXY-BUghdEVl.js +1 -0
- package/dist/public/assets/chunk-YZO67HFG-D13E0_Yh.js +1 -0
- package/dist/public/assets/chunk-ZAUX2LTX-Dp5y-2wt.js +1 -0
- package/dist/public/assets/chunk-ZCHMQSOR-RJjlln1D.js +2 -0
- package/dist/public/assets/classDiagram-v2-4MYWR3UA-CAqiFCSv.js +217 -0
- package/dist/public/assets/cose-bilkent-JH36ORCC-C_VOHzoP.js +1 -0
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dyk4ZPjK.js +1 -0
- package/dist/public/assets/cynefinDiagram-WF24UDRP-b_Ia8gQX.js +62 -0
- package/dist/public/assets/cytoscape.esm-GRKmfDkD.js +321 -0
- package/dist/public/assets/dagre-NK4GIZVX-CH1K1yF8.js +4 -0
- package/dist/public/assets/diagram-CBK3MWTC-OaKd5avy.js +24 -0
- package/dist/public/assets/diagram-I5XIIV2D-Cmu5z1ad.js +24 -0
- package/dist/public/assets/diagram-ODIL2UCW-Cz1kkDDX.js +30 -0
- package/dist/public/assets/diagram-PFBEJUXE-faMkmqUW.js +3 -0
- package/dist/public/assets/diagram-RJA3I4VV-nycvfte-.js +41 -0
- package/dist/public/assets/diagram-TYUNFSNR-CjEv5QCm.js +200 -0
- package/dist/public/assets/dist-DGs_yUrP.js +1 -0
- package/dist/public/assets/ebnfDiagram-V4P3TTPT-DN-IIxCy.js +1 -0
- package/dist/public/assets/elk-QONTBCTQ-Bsam88GP.js +27 -0
- package/dist/public/assets/erDiagram-KYQIGQAA-DEU_qqNK.js +99 -0
- package/dist/public/assets/eventmodeling-K75KTNOO-Bl6NCM9E.js +1 -0
- package/dist/public/assets/flowDiagram-IUGLLWBU-Cl4qZ-36.js +1 -0
- package/dist/public/assets/ganttDiagram-R7GPNTJY-BmMd4aGi.js +292 -0
- package/dist/public/assets/gitGraph-VSP46ZUC-Q0H2PWek.js +1 -0
- package/dist/public/assets/gitGraphDiagram-PDYL7XHY-BlCTBYTj.js +106 -0
- package/dist/public/assets/index-CuBJ0hof.css +1 -0
- package/dist/public/assets/index-D6WqGtsG.js +27876 -0
- package/dist/public/assets/index-D701BZPh.js +2219 -0
- package/dist/public/assets/info-OHQRW6UA-D0TMPJxW.js +1 -0
- package/dist/public/assets/infoDiagram-MVDRKAX5-CljbtJXu.js +2 -0
- package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-CiLpASIW.js → ishikawaDiagram-HPEHV2GE-_Y3Fr0hu.js} +6 -6
- package/dist/public/assets/journeyDiagram-BOSHW7O7-Bo55jJ4m.js +139 -0
- package/dist/public/assets/kanban-definition-FNSA4HC5-Cd-10MtF.js +89 -0
- package/dist/public/assets/katex-MEuSR36T.js +257 -0
- package/dist/public/assets/line-BDmh4sWC.js +1 -0
- package/dist/public/assets/linear-Dt7xjMrI.js +1 -0
- package/dist/public/assets/mermaid-parser.core-BJ1yyzvV.js +7 -0
- package/dist/public/assets/mindmap-definition-6OY57UG3-CRgumPuN.js +98 -0
- package/dist/public/assets/packet-JDAUHWVQ-DsTMT3Kw.js +1 -0
- package/dist/public/assets/path-B_0haWDX.js +1 -0
- package/dist/public/assets/pegDiagram-ECIUJNBX-BEGI5k3m.js +1 -0
- package/dist/public/assets/pie-XZMESJXO-COyqzA3N.js +1 -0
- package/dist/public/assets/pieDiagram-GNMPY74T-CrLJhZJJ.js +39 -0
- package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-B3czMbdS.js → quadrantDiagram-D57K4MC3-Fl7HMHxK.js} +6 -6
- package/dist/public/assets/radar-ABXABTNO-DeXHKowk.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-CUjKUdPz.js +1 -0
- package/dist/public/assets/railroad-abnf-LNEFI6M7-B1aEgHE6.js +1 -0
- package/dist/public/assets/railroad-ebnf-DWYD2UWJ-DmmI3Voz.js +1 -0
- package/dist/public/assets/railroad-peg-JR7BVNR7-BHzi9m7r.js +1 -0
- package/dist/public/assets/railroadDiagram-Y72NRBL7-D1oeE5fy.js +1 -0
- package/dist/public/assets/requirementDiagram-EQYSW5RA-BJDKK1aS.js +84 -0
- package/dist/public/assets/rolldown-runtime-BCiCTKAo.js +1 -0
- package/dist/public/assets/{rough.esm-By172zw-.js → rough.esm-Dy-Kn_BL.js} +1 -1
- package/dist/public/assets/sankeyDiagram-SY24JHO5-C4g0OwZ9.js +40 -0
- package/dist/public/assets/sequenceDiagram-BLEHNHQU-CEvy4P-b.js +169 -0
- package/dist/public/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dist/public/assets/src-MPsEqXxq.js +1 -0
- package/dist/public/assets/stateDiagram-v2-A6IESKWZ-BFhvw4Gl.js +291 -0
- package/dist/public/assets/swimlanes-B3ENRKFQ-BIl_Q-FM.js +1 -0
- package/dist/public/assets/swimlanesDiagram-AYQRV4AK-rvDbKEHQ.js +8 -0
- package/dist/public/assets/timeline-definition-JXYKGLGB-qAoWTH4N.js +120 -0
- package/dist/public/assets/treeView-D4JQ5SDB-vq16JKkJ.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-C0IZTaDk.js +1 -0
- package/dist/public/assets/usecaseDiagram-WPOLBNNX-Dq8iz49r.js +328 -0
- package/dist/public/assets/vennDiagram-Q3Y3IDCW-Br4JmRjM.js +34 -0
- package/dist/public/assets/wardley-7MLQ67FV-CEPlAQ79.js +1 -0
- package/dist/public/assets/wardleyDiagram-IVAIDKWA-DURB7Ue6.js +78 -0
- package/dist/public/assets/xychartDiagram-4URNHDU4-BiZywfhy.js +7 -0
- package/dist/public/index.html +27 -28
- package/dist/public/sbom.cdx.json +1 -0
- package/dist/types.d.ts +0 -12
- package/dist/types.js +2 -12
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +12 -5
- package/dist/utils.js +18 -43
- package/dist/utils.js.map +1 -1
- package/package.json +14 -14
- package/src/app.ts +51 -49
- package/src/auth/index.ts +3 -13
- package/src/auth/keycloak.ts +10 -15
- package/src/auth/mock.ts +144 -48
- package/src/auth/types.ts +10 -13
- package/src/common/errors.ts +45 -0
- package/src/common/validationSchemas.ts +3 -12
- package/src/domain/auth/index.ts +2 -12
- package/src/domain/calculations/index.ts +4 -14
- package/src/domain/calculations/schema.ts +2 -12
- package/src/domain/calculations/service.ts +8 -21
- package/src/domain/cardTypes/index.ts +10 -20
- package/src/domain/cardTypes/schema.ts +3 -12
- package/src/domain/cardTypes/service.ts +22 -29
- package/src/domain/cards/index.ts +158 -218
- package/src/domain/cards/lib.ts +9 -173
- package/src/domain/cards/mermaid.ts +25 -0
- package/src/domain/cards/schema.ts +19 -15
- package/src/domain/cards/service.ts +166 -134
- package/src/domain/connectors/index.ts +5 -14
- package/src/domain/connectors/service.ts +5 -20
- package/src/domain/events/events-by-project.ts +59 -0
- package/src/domain/events/index.ts +102 -0
- package/src/domain/events/lifetime.ts +17 -0
- package/src/domain/events/project-events.ts +266 -0
- package/src/domain/events/schema.ts +11 -0
- package/src/domain/fieldTypes/index.ts +6 -16
- package/src/domain/fieldTypes/schema.ts +3 -12
- package/src/domain/fieldTypes/service.ts +9 -21
- package/src/domain/graphModels/index.ts +4 -14
- package/src/domain/graphModels/schema.ts +3 -12
- package/src/domain/graphModels/service.ts +5 -18
- package/src/domain/graphViews/index.ts +4 -14
- package/src/domain/graphViews/schema.ts +3 -0
- package/src/domain/graphViews/service.ts +5 -18
- package/src/domain/labels/index.ts +4 -14
- package/src/domain/labels/service.ts +6 -16
- package/src/domain/linkTypes/index.ts +6 -16
- package/src/domain/linkTypes/schema.ts +2 -12
- package/src/domain/linkTypes/service.ts +8 -21
- package/src/domain/logicPrograms/index.ts +5 -17
- package/src/domain/logicPrograms/service.ts +7 -16
- package/src/domain/mcp/index.ts +33 -24
- package/src/domain/project/index.ts +59 -37
- package/src/domain/project/schema.ts +41 -18
- package/src/domain/project/service.ts +81 -71
- package/src/domain/projects/index.ts +38 -50
- package/src/domain/projects/schema.ts +3 -12
- package/src/domain/projects/service.ts +18 -88
- package/src/domain/reports/index.ts +4 -14
- package/src/domain/reports/schema.ts +2 -12
- package/src/domain/reports/service.ts +5 -18
- package/src/domain/resources/index.ts +102 -30
- package/src/domain/resources/schema.ts +15 -2
- package/src/domain/resources/service.ts +98 -81
- package/src/domain/skills/index.ts +51 -0
- package/src/domain/skills/schema.ts +9 -0
- package/src/domain/skills/service.ts +8 -0
- package/src/domain/templates/index.ts +8 -18
- package/src/domain/templates/schema.ts +2 -12
- package/src/domain/templates/service.ts +9 -22
- package/src/domain/tree/index.ts +4 -14
- package/src/domain/tree/service.ts +10 -21
- package/src/domain/workflows/index.ts +4 -14
- package/src/domain/workflows/schema.ts +2 -12
- package/src/domain/workflows/service.ts +5 -18
- package/src/export.ts +82 -73
- package/src/index.ts +30 -46
- package/src/main.ts +45 -37
- package/src/middleware/auth.ts +25 -16
- package/src/middleware/commandManager.ts +37 -49
- package/src/middleware/tree.ts +3 -0
- package/src/middleware/zvalidator.ts +3 -0
- package/src/overlay.ts +185 -0
- package/src/types.ts +2 -12
- package/src/utils.ts +26 -46
- package/dist/domain/cards/presence.d.ts +0 -50
- package/dist/domain/cards/presence.js +0 -93
- package/dist/domain/cards/presence.js.map +0 -1
- package/dist/project-registry.d.ts +0 -57
- package/dist/project-registry.js +0 -93
- package/dist/project-registry.js.map +0 -1
- package/dist/public/assets/abnfDiagram-VRR7QNED-Djr4KJ5E.js +0 -1
- package/dist/public/assets/arc-DrR4k_H-.js +0 -1
- package/dist/public/assets/architecture-TIHT7OUA-XL6N-4o9.js +0 -1
- package/dist/public/assets/architectureDiagram-ZJ3FMSHR-DsMU2Uwa.js +0 -36
- package/dist/public/assets/blockDiagram-677ZJIJ3-DRBmQUQJ.js +0 -132
- package/dist/public/assets/c4Diagram-LMCZKHZV-E0rM02LD.js +0 -10
- package/dist/public/assets/channel-D5fnImJy.js +0 -1
- package/dist/public/assets/chunk-32BRIVSS-BnDY0aSV.js +0 -1
- package/dist/public/assets/chunk-52WLFC77-N5YugKaZ.js +0 -10
- package/dist/public/assets/chunk-5FCAYU7R-I3_t_Ic_.js +0 -1
- package/dist/public/assets/chunk-5HE753X5-Dxz40rzH.js +0 -1
- package/dist/public/assets/chunk-5JV3BV7I-CNwCKRLH.js +0 -1
- package/dist/public/assets/chunk-5TONJI2A-ezWQ_Z2j.js +0 -2
- package/dist/public/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
- package/dist/public/assets/chunk-BIQX33UG-DS132-R_.js +0 -1
- package/dist/public/assets/chunk-C7G6YPKG-BN-cNjoj.js +0 -1
- package/dist/public/assets/chunk-CQNSW5MT-D8Mn1I73.js +0 -1
- package/dist/public/assets/chunk-CYSBUYHQ-Dc64Dwdo.js +0 -1
- package/dist/public/assets/chunk-EMLP6XTP-aIK0V8GX.js +0 -1
- package/dist/public/assets/chunk-EX3LRPZG-Db0XYyxy.js +0 -231
- package/dist/public/assets/chunk-FWX5IMBZ-BF_P2-Do.js +0 -2
- package/dist/public/assets/chunk-HOUHSVGY-L35GPy9G.js +0 -1
- package/dist/public/assets/chunk-ICXQ74PX-Bb8zaHde.js +0 -2
- package/dist/public/assets/chunk-JG7HCLWE-BtAXK3iQ.js +0 -2
- package/dist/public/assets/chunk-KEIR6QF5-DEvma7oi.js +0 -161
- package/dist/public/assets/chunk-MOZMSUNE-5FIqIBsY.js +0 -1
- package/dist/public/assets/chunk-OGEWGWER-BVIFy9xz.js +0 -1
- package/dist/public/assets/chunk-OSBZ3O6U-Cfd7kf1R.js +0 -1
- package/dist/public/assets/chunk-PUDLZKDR-Db3FSNR9.js +0 -156
- package/dist/public/assets/chunk-Q4XR5HBZ-BuKFRUzR.js +0 -70
- package/dist/public/assets/chunk-QBLGF6JB-DUGZXFh-.js +0 -1
- package/dist/public/assets/chunk-R7FJI6CG-D7mUd-qN.js +0 -1
- package/dist/public/assets/chunk-RYQCIY6F-C_3rESBd.js +0 -1
- package/dist/public/assets/chunk-U6XO7XAA-C3UhlwA1.js +0 -2
- package/dist/public/assets/chunk-V7JOEXUC-71b0ABpv.js +0 -206
- package/dist/public/assets/chunk-VAUOI2AC-C-GBw18h.js +0 -1
- package/dist/public/assets/chunk-VR4S4FIN-tUhbELKr.js +0 -1
- package/dist/public/assets/chunk-WYO6CB5R-BQoO62-B.js +0 -127
- package/dist/public/assets/chunk-XXDRQBXY-Co8n4ZHT.js +0 -1
- package/dist/public/assets/chunk-YOTPTUD7-DhCRKU1A.js +0 -1
- package/dist/public/assets/chunk-ZGVPDNZ5-hpz2Ryq5.js +0 -62
- package/dist/public/assets/chunk-ZIRB5QZD-BpeS1aZ7.js +0 -32
- package/dist/public/assets/classDiagram-OUVF2IWQ-CXdVorPK.js +0 -1
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-CXdVorPK.js +0 -1
- package/dist/public/assets/colors-Cg5Vh3br.js +0 -1
- package/dist/public/assets/cose-bilkent-JH36ORCC-4GoRbloS.js +0 -1
- package/dist/public/assets/cynefin-VYW2F7L2-BPH-25fI.js +0 -1
- package/dist/public/assets/cynefinDiagram-TSTJHNR4-PEf16euv.js +0 -62
- package/dist/public/assets/cytoscape.esm-C3UvhD5t.js +0 -321
- package/dist/public/assets/dagre-Buvkdvvj.js +0 -1
- package/dist/public/assets/dagre-VKFMJZFB-DPsCMBF1.js +0 -4
- package/dist/public/assets/diagram-FQU43EPY-DS-ryuRg.js +0 -3
- package/dist/public/assets/diagram-G47NLZAW-CzUoYkFf.js +0 -24
- package/dist/public/assets/diagram-NH7WQ7WH-MhGnE2fh.js +0 -24
- package/dist/public/assets/diagram-OA4YK3LP-CsQ9aFR_.js +0 -30
- package/dist/public/assets/diagram-WEI45ONY-Er3q49ew.js +0 -41
- package/dist/public/assets/dist-BzwexiH1.js +0 -1
- package/dist/public/assets/ebnfDiagram-CCIWWBDH-AnJAsk14.js +0 -1
- package/dist/public/assets/erDiagram-Q63AITRT-DulA16my.js +0 -85
- package/dist/public/assets/eventmodeling-45OFAUF4-CoIhTpHU.js +0 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-BGMXUq18.js +0 -1
- package/dist/public/assets/ganttDiagram-NO4QXBWP-DAvCPT7_.js +0 -292
- package/dist/public/assets/gitGraph-TEB2WS4Q-BcPsZts5.js +0 -1
- package/dist/public/assets/gitGraphDiagram-IHSO6WYX-CksvJvsQ.js +0 -106
- package/dist/public/assets/index-COSSLZqt.css +0 -1
- package/dist/public/assets/index-Y8Ckwau7.js +0 -447
- package/dist/public/assets/info-DKCQHKI2-7VGzrAVB.js +0 -1
- package/dist/public/assets/infoDiagram-FWYZ7A6U-D_by7lSL.js +0 -2
- package/dist/public/assets/journeyDiagram-5HDEW3XC-DpvFmk7c.js +0 -139
- package/dist/public/assets/kanban-definition-HUTT4EX6-DYP_x6zD.js +0 -89
- package/dist/public/assets/katex-DolUETbr.js +0 -257
- package/dist/public/assets/line-C8Sfsgt8.js +0 -1
- package/dist/public/assets/linear-BWTvbP1l.js +0 -1
- package/dist/public/assets/map-BaFkSB1l.js +0 -1
- package/dist/public/assets/mermaid-parser.core--8614tkK.js +0 -4
- package/dist/public/assets/mindmap-definition-LN4V7U3C-3IAd4gp3.js +0 -96
- package/dist/public/assets/ordinal-BdBDtYTt.js +0 -1
- package/dist/public/assets/packet-7NZHBO7P-KYt33H0C.js +0 -1
- package/dist/public/assets/path-HTXttWil.js +0 -1
- package/dist/public/assets/pegDiagram-2B236MQR-BQNFxYz2.js +0 -1
- package/dist/public/assets/pie-RZYD4A2V-xKz9s9I4.js +0 -1
- package/dist/public/assets/pieDiagram-ENE6RG2P-Cy13tg8_.js +0 -39
- package/dist/public/assets/radar-I7S5WNFK-B4QTX-fX.js +0 -1
- package/dist/public/assets/railroad-3IZDKUUU-Co_9rPVC.js +0 -1
- package/dist/public/assets/railroad-abnf-AHOZXSZD-Bhy_c3ol.js +0 -1
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-B9ENjG34.js +0 -1
- package/dist/public/assets/railroad-peg-LSFZ7HO6-CyJxDBsB.js +0 -1
- package/dist/public/assets/railroadDiagram-RFXS5EU6-M2j5SJF2.js +0 -1
- package/dist/public/assets/range-EplFIxc7.js +0 -1
- package/dist/public/assets/requirementDiagram-TGXJPOKE-CmvJWy_S.js +0 -84
- package/dist/public/assets/sankeyDiagram-HTMAVEWB-tAeOzMTn.js +0 -40
- package/dist/public/assets/sequenceDiagram-DBY2YBRQ-r0pwijM4.js +0 -162
- package/dist/public/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +0 -1
- package/dist/public/assets/src-DOh7_en_.js +0 -1
- package/dist/public/assets/stateDiagram-2N3HPSRC-a9IdkSQG.js +0 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-s2blPtZ-.js +0 -1
- package/dist/public/assets/swimlanes-5IMT3BWC-5w0Cdxk6.js +0 -2
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-BWa-KRed.js +0 -8
- package/dist/public/assets/time-BM2d9MsQ.js +0 -1
- package/dist/public/assets/timeline-definition-FHXFAJF6-CvXlv_4Y.js +0 -120
- package/dist/public/assets/treeView-QDETBFTQ-B9cxjfpB.js +0 -1
- package/dist/public/assets/treemap-6X3UGDF4-BplEq4hB.js +0 -1
- package/dist/public/assets/treemap-BfjIY-m6.js +0 -1
- package/dist/public/assets/vennDiagram-L72KCM5P-ti2qNcvo.js +0 -34
- package/dist/public/assets/wardley-OPB4EBWU-BX2ghg5e.js +0 -1
- package/dist/public/assets/wardleyDiagram-EHGQE667-C8lblm8x.js +0 -78
- package/dist/public/assets/xychartDiagram-FW5EYKEG-US-_k5eu.js +0 -7
- package/src/domain/cards/presence.ts +0 -124
- package/src/project-registry.ts +0 -130
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
4
|
+
import { type ProjectDirectory, type Workspace } from '@cyberismo/data-handler';
|
|
14
5
|
import {
|
|
15
6
|
type CleanResult,
|
|
16
|
-
type CommandManager,
|
|
17
7
|
type HubFetchFailure,
|
|
18
8
|
type ModuleSettingFromHub,
|
|
19
|
-
|
|
9
|
+
type ProjectModuleInfo,
|
|
10
|
+
type UpdatePlan,
|
|
11
|
+
} from '@cyberismo/model';
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export interface ProjectModule {
|
|
24
|
-
name: string;
|
|
13
|
+
// Never carries the module's source location.
|
|
14
|
+
export interface ProjectModule extends ProjectModuleInfo {
|
|
25
15
|
cardKeyPrefix: string;
|
|
26
16
|
}
|
|
27
17
|
|
|
@@ -57,34 +47,30 @@ export interface HubInfo {
|
|
|
57
47
|
}
|
|
58
48
|
|
|
59
49
|
async function toModuleInfo(
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
ws: Workspace,
|
|
51
|
+
row: ProjectModuleInfo,
|
|
62
52
|
): Promise<ProjectModule> {
|
|
63
53
|
try {
|
|
64
|
-
const data = await
|
|
54
|
+
const data = await ws.modules.show(row.name);
|
|
65
55
|
return {
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
...row,
|
|
57
|
+
name: data.name || row.name,
|
|
58
|
+
cardKeyPrefix: data.cardKeyPrefix || row.name,
|
|
68
59
|
};
|
|
69
60
|
} catch {
|
|
70
|
-
return {
|
|
71
|
-
name: moduleName,
|
|
72
|
-
cardKeyPrefix: moduleName,
|
|
73
|
-
};
|
|
61
|
+
return { ...row, cardKeyPrefix: row.name };
|
|
74
62
|
}
|
|
75
63
|
}
|
|
76
64
|
|
|
77
|
-
export async function getProject(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const project = await commands.showCmd.showProject();
|
|
82
|
-
const modules = await commands.showCmd.showModules();
|
|
65
|
+
export async function getProject(ws: Workspace): Promise<ProjectInfo> {
|
|
66
|
+
return ws.consistent(async () => {
|
|
67
|
+
const project = await ws.settings.info();
|
|
68
|
+
const modules = await ws.modules.inventory();
|
|
83
69
|
const moduleDetails = await Promise.all(
|
|
84
|
-
modules.map((
|
|
70
|
+
modules.map((row) => toModuleInfo(ws, row)),
|
|
85
71
|
);
|
|
86
72
|
|
|
87
|
-
const gitRemoteUrl = (await
|
|
73
|
+
const gitRemoteUrl = (await ws.settings.gitRemoteUrl()) ?? null;
|
|
88
74
|
|
|
89
75
|
return {
|
|
90
76
|
name: project.name,
|
|
@@ -98,50 +84,75 @@ export async function getProject(
|
|
|
98
84
|
}
|
|
99
85
|
|
|
100
86
|
export async function updateProject(
|
|
101
|
-
|
|
87
|
+
ws: Workspace,
|
|
88
|
+
directory: ProjectDirectory,
|
|
102
89
|
updates: ProjectUpdatePayload,
|
|
103
90
|
): Promise<ProjectInfo> {
|
|
104
91
|
const { name, cardKeyPrefix, description, category, gitRemoteUrl } = updates;
|
|
105
92
|
|
|
106
|
-
await
|
|
93
|
+
await ws.atomic(async () => {
|
|
107
94
|
if (cardKeyPrefix) {
|
|
108
|
-
await
|
|
95
|
+
await directory.rename(
|
|
96
|
+
ws.settings.prefix,
|
|
97
|
+
cardKeyPrefix,
|
|
98
|
+
ws.actor,
|
|
99
|
+
ws.identity,
|
|
100
|
+
);
|
|
109
101
|
}
|
|
110
102
|
if (name) {
|
|
111
|
-
await
|
|
103
|
+
await ws.settings.setName(name);
|
|
112
104
|
}
|
|
113
105
|
if (description !== undefined) {
|
|
114
|
-
await
|
|
106
|
+
await ws.settings.setDescription(description);
|
|
115
107
|
}
|
|
116
108
|
if (category !== undefined) {
|
|
117
|
-
await
|
|
109
|
+
await ws.settings.setCategory(category);
|
|
118
110
|
}
|
|
119
111
|
}, 'Update project settings');
|
|
120
112
|
|
|
121
113
|
if (gitRemoteUrl !== undefined) {
|
|
122
|
-
await
|
|
114
|
+
await ws.settings.setGitRemoteUrl(gitRemoteUrl);
|
|
123
115
|
}
|
|
124
116
|
|
|
125
|
-
return getProject(
|
|
117
|
+
return getProject(ws);
|
|
126
118
|
}
|
|
127
119
|
|
|
128
|
-
export async function updateModule(
|
|
129
|
-
|
|
120
|
+
export async function updateModule(
|
|
121
|
+
ws: Workspace,
|
|
122
|
+
module: string,
|
|
123
|
+
range?: string,
|
|
124
|
+
) {
|
|
125
|
+
await ws.modules.update(range ? { module, range } : { module });
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
export async function updateAllModules(
|
|
133
|
-
await
|
|
128
|
+
export async function updateAllModules(ws: Workspace) {
|
|
129
|
+
await ws.modules.update({});
|
|
134
130
|
}
|
|
135
131
|
|
|
136
|
-
export async function
|
|
137
|
-
|
|
132
|
+
export async function getUpdatePlan(ws: Workspace): Promise<UpdatePlan> {
|
|
133
|
+
return ws.modules.planUpdate({});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function listModuleVersions(
|
|
137
|
+
ws: Workspace,
|
|
138
|
+
target: { module?: string; source?: string },
|
|
139
|
+
): Promise<string[]> {
|
|
140
|
+
return ws.modules.listVersions(
|
|
141
|
+
target.source !== undefined
|
|
142
|
+
? { source: target.source }
|
|
143
|
+
: { module: target.module! },
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export async function deleteModule(ws: Workspace, module: string) {
|
|
148
|
+
await ws.modules.remove(module);
|
|
138
149
|
}
|
|
139
150
|
|
|
140
151
|
// Hub data is only refreshed on demand, so a project that has never fetched
|
|
141
152
|
// would otherwise show an empty catalogue until the user asks for a refresh.
|
|
142
|
-
async function populateHubCache(
|
|
153
|
+
async function populateHubCache(ws: Workspace) {
|
|
143
154
|
try {
|
|
144
|
-
await
|
|
155
|
+
await ws.modules.ensureModuleListExists();
|
|
145
156
|
} catch (error) {
|
|
146
157
|
// An unreachable hub must not fail listing the hubs we already know about.
|
|
147
158
|
console.warn('Failed to populate the hub cache', error);
|
|
@@ -149,24 +160,25 @@ async function populateHubCache(commands: CommandManager) {
|
|
|
149
160
|
}
|
|
150
161
|
|
|
151
162
|
export async function getImportableModules(
|
|
152
|
-
|
|
163
|
+
ws: Workspace,
|
|
153
164
|
): Promise<ModuleSettingFromHub[]> {
|
|
154
|
-
await populateHubCache(
|
|
155
|
-
return
|
|
165
|
+
await populateHubCache(ws);
|
|
166
|
+
return ws.modules.importable(false, true);
|
|
156
167
|
}
|
|
157
168
|
|
|
158
169
|
export async function importModule(
|
|
159
|
-
|
|
170
|
+
ws: Workspace,
|
|
160
171
|
source: string,
|
|
172
|
+
range?: string,
|
|
161
173
|
): Promise<void> {
|
|
162
|
-
await
|
|
174
|
+
await ws.modules.install(source, range ? { version: range } : undefined);
|
|
163
175
|
}
|
|
164
176
|
|
|
165
|
-
export async function getHubs(
|
|
166
|
-
await populateHubCache(
|
|
167
|
-
const hubs = await
|
|
177
|
+
export async function getHubs(ws: Workspace): Promise<HubInfo[]> {
|
|
178
|
+
await populateHubCache(ws);
|
|
179
|
+
const hubs = await ws.modules.hubDetails();
|
|
168
180
|
const importedModules = new Set(
|
|
169
|
-
(await
|
|
181
|
+
(await ws.modules.list()).map((mod) => mod.name),
|
|
170
182
|
);
|
|
171
183
|
return hubs.map((hub) => ({
|
|
172
184
|
location: hub.location,
|
|
@@ -182,28 +194,26 @@ export async function getHubs(commands: CommandManager): Promise<HubInfo[]> {
|
|
|
182
194
|
}
|
|
183
195
|
|
|
184
196
|
export async function addHub(
|
|
185
|
-
|
|
197
|
+
ws: Workspace,
|
|
186
198
|
location: string,
|
|
187
199
|
): Promise<HubFetchFailure[]> {
|
|
188
|
-
await
|
|
200
|
+
await ws.settings.hubs.add(location);
|
|
189
201
|
// The hub is configured even when it cannot be reached right now; its
|
|
190
202
|
// modules appear once a later refresh succeeds.
|
|
191
|
-
return
|
|
203
|
+
return ws.modules.fetchHubs(true);
|
|
192
204
|
}
|
|
193
205
|
|
|
194
|
-
export async function removeHub(
|
|
195
|
-
await
|
|
206
|
+
export async function removeHub(ws: Workspace, location: string) {
|
|
207
|
+
await ws.settings.hubs.remove(location);
|
|
196
208
|
}
|
|
197
209
|
|
|
198
|
-
export async function fetchHubs(
|
|
199
|
-
|
|
200
|
-
): Promise<HubFetchFailure[]> {
|
|
201
|
-
return commands.fetchCmd.fetchHubs(true);
|
|
210
|
+
export async function fetchHubs(ws: Workspace): Promise<HubFetchFailure[]> {
|
|
211
|
+
return ws.modules.fetchHubs(true);
|
|
202
212
|
}
|
|
203
213
|
|
|
204
214
|
export async function cleanProject(
|
|
205
|
-
|
|
215
|
+
ws: Workspace,
|
|
206
216
|
dryRun: boolean,
|
|
207
217
|
): Promise<CleanResult> {
|
|
208
|
-
return
|
|
218
|
+
return ws.clean.run(dryRun);
|
|
209
219
|
}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2026
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
4
|
import { Hono } from 'hono';
|
|
15
5
|
import { zValidator } from '../../middleware/zvalidator.js';
|
|
16
|
-
import type {
|
|
6
|
+
import type { ProjectDirectory } from '@cyberismo/data-handler';
|
|
7
|
+
import { errorBody, errorResponse } from '../../common/errors.js';
|
|
17
8
|
import { requireRole, getCurrentUser } from '../../middleware/auth.js';
|
|
9
|
+
import { isProjectReadOnly } from '../../overlay.js';
|
|
18
10
|
import { UserRole } from '../../types.js';
|
|
19
11
|
import { createProjectSchema, cloneProjectSchema } from './schema.js';
|
|
20
12
|
import * as projectsService from './service.js';
|
|
21
13
|
|
|
22
14
|
export function createProjectsRouter(
|
|
23
|
-
|
|
15
|
+
directory: ProjectDirectory,
|
|
24
16
|
multiProjectRoot?: string,
|
|
25
17
|
) {
|
|
26
18
|
const router = new Hono();
|
|
@@ -37,9 +29,12 @@ export function createProjectsRouter(
|
|
|
37
29
|
* 401:
|
|
38
30
|
* description: Unauthorized
|
|
39
31
|
*/
|
|
40
|
-
router.get('/', requireRole(UserRole.Reader), (c) => {
|
|
32
|
+
router.get('/', requireRole(UserRole.Reader), async (c) => {
|
|
41
33
|
return c.json({
|
|
42
|
-
projects:
|
|
34
|
+
projects: (await directory.list()).map((project) => ({
|
|
35
|
+
...project,
|
|
36
|
+
readOnly: isProjectReadOnly(project.prefix),
|
|
37
|
+
})),
|
|
43
38
|
canCreateProjects: !!multiProjectRoot,
|
|
44
39
|
});
|
|
45
40
|
});
|
|
@@ -58,38 +53,31 @@ export function createProjectsRouter(
|
|
|
58
53
|
async (c) => {
|
|
59
54
|
if (!multiProjectRoot) {
|
|
60
55
|
return c.json(
|
|
61
|
-
|
|
56
|
+
errorBody(
|
|
57
|
+
'permission-denied',
|
|
58
|
+
'Project creation is not available in single-project mode',
|
|
59
|
+
),
|
|
62
60
|
403,
|
|
63
61
|
);
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
const params = c.req.valid('json');
|
|
67
65
|
|
|
68
|
-
if (registry.has(params.prefix)) {
|
|
69
|
-
return c.json(
|
|
70
|
-
{ error: `Project with prefix '${params.prefix}' already exists` },
|
|
71
|
-
409,
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
66
|
try {
|
|
76
67
|
const result = await projectsService.createProject(
|
|
77
|
-
|
|
78
|
-
multiProjectRoot,
|
|
68
|
+
directory,
|
|
79
69
|
params,
|
|
80
70
|
getCurrentUser(c),
|
|
81
71
|
);
|
|
82
72
|
return c.json(result, 201);
|
|
83
73
|
} catch (error) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
: 'Failed to create project',
|
|
90
|
-
},
|
|
91
|
-
500,
|
|
74
|
+
// A taken prefix is the directory's ProjectExistsError: a 409.
|
|
75
|
+
const { status, body } = errorResponse(
|
|
76
|
+
error instanceof Error
|
|
77
|
+
? error
|
|
78
|
+
: new Error('Failed to create project'),
|
|
92
79
|
);
|
|
80
|
+
return c.json(body, status);
|
|
93
81
|
}
|
|
94
82
|
},
|
|
95
83
|
);
|
|
@@ -108,7 +96,10 @@ export function createProjectsRouter(
|
|
|
108
96
|
async (c) => {
|
|
109
97
|
if (!multiProjectRoot) {
|
|
110
98
|
return c.json(
|
|
111
|
-
|
|
99
|
+
errorBody(
|
|
100
|
+
'permission-denied',
|
|
101
|
+
'Project cloning is not available in single-project mode',
|
|
102
|
+
),
|
|
112
103
|
403,
|
|
113
104
|
);
|
|
114
105
|
}
|
|
@@ -116,18 +107,15 @@ export function createProjectsRouter(
|
|
|
116
107
|
const { url } = c.req.valid('json');
|
|
117
108
|
|
|
118
109
|
try {
|
|
119
|
-
const result = await
|
|
120
|
-
registry,
|
|
121
|
-
multiProjectRoot,
|
|
122
|
-
url,
|
|
123
|
-
);
|
|
110
|
+
const result = await directory.clone(url);
|
|
124
111
|
|
|
125
112
|
if (result.projects.length === 0) {
|
|
126
113
|
return c.json(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
errorBody(
|
|
115
|
+
'conflict',
|
|
116
|
+
'All projects in the cloned repository already exist',
|
|
117
|
+
{ skippedDuplicates: result.skippedDuplicates },
|
|
118
|
+
),
|
|
131
119
|
409,
|
|
132
120
|
);
|
|
133
121
|
}
|
|
@@ -135,12 +123,12 @@ export function createProjectsRouter(
|
|
|
135
123
|
return c.json(result, 201);
|
|
136
124
|
} catch (error) {
|
|
137
125
|
return c.json(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
126
|
+
errorBody(
|
|
127
|
+
'internal',
|
|
128
|
+
error instanceof Error
|
|
129
|
+
? error.message
|
|
130
|
+
: 'Failed to clone repository',
|
|
131
|
+
),
|
|
144
132
|
500,
|
|
145
133
|
);
|
|
146
134
|
}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2026
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
4
|
import { z } from 'zod';
|
|
15
5
|
import { Validate } from '@cyberismo/data-handler';
|
|
@@ -30,6 +20,7 @@ export const createProjectSchema = z.object({
|
|
|
30
20
|
}),
|
|
31
21
|
category: z.string().optional().default(''),
|
|
32
22
|
description: z.string().optional().default(''),
|
|
23
|
+
skipDefaultHub: z.boolean().optional(),
|
|
33
24
|
});
|
|
34
25
|
|
|
35
26
|
export const cloneProjectSchema = z.object({
|
|
@@ -1,98 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2026
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
scanForProjects,
|
|
19
|
-
} from '@cyberismo/data-handler';
|
|
20
|
-
import type { ProjectRegistry } from '../../project-registry.js';
|
|
21
|
-
|
|
22
|
-
export interface CreateProjectParams {
|
|
23
|
-
name: string;
|
|
24
|
-
prefix: string;
|
|
25
|
-
category?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface CreateProjectResult {
|
|
30
|
-
prefix: string;
|
|
31
|
-
name: string;
|
|
32
|
-
category?: string;
|
|
33
|
-
description?: string;
|
|
34
|
-
}
|
|
4
|
+
import { SYSTEM_ACTOR, type ProjectDirectory } from '@cyberismo/data-handler';
|
|
5
|
+
import type { CreateProjectParams } from '@cyberismo/model';
|
|
6
|
+
import { actorOf } from '../../middleware/commandManager.js';
|
|
7
|
+
import type { UserInfo } from '../../types.js';
|
|
35
8
|
|
|
36
9
|
export async function createProject(
|
|
37
|
-
|
|
38
|
-
rootPath: string,
|
|
10
|
+
directory: ProjectDirectory,
|
|
39
11
|
params: CreateProjectParams,
|
|
40
|
-
user?:
|
|
41
|
-
)
|
|
42
|
-
const {
|
|
43
|
-
const projectPath = join(rootPath, prefix);
|
|
44
|
-
|
|
45
|
-
const commands = await CommandManager.createProjectWithDefaults(
|
|
46
|
-
projectPath,
|
|
12
|
+
user?: UserInfo | null,
|
|
13
|
+
) {
|
|
14
|
+
const { prefix, failures, warnings } = await directory.create(
|
|
47
15
|
params,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
gitUser: user ?? undefined,
|
|
51
|
-
},
|
|
16
|
+
user ? actorOf(user) : SYSTEM_ACTOR,
|
|
17
|
+
user ? { name: user.name, email: user.email } : undefined,
|
|
52
18
|
);
|
|
53
|
-
|
|
54
|
-
registry.add(prefix, commands);
|
|
55
|
-
|
|
19
|
+
// The project's path stays on the server.
|
|
56
20
|
return {
|
|
57
21
|
prefix,
|
|
58
|
-
name,
|
|
59
|
-
category: category || undefined,
|
|
60
|
-
description: description || undefined,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export interface CloneProjectResult {
|
|
65
|
-
projects: { prefix: string; name: string }[];
|
|
66
|
-
skippedDuplicates?: string[];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export async function cloneProject(
|
|
70
|
-
registry: ProjectRegistry,
|
|
71
|
-
rootPath: string,
|
|
72
|
-
url: string,
|
|
73
|
-
): Promise<CloneProjectResult> {
|
|
74
|
-
const clonedPath = await Create.cloneProject(url, rootPath);
|
|
75
|
-
const scanned = await scanForProjects(clonedPath);
|
|
76
|
-
|
|
77
|
-
const registered: { prefix: string; name: string }[] = [];
|
|
78
|
-
const skippedDuplicates: string[] = [];
|
|
79
|
-
|
|
80
|
-
for (const project of scanned) {
|
|
81
|
-
if (registry.has(project.prefix)) {
|
|
82
|
-
skippedDuplicates.push(project.prefix);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
const commands = new CommandManager(project.path, registry.options);
|
|
86
|
-
await commands.initialize();
|
|
87
|
-
registry.add(project.prefix, commands);
|
|
88
|
-
registered.push({
|
|
89
|
-
prefix: project.prefix,
|
|
90
|
-
name: project.name,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
projects: registered,
|
|
96
|
-
...(skippedDuplicates.length > 0 && { skippedDuplicates }),
|
|
22
|
+
name: params.name,
|
|
23
|
+
category: params.category || undefined,
|
|
24
|
+
description: params.description || undefined,
|
|
25
|
+
failures,
|
|
26
|
+
warnings,
|
|
97
27
|
};
|
|
98
28
|
}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
4
|
import { Hono } from 'hono';
|
|
15
5
|
import * as reportService from './service.js';
|
|
@@ -50,10 +40,10 @@ router.post(
|
|
|
50
40
|
requireRole(UserRole.Admin),
|
|
51
41
|
zValidator('json', createReportSchema),
|
|
52
42
|
async (c) => {
|
|
53
|
-
const
|
|
43
|
+
const ws = c.get('ws');
|
|
54
44
|
const { identifier } = c.req.valid('json');
|
|
55
45
|
|
|
56
|
-
await reportService.createReport(
|
|
46
|
+
await reportService.createReport(ws, identifier);
|
|
57
47
|
return c.json({ message: 'Report created successfully' });
|
|
58
48
|
},
|
|
59
49
|
);
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
4
|
import { z } from 'zod';
|
|
15
5
|
import { identifierSchema } from '../../common/validationSchemas.js';
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
|
-
import type {
|
|
4
|
+
import type { Workspace } from '@cyberismo/data-handler';
|
|
15
5
|
|
|
16
|
-
export async function createReport(
|
|
17
|
-
|
|
18
|
-
reportName: string,
|
|
19
|
-
) {
|
|
20
|
-
await commands.createCmd.createReport(reportName);
|
|
6
|
+
export async function createReport(ws: Workspace, reportName: string) {
|
|
7
|
+
await ws.resources.create(reportName, 'reports', {});
|
|
21
8
|
}
|