@kapeta/local-cluster-service 0.25.3 → 0.26.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/CHANGELOG.md +14 -0
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/src/filesystem/routes.js +8 -0
- package/dist/cjs/src/filesystemManager.d.ts +2 -0
- package/dist/cjs/src/filesystemManager.js +7 -0
- package/dist/esm/index.js +0 -3
- package/dist/esm/src/filesystem/routes.js +8 -0
- package/dist/esm/src/filesystemManager.d.ts +2 -0
- package/dist/esm/src/filesystemManager.js +7 -0
- package/index.ts +0 -3
- package/package.json +1 -2
- package/src/filesystem/routes.ts +11 -0
- package/src/filesystemManager.ts +9 -0
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [0.26.0](https://github.com/kapetacom/local-cluster-service/compare/v0.25.4...v0.26.0) (2023-11-13)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Add storage field for editor ([#98](https://github.com/kapetacom/local-cluster-service/issues/98)) ([e81ef2f](https://github.com/kapetacom/local-cluster-service/commit/e81ef2f3e68e5ad7171fc3256bcfd96b515715ac))
|
7
|
+
|
8
|
+
## [0.25.4](https://github.com/kapetacom/local-cluster-service/compare/v0.25.3...v0.25.4) (2023-11-12)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Get rid of native node module ([ce9a7f2](https://github.com/kapetacom/local-cluster-service/commit/ce9a7f2eba8f86ebbd76e6a5d0ad282858361753))
|
14
|
+
|
1
15
|
## [0.25.3](https://github.com/kapetacom/local-cluster-service/compare/v0.25.2...v0.25.3) (2023-11-12)
|
2
16
|
|
3
17
|
|
package/dist/cjs/index.js
CHANGED
@@ -58,7 +58,6 @@ const DefaultProviderInstaller_1 = require("./src/utils/DefaultProviderInstaller
|
|
58
58
|
const authManager_1 = require("./src/authManager");
|
59
59
|
const codeGeneratorManager_1 = require("./src/codeGeneratorManager");
|
60
60
|
const Sentry = __importStar(require("@sentry/node"));
|
61
|
-
const profiling_node_1 = require("@sentry/profiling-node");
|
62
61
|
Sentry.init({
|
63
62
|
dsn: 'https://0b7cc946d82c591473d6f95fff5e210b@o4505820837249024.ingest.sentry.io/4506212692000768',
|
64
63
|
enabled: process.env.NODE_ENV !== 'development',
|
@@ -72,8 +71,6 @@ function createServer() {
|
|
72
71
|
const app = (0, express_1.default)();
|
73
72
|
Sentry.addIntegration(new Sentry.Integrations.Http({ tracing: true }));
|
74
73
|
Sentry.addIntegration(new Sentry.Integrations.Express({ app }));
|
75
|
-
// @ts-ignore for some reason this doesn't match the type in TS
|
76
|
-
Sentry.addIntegration(new profiling_node_1.ProfilingIntegration());
|
77
74
|
// This causes node < 20 to crash on request.
|
78
75
|
//app.use(Sentry.Handlers.requestHandler());
|
79
76
|
// TracingHandler creates a trace for every incoming request
|
@@ -24,6 +24,14 @@ router.post('/project/root', (req, res) => {
|
|
24
24
|
filesystemManager_1.filesystemManager.setProjectRootFolder(req.stringBody ?? '');
|
25
25
|
res.sendStatus(204);
|
26
26
|
});
|
27
|
+
router.get('/editor', (req, res) => {
|
28
|
+
res.send(filesystemManager_1.filesystemManager.getEditor());
|
29
|
+
});
|
30
|
+
router.use('/editor', stringBody_1.stringBody);
|
31
|
+
router.post('/editor', (req, res) => {
|
32
|
+
filesystemManager_1.filesystemManager.setEditor(req.stringBody ?? '');
|
33
|
+
res.sendStatus(204);
|
34
|
+
});
|
27
35
|
router.use('/', (req, res, next) => {
|
28
36
|
if (!req.query.path) {
|
29
37
|
res.status(400).send({ error: 'Missing required query parameter "path"' });
|
@@ -14,6 +14,8 @@ declare class FilesystemManager {
|
|
14
14
|
getRootFolder(): string;
|
15
15
|
getProjectRootFolder(): string | undefined;
|
16
16
|
setProjectRootFolder(folder: string): void;
|
17
|
+
getEditor(): string | undefined;
|
18
|
+
setEditor(editor: string): void;
|
17
19
|
}
|
18
20
|
export declare const filesystemManager: FilesystemManager;
|
19
21
|
export {};
|
@@ -14,6 +14,7 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
14
14
|
const storageService_1 = require("./storageService");
|
15
15
|
const SECTION_ID = 'filesystem';
|
16
16
|
const PROJECT_ROOT = 'project_root';
|
17
|
+
const EDITOR = 'editor';
|
17
18
|
function isFile(path) {
|
18
19
|
try {
|
19
20
|
return fs_1.default.statSync(path).isFile();
|
@@ -85,5 +86,11 @@ class FilesystemManager {
|
|
85
86
|
setProjectRootFolder(folder) {
|
86
87
|
storageService_1.storageService.put(SECTION_ID, PROJECT_ROOT, folder);
|
87
88
|
}
|
89
|
+
getEditor() {
|
90
|
+
return storageService_1.storageService.get(SECTION_ID, EDITOR);
|
91
|
+
}
|
92
|
+
setEditor(editor) {
|
93
|
+
storageService_1.storageService.put(SECTION_ID, EDITOR, editor);
|
94
|
+
}
|
88
95
|
}
|
89
96
|
exports.filesystemManager = new FilesystemManager();
|
package/dist/esm/index.js
CHANGED
@@ -58,7 +58,6 @@ const DefaultProviderInstaller_1 = require("./src/utils/DefaultProviderInstaller
|
|
58
58
|
const authManager_1 = require("./src/authManager");
|
59
59
|
const codeGeneratorManager_1 = require("./src/codeGeneratorManager");
|
60
60
|
const Sentry = __importStar(require("@sentry/node"));
|
61
|
-
const profiling_node_1 = require("@sentry/profiling-node");
|
62
61
|
Sentry.init({
|
63
62
|
dsn: 'https://0b7cc946d82c591473d6f95fff5e210b@o4505820837249024.ingest.sentry.io/4506212692000768',
|
64
63
|
enabled: process.env.NODE_ENV !== 'development',
|
@@ -72,8 +71,6 @@ function createServer() {
|
|
72
71
|
const app = (0, express_1.default)();
|
73
72
|
Sentry.addIntegration(new Sentry.Integrations.Http({ tracing: true }));
|
74
73
|
Sentry.addIntegration(new Sentry.Integrations.Express({ app }));
|
75
|
-
// @ts-ignore for some reason this doesn't match the type in TS
|
76
|
-
Sentry.addIntegration(new profiling_node_1.ProfilingIntegration());
|
77
74
|
// This causes node < 20 to crash on request.
|
78
75
|
//app.use(Sentry.Handlers.requestHandler());
|
79
76
|
// TracingHandler creates a trace for every incoming request
|
@@ -24,6 +24,14 @@ router.post('/project/root', (req, res) => {
|
|
24
24
|
filesystemManager_1.filesystemManager.setProjectRootFolder(req.stringBody ?? '');
|
25
25
|
res.sendStatus(204);
|
26
26
|
});
|
27
|
+
router.get('/editor', (req, res) => {
|
28
|
+
res.send(filesystemManager_1.filesystemManager.getEditor());
|
29
|
+
});
|
30
|
+
router.use('/editor', stringBody_1.stringBody);
|
31
|
+
router.post('/editor', (req, res) => {
|
32
|
+
filesystemManager_1.filesystemManager.setEditor(req.stringBody ?? '');
|
33
|
+
res.sendStatus(204);
|
34
|
+
});
|
27
35
|
router.use('/', (req, res, next) => {
|
28
36
|
if (!req.query.path) {
|
29
37
|
res.status(400).send({ error: 'Missing required query parameter "path"' });
|
@@ -14,6 +14,8 @@ declare class FilesystemManager {
|
|
14
14
|
getRootFolder(): string;
|
15
15
|
getProjectRootFolder(): string | undefined;
|
16
16
|
setProjectRootFolder(folder: string): void;
|
17
|
+
getEditor(): string | undefined;
|
18
|
+
setEditor(editor: string): void;
|
17
19
|
}
|
18
20
|
export declare const filesystemManager: FilesystemManager;
|
19
21
|
export {};
|
@@ -14,6 +14,7 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
14
14
|
const storageService_1 = require("./storageService");
|
15
15
|
const SECTION_ID = 'filesystem';
|
16
16
|
const PROJECT_ROOT = 'project_root';
|
17
|
+
const EDITOR = 'editor';
|
17
18
|
function isFile(path) {
|
18
19
|
try {
|
19
20
|
return fs_1.default.statSync(path).isFile();
|
@@ -85,5 +86,11 @@ class FilesystemManager {
|
|
85
86
|
setProjectRootFolder(folder) {
|
86
87
|
storageService_1.storageService.put(SECTION_ID, PROJECT_ROOT, folder);
|
87
88
|
}
|
89
|
+
getEditor() {
|
90
|
+
return storageService_1.storageService.get(SECTION_ID, EDITOR);
|
91
|
+
}
|
92
|
+
setEditor(editor) {
|
93
|
+
storageService_1.storageService.put(SECTION_ID, EDITOR, editor);
|
94
|
+
}
|
88
95
|
}
|
89
96
|
exports.filesystemManager = new FilesystemManager();
|
package/index.ts
CHANGED
@@ -32,7 +32,6 @@ import { defaultProviderInstaller } from './src/utils/DefaultProviderInstaller';
|
|
32
32
|
import { authManager } from './src/authManager';
|
33
33
|
import { codeGeneratorManager } from './src/codeGeneratorManager';
|
34
34
|
import * as Sentry from '@sentry/node';
|
35
|
-
import { ProfilingIntegration } from '@sentry/profiling-node';
|
36
35
|
|
37
36
|
Sentry.init({
|
38
37
|
dsn: 'https://0b7cc946d82c591473d6f95fff5e210b@o4505820837249024.ingest.sentry.io/4506212692000768',
|
@@ -54,8 +53,6 @@ function createServer() {
|
|
54
53
|
|
55
54
|
Sentry.addIntegration(new Sentry.Integrations.Http({ tracing: true }));
|
56
55
|
Sentry.addIntegration(new Sentry.Integrations.Express({ app }));
|
57
|
-
// @ts-ignore for some reason this doesn't match the type in TS
|
58
|
-
Sentry.addIntegration(new ProfilingIntegration());
|
59
56
|
|
60
57
|
// This causes node < 20 to crash on request.
|
61
58
|
//app.use(Sentry.Handlers.requestHandler());
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kapeta/local-cluster-service",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.26.0",
|
4
4
|
"description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
|
5
5
|
"type": "commonjs",
|
6
6
|
"exports": {
|
@@ -57,7 +57,6 @@
|
|
57
57
|
"@kapeta/sdk-config": "<2",
|
58
58
|
"@kapeta/web-microfrontend": "<2",
|
59
59
|
"@sentry/node": "^7.80.0",
|
60
|
-
"@sentry/profiling-node": "^1.2.6",
|
61
60
|
"@types/dockerode": "^3.3.19",
|
62
61
|
"@types/stream-json": "^1.7.3",
|
63
62
|
"async-lock": "^1.4.0",
|
package/src/filesystem/routes.ts
CHANGED
@@ -28,6 +28,17 @@ router.post('/project/root', (req: StringBodyRequest, res: Response) => {
|
|
28
28
|
res.sendStatus(204);
|
29
29
|
});
|
30
30
|
|
31
|
+
router.get('/editor', (req: Request, res: Response) => {
|
32
|
+
res.send(filesystemManager.getEditor());
|
33
|
+
});
|
34
|
+
|
35
|
+
router.use('/editor', stringBody);
|
36
|
+
|
37
|
+
router.post('/editor', (req: StringBodyRequest, res: Response) => {
|
38
|
+
filesystemManager.setEditor(req.stringBody ?? '');
|
39
|
+
res.sendStatus(204);
|
40
|
+
});
|
41
|
+
|
31
42
|
router.use('/', (req: Request, res: Response, next: NextFunction) => {
|
32
43
|
if (!req.query.path) {
|
33
44
|
res.status(400).send({ error: 'Missing required query parameter "path"' });
|
package/src/filesystemManager.ts
CHANGED
@@ -10,6 +10,7 @@ import { storageService } from './storageService';
|
|
10
10
|
|
11
11
|
const SECTION_ID = 'filesystem';
|
12
12
|
const PROJECT_ROOT = 'project_root';
|
13
|
+
const EDITOR = 'editor';
|
13
14
|
|
14
15
|
function isFile(path: string) {
|
15
16
|
try {
|
@@ -91,6 +92,14 @@ class FilesystemManager {
|
|
91
92
|
setProjectRootFolder(folder: string) {
|
92
93
|
storageService.put(SECTION_ID, PROJECT_ROOT, folder);
|
93
94
|
}
|
95
|
+
|
96
|
+
getEditor(): string | undefined {
|
97
|
+
return storageService.get(SECTION_ID, EDITOR);
|
98
|
+
}
|
99
|
+
|
100
|
+
setEditor(editor: string) {
|
101
|
+
storageService.put(SECTION_ID, EDITOR, editor);
|
102
|
+
}
|
94
103
|
}
|
95
104
|
|
96
105
|
export const filesystemManager = new FilesystemManager();
|