@codebolt/codeboltjs 1.1.38 → 1.1.40

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
@@ -25,7 +25,7 @@ declare class Codebolt {
25
25
  updateFile: (filename: string, filePath: string, newContent: string) => Promise<import("@codebolt/types").UpdateFileResponse>;
26
26
  deleteFile: (filename: string, filePath: string) => Promise<import("@codebolt/types").DeleteFileResponse>;
27
27
  deleteFolder: (foldername: string, folderpath: string) => Promise<import("@codebolt/types").DeleteFolderResponse>;
28
- listFile: (filePath: string) => Promise<unknown>;
28
+ listFile: (folderPath: string, isRecursive?: boolean) => Promise<unknown>;
29
29
  };
30
30
  git: {
31
31
  init: (path: string) => Promise<any>;
@@ -84,7 +84,7 @@ declare class Codebolt {
84
84
  eventNames(): (string | symbol)[];
85
85
  } | undefined;
86
86
  sendMessage: (message: string) => void;
87
- waitforReply: (message: string) => Promise<string>;
87
+ waitforReply: (message: string) => Promise<import("@codebolt/types").UserMessage>;
88
88
  processStarted: () => {
89
89
  event: {
90
90
  [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
package/modules/chat.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
- import { ChatMessage } from '@codebolt/types';
3
+ import { ChatMessage, UserMessage } from '@codebolt/types';
4
4
  /**
5
5
  * CustomEventEmitter class that extends the Node.js EventEmitter class.
6
6
  */
@@ -28,9 +28,9 @@ declare const cbchat: {
28
28
  /**
29
29
  * Waits for a reply to a sent message.
30
30
  * @param {string} message - The message for which a reply is expected.
31
- * @returns {Promise<ChatMessage>} A promise that resolves with the reply.
31
+ * @returns {Promise<UserMessage>} A promise that resolves with the reply.
32
32
  */
33
- waitforReply: (message: string) => Promise<string>;
33
+ waitforReply: (message: string) => Promise<UserMessage>;
34
34
  /**
35
35
  * Notifies the server that a process has started and sets up an event listener for stopProcessClicked events.
36
36
  * @returns An object containing the event emitter and a stopProcess method.
package/modules/chat.js CHANGED
@@ -62,7 +62,7 @@ const cbchat = {
62
62
  /**
63
63
  * Waits for a reply to a sent message.
64
64
  * @param {string} message - The message for which a reply is expected.
65
- * @returns {Promise<ChatMessage>} A promise that resolves with the reply.
65
+ * @returns {Promise<UserMessage>} A promise that resolves with the reply.
66
66
  */
67
67
  waitforReply: (message) => {
68
68
  return new Promise((resolve, reject) => {
package/modules/fs.d.ts CHANGED
@@ -59,6 +59,6 @@ declare const cbfs: {
59
59
  * @description Lists all files.
60
60
  * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
61
61
  */
62
- listFile: (filePath: string) => Promise<unknown>;
62
+ listFile: (folderPath: string, isRecursive?: boolean) => Promise<unknown>;
63
63
  };
64
64
  export default cbfs;
package/modules/fs.js CHANGED
@@ -168,11 +168,15 @@ const cbfs = {
168
168
  * @description Lists all files.
169
169
  * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
170
170
  */
171
- listFile: (filePath) => {
171
+ listFile: (folderPath, isRecursive = false) => {
172
172
  return new Promise((resolve, reject) => {
173
173
  websocket_1.default.getWebsocket.send(JSON.stringify({
174
174
  "type": "fsEvent",
175
175
  "action": "fileList",
176
+ message: {
177
+ folderPath,
178
+ isRecursive
179
+ }
176
180
  }));
177
181
  websocket_1.default.getWebsocket.on('message', (data) => {
178
182
  const response = JSON.parse(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "1.1.38",
3
+ "version": "1.1.40",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -18,7 +18,7 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://codeboltai.github.io",
20
20
  "dependencies": {
21
- "@codebolt/types": "^1.0.9",
21
+ "@codebolt/types": "^1.0.10",
22
22
  "tree-sitter": "^0.21.1",
23
23
  "tree-sitter-javascript": "^0.21.2",
24
24
  "typedoc-plugin-missing-exports": "^2.2.0",
@@ -1,7 +1,7 @@
1
1
  // chat.ts
2
2
  import cbws from './websocket';
3
3
  import { EventEmitter } from 'events';
4
- import {ChatMessage} from '@codebolt/types'
4
+ import {ChatMessage,UserMessage} from '@codebolt/types'
5
5
 
6
6
 
7
7
 
@@ -63,9 +63,9 @@ const cbchat = {
63
63
  /**
64
64
  * Waits for a reply to a sent message.
65
65
  * @param {string} message - The message for which a reply is expected.
66
- * @returns {Promise<ChatMessage>} A promise that resolves with the reply.
66
+ * @returns {Promise<UserMessage>} A promise that resolves with the reply.
67
67
  */
68
- waitforReply: (message: string): Promise<string> => {
68
+ waitforReply: (message: string): Promise<UserMessage> => {
69
69
  return new Promise((resolve, reject) => {
70
70
  cbws.getWebsocket.send(JSON.stringify({
71
71
  "type": "waitforReply",
package/src/modules/fs.ts CHANGED
@@ -164,12 +164,15 @@ const cbfs = {
164
164
  * @description Lists all files.
165
165
  * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
166
166
  */
167
- listFile: (filePath:string) => {
167
+ listFile: (folderPath:string,isRecursive=false) => {
168
168
  return new Promise((resolve, reject) => {
169
169
  cbws.getWebsocket.send(JSON.stringify({
170
170
  "type": "fsEvent",
171
171
  "action": "fileList",
172
-
172
+ message:{
173
+ folderPath,
174
+ isRecursive
175
+ }
173
176
  }));
174
177
  cbws.getWebsocket.on('message', (data: string) => {
175
178
  const response = JSON.parse(data);