@cyberismo/backend 0.0.15 → 0.0.16
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 +21 -0
- package/dist/app.js +9 -3
- package/dist/app.js.map +1 -1
- package/dist/common/validationSchemas.d.ts +48 -0
- package/dist/domain/calculations/index.d.ts +15 -0
- package/dist/domain/calculations/schema.d.ts +16 -0
- package/dist/domain/calculations/service.d.ts +14 -0
- package/dist/domain/cardTypes/index.d.ts +15 -0
- package/dist/domain/cardTypes/schema.d.ts +17 -0
- package/dist/domain/cardTypes/service.d.ts +15 -0
- package/dist/domain/cards/index.d.ts +15 -0
- package/dist/domain/cards/index.js +22 -6
- package/dist/domain/cards/index.js.map +1 -1
- package/dist/domain/cards/lib.d.ts +29 -0
- package/dist/domain/cards/lib.js +73 -2
- package/dist/domain/cards/lib.js.map +1 -1
- package/dist/domain/cards/service.d.ts +61 -0
- package/dist/domain/cards/service.js +20 -12
- package/dist/domain/cards/service.js.map +1 -1
- package/dist/domain/fieldTypes/index.d.ts +15 -0
- package/dist/domain/fieldTypes/schema.d.ts +28 -0
- package/dist/domain/fieldTypes/service.d.ts +16 -0
- package/dist/domain/graphModels/index.d.ts +15 -0
- package/dist/domain/graphModels/schema.d.ts +16 -0
- package/dist/domain/graphModels/service.d.ts +14 -0
- package/dist/domain/graphViews/index.d.ts +15 -0
- package/dist/domain/graphViews/schema.d.ts +4 -0
- package/dist/domain/graphViews/service.d.ts +14 -0
- package/dist/domain/labels/index.d.ts +15 -0
- package/dist/domain/labels/index.js +33 -0
- package/dist/domain/labels/index.js.map +1 -0
- package/dist/domain/labels/service.d.ts +19 -0
- package/dist/domain/labels/service.js +21 -0
- package/dist/domain/labels/service.js.map +1 -0
- package/dist/domain/linkTypes/index.d.ts +15 -0
- package/dist/domain/linkTypes/schema.d.ts +16 -0
- package/dist/domain/linkTypes/service.d.ts +15 -0
- package/dist/domain/logicPrograms/index.d.ts +15 -0
- package/dist/domain/logicPrograms/service.d.ts +15 -0
- package/dist/domain/reports/index.d.ts +15 -0
- package/dist/domain/reports/schema.d.ts +16 -0
- package/dist/domain/reports/service.d.ts +14 -0
- package/dist/domain/resources/index.d.ts +15 -0
- package/dist/domain/resources/schema.d.ts +60 -0
- package/dist/domain/resources/service.d.ts +36 -0
- package/dist/domain/templates/index.d.ts +15 -0
- package/dist/domain/templates/index.js +1 -1
- package/dist/domain/templates/index.js.map +1 -1
- package/dist/domain/templates/schema.d.ts +22 -0
- package/dist/domain/templates/service.d.ts +16 -0
- package/dist/domain/tree/index.d.ts +15 -0
- package/dist/domain/tree/index.js +3 -2
- package/dist/domain/tree/index.js.map +1 -1
- package/dist/domain/tree/service.d.ts +22 -0
- package/dist/domain/tree/service.js +10 -2
- package/dist/domain/tree/service.js.map +1 -1
- package/dist/domain/workflows/index.d.ts +15 -0
- package/dist/domain/workflows/schema.d.ts +16 -0
- package/dist/domain/workflows/service.d.ts +14 -0
- package/dist/export.d.ts +42 -0
- package/dist/export.js +48 -152
- package/dist/export.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/middleware/commandManager.d.ts +20 -0
- package/dist/middleware/tree.d.ts +9 -0
- package/dist/middleware/tree.js +13 -0
- package/dist/middleware/tree.js.map +1 -0
- package/dist/middleware/zvalidator.d.ts +9 -0
- package/dist/public/THIRD-PARTY.txt +53 -53
- package/dist/public/assets/{index-Dtn1rQ-9.js → index-D410yunq.js} +26486 -26409
- package/dist/public/index.html +1 -1
- package/dist/types.d.ts +29 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +0 -32
- package/dist/utils.js.map +1 -1
- package/package.json +6 -6
- package/src/app.ts +11 -4
- package/src/domain/cards/index.ts +31 -6
- package/src/domain/cards/lib.ts +93 -3
- package/src/domain/cards/service.ts +36 -24
- package/src/domain/labels/index.ts +36 -0
- package/src/domain/labels/service.ts +23 -0
- package/src/domain/resources/service.ts +3 -3
- package/src/domain/templates/index.ts +1 -1
- package/src/domain/tree/index.ts +10 -3
- package/src/domain/tree/service.ts +15 -1
- package/src/export.ts +59 -192
- package/src/index.ts +5 -1
- package/src/middleware/tree.ts +17 -0
- package/src/types.ts +13 -0
- package/src/utils.ts +0 -39
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { Hono } from 'hono';
|
|
14
|
+
import type { AppVars, TreeOptions } from './types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Create the Hono app for the backend
|
|
17
|
+
* @param projectPath - Path to the project
|
|
18
|
+
*/
|
|
19
|
+
export declare function createApp(projectPath?: string, opts?: TreeOptions): Hono<{
|
|
20
|
+
Variables: AppVars;
|
|
21
|
+
}, import("hono/types").BlankSchema, "/">;
|
package/dist/app.js
CHANGED
|
@@ -26,21 +26,24 @@ import reportsRouter from './domain/reports/index.js';
|
|
|
26
26
|
import templatesRouter from './domain/templates/index.js';
|
|
27
27
|
import treeRouter from './domain/tree/index.js';
|
|
28
28
|
import workflowsRouter from './domain/workflows/index.js';
|
|
29
|
+
import labelsRouter from './domain/labels/index.js';
|
|
29
30
|
import { readFile } from 'node:fs/promises';
|
|
30
31
|
import path from 'node:path';
|
|
31
|
-
import { isSSGContext } from './export.js';
|
|
32
32
|
import resourcesRouter from './domain/resources/index.js';
|
|
33
33
|
import logicProgramsRouter from './domain/logicPrograms/index.js';
|
|
34
|
+
import { isSSGContext } from 'hono/ssg';
|
|
35
|
+
import treeMiddleware from './middleware/tree.js';
|
|
34
36
|
/**
|
|
35
37
|
* Create the Hono app for the backend
|
|
36
38
|
* @param projectPath - Path to the project
|
|
37
39
|
*/
|
|
38
|
-
export function createApp(projectPath) {
|
|
40
|
+
export function createApp(projectPath, opts) {
|
|
39
41
|
const app = new Hono();
|
|
40
42
|
app.use('/api', cors());
|
|
41
43
|
app.use('*', serveStatic({
|
|
42
44
|
root: staticFrontendDirRelative,
|
|
43
45
|
}));
|
|
46
|
+
app.use(treeMiddleware(opts));
|
|
44
47
|
// Attach CommandManager to all requests
|
|
45
48
|
app.use(attachCommandManager(projectPath));
|
|
46
49
|
// Wire up routes
|
|
@@ -57,6 +60,7 @@ export function createApp(projectPath) {
|
|
|
57
60
|
app.route('/api/workflows', workflowsRouter);
|
|
58
61
|
app.route('/api/resources', resourcesRouter);
|
|
59
62
|
app.route('/api/logicPrograms', logicProgramsRouter);
|
|
63
|
+
app.route('/api/labels', labelsRouter);
|
|
60
64
|
// serve index.html for all other routes
|
|
61
65
|
app.notFound(async (c) => {
|
|
62
66
|
if (c.req.path.startsWith('/api')) {
|
|
@@ -68,7 +72,9 @@ export function createApp(projectPath) {
|
|
|
68
72
|
// Error handling
|
|
69
73
|
app.onError((err, c) => {
|
|
70
74
|
if (!isSSGContext(c)) {
|
|
71
|
-
|
|
75
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
76
|
+
console.error(err.stack);
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
79
|
return c.json({
|
|
74
80
|
error: err.message || 'Internal Server Error',
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AACF,OAAO,EAAE,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AAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACrB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;gBACpC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE,GAAG,CAAC,OAAO,IAAI,uBAAuB;SAC9C,EACD,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
export declare const resourceTypes: readonly ["calculations", "cardTypes", "fieldTypes", "graphModels", "graphViews", "linkTypes", "reports", "templates", "workflows"];
|
|
15
|
+
export declare const identifierSchema: z.ZodString;
|
|
16
|
+
export declare const resourceParamsSchema: z.ZodObject<{
|
|
17
|
+
prefix: z.ZodString;
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
cardTypes: "cardTypes";
|
|
20
|
+
calculations: "calculations";
|
|
21
|
+
fieldTypes: "fieldTypes";
|
|
22
|
+
graphModels: "graphModels";
|
|
23
|
+
graphViews: "graphViews";
|
|
24
|
+
linkTypes: "linkTypes";
|
|
25
|
+
reports: "reports";
|
|
26
|
+
templates: "templates";
|
|
27
|
+
workflows: "workflows";
|
|
28
|
+
}>;
|
|
29
|
+
identifier: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type ResourceParams = z.infer<typeof resourceParamsSchema>;
|
|
32
|
+
export declare const resourceParamsWithCard: z.ZodObject<{
|
|
33
|
+
prefix: z.ZodString;
|
|
34
|
+
identifier: z.ZodString;
|
|
35
|
+
type: z.ZodEnum<{
|
|
36
|
+
cardTypes: "cardTypes";
|
|
37
|
+
calculations: "calculations";
|
|
38
|
+
fieldTypes: "fieldTypes";
|
|
39
|
+
graphModels: "graphModels";
|
|
40
|
+
graphViews: "graphViews";
|
|
41
|
+
linkTypes: "linkTypes";
|
|
42
|
+
reports: "reports";
|
|
43
|
+
templates: "templates";
|
|
44
|
+
workflows: "workflows";
|
|
45
|
+
cards: "cards";
|
|
46
|
+
}>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type ResourceParamsWithCard = z.infer<typeof resourceParamsWithCard>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { Hono } from 'hono';
|
|
14
|
+
declare const router: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
15
|
+
export default router;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
export declare const createCalculationSchema: z.ZodObject<{
|
|
15
|
+
fileName: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import type { CommandManager } from '@cyberismo/data-handler';
|
|
14
|
+
export declare function createCalculation(commands: CommandManager, fileName: string): Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { Hono } from 'hono';
|
|
14
|
+
declare const router: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
15
|
+
export default router;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
export declare const createCardTypeSchema: z.ZodObject<{
|
|
15
|
+
identifier: z.ZodString;
|
|
16
|
+
workflowName: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import type { CommandManager } from '@cyberismo/data-handler';
|
|
14
|
+
export declare function getCardTypes(commands: CommandManager): Promise<(import("@cyberismo/data-handler/interfaces/resource-interfaces").CardType | undefined)[]>;
|
|
15
|
+
export declare function createCardType(commands: CommandManager, cardTypeName: string, workflowName: string): Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { Hono } from 'hono';
|
|
14
|
+
declare const router: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
15
|
+
export default router;
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
12
|
*/
|
|
13
13
|
import { Hono } from 'hono';
|
|
14
|
-
import { ssgParams, isSSGContext } from '../../export.js';
|
|
15
14
|
import { getCardDetails } from './lib.js';
|
|
16
15
|
import * as cardService from './service.js';
|
|
16
|
+
import { isSSGContext, ssgParams } from 'hono/ssg';
|
|
17
17
|
const router = new Hono();
|
|
18
18
|
/**
|
|
19
19
|
* @swagger
|
|
@@ -50,6 +50,12 @@ router.get('/', async (c) => {
|
|
|
50
50
|
* in: path
|
|
51
51
|
* required: true
|
|
52
52
|
* description: Card key (string)
|
|
53
|
+
* - name: raw
|
|
54
|
+
* in: query
|
|
55
|
+
* required: false
|
|
56
|
+
* schema:
|
|
57
|
+
* type: boolean
|
|
58
|
+
* description: When true, returns the raw card data without triggering calculations
|
|
53
59
|
* responses:
|
|
54
60
|
* 200:
|
|
55
61
|
* description: Object containing card details. See lib/api/types.ts/CardResponse for the structure.
|
|
@@ -60,14 +66,16 @@ router.get('/', async (c) => {
|
|
|
60
66
|
*/
|
|
61
67
|
router.get('/:key', ssgParams(async (c) => {
|
|
62
68
|
const commands = c.get('commands');
|
|
63
|
-
const
|
|
64
|
-
|
|
69
|
+
const opts = c.get('tree');
|
|
70
|
+
const cards = await cardService.findAllCards(commands, opts);
|
|
71
|
+
return cards.map((card) => ({ key: card.key }));
|
|
65
72
|
}), async (c) => {
|
|
66
73
|
const key = c.req.param('key');
|
|
67
74
|
if (!key) {
|
|
68
75
|
return c.text('No search key', 400);
|
|
69
76
|
}
|
|
70
|
-
const
|
|
77
|
+
const raw = c.req.query('raw');
|
|
78
|
+
const result = await getCardDetails(c.get('commands'), key, isSSGContext(c), raw?.toLowerCase() === 'true' ? true : false);
|
|
71
79
|
if (result.status === 200) {
|
|
72
80
|
return c.json(result.data);
|
|
73
81
|
}
|
|
@@ -97,6 +105,12 @@ router.get('/:key', ssgParams(async (c) => {
|
|
|
97
105
|
* type: object
|
|
98
106
|
* required: false
|
|
99
107
|
* description: New metadata for the card. Must be an object with key-value pairs.
|
|
108
|
+
* - name: raw
|
|
109
|
+
* in: query
|
|
110
|
+
* required: false
|
|
111
|
+
* schema:
|
|
112
|
+
* type: boolean
|
|
113
|
+
* description: When true, returns the raw card data without triggering calculations
|
|
100
114
|
* responses:
|
|
101
115
|
* 200:
|
|
102
116
|
* description: Object containing card details, same as GET. See definitions.ts/CardDetails for the structure.
|
|
@@ -113,9 +127,11 @@ router.patch('/:key', async (c) => {
|
|
|
113
127
|
if (!key) {
|
|
114
128
|
return c.text('No search key', 400);
|
|
115
129
|
}
|
|
130
|
+
const raw = c.req.query('raw');
|
|
116
131
|
const body = await c.req.json();
|
|
117
132
|
try {
|
|
118
|
-
|
|
133
|
+
await cardService.updateCard(commands, key, body);
|
|
134
|
+
const result = await getCardDetails(c.get('commands'), key, isSSGContext(c), raw?.toLowerCase() === 'true' ? true : false);
|
|
119
135
|
if (result.status === 200) {
|
|
120
136
|
return c.json(result.data);
|
|
121
137
|
}
|
|
@@ -500,7 +516,7 @@ router.delete('/:key/links', async (c) => {
|
|
|
500
516
|
*/
|
|
501
517
|
router.get('/:key/a/:attachment', ssgParams(async (c) => {
|
|
502
518
|
const commands = c.get('commands');
|
|
503
|
-
return await cardService.
|
|
519
|
+
return await cardService.findRelevantAttachments(commands, c.get('tree'));
|
|
504
520
|
}), (c) => {
|
|
505
521
|
const commands = c.get('commands');
|
|
506
522
|
const { key, attachment } = c.req.param();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/cards/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG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C,CAAC;IACpD,CAAC;IAED,IAAI,CAAC;QACH,MAAM,kBAAkB,GAAG,WAAW,CAAC,aAAa,CAClD,QAAQ,EACR,GAAG,EACH,QAAQ,CACT,CAAC;QACF,8DAA8D;QAC9D,MAAM,OAAO,GAAG,kBAAyB,CAAC;QAE1C,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE;YACtC,OAAO,EAAE;gBACP,cAAc,EAAE,OAAO,CAAC,QAAQ;gBAChC,qBAAqB,EAAE,yBAAyB,QAAQ,GAAG;gBAC3D,eAAe,EAAE,UAAU;aAC5B;SACF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EACH,KAAK,YAAY,KAAK;gBACpB,CAAC,CAAC,KAAK,CAAC,OAAO;gBACf,CAAC,CAAC,iCAAiC,GAAG,iBAAiB,QAAQ,EAAE;SACtE,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { type CommandManager } from '@cyberismo/data-handler';
|
|
14
|
+
import type { TreeOptions } from '../../types.js';
|
|
15
|
+
import type { QueryResult } from '@cyberismo/data-handler/types/queries';
|
|
16
|
+
interface result {
|
|
17
|
+
status: number;
|
|
18
|
+
message?: string;
|
|
19
|
+
data?: object;
|
|
20
|
+
}
|
|
21
|
+
export declare function getCardDetails(commands: CommandManager, key: string, staticMode: boolean, raw: boolean): Promise<result>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns all cards from a tree query, flattened.
|
|
24
|
+
* @param commands the command manager used for the query
|
|
25
|
+
* @param options optional tree query options
|
|
26
|
+
* @returns a promise that resolves to an array of all cards
|
|
27
|
+
*/
|
|
28
|
+
export declare function allCards(commands: CommandManager, options?: TreeOptions): Promise<QueryResult<'tree'>[]>;
|
|
29
|
+
export {};
|
package/dist/domain/cards/lib.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import Processor from '@asciidoctor/core';
|
|
14
14
|
import { evaluateMacros } from '@cyberismo/data-handler';
|
|
15
15
|
import { getCardQueryResult } from '../../export.js';
|
|
16
|
-
export async function getCardDetails(commands, key, staticMode) {
|
|
16
|
+
export async function getCardDetails(commands, key, staticMode, raw) {
|
|
17
17
|
let cardDetailsResponse;
|
|
18
18
|
try {
|
|
19
19
|
cardDetailsResponse = commands.showCmd.showCardDetails(key);
|
|
@@ -25,7 +25,7 @@ export async function getCardDetails(commands, key, staticMode) {
|
|
|
25
25
|
return { status: 400, message: `Card ${key} not found from project` };
|
|
26
26
|
}
|
|
27
27
|
// always parse for now if not in export mode
|
|
28
|
-
if (!staticMode) {
|
|
28
|
+
if (!staticMode && !raw) {
|
|
29
29
|
await commands.calculateCmd.generate();
|
|
30
30
|
}
|
|
31
31
|
let asciidocContent = '';
|
|
@@ -49,6 +49,58 @@ export async function getCardDetails(commands, key, staticMode) {
|
|
|
49
49
|
},
|
|
50
50
|
})
|
|
51
51
|
.toString();
|
|
52
|
+
if (raw) {
|
|
53
|
+
if (!cardDetailsResponse.metadata) {
|
|
54
|
+
throw new Error('Card has no metadata');
|
|
55
|
+
}
|
|
56
|
+
const cardType = await commands.showCmd.showResource(cardDetailsResponse.metadata.cardType, 'cardTypes');
|
|
57
|
+
const fields = [];
|
|
58
|
+
let i = 0;
|
|
59
|
+
for (const customField of cardType.customFields) {
|
|
60
|
+
const fieldType = await commands.showCmd.showResource(customField.name, 'fieldTypes');
|
|
61
|
+
fields.push({
|
|
62
|
+
key: customField.name,
|
|
63
|
+
visibility: 'always',
|
|
64
|
+
index: i++,
|
|
65
|
+
fieldDisplayName: fieldType.displayName,
|
|
66
|
+
fieldDescription: fieldType.description,
|
|
67
|
+
dataType: fieldType.dataType,
|
|
68
|
+
isCalculated: customField.isCalculated,
|
|
69
|
+
value: cardDetailsResponse.metadata[customField.name],
|
|
70
|
+
enumValues: fieldType.enumValues ?? [],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
status: 200,
|
|
75
|
+
data: {
|
|
76
|
+
key: cardDetailsResponse.key,
|
|
77
|
+
rank: cardDetailsResponse.metadata?.rank,
|
|
78
|
+
title: cardDetailsResponse.metadata?.title || '',
|
|
79
|
+
cardType: cardDetailsResponse.metadata?.cardType || '',
|
|
80
|
+
cardTypeDisplayName: cardDetailsResponse.metadata.cardType,
|
|
81
|
+
workflowState: '',
|
|
82
|
+
lastUpdated: cardDetailsResponse.metadata.lastUpdated,
|
|
83
|
+
fields,
|
|
84
|
+
labels: cardDetailsResponse.metadata?.labels || [],
|
|
85
|
+
links: [],
|
|
86
|
+
notifications: [],
|
|
87
|
+
policyChecks: {
|
|
88
|
+
successes: [],
|
|
89
|
+
failures: [],
|
|
90
|
+
},
|
|
91
|
+
deniedOperations: {
|
|
92
|
+
transition: [],
|
|
93
|
+
move: [],
|
|
94
|
+
delete: [],
|
|
95
|
+
editField: [],
|
|
96
|
+
editContent: [],
|
|
97
|
+
},
|
|
98
|
+
rawContent: cardDetailsResponse.content || '',
|
|
99
|
+
parsedContent: htmlContent,
|
|
100
|
+
attachments: cardDetailsResponse.attachments,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
52
104
|
const card = staticMode
|
|
53
105
|
? await getCardQueryResult(commands.project.basePath, key)
|
|
54
106
|
: await commands.calculateCmd.runQuery('card', 'localApp', {
|
|
@@ -67,4 +119,23 @@ export async function getCardDetails(commands, key, staticMode) {
|
|
|
67
119
|
},
|
|
68
120
|
};
|
|
69
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns all cards from a tree query, flattened.
|
|
124
|
+
* @param commands the command manager used for the query
|
|
125
|
+
* @param options optional tree query options
|
|
126
|
+
* @returns a promise that resolves to an array of all cards
|
|
127
|
+
*/
|
|
128
|
+
export async function allCards(commands, options) {
|
|
129
|
+
const fetchedCards = await commands.calculateCmd.runQuery('tree', 'exportedSite', options || {});
|
|
130
|
+
function flattenCards(cards) {
|
|
131
|
+
return cards.reduce((acc, curr) => {
|
|
132
|
+
acc.push(curr);
|
|
133
|
+
if (curr.children && curr.children.length > 0) {
|
|
134
|
+
acc.push(...flattenCards(curr.children));
|
|
135
|
+
}
|
|
136
|
+
return acc;
|
|
137
|
+
}, []);
|
|
138
|
+
}
|
|
139
|
+
return flattenCards(fetchedCards);
|
|
140
|
+
}
|
|
70
141
|
//# sourceMappingURL=lib.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/domain/cards/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAuB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/domain/cards/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAuB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,E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,UAAU,EAAE,mBAAmB,CAAC,OAAO,IAAI,EAAE;YAC7C,aAAa,EAAE,WAAW;YAC1B,WAAW,EAAE,mBAAmB,CAAC,WAAW;SAC7C;KACF,CAAC;AACJ,CAAC;AACD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,QAAwB,EACxB,OAAqB;IAErB,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,QAAQ,CACvD,MAAM,EACN,cAAc,EACd,OAAO,IAAI,EAAE,CACd,CAAC;IAEF,SAAS,YAAY,CAAC,KAA4B;QAChD,OAAO,KAAK,CAAC,MAAM,CAAwB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACvD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9C,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IACD,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
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
|
+
*/
|
|
13
|
+
import { type CommandManager } from '@cyberismo/data-handler';
|
|
14
|
+
import { allCards } from './lib.js';
|
|
15
|
+
import type { TreeOptions } from '../../types.js';
|
|
16
|
+
export declare function getProjectInfo(commands: CommandManager): Promise<{
|
|
17
|
+
name: string;
|
|
18
|
+
prefix: string;
|
|
19
|
+
workflows: (import("@cyberismo/data-handler/interfaces/resource-interfaces").Workflow | undefined)[];
|
|
20
|
+
cardTypes: (import("@cyberismo/data-handler/interfaces/resource-interfaces").CardType | undefined)[];
|
|
21
|
+
}>;
|
|
22
|
+
export declare function updateCard(commands: CommandManager, key: string, body: any): Promise<void>;
|
|
23
|
+
export declare function deleteCard(commands: CommandManager, key: string): Promise<void>;
|
|
24
|
+
export declare function createCard(commands: CommandManager, template: string, parentKey?: string): Promise<import("@cyberismo/data-handler").Card[]>;
|
|
25
|
+
export declare function uploadAttachments(commands: CommandManager, key: string, files: File[]): Promise<{
|
|
26
|
+
message: string;
|
|
27
|
+
files: string[];
|
|
28
|
+
}>;
|
|
29
|
+
export declare function removeAttachment(commands: CommandManager, key: string, filename: string): Promise<{
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
export declare function openAttachment(commands: CommandManager, key: string, filename: string): Promise<{
|
|
33
|
+
message: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function parseContent(commands: CommandManager, key: string, content: string): Promise<{
|
|
36
|
+
parsedContent: string;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function createLink(commands: CommandManager, key: string, toCard: string, linkType: string, description?: string): Promise<{
|
|
39
|
+
message: string;
|
|
40
|
+
}>;
|
|
41
|
+
export declare function removeLink(commands: CommandManager, key: string, toCard: string, linkType: string, description?: string): Promise<{
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
44
|
+
export declare function getAttachment(commands: CommandManager, key: string, filename: string): import("@cyberismo/data-handler/interfaces/request-status-interfaces").attachmentPayload;
|
|
45
|
+
/**
|
|
46
|
+
* Used for exporting cards, thus static mode is assumed
|
|
47
|
+
* @param commandsthe command manager used for the query
|
|
48
|
+
* @param options optional tree query options
|
|
49
|
+
* @returns all cards in a flattened array
|
|
50
|
+
*/
|
|
51
|
+
export declare function findAllCards(commands: CommandManager, options?: TreeOptions): ReturnType<typeof allCards>;
|
|
52
|
+
/**
|
|
53
|
+
* Gets all attachments that are required for rendering the wanted cards
|
|
54
|
+
* @param commands the command manager used for the query
|
|
55
|
+
* @param options optional tree query options
|
|
56
|
+
* @returns all attachments for cards returned by the tree query
|
|
57
|
+
*/
|
|
58
|
+
export declare function findRelevantAttachments(commands: CommandManager, options?: TreeOptions): Promise<{
|
|
59
|
+
key: string;
|
|
60
|
+
attachment: string;
|
|
61
|
+
}[]>;
|
|
@@ -11,9 +11,8 @@
|
|
|
11
11
|
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
12
|
*/
|
|
13
13
|
import Processor from '@asciidoctor/core';
|
|
14
|
-
import { CardLocation, } from '@cyberismo/data-handler/interfaces/project-interfaces';
|
|
15
14
|
import { evaluateMacros } from '@cyberismo/data-handler';
|
|
16
|
-
import {
|
|
15
|
+
import { allCards } from './lib.js';
|
|
17
16
|
export async function getProjectInfo(commands) {
|
|
18
17
|
const projectResponse = await commands.showCmd.showProject();
|
|
19
18
|
const workflowsResponse = await commands.showCmd.showWorkflowsWithDetails();
|
|
@@ -86,7 +85,6 @@ body) {
|
|
|
86
85
|
if (errors.length > 0) {
|
|
87
86
|
throw new Error(errors.join('\n'));
|
|
88
87
|
}
|
|
89
|
-
return await getCardDetails(commands, key);
|
|
90
88
|
}
|
|
91
89
|
export async function deleteCard(commands, key) {
|
|
92
90
|
await commands.removeCmd.remove('card', key);
|
|
@@ -156,17 +154,27 @@ export async function removeLink(commands, key, toCard, linkType, description) {
|
|
|
156
154
|
export function getAttachment(commands, key, filename) {
|
|
157
155
|
return commands.showCmd.showAttachment(key, filename);
|
|
158
156
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Used for exporting cards, thus static mode is assumed
|
|
159
|
+
* @param commandsthe command manager used for the query
|
|
160
|
+
* @param options optional tree query options
|
|
161
|
+
* @returns all cards in a flattened array
|
|
162
|
+
*/
|
|
163
|
+
export async function findAllCards(commands, options) {
|
|
164
|
+
return allCards(commands, options);
|
|
166
165
|
}
|
|
167
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Gets all attachments that are required for rendering the wanted cards
|
|
168
|
+
* @param commands the command manager used for the query
|
|
169
|
+
* @param options optional tree query options
|
|
170
|
+
* @returns all attachments for cards returned by the tree query
|
|
171
|
+
*/
|
|
172
|
+
export async function findRelevantAttachments(commands, options) {
|
|
173
|
+
const cards = new Set((await allCards(commands, options)).map((c) => c.key));
|
|
168
174
|
const attachments = await commands.showCmd.showAttachments();
|
|
169
|
-
return attachments
|
|
175
|
+
return attachments
|
|
176
|
+
.filter((attachment) => cards.has(attachment.card) && attachment.mimeType?.startsWith('image/'))
|
|
177
|
+
.map((attachment) => ({
|
|
170
178
|
key: attachment.card,
|
|
171
179
|
attachment: attachment.fileName,
|
|
172
180
|
}));
|