@cyberismo/backend 1.2.0 → 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/dist/app.d.ts +5 -15
- package/dist/app.js +28 -38
- package/dist/app.js.map +1 -1
- package/dist/auth/index.d.ts +0 -12
- package/dist/auth/index.js +2 -12
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/keycloak.d.ts +0 -12
- package/dist/auth/keycloak.js +2 -12
- package/dist/auth/keycloak.js.map +1 -1
- package/dist/auth/mock.d.ts +0 -12
- package/dist/auth/mock.js +2 -12
- package/dist/auth/mock.js.map +1 -1
- package/dist/auth/types.d.ts +0 -12
- 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 -102
- 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 -126
- 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 +6 -12
- package/dist/domain/cards/schema.js.map +1 -1
- package/dist/domain/cards/service.d.ts +28 -32
- package/dist/domain/cards/service.js +119 -83
- 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 +0 -12
- package/dist/domain/events/index.js +3 -13
- package/dist/domain/events/index.js.map +1 -1
- package/dist/domain/events/lifetime.d.ts +0 -12
- package/dist/domain/events/lifetime.js +2 -12
- package/dist/domain/events/lifetime.js.map +1 -1
- package/dist/domain/events/project-events.d.ts +10 -14
- package/dist/domain/events/project-events.js +22 -18
- package/dist/domain/events/project-events.js.map +1 -1
- package/dist/domain/events/schema.d.ts +0 -12
- package/dist/domain/events/schema.js +2 -12
- package/dist/domain/events/schema.js.map +1 -1
- 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 +30 -40
- package/dist/domain/project/index.js.map +1 -1
- package/dist/domain/project/schema.d.ts +0 -12
- package/dist/domain/project/schema.js +2 -12
- package/dist/domain/project/schema.js.map +1 -1
- package/dist/domain/project/service.d.ts +16 -28
- package/dist/domain/project/service.js +48 -58
- package/dist/domain/project/service.js.map +1 -1
- package/dist/domain/projects/index.d.ts +2 -14
- package/dist/domain/projects/index.js +19 -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 +19 -26
- package/dist/domain/resources/index.js.map +1 -1
- package/dist/domain/resources/schema.js +2 -0
- package/dist/domain/resources/schema.js.map +1 -1
- package/dist/domain/resources/service.d.ts +11 -23
- package/dist/domain/resources/service.js +48 -59
- package/dist/domain/resources/service.js.map +1 -1
- package/dist/domain/skills/index.d.ts +0 -12
- package/dist/domain/skills/index.js +4 -14
- package/dist/domain/skills/index.js.map +1 -1
- package/dist/domain/skills/schema.d.ts +0 -12
- package/dist/domain/skills/schema.js +2 -12
- package/dist/domain/skills/schema.js.map +1 -1
- package/dist/domain/skills/service.d.ts +2 -14
- package/dist/domain/skills/service.js +4 -14
- package/dist/domain/skills/service.js.map +1 -1
- 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 +6 -20
- package/dist/export.js +19 -29
- package/dist/export.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.js +19 -43
- package/dist/index.js.map +1 -1
- package/dist/main.js +19 -30
- package/dist/main.js.map +1 -1
- package/dist/middleware/auth.d.ts +0 -12
- package/dist/middleware/auth.js +2 -12
- package/dist/middleware/auth.js.map +1 -1
- package/dist/middleware/commandManager.d.ts +15 -20
- package/dist/middleware/commandManager.js +27 -36
- 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 +4 -16
- package/dist/overlay.js +22 -17
- package/dist/overlay.js.map +1 -1
- package/dist/public/THIRD-PARTY.txt +1397 -286
- 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-SVP7TREG-CIQMl7hl.js → chunk-2E7WHVMD-6aqPk-Hk.js} +4 -4
- package/dist/public/assets/chunk-4EMNKR2T-vovNSAaE.js +1 -0
- package/dist/public/assets/{chunk-F27PBJKO-tDfs6zeO.js → chunk-55XCU76K-DXkKnt2y.js} +1 -1
- 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-B7bWyHjt.js → chunk-XXDRQBXY-BUghdEVl.js} +1 -1
- 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-5FMLGOSQ-_V_nrIhD.js → cynefinDiagram-WF24UDRP-b_Ia8gQX.js} +1 -1
- 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-VX7I27RA-De_UQv8C.js → diagram-CBK3MWTC-OaKd5avy.js} +13 -13
- package/dist/public/assets/diagram-I5XIIV2D-Cmu5z1ad.js +24 -0
- package/dist/public/assets/{diagram-S7CK7UJ4-25IjIKyo.js → diagram-ODIL2UCW-Cz1kkDDX.js} +7 -7
- package/dist/public/assets/diagram-PFBEJUXE-faMkmqUW.js +3 -0
- package/dist/public/assets/{diagram-UQ7AKVKN-C5VvsV7x.js → diagram-RJA3I4VV-nycvfte-.js} +2 -2
- package/dist/public/assets/diagram-TYUNFSNR-CjEv5QCm.js +200 -0
- package/dist/public/assets/{dist-BDCdLWk4.js → dist-DGs_yUrP.js} +1 -1
- 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-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-5VMMS53U-KvT4DU1u.js → ishikawaDiagram-HPEHV2GE-_Y3Fr0hu.js} +6 -6
- package/dist/public/assets/{journeyDiagram-3NMN7TZE-PhGRkXkq.js → journeyDiagram-BOSHW7O7-Bo55jJ4m.js} +39 -39
- 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/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-AXDQQJYC-B9dlNtZl.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/{sankeyDiagram-P5KCCOFB-C4rb2pZ9.js → sankeyDiagram-SY24JHO5-C4g0OwZ9.js} +7 -7
- package/dist/public/assets/sequenceDiagram-BLEHNHQU-CEvy4P-b.js +169 -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-VM6X3IG4-BOXpwLCv.js → wardleyDiagram-IVAIDKWA-DURB7Ue6.js} +4 -4
- package/dist/public/assets/xychartDiagram-4URNHDU4-BiZywfhy.js +7 -0
- package/dist/public/index.html +27 -21
- package/dist/public/sbom.cdx.json +1 -1
- 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 +13 -12
- package/src/app.ts +33 -43
- package/src/auth/index.ts +2 -12
- package/src/auth/keycloak.ts +2 -12
- package/src/auth/mock.ts +2 -12
- package/src/auth/types.ts +2 -12
- 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 -128
- package/src/domain/cards/lib.ts +9 -161
- package/src/domain/cards/mermaid.ts +25 -0
- package/src/domain/cards/schema.ts +8 -12
- package/src/domain/cards/service.ts +165 -118
- 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 +3 -13
- package/src/domain/events/lifetime.ts +2 -12
- package/src/domain/events/project-events.ts +30 -18
- package/src/domain/events/schema.ts +2 -12
- 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 +34 -40
- package/src/domain/project/schema.ts +2 -12
- package/src/domain/project/service.ts +56 -71
- package/src/domain/projects/index.ts +34 -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 +19 -30
- package/src/domain/resources/schema.ts +3 -0
- package/src/domain/resources/service.ts +55 -90
- package/src/domain/skills/index.ts +4 -14
- package/src/domain/skills/schema.ts +2 -12
- package/src/domain/skills/service.ts +5 -15
- 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 +24 -33
- package/src/index.ts +29 -48
- package/src/main.ts +25 -35
- package/src/middleware/auth.ts +2 -12
- package/src/middleware/commandManager.ts +35 -50
- package/src/middleware/tree.ts +3 -0
- package/src/middleware/zvalidator.ts +3 -0
- package/src/overlay.ts +29 -19
- package/src/types.ts +2 -12
- package/src/utils.ts +26 -46
- package/dist/project-errors.d.ts +0 -18
- package/dist/project-errors.js +0 -25
- package/dist/project-errors.js.map +0 -1
- package/dist/project-registry.d.ts +0 -65
- package/dist/project-registry.js +0 -121
- package/dist/project-registry.js.map +0 -1
- package/dist/public/assets/__vite-browser-external-PaJ7c2l8.js +0 -1
- package/dist/public/assets/abnfDiagram-VCTEODGH-DB2dfOGe.js +0 -1
- package/dist/public/assets/architecture-7GRP2DOG-2V0X8hxt.js +0 -1
- package/dist/public/assets/architectureDiagram-5GKGNRK7-CRhUR2Ul.js +0 -36
- package/dist/public/assets/blockDiagram-I7D4REHJ-DJKsYF1v.js +0 -129
- package/dist/public/assets/c4Diagram-7LVT6UL2-BTwMzoAF.js +0 -38
- package/dist/public/assets/channel-C0JtPpMA.js +0 -1
- package/dist/public/assets/chunk-4HAMMTFA-DjjgrBsB.js +0 -62
- package/dist/public/assets/chunk-75Z2AOVW-CKqXRGJV.js +0 -2
- package/dist/public/assets/chunk-DU6HZSFF-iJGdiRt7.js +0 -127
- package/dist/public/assets/chunk-FOHPRMQF-DzxwRta7.js +0 -161
- package/dist/public/assets/chunk-GMAD6QVW-DxHVEaGj.js +0 -72
- package/dist/public/assets/chunk-GVQU2GXP-AMxD4_Ta.js +0 -1
- package/dist/public/assets/chunk-IMKFNOWR-0rz8QrYC.js +0 -231
- package/dist/public/assets/chunk-L3NEJ4N5-BK3KAKMe.js +0 -1
- package/dist/public/assets/chunk-OSK3NFVY-B8MdrI_M.js +0 -10
- package/dist/public/assets/chunk-P2QGCYS3-D3J5AcHg.js +0 -1
- package/dist/public/assets/chunk-POPQ4Y6H-CsYg_XkK.js +0 -1
- package/dist/public/assets/chunk-PWAF6VOD-D9cdEIZp.js +0 -1
- package/dist/public/assets/chunk-SHT3W25Y-1jjokCf3.js +0 -168
- package/dist/public/assets/chunk-TICWLB2K-Ccsy2PYz.js +0 -206
- package/dist/public/assets/classDiagram-ZZMXUADV-mWyXNAXi.js +0 -1
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-mWyXNAXi.js +0 -1
- package/dist/public/assets/cose-bilkent-JH36ORCC-DPzc3Pv4.js +0 -1
- package/dist/public/assets/cynefin-OW5HDTMX-BIVDCYOU.js +0 -1
- package/dist/public/assets/cytoscape.esm-NgwPT4ez.js +0 -321
- package/dist/public/assets/dagre-C-rnJpZF.js +0 -1
- package/dist/public/assets/dagre-GXQ25YYZ-CJc0wc6f.js +0 -4
- package/dist/public/assets/diagram-VSXAHHWV-Dw3rKVL_.js +0 -3
- package/dist/public/assets/diagram-Z3DM3KII-Bd-65QQW.js +0 -24
- package/dist/public/assets/ebnfDiagram-PWID7BFC-CrxdET5U.js +0 -1
- package/dist/public/assets/erDiagram-RLTQ6QDP-BKo0Uyna.js +0 -99
- package/dist/public/assets/eventmodeling-NTZA5JFV-DKkAdJZd.js +0 -1
- package/dist/public/assets/flowDiagram-HODETNUW-CEE2wjdt.js +0 -1
- package/dist/public/assets/ganttDiagram-EL5Y4UJY-BHFn8vk0.js +0 -292
- package/dist/public/assets/gitGraph-4MIJSDKK-Bpvnb45u.js +0 -1
- package/dist/public/assets/gitGraphDiagram-WWUBYQGX-Bw0EoxBY.js +0 -106
- package/dist/public/assets/index-D3HS7YxF.js +0 -2228
- package/dist/public/assets/index-Sv3WxZ_8.css +0 -1
- package/dist/public/assets/info-A6RAGUB7-BvvG_zrk.js +0 -1
- package/dist/public/assets/infoDiagram-27XIBGKW-CtpdJmtL.js +0 -2
- package/dist/public/assets/kanban-definition-UXKFOSKX-Oyx5QgRq.js +0 -89
- package/dist/public/assets/katex-ZlcWpGUi.js +0 -257
- package/dist/public/assets/line-Dr41HTk1.js +0 -1
- package/dist/public/assets/linear-DDBi9FwZ.js +0 -1
- package/dist/public/assets/mermaid-parser.core-DsIAxDBa.js +0 -7
- package/dist/public/assets/mindmap-definition-YA3MSWOX-r8hvd6gP.js +0 -96
- package/dist/public/assets/packet-AYTQ26CC-B0EpJ2Sc.js +0 -1
- package/dist/public/assets/pegDiagram-XKGWAZYB-DaNkQTQF.js +0 -1
- package/dist/public/assets/pie-WAS4IAKB-Dt2zttL9.js +0 -1
- package/dist/public/assets/pieDiagram-E7YTZNPT-x0XWEGbd.js +0 -39
- package/dist/public/assets/radar-RG4KPBEZ-DjbR4-5l.js +0 -1
- package/dist/public/assets/railroad-74A4TZTK-Bk3B5r_R.js +0 -1
- package/dist/public/assets/railroad-abnf-HS5TGJTU-DxaWfACD.js +0 -1
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-DscxXZO0.js +0 -1
- package/dist/public/assets/railroad-peg-WCYAUIDC-BCWzRFzw.js +0 -1
- package/dist/public/assets/railroadDiagram-O6MQD6OU-DhwsoX6A.js +0 -1
- package/dist/public/assets/requirementDiagram-BXWQKSXE-BiqZ6axf.js +0 -84
- package/dist/public/assets/rolldown-runtime-B0Z9INg1.js +0 -1
- package/dist/public/assets/sequenceDiagram-WJ2MYXX4-DRKTnGD7.js +0 -162
- package/dist/public/assets/src-an_qrnIj.js +0 -1
- package/dist/public/assets/stateDiagram-D77RDMKH-xxdybg5Z.js +0 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-CXzmJy_a.js +0 -1
- package/dist/public/assets/swimlanes-42K2YHIH-DyGI1gI6.js +0 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-7hqb6VoW.js +0 -8
- package/dist/public/assets/timeline-definition-24CTP7MA-C2pIp77Q.js +0 -120
- package/dist/public/assets/treeView-Q6P3EWNA-CxRtaaB8.js +0 -1
- package/dist/public/assets/treemap-WGGIJYW6-G1IHiwTa.js +0 -1
- package/dist/public/assets/vennDiagram-4TSXK5OY-CwimQRR9.js +0 -34
- package/dist/public/assets/wardley-WFR3VGLG-DkQ3TjZX.js +0 -1
- package/dist/public/assets/xychartDiagram-S5SC5T6Z-ChOPYsHc.js +0 -7
- package/src/project-errors.ts +0 -33
- package/src/project-registry.ts +0 -161
|
@@ -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 createWorkflow(
|
|
17
|
-
|
|
18
|
-
workflowName: string,
|
|
19
|
-
) {
|
|
20
|
-
await commands.createCmd.createWorkflow(workflowName, '');
|
|
6
|
+
export async function createWorkflow(ws: Workspace, workflowName: string) {
|
|
7
|
+
await ws.resources.create(workflowName, 'workflows', {});
|
|
21
8
|
}
|
package/src/export.ts
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
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 fs from 'node:fs/promises';
|
|
15
5
|
|
|
16
|
-
import
|
|
6
|
+
import {
|
|
7
|
+
SYSTEM_ACTOR,
|
|
8
|
+
type ProjectDirectory,
|
|
9
|
+
type Workspace,
|
|
10
|
+
} from '@cyberismo/data-handler';
|
|
17
11
|
import { createApp } from './app.js';
|
|
18
12
|
import { MockAuthProvider } from './auth/mock.js';
|
|
19
|
-
import type { ProjectRegistry } from './project-registry.js';
|
|
20
13
|
import { cp } from 'node:fs/promises';
|
|
21
14
|
import { staticFrontendDirRelative } from './utils.js';
|
|
22
|
-
import type { QueryResult } from '@cyberismo/
|
|
15
|
+
import type { QueryResult, ProjectErrors } from '@cyberismo/model';
|
|
23
16
|
import { toSSG } from 'hono/ssg';
|
|
24
17
|
import type { TreeOptions } from './types.js';
|
|
25
|
-
import type { ProjectErrors } from './project-errors.js';
|
|
26
18
|
import {
|
|
27
19
|
findAllCards,
|
|
28
20
|
findRelevantAttachments,
|
|
29
21
|
} from './domain/cards/service.js';
|
|
22
|
+
import { CARD_ROUTES_PER_KEY } from './domain/cards/lib.js';
|
|
30
23
|
|
|
31
24
|
export interface ExportSiteOptions extends TreeOptions {
|
|
32
25
|
defaultProject?: string;
|
|
@@ -48,19 +41,19 @@ export function reset() {
|
|
|
48
41
|
/**
|
|
49
42
|
* Get the card query result for a given card key. Should only be called during
|
|
50
43
|
* static site generation
|
|
51
|
-
* @param
|
|
44
|
+
* @param ws - Handle of the project.
|
|
52
45
|
* @param cardKey - Key of the card to get the query result for.
|
|
53
46
|
* @returns The card query result for the given card key.
|
|
54
47
|
*/
|
|
55
48
|
export async function getCardQueryResult(
|
|
56
|
-
|
|
49
|
+
ws: Workspace,
|
|
57
50
|
cardKey?: string,
|
|
58
51
|
): Promise<QueryResult<'card'>[]> {
|
|
59
|
-
const prefix =
|
|
52
|
+
const prefix = ws.settings.prefix;
|
|
60
53
|
if (!_cardQueryCache.has(prefix)) {
|
|
61
54
|
_cardQueryCache.set(
|
|
62
55
|
prefix,
|
|
63
|
-
|
|
56
|
+
ws.queries.runQuery('card', 'exportedSite', {}),
|
|
64
57
|
);
|
|
65
58
|
}
|
|
66
59
|
return _cardQueryCache.get(prefix)!.then((results) => {
|
|
@@ -78,7 +71,7 @@ export async function getCardQueryResult(
|
|
|
78
71
|
/**
|
|
79
72
|
* Export the site to a given directory.
|
|
80
73
|
* Note: Do not call this function in parallel.
|
|
81
|
-
* @param
|
|
74
|
+
* @param directory - Directory the exported projects are opened from.
|
|
82
75
|
* @param exportDir - Directory to export to.
|
|
83
76
|
* @param options - Export options.
|
|
84
77
|
* @param options.recursive - Whether to export cards recursively.
|
|
@@ -88,7 +81,7 @@ export async function getCardQueryResult(
|
|
|
88
81
|
* @returns Errors that occurred during export, grouped by project.
|
|
89
82
|
*/
|
|
90
83
|
export async function exportSite(
|
|
91
|
-
|
|
84
|
+
directory: ProjectDirectory,
|
|
92
85
|
exportDir?: string,
|
|
93
86
|
options?: ExportSiteOptions,
|
|
94
87
|
onProgress?: (current: number, total: number) => void,
|
|
@@ -100,12 +93,10 @@ export async function exportSite(
|
|
|
100
93
|
...treeOpts,
|
|
101
94
|
};
|
|
102
95
|
|
|
103
|
-
|
|
96
|
+
const prefixes = (await directory.list()).map((p) => p.prefix);
|
|
97
|
+
if (defaultProject && !prefixes.includes(defaultProject)) {
|
|
104
98
|
throw new Error(
|
|
105
|
-
`Default project '${defaultProject}' is not in the registry. Available: ${
|
|
106
|
-
.list()
|
|
107
|
-
.map((p) => p.prefix)
|
|
108
|
-
.join(', ')}`,
|
|
99
|
+
`Default project '${defaultProject}' is not in the registry. Available: ${prefixes.join(', ')}`,
|
|
109
100
|
);
|
|
110
101
|
}
|
|
111
102
|
|
|
@@ -113,7 +104,7 @@ export async function exportSite(
|
|
|
113
104
|
process.env.CYBERISMO_DEFAULT_PROJECT = defaultProject;
|
|
114
105
|
}
|
|
115
106
|
|
|
116
|
-
const app = createApp(new MockAuthProvider(),
|
|
107
|
+
const app = createApp(new MockAuthProvider(), directory, opts, prefixes);
|
|
117
108
|
|
|
118
109
|
// copy whole frontend to the same directory
|
|
119
110
|
await cp(staticFrontendDirRelative, exportDir, { recursive: true });
|
|
@@ -122,16 +113,16 @@ export async function exportSite(
|
|
|
122
113
|
|
|
123
114
|
// estimate total based on the number of cards to export across all projects
|
|
124
115
|
let total = OVERHEAD_CALLS;
|
|
125
|
-
for (const
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
116
|
+
for (const prefix of prefixes) {
|
|
117
|
+
const ws = await directory.open(prefix, SYSTEM_ACTOR);
|
|
118
|
+
const cards = await findAllCards(ws, opts);
|
|
119
|
+
const attachments = await findRelevantAttachments(ws, opts);
|
|
120
|
+
total += cards.length * CARD_ROUTES_PER_KEY + attachments.length;
|
|
129
121
|
}
|
|
130
122
|
|
|
131
123
|
// One pass per project so an error is attributed to the project whose route
|
|
132
124
|
// produced it (the response itself carries no project). Shared routes get
|
|
133
125
|
// their own pass so each route is emitted exactly once.
|
|
134
|
-
const prefixes = registry.list().map((p) => p.prefix);
|
|
135
126
|
const projectOf = (pathname: string) =>
|
|
136
127
|
prefixes.find((p) => {
|
|
137
128
|
const base = `/api/projects/${p}`;
|
package/src/index.ts
CHANGED
|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
*/
|
|
13
|
-
import { serve } from '@hono/node-server';
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
|
|
14
4
|
import type { Env, Schema } from 'hono';
|
|
15
5
|
import { Hono } from 'hono';
|
|
16
6
|
import { serveStatic } from '@hono/node-server/serve-static';
|
|
17
7
|
import path from 'node:path';
|
|
18
8
|
import { readFile } from 'node:fs/promises';
|
|
19
|
-
import {
|
|
9
|
+
import { listen } from './utils.js';
|
|
20
10
|
import { startPolicyPolling } from './overlay.js';
|
|
21
11
|
import { createApp } from './app.js';
|
|
22
12
|
import type { AuthProvider } from './auth/types.js';
|
|
23
|
-
import type {
|
|
13
|
+
import type { ProjectDirectory } from '@cyberismo/data-handler';
|
|
24
14
|
export { MockAuthProvider } from './auth/mock.js';
|
|
25
15
|
export type { MockUserConfig } from './auth/mock.js';
|
|
26
16
|
export type { AuthProvider } from './auth/types.js';
|
|
27
17
|
export { exportSite, type ExportSiteOptions } from './export.js';
|
|
28
|
-
export { ProjectRegistry } from './project-registry.js';
|
|
29
|
-
export { formatProjectErrors, type ProjectErrors } from './project-errors.js';
|
|
30
18
|
|
|
31
19
|
const DEFAULT_PORT = 3000;
|
|
32
|
-
const
|
|
20
|
+
const MAX_PORT_ATTEMPTS = 100;
|
|
33
21
|
|
|
34
22
|
/**
|
|
35
23
|
* Preview the exported site
|
|
@@ -47,60 +35,53 @@ export async function previewSite(dir: string, findPort: boolean = true) {
|
|
|
47
35
|
return c.html(file.toString());
|
|
48
36
|
});
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (findPort) {
|
|
53
|
-
port = await findFreePort(port, DEFAULT_MAX_PORT);
|
|
54
|
-
}
|
|
55
|
-
startApp(app, port);
|
|
38
|
+
const port = parseInt(process.env.PORT || DEFAULT_PORT.toString(), 10);
|
|
39
|
+
await startApp(app, port, findPort);
|
|
56
40
|
}
|
|
57
41
|
|
|
58
42
|
/**
|
|
59
43
|
* Start the server
|
|
60
44
|
* @param authProvider - Authentication provider
|
|
61
|
-
* @param
|
|
45
|
+
* @param directory - Directory the projects are opened from
|
|
62
46
|
* @param findPort - If true, find a free port
|
|
63
47
|
*/
|
|
64
48
|
export async function startServer(
|
|
65
49
|
authProvider: AuthProvider,
|
|
66
|
-
|
|
50
|
+
directory: ProjectDirectory,
|
|
67
51
|
findPort: boolean = true,
|
|
68
52
|
multiProjectRoot?: string,
|
|
69
53
|
) {
|
|
70
54
|
const useOsAssigned = process.env.CYBERISMO_E2E_OSPORT === 'true';
|
|
71
|
-
|
|
55
|
+
const port = useOsAssigned
|
|
72
56
|
? 0
|
|
73
57
|
: parseInt(process.env.PORT || DEFAULT_PORT.toString(), 10);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
startPolicyPolling(() => registry.list().map((p) => ({ prefix: p.prefix })));
|
|
58
|
+
startPolicyPolling(async () =>
|
|
59
|
+
(await directory.list()).map((p) => ({ prefix: p.prefix })),
|
|
60
|
+
);
|
|
78
61
|
const app = createApp(
|
|
79
62
|
authProvider,
|
|
80
|
-
|
|
63
|
+
directory,
|
|
64
|
+
undefined,
|
|
81
65
|
undefined,
|
|
82
|
-
false,
|
|
83
66
|
multiProjectRoot,
|
|
84
67
|
);
|
|
85
|
-
startApp(app, port);
|
|
68
|
+
await startApp(app, port, findPort && !useOsAssigned);
|
|
86
69
|
}
|
|
87
70
|
|
|
88
|
-
function startApp<E extends Env, S extends Schema, P extends string>(
|
|
71
|
+
async function startApp<E extends Env, S extends Schema, P extends string>(
|
|
89
72
|
app: Hono<E, S, P>,
|
|
90
73
|
port: number,
|
|
74
|
+
findPort: boolean,
|
|
91
75
|
) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
(info) => {
|
|
99
|
-
console.log(`Running Cyberismo app on http://localhost:${info.port}`);
|
|
100
|
-
console.log('Press Control+C to stop.');
|
|
101
|
-
// When spawned with stdio: [..., 'ipc'], publish the bound port to the parent.
|
|
102
|
-
// No-op in normal startup (process.send is undefined without an IPC channel).
|
|
103
|
-
process.send?.({ type: 'listening', port: info.port });
|
|
104
|
-
},
|
|
76
|
+
const bound = await listen(
|
|
77
|
+
app.fetch,
|
|
78
|
+
port,
|
|
79
|
+
process.env.HOST || '127.0.0.1',
|
|
80
|
+
findPort ? port + MAX_PORT_ATTEMPTS : port,
|
|
105
81
|
);
|
|
82
|
+
console.log(`Running Cyberismo app on http://localhost:${bound.port}`);
|
|
83
|
+
console.log('Press Control+C to stop.');
|
|
84
|
+
// When spawned with stdio: [..., 'ipc'], publish the bound port to the parent.
|
|
85
|
+
// No-op in normal startup (process.send is undefined without an IPC channel).
|
|
86
|
+
process.send?.({ type: 'listening', port: bound.port });
|
|
106
87
|
}
|
package/src/main.ts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
*/
|
|
13
|
-
import { scanForProjects } from '@cyberismo/data-handler';
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
|
|
4
|
+
import { localFolder } from '@cyberismo/data-handler';
|
|
14
5
|
import { startServer } from './index.js';
|
|
15
6
|
import { exportSite } from './export.js';
|
|
16
7
|
import { MockAuthProvider } from './auth/mock.js';
|
|
17
8
|
import { KeycloakAuthProvider } from './auth/keycloak.js';
|
|
18
9
|
import type { AuthProvider } from './auth/types.js';
|
|
19
|
-
import {
|
|
20
|
-
import { formatProjectErrors } from './project-errors.js';
|
|
10
|
+
import { formatProjectErrors } from '@cyberismo/model';
|
|
21
11
|
import { gitOptionsFromEnv } from './utils.js';
|
|
22
12
|
import { parseArgs } from 'node:util';
|
|
23
13
|
import dotenv from 'dotenv';
|
|
@@ -60,9 +50,21 @@ function createAuthProvider(): AuthProvider {
|
|
|
60
50
|
}
|
|
61
51
|
|
|
62
52
|
const projectPath = process.env.npm_config_project_path || process.cwd();
|
|
63
|
-
|
|
53
|
+
|
|
54
|
+
const { values: args } = parseArgs({
|
|
55
|
+
options: {
|
|
56
|
+
export: { type: 'boolean', default: false },
|
|
57
|
+
'default-project': { type: 'string' },
|
|
58
|
+
},
|
|
59
|
+
strict: false,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
let opened;
|
|
64
63
|
try {
|
|
65
|
-
|
|
64
|
+
opened = await localFolder(
|
|
65
|
+
projectPath,
|
|
66
|
+
args.export ? undefined : gitOptionsFromEnv(),
|
|
67
|
+
);
|
|
66
68
|
} catch (error) {
|
|
67
69
|
console.error(
|
|
68
70
|
error instanceof Error
|
|
@@ -71,17 +73,11 @@ try {
|
|
|
71
73
|
);
|
|
72
74
|
process.exit(1);
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
const { values: args } = parseArgs({
|
|
76
|
-
options: {
|
|
77
|
-
export: { type: 'boolean', default: false },
|
|
78
|
-
'default-project': { type: 'string' },
|
|
79
|
-
},
|
|
80
|
-
strict: false,
|
|
81
|
-
});
|
|
76
|
+
const { directory, failed } = opened;
|
|
82
77
|
|
|
83
78
|
if (args.export) {
|
|
84
|
-
|
|
79
|
+
const projects = await directory.list();
|
|
80
|
+
if (projects.length === 0 && failed.length === 0) {
|
|
85
81
|
console.error('No projects found to export.');
|
|
86
82
|
process.exit(1);
|
|
87
83
|
}
|
|
@@ -89,16 +85,14 @@ if (args.export) {
|
|
|
89
85
|
typeof args['default-project'] === 'string'
|
|
90
86
|
? args['default-project']
|
|
91
87
|
: undefined;
|
|
92
|
-
const { registry, failed } =
|
|
93
|
-
await ProjectRegistry.fromScannedProjects(projects);
|
|
94
88
|
if (
|
|
95
|
-
|
|
89
|
+
projects.length === 0 ||
|
|
96
90
|
failed.some((f) => f.prefix === defaultProject)
|
|
97
91
|
) {
|
|
98
92
|
console.error(formatProjectErrors(failed));
|
|
99
93
|
process.exit(1);
|
|
100
94
|
}
|
|
101
|
-
const { errors: exportErrors } = await exportSite(
|
|
95
|
+
const { errors: exportErrors } = await exportSite(directory, undefined, {
|
|
102
96
|
defaultProject,
|
|
103
97
|
});
|
|
104
98
|
const errors = [...failed, ...exportErrors];
|
|
@@ -107,13 +101,9 @@ if (args.export) {
|
|
|
107
101
|
process.exit(1);
|
|
108
102
|
}
|
|
109
103
|
} else {
|
|
110
|
-
const { registry, failed } = await ProjectRegistry.fromScannedProjects(
|
|
111
|
-
projects,
|
|
112
|
-
gitOptionsFromEnv(),
|
|
113
|
-
);
|
|
114
104
|
if (failed.length > 0) {
|
|
115
105
|
console.error(formatProjectErrors(failed));
|
|
116
106
|
}
|
|
117
107
|
const authProvider = createAuthProvider();
|
|
118
|
-
await startServer(authProvider,
|
|
108
|
+
await startServer(authProvider, directory, true, projectPath);
|
|
119
109
|
}
|
package/src/middleware/auth.ts
CHANGED
|
@@ -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. This program is distributed in the hope that it
|
|
7
|
-
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
8
|
-
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
-
See the GNU Affero General Public License for more details.
|
|
10
|
-
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 type { Context, MiddlewareHandler } from 'hono';
|
|
15
5
|
import type { UserInfo } from '../types.js';
|
|
@@ -1,81 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
-
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
-
|
|
9
|
-
You should have received a copy of the GNU Affero General Public
|
|
10
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
12
3
|
|
|
13
4
|
import type { Context, MiddlewareHandler } from 'hono';
|
|
14
|
-
import type {
|
|
5
|
+
import type { ActorRef } from '@cyberismo/model';
|
|
6
|
+
import type { ProjectDirectory, Workspace } from '@cyberismo/data-handler';
|
|
15
7
|
import { getCurrentUser } from './auth.js';
|
|
16
|
-
import type
|
|
8
|
+
import { UserRole, type UserInfo } from '../types.js';
|
|
17
9
|
import type { ProjectEvents } from '../domain/events/project-events.js';
|
|
10
|
+
import type { EventsByProject } from '../domain/events/events-by-project.js';
|
|
18
11
|
|
|
19
12
|
// Extend Hono Context type to include our custom properties
|
|
20
13
|
declare module 'hono' {
|
|
21
14
|
interface ContextVariableMap {
|
|
22
|
-
|
|
15
|
+
ws: Workspace;
|
|
23
16
|
events: ProjectEvents;
|
|
24
17
|
projectPath: string;
|
|
25
|
-
|
|
18
|
+
directory: ProjectDirectory;
|
|
19
|
+
eventsByProject: EventsByProject;
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
22
|
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
) {
|
|
37
|
-
const user = getCurrentUser(c);
|
|
38
|
-
if (!user) {
|
|
39
|
-
throw new Error('CommandManager expects a user');
|
|
40
|
-
}
|
|
41
|
-
c.set('commands', commands);
|
|
42
|
-
c.set('projectPath', commands.project.basePath);
|
|
43
|
-
await commands.runAsAuthor({ name: user.name, email: user.email }, () =>
|
|
44
|
-
next(),
|
|
45
|
-
);
|
|
23
|
+
/** The actor a user acts as. */
|
|
24
|
+
export function actorOf(user: UserInfo): ActorRef {
|
|
25
|
+
return {
|
|
26
|
+
kind: user.role === UserRole.Connector ? 'connector' : 'user',
|
|
27
|
+
id: user.id,
|
|
28
|
+
name: user.name,
|
|
29
|
+
};
|
|
46
30
|
}
|
|
47
31
|
|
|
48
|
-
// TODO: Remove once MCP is made project-scoped via attachProjectRegistry
|
|
49
|
-
export const attachCommandManager = (
|
|
50
|
-
commands: CommandManager,
|
|
51
|
-
): MiddlewareHandler => {
|
|
52
|
-
return (c, next) => runWithCommands(c, commands, next);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
32
|
/**
|
|
56
|
-
* Middleware that
|
|
57
|
-
*
|
|
33
|
+
* Middleware that opens the authenticated user's handle over the project
|
|
34
|
+
* and puts it, with the project's events and the directory, on the context.
|
|
35
|
+
* An unknown project is refused with ProjectNotFoundError (404).
|
|
58
36
|
*
|
|
59
|
-
* @param
|
|
37
|
+
* @param directory - Directory the project is opened from.
|
|
38
|
+
* @param events - Events of the directory's projects.
|
|
60
39
|
* @param fixedPrefix - When provided, used instead of the `:prefix` route
|
|
61
40
|
* param. This is needed in export/SSG mode where routes are mounted at
|
|
62
41
|
* concrete paths (e.g. `/api/projects/decision/...`) with no dynamic param.
|
|
63
42
|
*/
|
|
64
|
-
export const
|
|
65
|
-
|
|
43
|
+
export const attachProjectDirectory = (
|
|
44
|
+
directory: ProjectDirectory,
|
|
45
|
+
events: EventsByProject,
|
|
66
46
|
fixedPrefix?: string,
|
|
67
47
|
): MiddlewareHandler => {
|
|
68
48
|
return async (c: Context, next) => {
|
|
69
|
-
c.set('registry', registry);
|
|
70
49
|
const prefix = c.req.param('prefix') ?? fixedPrefix;
|
|
71
50
|
if (!prefix) {
|
|
72
51
|
return c.json({ error: 'Project prefix is required' }, 400);
|
|
73
52
|
}
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
|
|
53
|
+
const user = getCurrentUser(c);
|
|
54
|
+
if (!user) {
|
|
55
|
+
throw new Error('A project handle expects a user');
|
|
77
56
|
}
|
|
78
|
-
|
|
79
|
-
|
|
57
|
+
const identity = { name: user.name, email: user.email };
|
|
58
|
+
const ws = await directory.open(prefix, actorOf(user), identity);
|
|
59
|
+
c.set('directory', directory);
|
|
60
|
+
c.set('eventsByProject', events);
|
|
61
|
+
c.set('events', await events.for(prefix));
|
|
62
|
+
c.set('ws', ws);
|
|
63
|
+
c.set('projectPath', ws.path);
|
|
64
|
+
await next();
|
|
80
65
|
};
|
|
81
66
|
};
|
package/src/middleware/tree.ts
CHANGED
package/src/overlay.ts
CHANGED
|
@@ -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. This program is distributed in the hope that it
|
|
7
|
-
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
8
|
-
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
-
See the GNU Affero General Public License for more details.
|
|
10
|
-
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
|
/**
|
|
15
5
|
* Which projects, or the whole instance, are read-only.
|
|
@@ -20,7 +10,10 @@
|
|
|
20
10
|
*/
|
|
21
11
|
|
|
22
12
|
import { z } from 'zod';
|
|
23
|
-
import
|
|
13
|
+
import {
|
|
14
|
+
ProjectNotFoundError,
|
|
15
|
+
type ProjectDirectory,
|
|
16
|
+
} from '@cyberismo/data-handler';
|
|
24
17
|
|
|
25
18
|
const POLL_INTERVAL_MS = 10_000;
|
|
26
19
|
const FETCH_TIMEOUT_MS = 2_000;
|
|
@@ -91,7 +84,7 @@ async function reportProjects(
|
|
|
91
84
|
}
|
|
92
85
|
|
|
93
86
|
export function startPolicyPolling(
|
|
94
|
-
projects: () => { prefix: string }[] = () => [],
|
|
87
|
+
projects: () => Promise<{ prefix: string }[]> = async () => [],
|
|
95
88
|
): void {
|
|
96
89
|
const base = process.env.CYBERISMO_OVERLAY_URL;
|
|
97
90
|
if (!base) return;
|
|
@@ -127,7 +120,7 @@ export function startPolicyPolling(
|
|
|
127
120
|
// is registered within one interval.
|
|
128
121
|
let lastReportFailure: string | undefined;
|
|
129
122
|
const report = async () => {
|
|
130
|
-
const current = projects();
|
|
123
|
+
const current = await projects();
|
|
131
124
|
if (current.length === 0) return;
|
|
132
125
|
try {
|
|
133
126
|
await reportProjects(base, token, current);
|
|
@@ -166,10 +159,27 @@ export function startPolicyPolling(
|
|
|
166
159
|
* cannot see which one a call touches. Making a frozen project unresolvable
|
|
167
160
|
* fails closed, at the cost of hiding it from reads and from administrators too.
|
|
168
161
|
*/
|
|
169
|
-
export function writableProjects(
|
|
162
|
+
export function writableProjects(
|
|
163
|
+
directory: ProjectDirectory,
|
|
164
|
+
): ProjectDirectory {
|
|
170
165
|
return {
|
|
171
|
-
|
|
172
|
-
isProjectReadOnly(prefix)
|
|
173
|
-
|
|
166
|
+
open: async (prefix, actor, identity) => {
|
|
167
|
+
if (isProjectReadOnly(prefix)) {
|
|
168
|
+
throw new ProjectNotFoundError(prefix);
|
|
169
|
+
}
|
|
170
|
+
return directory.open(prefix, actor, identity);
|
|
171
|
+
},
|
|
172
|
+
list: async () =>
|
|
173
|
+
(await directory.list()).filter((p) => !isProjectReadOnly(p.prefix)),
|
|
174
|
+
create: (params, actor, identity) =>
|
|
175
|
+
directory.create(params, actor, identity),
|
|
176
|
+
clone: (url) => directory.clone(url),
|
|
177
|
+
rename: async (prefix, newPrefix, actor, identity, options) => {
|
|
178
|
+
if (isProjectReadOnly(prefix)) {
|
|
179
|
+
throw new ProjectNotFoundError(prefix);
|
|
180
|
+
}
|
|
181
|
+
return directory.rename(prefix, newPrefix, actor, identity, options);
|
|
182
|
+
},
|
|
183
|
+
replace: (prefix) => directory.replace(prefix),
|
|
174
184
|
};
|
|
175
185
|
}
|
package/src/types.ts
CHANGED
|
@@ -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 type { Context } from 'hono';
|
|
15
5
|
|