@kapeta/local-cluster-service 0.26.0 → 0.27.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.27.0](https://github.com/kapetacom/local-cluster-service/compare/v0.26.0...v0.27.0) (2023-11-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * add /files/release-channel endpoint to enable beta releases in the app [KAP-2014] ([#99](https://github.com/kapetacom/local-cluster-service/issues/99)) ([096b4be](https://github.com/kapetacom/local-cluster-service/commit/096b4bea99d0e0ccf11f2ef04730737adb2995a3))
7
+
1
8
  # [0.26.0](https://github.com/kapetacom/local-cluster-service/compare/v0.25.4...v0.26.0) (2023-11-13)
2
9
 
3
10
 
@@ -32,6 +32,14 @@ router.post('/editor', (req, res) => {
32
32
  filesystemManager_1.filesystemManager.setEditor(req.stringBody ?? '');
33
33
  res.sendStatus(204);
34
34
  });
35
+ router.get('/release-channel', (req, res) => {
36
+ res.send(filesystemManager_1.filesystemManager.getReleaseChannel());
37
+ });
38
+ router.use('/release-channel', stringBody_1.stringBody);
39
+ router.post('/release-channel', (req, res) => {
40
+ filesystemManager_1.filesystemManager.setReleaseChannel(req.stringBody ?? '');
41
+ res.sendStatus(204);
42
+ });
35
43
  router.use('/', (req, res, next) => {
36
44
  if (!req.query.path) {
37
45
  res.status(400).send({ error: 'Missing required query parameter "path"' });
@@ -16,6 +16,8 @@ declare class FilesystemManager {
16
16
  setProjectRootFolder(folder: string): void;
17
17
  getEditor(): string | undefined;
18
18
  setEditor(editor: string): void;
19
+ getReleaseChannel(): string | undefined;
20
+ setReleaseChannel(channel: string): void;
19
21
  }
20
22
  export declare const filesystemManager: FilesystemManager;
21
23
  export {};
@@ -15,6 +15,7 @@ const storageService_1 = require("./storageService");
15
15
  const SECTION_ID = 'filesystem';
16
16
  const PROJECT_ROOT = 'project_root';
17
17
  const EDITOR = 'editor';
18
+ const RELEASE_CHANNEL = 'release_channel';
18
19
  function isFile(path) {
19
20
  try {
20
21
  return fs_1.default.statSync(path).isFile();
@@ -92,5 +93,12 @@ class FilesystemManager {
92
93
  setEditor(editor) {
93
94
  storageService_1.storageService.put(SECTION_ID, EDITOR, editor);
94
95
  }
96
+ // Should we put this in its own manager service?
97
+ getReleaseChannel() {
98
+ return storageService_1.storageService.get('app', RELEASE_CHANNEL);
99
+ }
100
+ setReleaseChannel(channel) {
101
+ storageService_1.storageService.put('app', RELEASE_CHANNEL, channel);
102
+ }
95
103
  }
96
104
  exports.filesystemManager = new FilesystemManager();
@@ -32,6 +32,14 @@ router.post('/editor', (req, res) => {
32
32
  filesystemManager_1.filesystemManager.setEditor(req.stringBody ?? '');
33
33
  res.sendStatus(204);
34
34
  });
35
+ router.get('/release-channel', (req, res) => {
36
+ res.send(filesystemManager_1.filesystemManager.getReleaseChannel());
37
+ });
38
+ router.use('/release-channel', stringBody_1.stringBody);
39
+ router.post('/release-channel', (req, res) => {
40
+ filesystemManager_1.filesystemManager.setReleaseChannel(req.stringBody ?? '');
41
+ res.sendStatus(204);
42
+ });
35
43
  router.use('/', (req, res, next) => {
36
44
  if (!req.query.path) {
37
45
  res.status(400).send({ error: 'Missing required query parameter "path"' });
@@ -16,6 +16,8 @@ declare class FilesystemManager {
16
16
  setProjectRootFolder(folder: string): void;
17
17
  getEditor(): string | undefined;
18
18
  setEditor(editor: string): void;
19
+ getReleaseChannel(): string | undefined;
20
+ setReleaseChannel(channel: string): void;
19
21
  }
20
22
  export declare const filesystemManager: FilesystemManager;
21
23
  export {};
@@ -15,6 +15,7 @@ const storageService_1 = require("./storageService");
15
15
  const SECTION_ID = 'filesystem';
16
16
  const PROJECT_ROOT = 'project_root';
17
17
  const EDITOR = 'editor';
18
+ const RELEASE_CHANNEL = 'release_channel';
18
19
  function isFile(path) {
19
20
  try {
20
21
  return fs_1.default.statSync(path).isFile();
@@ -92,5 +93,12 @@ class FilesystemManager {
92
93
  setEditor(editor) {
93
94
  storageService_1.storageService.put(SECTION_ID, EDITOR, editor);
94
95
  }
96
+ // Should we put this in its own manager service?
97
+ getReleaseChannel() {
98
+ return storageService_1.storageService.get('app', RELEASE_CHANNEL);
99
+ }
100
+ setReleaseChannel(channel) {
101
+ storageService_1.storageService.put('app', RELEASE_CHANNEL, channel);
102
+ }
95
103
  }
96
104
  exports.filesystemManager = new FilesystemManager();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -39,6 +39,17 @@ router.post('/editor', (req: StringBodyRequest, res: Response) => {
39
39
  res.sendStatus(204);
40
40
  });
41
41
 
42
+ router.get('/release-channel', (req: Request, res: Response) => {
43
+ res.send(filesystemManager.getReleaseChannel());
44
+ });
45
+
46
+ router.use('/release-channel', stringBody);
47
+
48
+ router.post('/release-channel', (req: StringBodyRequest, res: Response) => {
49
+ filesystemManager.setReleaseChannel(req.stringBody ?? '');
50
+ res.sendStatus(204);
51
+ });
52
+
42
53
  router.use('/', (req: Request, res: Response, next: NextFunction) => {
43
54
  if (!req.query.path) {
44
55
  res.status(400).send({ error: 'Missing required query parameter "path"' });
@@ -11,6 +11,7 @@ import { storageService } from './storageService';
11
11
  const SECTION_ID = 'filesystem';
12
12
  const PROJECT_ROOT = 'project_root';
13
13
  const EDITOR = 'editor';
14
+ const RELEASE_CHANNEL = 'release_channel';
14
15
 
15
16
  function isFile(path: string) {
16
17
  try {
@@ -100,6 +101,15 @@ class FilesystemManager {
100
101
  setEditor(editor: string) {
101
102
  storageService.put(SECTION_ID, EDITOR, editor);
102
103
  }
104
+
105
+ // Should we put this in its own manager service?
106
+ getReleaseChannel() {
107
+ return storageService.get<string>('app', RELEASE_CHANNEL);
108
+ }
109
+
110
+ setReleaseChannel(channel: string) {
111
+ storageService.put('app', RELEASE_CHANNEL, channel);
112
+ }
103
113
  }
104
114
 
105
115
  export const filesystemManager = new FilesystemManager();