Skip to content

Commit d22b3b8

Browse files
changes
1 parent b7ae996 commit d22b3b8

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ declare class Codebolt {
202202
addToAgentState: (key: string, value: string) => Promise<import("@codebolt/types").AddToAgentStateResponse>;
203203
getAgentState: () => Promise<import("@codebolt/types").GetAgentStateResponse>;
204204
getProjectState: () => Promise<any>;
205-
updateProjectState: () => Promise<any>;
205+
updateProjectState: (key: string, value: any) => Promise<any>;
206206
};
207207
taskplaner: {
208208
addTask: (task: string) => Promise<any>;

modules/state.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ declare const cbstate: {
2626
* Updates the project state on the server via WebSocket.
2727
* @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
2828
*/
29-
updateProjectState: () => Promise<any>;
29+
updateProjectState: (key: string, value: any) => Promise<any>;
3030
};
3131
export default cbstate;

modules/state.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ const cbstate = {
8787
* Updates the project state on the server via WebSocket.
8888
* @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
8989
*/
90-
updateProjectState: async () => {
90+
updateProjectState: async (key, value) => {
9191
return new Promise((resolve, reject) => {
9292
websocket_1.default.getWebsocket.send(JSON.stringify({
9393
"type": "projectStateEvent",
9494
"action": "updateProjectState",
95+
payload: {
96+
key,
97+
value
98+
}
9599
}));
96100
websocket_1.default.getWebsocket.on('message', (data) => {
97101
const response = JSON.parse(data);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codebolt/codeboltjs",
3-
"version": "1.1.87",
3+
"version": "1.1.88",
44
"description": "",
55
"keywords": [],
66
"author": "",

src/modules/state.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,15 @@ const cbstate = {
9090
* Updates the project state on the server via WebSocket.
9191
* @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
9292
*/
93-
updateProjectState: async (): Promise<any> => {
93+
updateProjectState: async (key:string,value:any): Promise<any> => {
9494
return new Promise((resolve, reject) => {
9595
cbws.getWebsocket.send(JSON.stringify({
9696
"type": "projectStateEvent",
9797
"action": "updateProjectState",
98+
payload:{
99+
key,
100+
value
101+
}
98102
}));
99103
cbws.getWebsocket.on('message', (data: string) => {
100104
const response = JSON.parse(data);

0 commit comments

Comments
 (0)