@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
|
|
4
|
+
import { DomainError } from '@cyberismo/data-handler';
|
|
5
|
+
import {
|
|
6
|
+
ERROR_HTTP_STATUS,
|
|
7
|
+
type ErrorBody,
|
|
8
|
+
type ErrorCode,
|
|
9
|
+
} from '@cyberismo/model';
|
|
10
|
+
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The HTTP response for an error that reached the edge. Only a DomainError's
|
|
14
|
+
* domain 'code' picks the status; anything else is a 500.
|
|
15
|
+
*/
|
|
16
|
+
export function errorResponse(error: Error): {
|
|
17
|
+
status: ContentfulStatusCode;
|
|
18
|
+
body: ErrorBody;
|
|
19
|
+
} {
|
|
20
|
+
const message = error.message || 'Internal Server Error';
|
|
21
|
+
if (error instanceof DomainError) {
|
|
22
|
+
return {
|
|
23
|
+
status: ERROR_HTTP_STATUS[error.code] as ContentfulStatusCode,
|
|
24
|
+
body: {
|
|
25
|
+
error: message,
|
|
26
|
+
code: error.code,
|
|
27
|
+
message,
|
|
28
|
+
...(error.details && { details: error.details }),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
status: 500,
|
|
34
|
+
body: { error: message, code: 'internal', message },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The body of an error the edge decides itself. */
|
|
39
|
+
export function errorBody(
|
|
40
|
+
code: ErrorCode,
|
|
41
|
+
message: string,
|
|
42
|
+
details?: Record<string, unknown>,
|
|
43
|
+
): ErrorBody {
|
|
44
|
+
return { error: message, code, message, ...(details && { details }) };
|
|
45
|
+
}
|
|
@@ -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.
|
|
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
|
|
3
|
+
|
|
13
4
|
import { z } from 'zod';
|
|
14
5
|
import { Validate } from '@cyberismo/data-handler';
|
|
15
6
|
|
package/src/domain/auth/index.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 { Hono } from 'hono';
|
|
15
5
|
import { getCurrentUser } from '../../middleware/auth.js';
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
4
|
import { Hono } from 'hono';
|
|
15
5
|
import * as calculationService from './service.js';
|
|
@@ -50,10 +40,10 @@ router.post(
|
|
|
50
40
|
requireRole(UserRole.Admin, [UserRole.Connector]),
|
|
51
41
|
zValidator('json', createCalculationSchema),
|
|
52
42
|
async (c) => {
|
|
53
|
-
const
|
|
43
|
+
const ws = c.get('ws');
|
|
54
44
|
const { identifier } = c.req.valid('json');
|
|
55
45
|
|
|
56
|
-
await calculationService.createCalculation(
|
|
46
|
+
await calculationService.createCalculation(ws, identifier);
|
|
57
47
|
return c.json({ message: 'Calculation created successfully' });
|
|
58
48
|
},
|
|
59
49
|
);
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
-
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
-
the terms of the GNU Affero General Public License version 3 as published by
|
|
6
|
-
the Free Software Foundation.
|
|
7
|
-
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
8
|
-
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
9
|
-
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
10
|
-
details. You should have received a copy of the GNU Affero General Public
|
|
11
|
-
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Cyberismo Ltd and contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
13
3
|
|
|
14
4
|
import { z } from 'zod';
|
|
15
5
|
|
|
@@ -1,17 +1,7 @@
|
|
|
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
|
import { updateResourceWithOperation } from '../resources/service.js';
|
|
16
6
|
|
|
17
7
|
/**
|
|
@@ -22,17 +12,14 @@ function capitalize(str: string): string {
|
|
|
22
12
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
23
13
|
}
|
|
24
14
|
|
|
25
|
-
export async function createCalculation(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
) {
|
|
29
|
-
await commands.atomic(async () => {
|
|
30
|
-
await commands.createCmd.createCalculation(identifier);
|
|
15
|
+
export async function createCalculation(ws: Workspace, identifier: string) {
|
|
16
|
+
await ws.atomic(async () => {
|
|
17
|
+
await ws.resources.create(identifier, 'calculations', {});
|
|
31
18
|
|
|
32
19
|
// Set displayName to capitalized version of identifier
|
|
33
|
-
const project = await
|
|
20
|
+
const project = await ws.settings.info();
|
|
34
21
|
await updateResourceWithOperation(
|
|
35
|
-
|
|
22
|
+
ws,
|
|
36
23
|
{ prefix: project.prefix, type: 'calculations', identifier },
|
|
37
24
|
{
|
|
38
25
|
updateKey: { key: 'displayName' },
|
|
@@ -1,17 +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
4
|
import { Hono } from 'hono';
|
|
5
|
+
import { ResourceNotFoundError } from '@cyberismo/data-handler';
|
|
15
6
|
import * as cardTypeService from './service.js';
|
|
16
7
|
import {
|
|
17
8
|
createCardTypeSchema,
|
|
@@ -39,10 +30,10 @@ const router = new Hono();
|
|
|
39
30
|
* description: project_path not set or other internal error
|
|
40
31
|
*/
|
|
41
32
|
router.get('/', requireRole(UserRole.Reader), async (c) => {
|
|
42
|
-
const
|
|
33
|
+
const ws = c.get('ws');
|
|
43
34
|
|
|
44
35
|
try {
|
|
45
|
-
const cardTypes = await cardTypeService.getCardTypes(
|
|
36
|
+
const cardTypes = await cardTypeService.getCardTypes(ws);
|
|
46
37
|
return c.json(cardTypes);
|
|
47
38
|
} catch (error) {
|
|
48
39
|
return c.json(
|
|
@@ -87,11 +78,11 @@ router.post(
|
|
|
87
78
|
requireRole(UserRole.Admin),
|
|
88
79
|
zValidator('json', createCardTypeSchema),
|
|
89
80
|
async (c) => {
|
|
90
|
-
const
|
|
81
|
+
const ws = c.get('ws');
|
|
91
82
|
const { identifier, workflowName } = c.req.valid('json');
|
|
92
83
|
|
|
93
84
|
try {
|
|
94
|
-
await cardTypeService.createCardType(
|
|
85
|
+
await cardTypeService.createCardType(ws, identifier, workflowName);
|
|
95
86
|
return c.json({ message: 'Card type created successfully' });
|
|
96
87
|
} catch (error) {
|
|
97
88
|
return c.json(
|
|
@@ -153,16 +144,15 @@ router.patch(
|
|
|
153
144
|
zValidator('param', cardTypeNameParamSchema),
|
|
154
145
|
zValidator('json', fieldVisibilityBodySchema),
|
|
155
146
|
async (c) => {
|
|
156
|
-
const
|
|
147
|
+
const ws = c.get('ws');
|
|
157
148
|
const { cardTypeName } = c.req.valid('param');
|
|
158
149
|
const body = c.req.valid('json');
|
|
159
150
|
|
|
160
151
|
try {
|
|
161
|
-
await cardTypeService.updateFieldVisibility(
|
|
152
|
+
await cardTypeService.updateFieldVisibility(ws, cardTypeName, body);
|
|
162
153
|
return c.json({ message: 'Field visibility updated successfully' });
|
|
163
154
|
} catch (error) {
|
|
164
|
-
|
|
165
|
-
if (error instanceof Error && error.message.includes('does not exist')) {
|
|
155
|
+
if (error instanceof ResourceNotFoundError) {
|
|
166
156
|
return c.json({ error: error.message }, 404);
|
|
167
157
|
}
|
|
168
158
|
return c.json(
|
|
@@ -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.
|
|
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
|
|
3
|
+
|
|
13
4
|
import { z } from 'zod';
|
|
14
5
|
import { identifierSchema } from '../../common/validationSchemas.js';
|
|
15
6
|
|
|
@@ -1,31 +1,26 @@
|
|
|
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 {
|
|
4
|
+
import {
|
|
5
|
+
ResourceNotFoundError,
|
|
6
|
+
resourceName,
|
|
7
|
+
type Workspace,
|
|
8
|
+
} from '@cyberismo/data-handler';
|
|
15
9
|
import type { VisibilityGroup, FieldVisibilityBody } from './schema.js';
|
|
16
10
|
|
|
17
|
-
export async function getCardTypes(
|
|
18
|
-
const cardTypesWithDetails =
|
|
19
|
-
await commands.showCmd.showCardTypesWithDetails();
|
|
11
|
+
export async function getCardTypes(ws: Workspace) {
|
|
12
|
+
const cardTypesWithDetails = await ws.resources.contents('cardTypes');
|
|
20
13
|
return cardTypesWithDetails;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
export async function createCardType(
|
|
24
|
-
|
|
17
|
+
ws: Workspace,
|
|
25
18
|
cardTypeName: string,
|
|
26
19
|
workflowName: string,
|
|
27
20
|
) {
|
|
28
|
-
await
|
|
21
|
+
await ws.resources.create(cardTypeName, 'cardTypes', {
|
|
22
|
+
workflow: workflowName,
|
|
23
|
+
});
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
const groupToKey: Record<Exclude<VisibilityGroup, 'hidden'>, string> = {
|
|
@@ -48,19 +43,16 @@ function getCurrentGroup(
|
|
|
48
43
|
* Handles moving fields between visibility groups and reordering within groups.
|
|
49
44
|
*/
|
|
50
45
|
export async function updateFieldVisibility(
|
|
51
|
-
|
|
46
|
+
ws: Workspace,
|
|
52
47
|
cardTypeName: string,
|
|
53
48
|
body: FieldVisibilityBody,
|
|
54
49
|
): Promise<void> {
|
|
55
50
|
const { fieldName, group: targetGroup, index: targetIndex } = body;
|
|
56
51
|
const target = resourceName(cardTypeName);
|
|
57
52
|
|
|
58
|
-
await
|
|
53
|
+
await ws.atomic(async () => {
|
|
59
54
|
// Read is now inside the write lock
|
|
60
|
-
const cardType = await
|
|
61
|
-
cardTypeName,
|
|
62
|
-
'cardTypes',
|
|
63
|
-
);
|
|
55
|
+
const cardType = await ws.resources.show(cardTypeName, 'cardTypes');
|
|
64
56
|
if (!cardType) {
|
|
65
57
|
throw new Error(`Card type '${cardTypeName}' not found`);
|
|
66
58
|
}
|
|
@@ -74,7 +66,8 @@ export async function updateFieldVisibility(
|
|
|
74
66
|
(f: { name: string }) => f.name === fieldName,
|
|
75
67
|
);
|
|
76
68
|
if (!fieldExists) {
|
|
77
|
-
throw new
|
|
69
|
+
throw new ResourceNotFoundError(
|
|
70
|
+
fieldName,
|
|
78
71
|
`Field '${fieldName}' does not exist in card type '${cardTypeName}'. `,
|
|
79
72
|
);
|
|
80
73
|
}
|
|
@@ -88,7 +81,7 @@ export async function updateFieldVisibility(
|
|
|
88
81
|
// If same group, just handle reordering
|
|
89
82
|
if (currentGroup === targetGroup) {
|
|
90
83
|
if (targetGroup !== 'hidden' && targetIndex !== undefined) {
|
|
91
|
-
await
|
|
84
|
+
await ws.changes.apply({
|
|
92
85
|
kind: 'edit',
|
|
93
86
|
target,
|
|
94
87
|
updateKey: { key: groupToKey[targetGroup] },
|
|
@@ -100,7 +93,7 @@ export async function updateFieldVisibility(
|
|
|
100
93
|
|
|
101
94
|
// Remove from current group (if not hidden)
|
|
102
95
|
if (currentGroup !== 'hidden') {
|
|
103
|
-
await
|
|
96
|
+
await ws.changes.apply({
|
|
104
97
|
kind: 'edit',
|
|
105
98
|
target,
|
|
106
99
|
updateKey: { key: groupToKey[currentGroup] },
|
|
@@ -110,7 +103,7 @@ export async function updateFieldVisibility(
|
|
|
110
103
|
|
|
111
104
|
// Add to new group (if not hidden)
|
|
112
105
|
if (targetGroup !== 'hidden') {
|
|
113
|
-
await
|
|
106
|
+
await ws.changes.apply({
|
|
114
107
|
kind: 'edit',
|
|
115
108
|
target,
|
|
116
109
|
updateKey: { key: groupToKey[targetGroup] },
|
|
@@ -118,7 +111,7 @@ export async function updateFieldVisibility(
|
|
|
118
111
|
});
|
|
119
112
|
|
|
120
113
|
if (targetIndex !== undefined) {
|
|
121
|
-
await
|
|
114
|
+
await ws.changes.apply({
|
|
122
115
|
kind: 'edit',
|
|
123
116
|
target,
|
|
124
117
|
updateKey: { key: groupToKey[targetGroup] },
|