@codebolt/codeboltjs 1.1.55 → 1.1.58

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/index.d.ts CHANGED
@@ -179,6 +179,8 @@ declare class Codebolt {
179
179
  project: {
180
180
  getProjectSettings: (output: any) => void;
181
181
  getProjectPath: () => Promise<import("@codebolt/types").GetProjectPathResponse>;
182
+ getRepoMap: (message: any) => Promise<import("@codebolt/types").GetProjectPathResponse>;
183
+ runProject: () => void;
182
184
  };
183
185
  dbmemory: {
184
186
  addKnowledge: (key: string, value: any) => Promise<import("@codebolt/types").MemorySetResponse>;
@@ -14,5 +14,7 @@ declare const cbproject: {
14
14
  * @returns {Promise<GetProjectPathResponse>} A promise that resolves with the project path response.
15
15
  */
16
16
  getProjectPath: () => Promise<GetProjectPathResponse>;
17
+ getRepoMap: (message: any) => Promise<GetProjectPathResponse>;
18
+ runProject: () => void;
17
19
  };
18
20
  export default cbproject;
@@ -33,6 +33,26 @@ const cbproject = {
33
33
  }
34
34
  });
35
35
  });
36
- }
36
+ },
37
+ getRepoMap: (message) => {
38
+ return new Promise((resolve, reject) => {
39
+ websocket_1.default.getWebsocket.send(JSON.stringify({
40
+ "type": "settingEvent",
41
+ "action": "getRepoMap",
42
+ message
43
+ }));
44
+ websocket_1.default.getWebsocket.on('message', (data) => {
45
+ const response = JSON.parse(data);
46
+ if (response.type === "getRepoMapResponse") {
47
+ resolve(response);
48
+ }
49
+ });
50
+ });
51
+ },
52
+ runProject: () => {
53
+ websocket_1.default.getWebsocket.send(JSON.stringify({
54
+ "type": "runProject"
55
+ }));
56
+ },
37
57
  };
38
58
  exports.default = cbproject;
@@ -57,13 +57,13 @@ class cbws {
57
57
  });
58
58
  this.websocket.on('open', () => {
59
59
  console.log('WebSocket connected');
60
- if (this.websocket) {
61
- this.websocket.send(JSON.stringify({
62
- "type": "sendMessage",
63
- "message": initialMessage
64
- }));
65
- resolve(this.websocket);
66
- }
60
+ // if (this.websocket) {
61
+ // this.websocket.send(JSON.stringify({
62
+ // "type": "sendMessage",
63
+ // "message": initialMessage
64
+ // }));
65
+ // resolve(this.websocket);
66
+ // }
67
67
  });
68
68
  this.websocket.on('message', (data) => {
69
69
  // Handle incoming WebSocket messages here.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "1.1.55",
3
+ "version": "1.1.58",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -1,5 +1,5 @@
1
1
  import cbws from './websocket';
2
- import {GetProjectPathResponse } from '@codebolt/types';
2
+ import { GetProjectPathResponse } from '@codebolt/types';
3
3
  /**
4
4
  * A module for interacting with project settings and paths.
5
5
  */
@@ -29,6 +29,26 @@ const cbproject = {
29
29
  }
30
30
  });
31
31
  });
32
- }
32
+ },
33
+ getRepoMap: (message: any): Promise<GetProjectPathResponse> => {
34
+ return new Promise((resolve, reject) => {
35
+ cbws.getWebsocket.send(JSON.stringify({
36
+ "type": "settingEvent",
37
+ "action": "getRepoMap",
38
+ message
39
+ }));
40
+ cbws.getWebsocket.on('message', (data: string) => {
41
+ const response = JSON.parse(data);
42
+ if (response.type === "getRepoMapResponse") {
43
+ resolve(response);
44
+ }
45
+ });
46
+ });
47
+ },
48
+ runProject: () => {
49
+ cbws.getWebsocket.send(JSON.stringify({
50
+ "type": "runProject"
51
+ }));
52
+ },
33
53
  };
34
54
  export default cbproject
@@ -56,13 +56,13 @@ class cbws {
56
56
 
57
57
  this.websocket.on('open', () => {
58
58
  console.log('WebSocket connected');
59
- if (this.websocket) {
60
- this.websocket.send(JSON.stringify({
61
- "type": "sendMessage",
62
- "message": initialMessage
63
- }));
64
- resolve(this.websocket);
65
- }
59
+ // if (this.websocket) {
60
+ // this.websocket.send(JSON.stringify({
61
+ // "type": "sendMessage",
62
+ // "message": initialMessage
63
+ // }));
64
+ // resolve(this.websocket);
65
+ // }
66
66
  });
67
67
 
68
68
  this.websocket.on('message', (data: WebSocket.Data) => {