@trap_stevo/filetide 0.0.53 → 0.0.55

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/LICENSE.md CHANGED
@@ -4,32 +4,69 @@
4
4
 
5
5
  This License Agreement ("Agreement") is entered into by and between **Hassan Steven Compton**, the owner of the package ("Licensor"), and any individual or entity attempting to use the package ("Licensee"). By attempting to install, use, modify, or distribute the package, Licensee agrees to the following terms and conditions:
6
6
 
7
- ## 1. **Ownership**
7
+ ## 1. **Definitions**
8
+ - **"Package"**: Refers to the software identified as @trap_stevo/filetide, including its source code, object code, binaries, and any related files or documentation.
9
+ - **"Wrapper API"**: Refers to any software, service, or application developed by the Licensee that interacts with the Package as a dependency but does not include, modify, or expose the Package's source code or proprietary components.
10
+ - **"Derivative Work"**: Refers to any software, service, or product that is based on or derived from the Package's source code or object code, either in part or in whole, and includes modified, translated, or adapted versions of the Package.
11
+
12
+ ## 2. **Ownership**
8
13
  **Hassan Steven Compton** is the sole owner of all rights, title, and interest in and to @trap_stevo/filetide, including all related intellectual property rights.
9
14
 
10
- ## 2. **Grant of License**
11
- Licensee is **NOT** granted any rights to use, modify, distribute, or create derivative works of @trap_stevo/filetide, either in part or in whole, without prior express written consent from the Licensor. **Any granted license is non-transferable and non-sublicensable without express written consent from the Licensor.**
15
+ ## 3. **Grant of License**
16
+ Subject to the terms of this agreement, the Licensor grants the Licensee a limited, non-exclusive, revocable license to:
17
+ 1. Use the Package as a dependency or library within their own projects to create Wrapper APIs, services, or applications.
18
+ 2. Distribute Wrapper APIs, services, or applications that rely on the Package, provided the Package's source code is not included, modified, or distributed as part of the Wrapper.
19
+
20
+ Licensee is **NOT** permitted to:
21
+ - Modify, copy, or distribute the Package's source code or object code.
22
+ - Create or distribute any Derivative Work based on the Package.
23
+ - Remove, alter, or obscure any proprietary notices, attributions, or trademarks included in the Package.
12
24
 
13
- ## 3. **Prohibited Uses**
25
+ This license is non-transferable and non-sublicensable without prior express written consent from the Licensor.
26
+
27
+ ## 4. **Prohibited Uses**
14
28
  Without the express written permission of the Licensor, Licensee shall not:
15
- - Use the package for any purpose, including but not limited to personal, commercial, or educational purposes.
16
- - Copy, modify, distribute, or sublicense the package.
17
- - Reverse-engineer, decompile, or disassemble the package.
18
- - Create derivative works or adapt the package in any form.
29
+ 1. Modify, decompile, reverse-engineer, or disassemble the Package in any way.
30
+ 2. Include the Package's source code or object code in any distributed software, service, or application.
31
+ 3. Use the Package to create a competing product or service that replicates the functionality of the Package.
32
+ 4. Make the Package publicly available, including uploading it to public repositories or including it in distributed software bundles.
33
+ 5. Use the Package in any way that violates applicable laws, infringes on third-party rights, or breaches this agreement.
34
+
35
+ ## 5. **Wrapper API Creation**
36
+ Licensee is permitted to create and distribute Wrapper APIs, provided that:
37
+ 1. The Wrapper API does not expose or include the Package's source code or object code in any form.
38
+ 2. The Wrapper API identifies @trap_stevo/filetide as a dependency in its documentation and credits it as required by this license.
39
+ 3. The Wrapper API complies with all terms outlined in this agreement, including restrictions on modification and redistribution of the Package.
40
+ 4. The Wrapper API adds substantial original functionality and does not merely replicate or repackage the Package's functionality.
41
+
42
+ ## 6. **Request for Permission**
43
+ Licensee may request additional permissions to use the Package beyond the scope of this agreement by contacting the Licensor at **h.steven.compton13@gmail.com**. All requests must:
44
+
45
+ 1. Be submitted in writing.
46
+ 2. Specify the intended use of the Package in detail, including but not limited to the purpose, scope, and distribution method.
47
+
48
+ The Licensor reserves the right to:
49
+ - Approve or deny any request at its sole discretion, with or without providing a reason.
50
+ - Impose additional terms and conditions for any granted permission.
51
+ - Revoke any granted permission at any time, for any reason, with prior written notice to the Licensee.
19
52
 
