@codebolt/codeboltjs 1.1.87 → 1.1.88

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
@@ -202,7 +202,7 @@ declare class Codebolt {
202
202
  addToAgentState: (key: string, value: string) => Promise<import("@codebolt/types").AddToAgentStateResponse>;
203
203
  getAgentState: () => Promise<import("@codebolt/types").GetAgentStateResponse>;
204
204
  getProjectState: () => Promise<any>;
205
- updateProjectState: () => Promise<any>;
205
+ updateProjectState: (key: string, value: any) => Promise<any>;
206
206
  };
207
207
  taskplaner: {
208
208
  addTask: (task: string) => Promise<any>;
@@ -26,6 +26,6 @@ declare const cbstate: {
26
26
  * Updates the project state on the server via WebSocket.
27
27
  * @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
28
28
  */
29
- updateProjectState: () => Promise<any>;
29
+ updateProjectState: (key: string, value: any) => Promise<any>;
30
30
  };
31
31
  export default cbstate;
package/modules/state.js CHANGED
@@ -87,11 +87,15 @@ const cbstate = {
87
87
  * Updates the project state on the server via WebSocket.
88
88
  * @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
89
89
  */
90
- updateProjectState: async () => {
90
+ updateProjectState: async (key, value) => {
91
91
  return new Promise((resolve, reject) => {
92
92
  websocket_1.default.getWebsocket.send(JSON.stringify({
93
93
  "type": "projectStateEvent",
94
94
  "action": "updateProjectState",
95
+ payload: {
96
+ key,
97
+ value
98
+ }
95
99
  }));
96
100
  websocket_1.default.getWebsocket.on('message', (data) => {
97
101
  const response = JSON.parse(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "1.1.87",
3
+ "version": "1.1.88",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -90,11 +90,15 @@ const cbstate = {
90
90
  * Updates the project state on the server via WebSocket.
91
91
  * @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
92
92
  */
93
- updateProjectState: async (): Promise<any> => {
93
+ updateProjectState: async (key:string,value:any): Promise<any> => {
94
94
  return new Promise((resolve, reject) => {
95
95
  cbws.getWebsocket.send(JSON.stringify({
96
96
  "type": "projectStateEvent",
97
97
  "action": "updateProjectState",
98
+ payload:{
99
+ key,
100
+ value
101
+ }
98
102
  }));
99
103
  cbws.getWebsocket.on('message', (data: string) => {
100
104
  const response = JSON.parse(data);