@codebolt/codeboltjs 1.1.64 → 1.1.65

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
@@ -108,7 +108,7 @@ declare class Codebolt {
108
108
  };
109
109
  stopProcess: () => void;
110
110
  processFinished: () => void;
111
- sendConfirmationRequest: (confirmationMessage: string, buttons?: string[]) => Promise<string>;
111
+ sendConfirmationRequest: (confirmationMessage: string, buttons?: string[], withFeedback?: boolean) => Promise<string>;
112
112
  sendNotificationEvent: (notificationMessage: string, type: "debug" | "git" | "planner" | "browser" | "editor" | "terminal" | "preview") => void;
113
113
  };
114
114
  terminal: {
package/modules/chat.d.ts CHANGED
@@ -53,7 +53,7 @@ declare const cbchat: {
53
53
  * Sends a confirmation request to the server with two options: Yes or No.
54
54
  * @returns {Promise<string>} A promise that resolves with the server's response.
55
55
  */
56
- sendConfirmationRequest: (confirmationMessage: string, buttons?: string[]) => Promise<string>;
56
+ sendConfirmationRequest: (confirmationMessage: string, buttons?: string[], withFeedback?: boolean) => Promise<string>;
57
57
  /**
58
58
  * Sends a notification event to the server.
59
59
  * @param {string} notificationMessage - The message to be sent in the notification.
package/modules/chat.js CHANGED
@@ -143,16 +143,17 @@ const cbchat = {
143
143
  * Sends a confirmation request to the server with two options: Yes or No.
144
144
  * @returns {Promise<string>} A promise that resolves with the server's response.
145
145
  */
146
- sendConfirmationRequest: (confirmationMessage, buttons = []) => {
146
+ sendConfirmationRequest: (confirmationMessage, buttons = [], withFeedback = false) => {
147
147
  return new Promise((resolve, reject) => {
148
148
  websocket_1.default.getWebsocket.send(JSON.stringify({
149
149
  "type": "confirmationRequest",
150
150
  "message": confirmationMessage,
151
- buttons: buttons
151
+ buttons: buttons,
152
+ withFeedback
152
153
  }));
153
154
  websocket_1.default.getWebsocket.on('message', (data) => {
154
155
  const response = JSON.parse(data);
155
- if (response.type === "confirmationResponse") {
156
+ if (response.type === "confirmationResponse" || response.type === "feedbackResponse") {
156
157
  resolve(response); // Resolve the Promise with the server's response
157
158
  }
158
159
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "1.1.64",
3
+ "version": "1.1.65",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -148,17 +148,18 @@ const cbchat = {
148
148
  * Sends a confirmation request to the server with two options: Yes or No.
149
149
  * @returns {Promise<string>} A promise that resolves with the server's response.
150
150
  */
151
- sendConfirmationRequest: (confirmationMessage: string, buttons: string[] = []): Promise<string> => {
151
+ sendConfirmationRequest: (confirmationMessage: string, buttons: string[] = [],withFeedback:boolean=false): Promise<string> => {
152
152
  return new Promise((resolve, reject) => {
153
153
  cbws.getWebsocket.send(JSON.stringify({
154
154
  "type": "confirmationRequest",
155
155
  "message": confirmationMessage,
156
- buttons: buttons
156
+ buttons: buttons,
157
+ withFeedback
157
158
 
158
159
  }));
159
160
  cbws.getWebsocket.on('message', (data: string) => {
160
161
  const response = JSON.parse(data);
161
- if (response.type === "confirmationResponse") {
162
+ if (response.type === "confirmationResponse" || response.type === "feedbackResponse" ) {
162
163
  resolve(response); // Resolve the Promise with the server's response
163
164
  }
164
165
  });