@cyberismo/backend 1.2.0 → 1.3.1
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 +31 -44
- 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/frontend.d.ts +22 -0
- package/dist/frontend.js +51 -0
- package/dist/frontend.js.map +1 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +22 -48
- 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 +37 -52
- 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/frontend.ts +58 -0
- package/src/index.ts +32 -53
- 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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Regex that matches standard AsciiDoc mermaid diagram blocks.
|
|
6
|
+
* Supports [mermaid], [mermaid,id], [mermaid,id,format=svg], etc.
|
|
7
|
+
* Matches both literal blocks (....) and listing blocks (----).
|
|
8
|
+
* Supports both LF and CRLF line endings.
|
|
9
|
+
*/
|
|
10
|
+
const MERMAID_BLOCK_REGEX =
|
|
11
|
+
/\[mermaid[^\]]*\]\r?\n(\.{4,}|-{4,})\r?\n([\s\S]*?)\r?\n\1/g;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Pre-processes AsciiDoc content to convert [mermaid] blocks into passthrough HTML
|
|
15
|
+
* that can be detected and rendered by the frontend.
|
|
16
|
+
* This must run BEFORE asciidoctor.js converts the AsciiDoc to HTML.
|
|
17
|
+
* @param content - Raw AsciiDoc content
|
|
18
|
+
* @returns AsciiDoc content with mermaid blocks replaced by passthrough HTML divs
|
|
19
|
+
*/
|
|
20
|
+
export function preprocessMermaidBlocksForHtml(content: string): string {
|
|
21
|
+
return content.replace(MERMAID_BLOCK_REGEX, (_match, _delim, code) => {
|
|
22
|
+
const encoded = Buffer.from(code, 'utf-8').toString('base64');
|
|
23
|
+
return `++++\n<div class="mermaid-block" data-mermaid-code="${encoded}"></div>\n++++`;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -1,18 +1,10 @@
|
|
|
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
|
|
|
6
|
+
export const cardKeyParamSchema = z.object({ key: z.string().min(1) });
|
|
7
|
+
|
|
16
8
|
const linkDirection = z.enum(['outbound', 'inbound']);
|
|
17
9
|
|
|
18
10
|
export const createLinkSchema = z.object({
|
|
@@ -56,3 +48,7 @@ export const exportCardPdfSchema = z.object({
|
|
|
56
48
|
});
|
|
57
49
|
|
|
58
50
|
export type ExportCardPdfRequestBody = z.infer<typeof exportCardPdfSchema>;
|
|
51
|
+
|
|
52
|
+
export const cardBatchSchema = z.object({
|
|
53
|
+
keys: z.array(z.string()).min(1).max(100),
|
|
54
|
+
});
|
|
@@ -1,37 +1,130 @@
|
|
|
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 {
|
|
5
|
+
AttachmentContent,
|
|
6
|
+
Card,
|
|
15
7
|
ExportPdfOptions,
|
|
16
8
|
MetadataContent,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { type
|
|
20
|
-
import { preprocessMermaidBlocksForHtml } from '
|
|
21
|
-
import { rewriteAsciidocCardXrefs } from '@cyberismo/data-handler/utils/asciidoc-xref';
|
|
9
|
+
QueryResult,
|
|
10
|
+
} from '@cyberismo/model';
|
|
11
|
+
import { AsciidoctorPdfError, type Workspace } from '@cyberismo/data-handler';
|
|
12
|
+
import { preprocessMermaidBlocksForHtml } from './mermaid.js';
|
|
22
13
|
import { allCards } from './lib.js';
|
|
14
|
+
import { getCardQueryResult } from '../../export.js';
|
|
23
15
|
import type { TreeOptions } from '../../types.js';
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
type RenderMode = 'inject' | 'staticSite';
|
|
18
|
+
|
|
19
|
+
async function renderAdoc(
|
|
20
|
+
ws: Workspace,
|
|
21
|
+
key: string,
|
|
22
|
+
content: string,
|
|
23
|
+
mode: RenderMode,
|
|
24
|
+
fallback?: string,
|
|
25
|
+
): Promise<string> {
|
|
26
|
+
let { content: asciidocContent } = await ws.render.macros(content, {
|
|
27
|
+
context: mode === 'staticSite' ? 'exportedSite' : 'localApp',
|
|
28
|
+
mode,
|
|
29
|
+
cardKey: key,
|
|
30
|
+
fallback,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Convert [mermaid] AsciiDoc blocks to passthrough HTML before asciidoctor processes them
|
|
34
|
+
asciidocContent = preprocessMermaidBlocksForHtml(asciidocContent);
|
|
35
|
+
|
|
36
|
+
// Rewrite native AsciiDoc xrefs that target other cards into
|
|
37
|
+
// /projects/<prefix>/cards/<key> links.
|
|
38
|
+
return ws.render.xrefs(asciidocContent, mode);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function getCardData(
|
|
42
|
+
ws: Workspace,
|
|
43
|
+
key: string,
|
|
44
|
+
staticMode: boolean,
|
|
45
|
+
): Promise<QueryResult<'card'>> {
|
|
46
|
+
return ws.consistent(async () => {
|
|
47
|
+
// The key reaches the logic program unchecked; details() rejects unknown keys first.
|
|
48
|
+
await ws.cards.details(key);
|
|
49
|
+
const card = staticMode
|
|
50
|
+
? await getCardQueryResult(ws, key)
|
|
51
|
+
: await ws.queries.runQuery('card', 'localApp', { cardKey: key });
|
|
52
|
+
if (card.length !== 1) {
|
|
53
|
+
throw new Error('Query failed. Check card-query syntax');
|
|
54
|
+
}
|
|
55
|
+
// Hidden fields stay off the static site; the card view never shows them.
|
|
56
|
+
const data = staticMode
|
|
57
|
+
? { ...card[0], fields: card[0].fields.filter((f) => f.visibility) }
|
|
58
|
+
: card[0];
|
|
59
|
+
return data;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** One solve for many cards; keys the project does not hold are left out. */
|
|
64
|
+
export async function getCardBatch(
|
|
65
|
+
ws: Workspace,
|
|
66
|
+
keys: string[],
|
|
67
|
+
): Promise<Record<string, QueryResult<'card'>>> {
|
|
68
|
+
return ws.consistent(async () => {
|
|
69
|
+
// The keys reach the logic program unchecked; only known ones go through.
|
|
70
|
+
const cardKeys = [...new Set(keys)].filter((key) => ws.cards.has(key));
|
|
71
|
+
// The card query reads an empty list as no list and answers every card.
|
|
72
|
+
if (cardKeys.length === 0) {
|
|
73
|
+
return {};
|
|
74
|
+
}
|
|
75
|
+
const cards = await ws.queries.runQuery('card', 'localApp', { cardKeys });
|
|
76
|
+
return Object.fromEntries(cards.map((card) => [card.key, card]));
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export async function getCardContent(
|
|
81
|
+
ws: Workspace,
|
|
82
|
+
key: string,
|
|
83
|
+
staticMode: boolean,
|
|
84
|
+
): Promise<{ adocContent: string }> {
|
|
85
|
+
return ws.consistent(async () => {
|
|
86
|
+
const card = await ws.cards.details(key);
|
|
87
|
+
const adocContent = await renderAdoc(
|
|
88
|
+
ws,
|
|
89
|
+
key,
|
|
90
|
+
card.content || '',
|
|
91
|
+
staticMode ? 'staticSite' : 'inject',
|
|
92
|
+
'',
|
|
93
|
+
);
|
|
94
|
+
return { adocContent };
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// The static site publishes no more of the stored card than its card view reads.
|
|
99
|
+
type StaticCardSource = Pick<Card, 'key' | 'path' | 'content' | 'attachments'>;
|
|
100
|
+
|
|
101
|
+
export async function getCardSource(
|
|
102
|
+
ws: Workspace,
|
|
103
|
+
key: string,
|
|
104
|
+
staticMode: boolean,
|
|
105
|
+
): Promise<Card | StaticCardSource> {
|
|
106
|
+
const card = await ws.cards.details(key);
|
|
107
|
+
if (!staticMode) {
|
|
108
|
+
return card;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
key: card.key,
|
|
112
|
+
path: card.path,
|
|
113
|
+
content: card.content,
|
|
114
|
+
attachments: card.attachments,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export async function getProjectInfo(ws: Workspace) {
|
|
119
|
+
return ws.consistent(async () => {
|
|
120
|
+
const projectResponse = await ws.settings.info();
|
|
28
121
|
|
|
29
|
-
const workflowsResponse = await
|
|
122
|
+
const workflowsResponse = await ws.resources.contents('workflows');
|
|
30
123
|
if (!workflowsResponse) {
|
|
31
124
|
throw new Error('No workflows found');
|
|
32
125
|
}
|
|
33
126
|
|
|
34
|
-
const cardTypesResponse = await
|
|
127
|
+
const cardTypesResponse = await ws.resources.contents('cardTypes');
|
|
35
128
|
if (!cardTypesResponse) {
|
|
36
129
|
throw new Error('No card types found');
|
|
37
130
|
}
|
|
@@ -46,55 +139,48 @@ export async function getProjectInfo(commands: CommandManager) {
|
|
|
46
139
|
}
|
|
47
140
|
|
|
48
141
|
export async function updateCard(
|
|
49
|
-
|
|
142
|
+
ws: Workspace,
|
|
50
143
|
key: string,
|
|
51
144
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
145
|
body: any,
|
|
53
|
-
): Promise<
|
|
54
|
-
|
|
55
|
-
await commands.atomic(async () => {
|
|
146
|
+
): Promise<void> {
|
|
147
|
+
await ws.atomic(async () => {
|
|
56
148
|
if (body.state) {
|
|
57
|
-
await
|
|
58
|
-
written = true;
|
|
149
|
+
await ws.cards.transition(key, body.state);
|
|
59
150
|
}
|
|
60
151
|
if (body.content != null) {
|
|
61
|
-
await
|
|
62
|
-
written = true;
|
|
152
|
+
await ws.cards.edit(key, body.content);
|
|
63
153
|
}
|
|
64
154
|
if (body.metadata) {
|
|
65
155
|
for (const [metadataKey, metadataValue] of Object.entries(
|
|
66
156
|
body.metadata,
|
|
67
157
|
)) {
|
|
68
|
-
await
|
|
158
|
+
await ws.cards.editField(
|
|
69
159
|
key,
|
|
70
160
|
metadataKey,
|
|
71
|
-
metadataValue as MetadataContent,
|
|
161
|
+
metadataValue as Exclude<MetadataContent, bigint>,
|
|
72
162
|
);
|
|
73
|
-
written = true;
|
|
74
163
|
}
|
|
75
164
|
}
|
|
76
165
|
if (body.parent) {
|
|
77
|
-
await
|
|
78
|
-
written = true;
|
|
166
|
+
await ws.cards.move(key, body.parent);
|
|
79
167
|
}
|
|
80
168
|
if (body.index != null) {
|
|
81
|
-
await
|
|
82
|
-
written = true;
|
|
169
|
+
await ws.cards.rankAt(key, body.index);
|
|
83
170
|
}
|
|
84
171
|
}, `Update card ${key}`);
|
|
85
|
-
return written;
|
|
86
172
|
}
|
|
87
173
|
|
|
88
|
-
export async function deleteCard(
|
|
89
|
-
await
|
|
174
|
+
export async function deleteCard(ws: Workspace, key: string) {
|
|
175
|
+
await ws.cards.remove(key);
|
|
90
176
|
}
|
|
91
177
|
|
|
92
178
|
export async function createCard(
|
|
93
|
-
|
|
179
|
+
ws: Workspace,
|
|
94
180
|
template: string,
|
|
95
181
|
parentKey?: string,
|
|
96
182
|
) {
|
|
97
|
-
const result = await
|
|
183
|
+
const result = await ws.cards.create(
|
|
98
184
|
template,
|
|
99
185
|
parentKey === 'root' ? undefined : parentKey,
|
|
100
186
|
);
|
|
@@ -106,20 +192,16 @@ export async function createCard(
|
|
|
106
192
|
}
|
|
107
193
|
|
|
108
194
|
export async function uploadAttachments(
|
|
109
|
-
|
|
195
|
+
ws: Workspace,
|
|
110
196
|
key: string,
|
|
111
197
|
files: File[],
|
|
112
198
|
) {
|
|
113
199
|
const succeeded: string[] = [];
|
|
114
|
-
await
|
|
200
|
+
await ws.atomic(async () => {
|
|
115
201
|
for (const file of files) {
|
|
116
202
|
if (file instanceof File) {
|
|
117
203
|
const buffer = await file.arrayBuffer();
|
|
118
|
-
await
|
|
119
|
-
key,
|
|
120
|
-
file.name,
|
|
121
|
-
Buffer.from(buffer),
|
|
122
|
-
);
|
|
204
|
+
await ws.cards.addAttachment(key, file.name, Buffer.from(buffer));
|
|
123
205
|
succeeded.push(file.name);
|
|
124
206
|
}
|
|
125
207
|
}
|
|
@@ -139,50 +221,27 @@ function validateAttachmentFileName(filename: string): void {
|
|
|
139
221
|
}
|
|
140
222
|
|
|
141
223
|
export async function removeAttachment(
|
|
142
|
-
|
|
224
|
+
ws: Workspace,
|
|
143
225
|
key: string,
|
|
144
226
|
filename: string,
|
|
145
227
|
) {
|
|
146
228
|
validateAttachmentFileName(filename);
|
|
147
|
-
await
|
|
229
|
+
await ws.cards.removeAttachment(key, filename);
|
|
148
230
|
return { message: 'Attachment removed successfully' };
|
|
149
231
|
}
|
|
150
232
|
|
|
151
233
|
export async function parseContent(
|
|
152
|
-
|
|
234
|
+
ws: Workspace,
|
|
153
235
|
key: string,
|
|
154
236
|
content: string,
|
|
155
237
|
) {
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
asciidocContent = await evaluateMacros(content, {
|
|
160
|
-
context: 'localApp',
|
|
161
|
-
mode: 'inject',
|
|
162
|
-
project: commands.project,
|
|
163
|
-
cardKey: key,
|
|
164
|
-
});
|
|
165
|
-
} catch (error) {
|
|
166
|
-
asciidocContent = `Macro error: ${error instanceof Error ? error.message : 'Unknown error'}\n\n${content}`;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Convert [mermaid] AsciiDoc blocks to passthrough HTML before asciidoctor processes them
|
|
170
|
-
asciidocContent = preprocessMermaidBlocksForHtml(asciidocContent);
|
|
171
|
-
|
|
172
|
-
// Rewrite native AsciiDoc xrefs that target other cards into
|
|
173
|
-
// /projects/<prefix>/cards/<key> links.
|
|
174
|
-
asciidocContent = rewriteAsciidocCardXrefs(
|
|
175
|
-
asciidocContent,
|
|
176
|
-
commands.project,
|
|
177
|
-
'inject',
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
return { adocContent: asciidocContent };
|
|
181
|
-
});
|
|
238
|
+
return ws.consistent(async () => ({
|
|
239
|
+
adocContent: await renderAdoc(ws, key, content, 'inject'),
|
|
240
|
+
}));
|
|
182
241
|
}
|
|
183
242
|
|
|
184
243
|
export async function createLink(
|
|
185
|
-
|
|
244
|
+
ws: Workspace,
|
|
186
245
|
key: string,
|
|
187
246
|
target: string,
|
|
188
247
|
linkType: string,
|
|
@@ -194,19 +253,13 @@ export async function createLink(
|
|
|
194
253
|
const source = direction === 'outbound' ? key : target;
|
|
195
254
|
const destination = direction === 'outbound' ? target : key;
|
|
196
255
|
|
|
197
|
-
await
|
|
198
|
-
source,
|
|
199
|
-
destination,
|
|
200
|
-
linkType,
|
|
201
|
-
description,
|
|
202
|
-
direction,
|
|
203
|
-
);
|
|
256
|
+
await ws.cards.addLink(source, destination, linkType, description, direction);
|
|
204
257
|
|
|
205
258
|
return { message: 'Link created successfully' };
|
|
206
259
|
}
|
|
207
260
|
|
|
208
261
|
export async function removeLink(
|
|
209
|
-
|
|
262
|
+
ws: Workspace,
|
|
210
263
|
key: string,
|
|
211
264
|
target: string,
|
|
212
265
|
linkType: string,
|
|
@@ -217,18 +270,12 @@ export async function removeLink(
|
|
|
217
270
|
// For inbound: target is source, key is destination
|
|
218
271
|
const source = direction === 'outbound' ? key : target;
|
|
219
272
|
const destination = direction === 'outbound' ? target : key;
|
|
220
|
-
await
|
|
221
|
-
'link',
|
|
222
|
-
source,
|
|
223
|
-
destination,
|
|
224
|
-
linkType,
|
|
225
|
-
description,
|
|
226
|
-
);
|
|
273
|
+
await ws.cards.removeLink(source, destination, linkType, description);
|
|
227
274
|
return { message: 'Link removed successfully' };
|
|
228
275
|
}
|
|
229
276
|
|
|
230
277
|
export async function updateLink(
|
|
231
|
-
|
|
278
|
+
ws: Workspace,
|
|
232
279
|
key: string,
|
|
233
280
|
toCard: string,
|
|
234
281
|
linkType: string,
|
|
@@ -241,18 +288,11 @@ export async function updateLink(
|
|
|
241
288
|
) {
|
|
242
289
|
// For simplicity create the new link first so that duplicate-link validation runs before
|
|
243
290
|
// the old link is removed. This also handles direction changes.
|
|
244
|
-
return
|
|
245
|
-
await createLink(
|
|
246
|
-
commands,
|
|
247
|
-
key,
|
|
248
|
-
toCard,
|
|
249
|
-
linkType,
|
|
250
|
-
direction,
|
|
251
|
-
linkDescription,
|
|
252
|
-
);
|
|
291
|
+
return ws.atomic(async () => {
|
|
292
|
+
await createLink(ws, key, toCard, linkType, direction, linkDescription);
|
|
253
293
|
|
|
254
294
|
await removeLink(
|
|
255
|
-
|
|
295
|
+
ws,
|
|
256
296
|
key,
|
|
257
297
|
previousToCard,
|
|
258
298
|
previousLinkType,
|
|
@@ -265,12 +305,12 @@ export async function updateLink(
|
|
|
265
305
|
}
|
|
266
306
|
|
|
267
307
|
export async function getAttachment(
|
|
268
|
-
|
|
308
|
+
ws: Workspace,
|
|
269
309
|
key: string,
|
|
270
310
|
filename: string,
|
|
271
|
-
): Promise<
|
|
311
|
+
): Promise<AttachmentContent> {
|
|
272
312
|
validateAttachmentFileName(filename);
|
|
273
|
-
return
|
|
313
|
+
return ws.cards.attachment(key, filename);
|
|
274
314
|
}
|
|
275
315
|
|
|
276
316
|
/**
|
|
@@ -280,25 +320,25 @@ export async function getAttachment(
|
|
|
280
320
|
* @returns all cards in a flattened array
|
|
281
321
|
*/
|
|
282
322
|
export async function findAllCards(
|
|
283
|
-
|
|
323
|
+
ws: Workspace,
|
|
284
324
|
options?: TreeOptions,
|
|
285
325
|
): ReturnType<typeof allCards> {
|
|
286
|
-
return allCards(
|
|
326
|
+
return allCards(ws, options);
|
|
287
327
|
}
|
|
288
328
|
/**
|
|
289
329
|
* Gets all attachments that are required for rendering the wanted cards
|
|
290
|
-
* @param
|
|
330
|
+
* @param ws the command manager used for the query
|
|
291
331
|
* @param options optional tree query options
|
|
292
332
|
* @returns all attachments for cards returned by the tree query
|
|
293
333
|
*/
|
|
294
334
|
export async function findRelevantAttachments(
|
|
295
|
-
|
|
335
|
+
ws: Workspace,
|
|
296
336
|
options?: TreeOptions,
|
|
297
337
|
) {
|
|
298
338
|
const cards = new Set<string>(
|
|
299
|
-
(await allCards(
|
|
339
|
+
(await allCards(ws, options)).map((c) => c.key),
|
|
300
340
|
);
|
|
301
|
-
const attachments = await
|
|
341
|
+
const attachments = await ws.cards.attachments();
|
|
302
342
|
return attachments
|
|
303
343
|
.filter(
|
|
304
344
|
(attachment) =>
|
|
@@ -311,9 +351,16 @@ export async function findRelevantAttachments(
|
|
|
311
351
|
}
|
|
312
352
|
|
|
313
353
|
export async function exportCard(
|
|
314
|
-
|
|
354
|
+
ws: Workspace,
|
|
315
355
|
options: ExportPdfOptions,
|
|
316
|
-
): Promise<
|
|
317
|
-
|
|
318
|
-
|
|
356
|
+
): Promise<Uint8Array> {
|
|
357
|
+
try {
|
|
358
|
+
return (await ws.export.pdf(options)).pdf;
|
|
359
|
+
} catch (error) {
|
|
360
|
+
// Diagnostics can carry server paths: logged here, never sent.
|
|
361
|
+
if (error instanceof AsciidoctorPdfError) {
|
|
362
|
+
console.error(error.message, error.diagnostics.join('\n'));
|
|
363
|
+
}
|
|
364
|
+
throw error;
|
|
365
|
+
}
|
|
319
366
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
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. 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
|
|
3
|
+
|
|
13
4
|
import { Hono } from 'hono';
|
|
14
5
|
import { isSSGContext } from 'hono/ssg';
|
|
15
6
|
import * as connectorsService from './service.js';
|
|
@@ -31,8 +22,8 @@ router.get('/', requireRole(UserRole.Reader), async (c) => {
|
|
|
31
22
|
if (isSSGContext(c)) {
|
|
32
23
|
return c.json([]);
|
|
33
24
|
}
|
|
34
|
-
const
|
|
35
|
-
const connectors = await connectorsService.getConnectors(
|
|
25
|
+
const ws = c.get('ws');
|
|
26
|
+
const connectors = await connectorsService.getConnectors(ws);
|
|
36
27
|
return c.json(connectors);
|
|
37
28
|
});
|
|
38
29
|
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2024
|
|
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
6
|
export interface ExternalItem {
|
|
17
7
|
key: string;
|
|
@@ -24,13 +14,8 @@ export interface Connector {
|
|
|
24
14
|
items: ExternalItem[];
|
|
25
15
|
}
|
|
26
16
|
|
|
27
|
-
export async function getConnectors(
|
|
28
|
-
|
|
29
|
-
): Promise<Connector[]> {
|
|
30
|
-
const results = await commands.calculateCmd.runQuery(
|
|
31
|
-
'connectors',
|
|
32
|
-
'localApp',
|
|
33
|
-
);
|
|
17
|
+
export async function getConnectors(ws: Workspace): Promise<Connector[]> {
|
|
18
|
+
const results = await ws.queries.runQuery('connectors', 'localApp');
|
|
34
19
|
|
|
35
20
|
// Separate connectors from items based on type field
|
|
36
21
|
const connectorsMap = new Map<string, Connector>();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
|
|
4
|
+
import { SYSTEM_ACTOR, type ProjectDirectory } from '@cyberismo/data-handler';
|
|
5
|
+
import { ProjectEvents } from './project-events.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The events of each project of a directory, by prefix. A project's events
|
|
9
|
+
* follow its changes, read through a system handle, from first use.
|
|
10
|
+
*/
|
|
11
|
+
export class EventsByProject {
|
|
12
|
+
private readonly events = new Map<string, ProjectEvents>();
|
|
13
|
+
|
|
14
|
+
constructor(private readonly directory: ProjectDirectory) {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The events of the project with `prefix`.
|
|
18
|
+
* @throws ProjectNotFoundError if the directory has no such project.
|
|
19
|
+
*/
|
|
20
|
+
async for(prefix: string): Promise<ProjectEvents> {
|
|
21
|
+
const known = this.events.get(prefix);
|
|
22
|
+
if (known) {
|
|
23
|
+
return known;
|
|
24
|
+
}
|
|
25
|
+
const ws = await this.directory.open(prefix, SYSTEM_ACTOR);
|
|
26
|
+
// Another request may have created them while this one waited.
|
|
27
|
+
let events = this.events.get(prefix);
|
|
28
|
+
if (!events) {
|
|
29
|
+
const held = new ProjectEvents(ws.changes);
|
|
30
|
+
this.events.set(prefix, held);
|
|
31
|
+
// An event names the project's prefix once its write is done, so a
|
|
32
|
+
// rename is followed as the directory follows it.
|
|
33
|
+
ws.changes.subscribe(({ project }) => this.follow(held, project));
|
|
34
|
+
events = held;
|
|
35
|
+
}
|
|
36
|
+
return events;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Keeps `events` under `prefix`, its project's prefix now, unless another
|
|
40
|
+
// project's events hold it.
|
|
41
|
+
private follow(events: ProjectEvents, prefix: string) {
|
|
42
|
+
if (this.events.has(prefix)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
for (const [key, held] of this.events) {
|
|
46
|
+
if (held === events) {
|
|
47
|
+
this.events.delete(key);
|
|
48
|
+
this.events.set(prefix, events);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Disposes the project's events, closing their connections. */
|
|
55
|
+
drop(prefix: string) {
|
|
56
|
+
this.events.get(prefix)?.dispose();
|
|
57
|
+
this.events.delete(prefix);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -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 { Hono } from 'hono';
|
|
15
5
|
import { disableSSG } from 'hono/ssg';
|
|
@@ -91,7 +81,7 @@ router.put(
|
|
|
91
81
|
zValidator('json', presenceSchema),
|
|
92
82
|
(c) => {
|
|
93
83
|
const { connectionId, sequence, cardKey, mode } = c.req.valid('json');
|
|
94
|
-
if (cardKey && !c.get('
|
|
84
|
+
if (cardKey && !c.get('ws').cards.has(cardKey)) {
|
|
95
85
|
return c.json({ error: 'Card not found' }, 404);
|
|
96
86
|
}
|
|
97
87
|
const events = c.get('events');
|
|
@@ -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
|
const MAX_LIFETIME_MS = 30 * 60_000;
|
|
15
5
|
const ROTATION_MARGIN_MS = 30_000;
|