20
- ## 4. **Request for Permission**
21
- Licensee may request permission to use the package by contacting the Licensor at **h.steven.compton13@gmail.com**. All requests must be made in writing, specifying the intended use of the package. Licensor reserves the right to approve, deny, or revoke any permission at its sole discretion. Any granted permission is subject to the Licensor’s terms and may be revoked at any time.
53
+ Any permission granted by the Licensor:
54
+ - Must be documented in writing.
55
+ - Does not constitute a waiver of any rights or terms outlined in this agreement unless explicitly stated.
56
+ - Remains non-transferable and non-sublicensable.
22
57
 
23
- ## 5. **Violation of Terms**
24
- Any unauthorized use of @trap_stevo/filetide will result in immediate termination of any rights granted under this Agreement. The Licensor reserves the right to pursue legal action, including seeking damages and injunctive relief, for any violations of these terms.
58
+ ## 7. **Violation of Terms**
59
+ 1. Any violation of this agreement will result in the immediate termination of the Licensee's rights under this license.
60
+ 2. Upon termination, the Licensee must cease all use of the Package, destroy all copies in their possession, and confirm compliance with this clause to the Licensor in writing.
61
+ 3. The Licensor reserves the right to seek legal remedies, including damages and injunctive relief, for any breach of this agreement.
25
62
 
26
- ## 6. **No Warranty**
63
+ ## 8. **No Warranty**
27
64
  @trap_stevo/filetide is provided "as is," without any warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. Licensee assumes all risks associated with the use of the package, including but not limited to potential damage to systems or data.
28
65
 
29
- ## 7. **Indemnification**
66
+ ## 9. **Indemnification**
30
67
  Licensee agrees to indemnify and hold harmless the Licensor from any and all claims, damages, liabilities, and expenses arising out of Licensee's use of the package in violation of this Agreement.
31
68
 
32
- ## 8. **Governing Law and Dispute Resolution**
69
+ ## 10. **Governing Law and Dispute Resolution**
33
70
  This Agreement shall be governed by and construed in accordance with the laws of **the state of Georgia**, without regard to its conflict of law principles. Any disputes arising out of this Agreement shall be resolved through arbitration in **the state of Georgia**.
34
71
 
35
72
  ## 9. **Amendments**
@@ -23,7 +23,7 @@ const HUDTargetQueue = require("./HUDManagers/HUDTargetQueueManager");
23
23
  var _FileMessager_brand = /*#__PURE__*/new WeakSet();
