@trap_stevo/filetide 0.0.36 → 0.0.38

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.
@@ -148,7 +148,8 @@ class FileMessager {
148
148
  handleListClientFiles(clientData) {
149
149
  const {
150
150
  requesterID,
151
- recipientID
151
+ recipientID,
152
+ depth = 1
152
153
  } = clientData;
153
154
  const recipientConnectionID = FileNetClientManager.getOnlineClient(recipientID).id;
154
155
  const senderConnectionID = FileNetClientManager.getOnlineClient(requesterID).id;
@@ -159,7 +160,8 @@ class FileMessager {
159
160
  }
160
161
  this.fileNet.emitToTide(client.tideID, "list-files", {
161
162
  senderID: requesterID,
162
- recipientID
163
+ recipientID,
164
+ depth
163
165
  });
164
166
  }
165
167
  handleClientToClientTransfer(transferData) {
@@ -268,10 +270,12 @@ class FileMessager {
268
270
  activeTransferBarrier
269
271
  });
270
272
  this.fileNet.emitToTide(tideID, "current-online-clients", Object.fromEntries(FileNetClientManager.getOnlineClients()));
273
+ this.fileNet.emit("current-clients", Object.fromEntries(FileNetClientManager.getOnlineClients()));
271
274
  return;
272
275
  }
273
276
  handleClientOffline(clientID) {
274
277
  FileNetClientManager.clearOnlineClient(clientID);
278
+ this.fileNet.emit("current-clients", Object.fromEntries(FileNetClientManager.getOnlineClients()));
275
279
  return;
276
280
  }
277
281
  }
@@ -236,6 +236,7 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
236
236
  onTransferStart,
237
237
  onTransferComplete,
238
238
  onTransferRequested,
239
+ onTransferStatus,
239
240
  onListFiles,
240
241
  onCurrentOnlineClients
241
242
  } = options;
@@ -280,7 +281,22 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
280
281
  cliTable.setData(currentClients);
281
282
  console.log(`\n[FileTide ~ FileNet]\n\n`, cliTable.render(), "\n");
282
283
  if (onCurrentOnlineClients) {
283
- onCurrentOnlineClients(currentClients);
284
+ onCurrentOnlineClients(currentClients, true);
285
+ }
286
+ });
287
+ client.clientTide.onEvent(userID, "current-clients", data => {
288
+ const currentClients = {};
289
+ Object.keys(data).forEach(key => {
290
+ if (key !== userID) {
291
+ currentClients[key] = data[key];
292
+ }
293
+ });
294
+ if (Object.keys(currentClients).length <= 0) {
295
+ return;
296
+ }
297
+ _FileTide.outputGradient(`\n[FileTide ~ FileNet]\n\n✨ Current Clients >${Object.keys(currentClients).length}< ✨\n`, significantMessageColors);
298
+ if (onCurrentOnlineClients) {
299
+ onCurrentOnlineClients(currentClients, false);
284
300
  }
285
301
  });
286
302
  client.clientTide.onEvent(userID, "queue-incoming-transfer", async data => {
@@ -365,6 +381,12 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
365
381
  onTransferProgress(data);
366
382
  }
367
383
  });
384
+ client.clientTide.onEvent(userID, "transfer-status", data => {
385
+ if (onTransferStatus) {
386
+ onTransferStatus(data);
387
+ }
388
+ return;
389
+ });
368
390
  client.clientTide.onEvent(userID, "transfer-complete", data => {
369
391
  const savePath = FileUtilityManager.getTidePath(path.join(data.filePath, data.fileName));
370
392
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "description": "Revolutionizing real-time file transfer with seamless, instant communication across any device. Deliver files instantly, regardless of platform, and experience unparalleled speed and control in managing transfers. Elevate your file-sharing capabilities with a tool designed for precision, efficiency, and effortless connectivity.",
5
5
  "main": "dist/cjs/FileTide.js",
6
6
  "scripts": {