@cyberismo/backend 0.0.15 → 0.0.17
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 +11 -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/project/index.d.ts +15 -0
- package/dist/domain/project/index.js +42 -0
- package/dist/domain/project/index.js.map +1 -0
- package/dist/domain/project/schema.d.ts +20 -0
- package/dist/domain/project/schema.js +21 -0
- package/dist/domain/project/schema.js.map +1 -0
- package/dist/domain/project/service.d.ts +30 -0
- package/dist/domain/project/service.js +54 -0
- package/dist/domain/project/service.js.map +1 -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/resources/service.js +60 -31
- package/dist/domain/resources/service.js.map +1 -1
- 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 +77 -83
- package/dist/public/assets/index-BrNy_4vV.js +163198 -0
- 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 +14 -8
- package/src/app.ts +13 -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/project/index.ts +58 -0
- package/src/domain/project/schema.ts +23 -0
- package/src/domain/project/service.ts +88 -0
- package/src/domain/resources/service.ts +87 -41
- 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/public/assets/index-Dtn1rQ-9.js +0 -163921
|
@@ -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 createReportSchema: z.ZodObject<{
|
|
15
|
+
identifier: 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 createReport(commands: CommandManager, reportName: 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,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const resourceFileParamsSchema: z.ZodObject<{
|
|
3
|
+
prefix: z.ZodString;
|
|
4
|
+
type: z.ZodEnum<{
|
|
5
|
+
cardTypes: "cardTypes";
|
|
6
|
+
calculations: "calculations";
|
|
7
|
+
fieldTypes: "fieldTypes";
|
|
8
|
+
graphModels: "graphModels";
|
|
9
|
+
graphViews: "graphViews";
|
|
10
|
+
linkTypes: "linkTypes";
|
|
11
|
+
reports: "reports";
|
|
12
|
+
templates: "templates";
|
|
13
|
+
workflows: "workflows";
|
|
14
|
+
}>;
|
|
15
|
+
identifier: z.ZodString;
|
|
16
|
+
file: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type ResourceFileParams = z.infer<typeof resourceFileParamsSchema>;
|
|
19
|
+
export declare const validateResourceParamsSchema: z.ZodObject<{
|
|
20
|
+
prefix: z.ZodString;
|
|
21
|
+
identifier: z.ZodString;
|
|
22
|
+
type: z.ZodEnum<{
|
|
23
|
+
cardTypes: "cardTypes";
|
|
24
|
+
fieldTypes: "fieldTypes";
|
|
25
|
+
graphModels: "graphModels";
|
|
26
|
+
graphViews: "graphViews";
|
|
27
|
+
linkTypes: "linkTypes";
|
|
28
|
+
reports: "reports";
|
|
29
|
+
templates: "templates";
|
|
30
|
+
workflows: "workflows";
|
|
31
|
+
}>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type ValidateResourceParams = z.infer<typeof validateResourceParamsSchema>;
|
|
34
|
+
export declare const updateOperationBodySchema: z.ZodObject<{
|
|
35
|
+
updateKey: z.ZodUnion<readonly [z.ZodObject<{
|
|
36
|
+
key: z.ZodLiteral<"content">;
|
|
37
|
+
subKey: z.ZodString;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
key: z.ZodString;
|
|
40
|
+
}, z.core.$strip>]>;
|
|
41
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
+
name: z.ZodLiteral<"add">;
|
|
43
|
+
target: z.ZodUnknown;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
name: z.ZodLiteral<"change">;
|
|
46
|
+
target: z.ZodUnknown;
|
|
47
|
+
to: z.ZodUnknown;
|
|
48
|
+
mappingTable: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
stateMapping: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
name: z.ZodLiteral<"remove">;
|
|
53
|
+
target: z.ZodUnknown;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
name: z.ZodLiteral<"rank">;
|
|
56
|
+
target: z.ZodUnknown;
|
|
57
|
+
newIndex: z.ZodNumber;
|
|
58
|
+
}, z.core.$strip>], "name">;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export type UpdateOperationBody = z.infer<typeof updateOperationBodySchema>;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { ResourceParams } from '../../common/validationSchemas.js';
|
|
15
|
+
import type { ValidateResourceParams, UpdateOperationBody } from './schema.js';
|
|
16
|
+
export declare function buildResourceTree(commands: CommandManager): Promise<unknown[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete a resource.
|
|
19
|
+
* @param commands Command manager.
|
|
20
|
+
* @param resource Resource to delete.
|
|
21
|
+
*/
|
|
22
|
+
export declare function deleteResource(commands: CommandManager, resource: ResourceParams): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Validate a single resource.
|
|
25
|
+
* @param commands Command manager.
|
|
26
|
+
* @param resource Resource to validate.
|
|
27
|
+
* @returns Validation result with errors and validity status.
|
|
28
|
+
*/
|
|
29
|
+
export declare function validateResource(commands: CommandManager, resource: ValidateResourceParams): Promise<{
|
|
30
|
+
errors: string[];
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Perform an updateOperation on a resource key.
|
|
34
|
+
* This delegates to data-handler Update.applyResourceOperation.
|
|
35
|
+
*/
|
|
36
|
+
export declare function updateResourceWithOperation(commands: CommandManager, resource: ResourceParams, body: UpdateOperationBody): Promise<void>;
|
|
@@ -22,10 +22,40 @@ const resourceTypes = [
|
|
|
22
22
|
'templates',
|
|
23
23
|
'workflows',
|
|
24
24
|
];
|
|
25
|
+
async function getModules(commands) {
|
|
26
|
+
try {
|
|
27
|
+
const moduleNames = commands.showCmd.showModules();
|
|
28
|
+
return Promise.all(moduleNames.map(async (moduleName) => {
|
|
29
|
+
try {
|
|
30
|
+
const module = await commands.showCmd.showModule(moduleName);
|
|
31
|
+
return { name: module.name, cardKeyPrefix: module.cardKeyPrefix };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return { name: moduleName, cardKeyPrefix: moduleName };
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
25
42
|
export async function buildResourceTree(commands) {
|
|
26
43
|
const project = await commands.showCmd.showProject();
|
|
27
44
|
const tree = [];
|
|
28
|
-
const
|
|
45
|
+
const sortByDisplayName = (nodes) => nodes.sort((a, b) => (a.data.displayName || a.data.name.split('/')[2] || '').localeCompare(b.data.displayName || b.data.name.split('/')[2] || ''));
|
|
46
|
+
const modules = await getModules(commands);
|
|
47
|
+
// General section first (single node with project + modules metadata)
|
|
48
|
+
tree.push({
|
|
49
|
+
id: 'general-project',
|
|
50
|
+
type: 'general',
|
|
51
|
+
name: 'project',
|
|
52
|
+
data: {
|
|
53
|
+
name: project.name,
|
|
54
|
+
cardKeyPrefix: project.prefix,
|
|
55
|
+
modules,
|
|
56
|
+
},
|
|
57
|
+
readOnly: false,
|
|
58
|
+
});
|
|
29
59
|
// Process each resource type
|
|
30
60
|
for (const resourceType of resourceTypes) {
|
|
31
61
|
let rootResources;
|
|
@@ -36,42 +66,41 @@ export async function buildResourceTree(commands) {
|
|
|
36
66
|
else {
|
|
37
67
|
({ rootResources, moduleResources } = await groupResourcesByPrefix(commands, resourceType, project.prefix));
|
|
38
68
|
}
|
|
39
|
-
//
|
|
40
|
-
|
|
69
|
+
// Sort resources by display name if present
|
|
70
|
+
sortByDisplayName(rootResources);
|
|
71
|
+
Object.values(moduleResources).forEach((resources) => sortByDisplayName(resources));
|
|
72
|
+
const projectNode = rootResources.length > 0
|
|
73
|
+
? [
|
|
74
|
+
{
|
|
75
|
+
id: `${resourceType}-project`,
|
|
76
|
+
type: 'module',
|
|
77
|
+
name: 'project',
|
|
78
|
+
children: rootResources,
|
|
79
|
+
readOnly: false,
|
|
80
|
+
},
|
|
81
|
+
]
|
|
82
|
+
: [];
|
|
83
|
+
const moduleNodes = Object.entries(moduleResources)
|
|
84
|
+
.map(([prefix, resources]) => ({
|
|
85
|
+
id: `${resourceType}-module-${prefix}`,
|
|
86
|
+
type: 'module',
|
|
87
|
+
name: modules.find((module) => module.cardKeyPrefix === prefix)?.name ||
|
|
88
|
+
prefix,
|
|
89
|
+
prefix,
|
|
90
|
+
children: resources,
|
|
91
|
+
readOnly: true,
|
|
92
|
+
}))
|
|
93
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
94
|
+
const allResources = [...projectNode, ...moduleNodes];
|
|
95
|
+
// Add combined resources (project + modules nested under module nodes) under the same group
|
|
96
|
+
if (allResources.length > 0) {
|
|
41
97
|
tree.push({
|
|
42
98
|
id: resourceType,
|
|
43
99
|
type: 'resourceGroup',
|
|
44
100
|
name: resourceType,
|
|
45
|
-
children:
|
|
101
|
+
children: allResources,
|
|
46
102
|
});
|
|
47
103
|
}
|
|
48
|
-
// Collect module resources
|
|
49
|
-
Object.entries(moduleResources).forEach(([prefix, resources]) => {
|
|
50
|
-
if (!allModuleResources[prefix]) {
|
|
51
|
-
allModuleResources[prefix] = {};
|
|
52
|
-
}
|
|
53
|
-
allModuleResources[prefix][resourceType] = resources;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
// Build modules section
|
|
57
|
-
if (Object.keys(allModuleResources).length > 0) {
|
|
58
|
-
const modules = Object.entries(allModuleResources).map(([prefix, resourcesByType]) => ({
|
|
59
|
-
id: `modules-${prefix}`,
|
|
60
|
-
type: 'module',
|
|
61
|
-
name: prefix,
|
|
62
|
-
children: Object.entries(resourcesByType).map(([type, resources]) => ({
|
|
63
|
-
id: `modules-${prefix}-${type}`,
|
|
64
|
-
type: 'resourceGroup',
|
|
65
|
-
name: type,
|
|
66
|
-
children: resources,
|
|
67
|
-
})),
|
|
68
|
-
}));
|
|
69
|
-
tree.push({
|
|
70
|
-
id: 'modules',
|
|
71
|
-
type: 'modulesGroup',
|
|
72
|
-
name: 'modules',
|
|
73
|
-
children: modules,
|
|
74
|
-
});
|
|
75
104
|
}
|
|
76
105
|
return tree;
|
|
77
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/domain/resources/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AASF,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,aAAa,GAAyB;IAC1C,cAAc;IACd,WAAW;IACX,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,WAAW;IACX,SAAS;IACT,WAAW;IACX,WAAW;CACZ,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/domain/resources/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AASF,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,aAAa,GAAyB;IAC1C,cAAc;IACd,WAAW;IACX,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,WAAW;IACX,SAAS;IACT,WAAW;IACX,WAAW;CACZ,CAAC;AAEF,KAAK,UAAU,UAAU,CAAC,QAAwB;IAChD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACnD,OAAO,OAAO,CAAC,GAAG,CAChB,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YACnC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,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AAM,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,gBAAgB,CACxD,QAAQ,EACR,QAAQ,CAAC,OAAO,CACjB,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,QAAwB,EACxB,QAAwB,EACxB,IAAyB;IAEzB,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACtC,MAAM,QAAQ,CAAC,SAAS,CAAC,sBAAsB,CAC7C,oBAAoB,CAAC,QAAQ,CAAC,EAC9B,SAAS,EACT,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -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,10 +11,10 @@
|
|
|
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 { isSSGContext } from '../../export.js';
|
|
15
14
|
import * as templateService from './service.js';
|
|
16
15
|
import { createTemplateSchema, addTemplateCardSchema } from './schema.js';
|
|
17
16
|
import { zValidator } from '../../middleware/zvalidator.js';
|
|
17
|
+
import { isSSGContext } from 'hono/ssg';
|
|
18
18
|
const router = new Hono();
|
|
19
19
|
/**
|
|
20
20
|
* @swagger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC1B,0CAA0C;IAC1C,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QACzE,OAAO,C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,CACjD,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,KAAK,CACN,CAAC;IACF,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 createTemplateSchema: z.ZodObject<{
|
|
15
|
+
identifier: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const addTemplateCardSchema: z.ZodObject<{
|
|
18
|
+
template: z.ZodString;
|
|
19
|
+
cardType: z.ZodString;
|
|
20
|
+
parentKey: z.ZodOptional<z.ZodString>;
|
|
21
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
@@ -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 type { CommandManager } from '@cyberismo/data-handler';
|
|
14
|
+
export declare function getTemplatesWithDetails(commands: CommandManager): Promise<import("@cyberismo/data-handler").TemplateConfiguration[]>;
|
|
15
|
+
export declare function createTemplate(commands: CommandManager, templateName: string): Promise<void>;
|
|
16
|
+
export declare function addTemplateCard(commands: CommandManager, template: string, cardType: string, parentKey?: string, count?: number): Promise<string[]>;
|
|
@@ -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;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { Hono } from 'hono';
|
|
14
14
|
import * as treeService from './service.js';
|
|
15
|
-
import { isSSGContext } from '
|
|
15
|
+
import { isSSGContext } from 'hono/ssg';
|
|
16
16
|
const router = new Hono();
|
|
17
17
|
/**
|
|
18
18
|
* @swagger
|
|
@@ -30,8 +30,9 @@ const router = new Hono();
|
|
|
30
30
|
*/
|
|
31
31
|
router.get('/', async (c) => {
|
|
32
32
|
const commands = c.get('commands');
|
|
33
|
+
const tree = c.get('tree');
|
|
33
34
|
try {
|
|
34
|
-
const response = await treeService.getCardTree(commands, isSSGContext(c));
|
|
35
|
+
const response = await treeService.getCardTree(commands, isSSGContext(c), tree?.cardKey, tree?.recursive);
|
|
35
36
|
return c.json(response);
|
|
36
37
|
}
|
|
37
38
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/tree/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/tree/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,CAAa,EAAE,EAAE;IACtC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE3B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,WAAW,CAC5C,QAAQ,EACR,YAAY,CAAC,CAAC,CAAC,EACf,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,SAAS,CAChB,CAAC;QACF,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,cAAc,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;SACvG,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* Returns the card tree of the project
|
|
16
|
+
* @param commands command manager used for the query
|
|
17
|
+
* @param isSsg whether the context is static site generation
|
|
18
|
+
* @param cardKey optional card key to start the tree from
|
|
19
|
+
* @param recursive if false, includes only the given card. Otherwise, includes all child cards recursively.
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCardTree(commands: CommandManager, isSsg: boolean, cardKey?: string, recursive?: boolean): ReturnType<typeof commands.calculateCmd.runQuery>;
|
|
@@ -10,8 +10,16 @@
|
|
|
10
10
|
details. You should have received a copy of the GNU Affero General Public
|
|
11
11
|
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Returns the card tree of the project
|
|
15
|
+
* @param commands command manager used for the query
|
|
16
|
+
* @param isSsg whether the context is static site generation
|
|
17
|
+
* @param cardKey optional card key to start the tree from
|
|
18
|
+
* @param recursive if false, includes only the given card. Otherwise, includes all child cards recursively.
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export async function getCardTree(commands, isSsg, cardKey, recursive) {
|
|
14
22
|
await commands.calculateCmd.generate();
|
|
15
|
-
return commands.calculateCmd.runQuery('tree', isSsg ? 'exportedSite' : 'localApp');
|
|
23
|
+
return commands.calculateCmd.runQuery('tree', isSsg ? 'exportedSite' : 'localApp', { cardKey, recursive });
|
|
16
24
|
}
|
|
17
25
|
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/domain/tree/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAIF,MAAM,CAAC,KAAK,UAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/domain/tree/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAIF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAwB,EACxB,KAAc,EACd,OAAgB,EAChB,SAAmB;IAEnB,MAAM,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IACvC,OAAO,QAAQ,CAAC,YAAY,CAAC,QAAQ,CACnC,MAAM,EACN,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,EACnC,EAAE,OAAO,EAAE,SAAS,EAAE,CACvB,CAAC;AACJ,CAAC"}
|
|
@@ -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 createWorkflowSchema: z.ZodObject<{
|
|
15
|
+
identifier: 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 createWorkflow(commands: CommandManager, workflowName: string): Promise<void>;
|
package/dist/export.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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 { QueryResult } from '@cyberismo/data-handler/types/queries';
|
|
14
|
+
import type { TreeOptions } from './types.js';
|
|
15
|
+
/**
|
|
16
|
+
* DO NO USE DIRECTLY. This resets the callOnce map, allowing you to redo the export.
|
|
17
|
+
* Also resets the card query promise.
|
|
18
|
+
*/
|
|
19
|
+
export declare function reset(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Get the card query result for a given card key. Should only be called during
|
|
22
|
+
* static site generation
|
|
23
|
+
* @param projectPath - Path to the project.
|
|
24
|
+
* @param cardKey - Key of the card to get the query result for.
|
|
25
|
+
* @returns The card query result for the given card key.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getCardQueryResult(projectPath: string, cardKey?: string): Promise<QueryResult<'card'>[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Export the site to a given directory.
|
|
30
|
+
* Note: Do not call this function in parallel.
|
|
31
|
+
* @param projectPath - Path to the project.
|
|
32
|
+
* @param options - Export options.
|
|
33
|
+
* @param options.recursive - Whether to export cards recursively.
|
|
34
|
+
* @param options.cardKey - Key of the card to export. If not provided, all cards will be exported.
|
|
35
|
+
* @param exportDir - Directory to export to.
|
|
36
|
+
* @param level - Log level for the operation.
|
|
37
|
+
* @param onProgress - Optional progress callback function.
|
|
38
|
+
* @returns An object containing any errors that occurred during export.
|
|
39
|
+
*/
|
|
40
|
+
export declare function exportSite(projectPath: string, exportDir?: string, options?: TreeOptions, level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal', onProgress?: (current: number, total: number) => void): Promise<{
|
|
41
|
+
errors: string[];
|
|
42
|
+
}>;
|