24
24
  class FileMessager {
25
25
  constructor(options = {
26
- pingTimeout: 3600000,
26
+ pingTimeout: 180000,
27
27
  pingInterval: 60000
28
28
  }, transportOptions = {
29
29
  parallelChunks: 3,
@@ -161,7 +161,8 @@ class FileMessager {
161
161
  const {
162
162
  totalItemsSent,
163
163
  recipientID,
164
- senderID
164
+ senderID,
165
+ runningOn
165
166
  } = listData;
166
167
  try {
167
168
  const recipientConnectionID = FileNetClientManager.getOnlineClient(recipientID).id;
@@ -173,7 +174,8 @@ class FileMessager {
173
174
  }
174
175
  this.fileNet.emitToTide(client.tideID, "client-file-list-received", {
175
176
  senderID,
176
- totalItemsSent
177
+ totalItemsSent,
178
+ runningOn
177
179
  });
178
180
  } catch (error) {
179
181
  console.error(`[FileTide ~ Net Scanner] ~ `, error);
@@ -185,7 +187,8 @@ class FileMessager {
185
187
  listedFiles,
186
188
  totalItems,
187
189
  recipientID,
188
- senderID
190
+ senderID,
191
+ runningOn
189
192
  } = listData;
190
193
  try {
191
194
  const recipientConnectionID = FileNetClientManager.getOnlineClient(recipientID).id;
@@ -198,7 +201,8 @@ class FileMessager {
198
201
  this.fileNet.emitToTide(client.tideID, "client-file-list", {
199
202
  senderID,
200
203
  totalItems,
201
- listedFiles
204
+ listedFiles,
205
+ runningOn
202
206
  });
203
207
  } catch (error) {
204
208
  console.error(`[FileTide ~ Net Scanner] ~ `, error);
@@ -420,7 +424,7 @@ class FileMessager {
420
424
  }
421
425
  handleAcknowledgeTransferTide(senderTide, data) {
422
426
  try {
423
- console.log(`[FileTide ~ Net Activity] ~ ${data.recipientName} acknowledged tide transfer from ${data.senderName}.\n\n\t~ [${data.fileName}-${data.transferStats.startTime}] ~\n\n\t\tFile Name ~ ${data.fileName}\n\t\tDestination ~ ${data.path}\n\n\t\t\tProgress ~ ${data.transferStats.progress.toFixed(2)}%\n\t\t\tETA ~ ${data.transferStats.timeLeft <= 0 ? "Now" : FileNetUtilityManager.convertSeconds(data.transferStats.timeLeft.toFixed(2))}\n\t\t\tSpeed ~ ${FileNetUtilityManager.getFormattedSize(data.transferStats.speed, true)}/s\n\t\t\tSize ~ ${FileNetUtilityManager.getFormattedSize(data.transferStats.totalSize, true)}\n\t\t\tTransferred ~ ${FileNetUtilityManager.getFormattedSize(data.transferStats.current, true)}\n`);
427
+ console.log(`[FileTide ~ Net Activity] ~ ${data.recipientName} acknowledged tide transfer from ${data.senderName}.\n\n\t~ [${data.fileName}-${data.transferStats.startTime}] ~\n\n\t\tFile Name ~ ${data.fileName}\n\t\tDestination ~ ${data.path}\n\n\t\t\tProgress ~ ${data.transferStats.progress !== null && data.transferStats.progress !== undefined ? data.transferStats.progress.toFixed(2) : "N/A"}%\n\t\t\tETA ~ ${data.transferStats.timeLeft <= 0 ? "Now" : FileNetUtilityManager.convertSeconds(data.transferStats.timeLeft !== null && data.transferStats.timeLeft !== undefined ? data.transferStats.timeLeft.toFixed(2) : Infinity)}\n\t\t\tSpeed ~ ${FileNetUtilityManager.getFormattedSize(data.transferStats.speed, true)}/s\n\t\t\tSize ~ ${FileNetUtilityManager.getFormattedSize(data.transferStats.totalSize, true)}\n\t\t\tTransferred ~ ${FileNetUtilityManager.getFormattedSize(data.transferStats.current, true)}\n`);
424
428
  } catch (error) {
425
429
  console.error(`[FileTide ~ Net Activity] ~ ${data.recipientName} acknowledged tide transfer from ${data.senderName}.\n\n${error}`);
426
430
  }
@@ -511,7 +515,7 @@ class FileMessager {
511
515
  this.fileNet.emitToTide(connectionDetails.tideID, "current-online-clients", Object.fromEntries(FileNetClientManager.getOnlineClients()));
512
516
  return;
513
517
  }
514
- handleClientOnline(senderTide, clientID, tideID, pClientID, connectionID, activeTransferBarrier) {
518
+ handleClientOnline(senderTide, clientID, tideID, pClientID, connectionID, activeTransferBarrier, originClientID, currentTideChannel) {
515
519
  if (!this.onlineClients.contains(connectionID)) {
516
520
  return;
517
521
  }
@@ -524,11 +528,18 @@ class FileMessager {
524
528
  pClientID: currentClientID,
525
529
  clientID: nClientID,
526
530
  tideID: senderTide.tideID,
527
- id: senderTide.id
531
+ id: senderTide.id,
532
+ connectedOn: Date.now(),
533
+ currentTideChannel,
534
+ originClientID
528
535
  });
529
536
  return;
530
537
  }
531
- FileNetClientManager.addOnlineClient(clientID, pClientID, tideID, connectionID);
538
+ FileNetClientManager.addOnlineClient(clientID, pClientID, tideID, connectionID, {
539
+ connectedOn: Date.now(),
540
+ currentTideChannel,
541
+ originClientID
542
+ });
532
543
  this.clientTransferBarriers.set(tideID, {
533
544
  clientID,
534
545
  activeTransferBarrier
@@ -557,7 +568,7 @@ class FileMessager {
557
568
  const tidingTransfers = this.currentTidingTransfers.get(clientData.clientID);
558
569
  if (tidingTransfers && tidingTransfers.size > 0) {
559
570
  for (let recipientID of tidingTransfers.keys()) {
560
- const recipientConnectionID = FileNetClientManager.getOnlineClient(data.recipientID).id;
571
+ const recipientConnectionID = FileNetClientManager.getOnlineClient(clientData.recipientID).id;
561
572
  const client = this.getClientFromID(recipientConnectionID);
562
573
  if (client) {
563
574
  this.fileNet.emitToTide(client.tideID, "save-current-transfer-states", {
@@ -10,6 +10,7 @@ const {
10
10
  const chalk = require("chalk");
11
11
  const path = require("path");
12
12
  const fs = require("fs");
13
+ const os = require("os");
13
14
  const {
14
15
  FileTideDebugUtilityManager,
15
16
  significantMessageColors,
@@ -48,6 +49,7 @@ class FileTide {
48
49
  this.transferBarrier = false;
49
50
  this.clients = new Map();
50
51
  this.currentUserID = "";
52
+ this.runningOn = os.platform();
51
53
  this.inDebugMode = debugMode;
52
54
  FileTideDebugUtilityManager.setDebugMode(debugMode);
53
55
  return;
@@ -109,7 +111,7 @@ class FileTide {
109
111
  const newClient = new FileMessagerClient(clientOptions, transportOptions, messagerSettings);
110
112
  const enterRoom = newClient.joinRoom(userID, roomName, connectionOptions, headers, onConnect, onDisconnect, authURL, authHeaders, useAuthentication, queryAuthToken);
111
113
  this.transferBarrier = enableTransferBarrier;
112
- this.clientShorePolicies.set(userID, [FileUtilityManager.getTidePath(">Downloads"), FileUtilityManager.getTidePath(">Documents"), FileUtilityManager.getTidePath(">Pictures"), FileUtilityManager.getTidePath(">Desktop"), FileUtilityManager.getTidePath(">Videos"), FileUtilityManager.getTidePath(">Music")]);
114
+ this.clientShorePolicies.set(userID, [FileUtilityManager.getTidePath(">Downloads"), FileUtilityManager.getTidePath(">Documents"), FileUtilityManager.getTidePath(">Desktop"), FileUtilityManager.getTidePath(">Photos"), FileUtilityManager.getTidePath(">Videos"), FileUtilityManager.getTidePath(">Music")]);
113
115
  this.clients.set(userID, newClient);
114
116
  FileTide.outputGradient(`[FileTide] ~ Messager launched successfully for client ~ ${userID}!`, significantMessageColors);
115
117
  _assertClassBrand(_FileTide_brand, this, _setupFileEventListeners).call(this, userID, newClient, onTransferProgress, onIncomingTransfer, onIncomingFile, onTransferBarrier, options);
@@ -304,11 +306,11 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
304
306
  headerAlign: "center",
305
307
  cellAlign: "left",
306
308
  borderStyle: "bold",
307
- columnOrder: ["clientID", "id", "tideID"],
309
+ columnOrder: ["clientID", "originClientID", "connectedOnDisplay"],
308
310
  columnNames: {
309
311
  clientID: "Client Name",
310
- id: "Identifier",
311
- tideID: "Tide Identifier"
312
+ originClientID: "Origin Name",
313
+ connectedOnDisplay: "Connected On"
312
314
  },
313
315
  title: "✨ Online ✨",
314
316
  tableNumber: 1,
@@ -330,7 +332,11 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
330
332
  const currentClients = {};
331
333
  Object.keys(data).forEach(key => {
332
334
  if (key !== userID) {
333
- currentClients[key] = data[key];
335
+ if (data[key] && data[key].currentTideChannel === data[userID].currentTideChannel) {
336
+ let currentClient = data[key];
337
+ currentClient.connectedOnDisplay = HUDUtilityManager.convertUTCDateToDateDisplay(currentClient.connectedOn, true, 1);
338
+ currentClients[key] = currentClient;
339
+ }
334
340
  }
335
341
  });
336
342
  if (Object.keys(currentClients).length <= 0) {
@@ -605,7 +611,8 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
605
611
  senderID: data.recipientID,
606
612
  recipientID: data.senderID,
607
613
  totalItems: files.length,
608
- listedFiles: files
614
+ listedFiles: files,
615
+ runningOn: this.runningOn
609
616
  });
610
617
  }
611
618
  });
@@ -614,7 +621,8 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
614
621
  client.clientTide.emitEvent(userID, "sent-file-list-to-client", {
615
622
  senderID: data.recipientID,
616
623
  recipientID: data.senderID,
617
- totalItemsSent: totalFilesSent
624
+ totalItemsSent: totalFilesSent,
625
+ runningOn: this.runningOn
618
626
  });
619
627
  }, 1000);
620
628
  });
@@ -3,7 +3,7 @@
3
3
  class FileMessagerConfigManager {
4
4
  static getServerOptions({
5
5
  maxHttpBufferSize = 1e9,
6
- pingTimeout = 3600000,
6
+ pingTimeout = 180000,
7
7
  pingInterval = 60000,
8
8
  useHTTPS = false,
9
9
  corsOrigin = "*",
@@ -12,11 +12,13 @@ class FileMessagerConfigManager {
12
12
  ...rest
13
13
  } = {}) {
14
14
  return {
15
- maxHttpBufferSize,
16
15
  useHTTPS,
17
16
  useCors,
18
17
  port,
19
18
  socketOptions: {
19
+ maxHttpBufferSize,
20
+ pingInterval,
21
+ pingTimeout,
20
22
  cors: {
21
23
  origin: corsOrigin,
22
24
  methods: ["GET", "POST"]
@@ -2,7 +2,7 @@
2
2
 
3
3
  const currentOnlineClients = new Map();
4
4
  class FileNetClientManager {
5
- static addOnlineClient(clientID, pClientID, tideID, id) {
5
+ static addOnlineClient(clientID, pClientID, tideID, id, details = {}) {
6
6
  if (currentOnlineClients.get(pClientID)) {
7
7
  currentOnlineClients.delete(pClientID);
8
8
  }
@@ -10,7 +10,8 @@ class FileNetClientManager {
10
10
  pClientID: pClientID || "",
11
11
  clientID,
12
12
  tideID,
13
- id
13
+ id,
14
+ ...(details || {})
14
15
  });
15
16
  return currentOnlineClients;
16
17
  }
@@ -12,9 +12,10 @@ class FileTransferTrackingManager {
12
12
  FileTransferTrackingManager.instance = this;
13
13
  }
14
14
  trackTransfer(data, fileStream) {
15
- FileTideDebugUtilityManager.log("notice", true, `Tracking transfer ~ ${data.fileName} | ${data.senderName}...`);
15
+ const senderN = data.senderName || data.senderID;
16
+ FileTideDebugUtilityManager.log("notice", true, `Tracking transfer ~ ${data.fileName} | ${senderN}...`);
16
17
  if (this.containsTransfer(data.fileName)) {
17
- FileTideDebugUtilityManager.log("notice", true, `Transfer ~ ${data.fileName} | ${data.senderName} already tracked.`);
18
+ FileTideDebugUtilityManager.log("notice", true, `Transfer ~ ${data.fileName} | ${senderN} already tracked.`);
18
19
  return;
19
20
  }
20
21
  const totalChunks = data.totalChunks || Math.ceil(data.fileSize / (data.chunkSize || 512 * 1024));
@@ -26,17 +27,18 @@ class FileTransferTrackingManager {
26
27
  fileStream,
27
28
  chunkSize
28
29
  });
29
- FileTideDebugUtilityManager.log("notice", true, `Tracked transfer ~ ${data.fileName} | ${data.senderName}!`);
30
+ FileTideDebugUtilityManager.log("notice", true, `Tracked transfer ~ ${data.fileName} | ${senderN}!`);
30
31
  }
31
32
  updateTransfer(data) {
32
- FileTideDebugUtilityManager.log("notice", true, `Updating tracked transfer ~ ${data.fileName} | ${data.senderName}...`);
33
+ const senderN = data.senderName || data.senderID;
34
+ FileTideDebugUtilityManager.log("notice", true, `Updating tracked transfer ~ ${data.fileName} | ${senderN}...`);
33
35
  if (!this.containsTransfer(data.fileName)) {
34
- FileTideDebugUtilityManager.log("notice", true, `Transfer ~ ${data.fileName} | ${data.senderName} not tracked.`);
36
+ FileTideDebugUtilityManager.log("notice", true, `Transfer ~ ${data.fileName} | ${senderN} not tracked.`);
35
37
  return;
36
38
  }
37
39
  const transferState = this.getTransfer(data.fileName);
38
40
  transferState.receivedChunks.add(data.chunkIndex);
39
- FileTideDebugUtilityManager.log("notice", true, `Updated tracked transfer ~ ${data.fileName} | ${data.senderName}!`);
41
+ FileTideDebugUtilityManager.log("notice", true, `Updated tracked transfer ~ ${data.fileName} | ${senderN}!`);
40
42
  }
41
43
  containsTransfer(transferID) {
42
44
  return this.activeTransfers.has(transferID);
@@ -271,7 +271,7 @@ class FileUtilityManager {
271
271
  ">AppData": platform === "win32" ? path.join(homeDir, "AppData", "Roaming") : path.join(homeDir, ".config"),
272
272
  ">LocalAppData": platform === "win32" ? path.join(homeDir, "AppData", "Local") : path.join(homeDir, ".local", "share"),
273
273
  ">Music": path.join(homeDir, "Music"),
274
- ">Pictures": path.join(homeDir, "Pictures"),
274
+ ">Photos": platform === "win32" ? path.join(homeDir, "Pictures") : path.join(homeDir, "Photos"),
275
275
  ">Videos": path.join(homeDir, "Videos"),
276
276
  ">Public": platform === "win32" ? path.join("C:", "Users", "Public") : "/usr/share",
277
277
  ">Templates": path.join(homeDir, "Templates"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
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": {