@trap_stevo/filetide 0.0.69 → 0.0.70

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
@@ -30,7 +30,11 @@ Without the express written permission of the Licensor, Licensee shall not:
30
30
  2. Include the Package's source code or object code in any distributed software, service, or application.
31
31
  3. Use the Package to create a competing product or service that replicates the functionality of the Package.
32
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.
33
+ 5. Attempt to extract or analyze the functionality, structure, or behavior of the Package through runtime inspection, instrumentation, reflection, or behavioral analysis.
34
+ 6. Privately share, sublicense, or distribute the Package or any portion thereof, whether internally within an organization or externally to any third party, without written authorization.
35
+ 7. Remove, obscure, obfuscate, or alter any attribution, copyright notices, proprietary labels, or identifiers included in the Package.
36
+ 8. Re-upload, rename, fork, or redistribute the Package or any portion thereof on any registry, platform, or namespace other than that explicitly maintained by or authorized by the Licensor.
37
+ 9. Use the Package in any way that violates applicable laws, infringes on third-party rights, or breaches this agreement.
34
38
 
35
39
  ## 5. **Wrapper API Creation**
36
40
  Licensee is permitted to create and distribute Wrapper APIs, provided that:
@@ -69,5 +73,7 @@ Licensee agrees to indemnify and hold harmless the Licensor from any and all cla
69
73
  ## 10. **Governing Law and Dispute Resolution**
70
74
  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**.
71
75
 
72
- ## 9. **Amendments**
76
+ ## 11. **Amendments**
73
77
  Licensor reserves the right to modify or update this Agreement at any time. Any changes to the Agreement will be effective **30 days** after being posted to **https://www.npmjs.com/package/@trap_stevo/filetide**. The Licensor will notify Licensees of any material changes by **posting a notice in the package’s release notes on NPM**. Continued use of the package after the notice period constitutes acceptance of the modified terms.
78
+
79
+ **This Agreement applies to all versions of @trap_stevo/filetide downloaded, installed, or used on or after the Effective Date of this license, regardless of version number.** Use of any version of the Package after this date shall be deemed acceptance of and agreement to the terms of this license, unless otherwise explicitly stated by the Licensor.
@@ -1165,6 +1165,14 @@ class FileMessager {
1165
1165
  }
1166
1166
  return client;
1167
1167
  }
1168
+ getClient(clientID) {
1169
+ const client = FileNetClientManager.getOnlineClient(clientID);
1170
+ if (!client) {
1171
+ console.log(`Client ~ ${clientID} not found.`);
1172
+ return;
1173
+ }
1174
+ return client;
1175
+ }
1168
1176
  requestFromClient(requesterID, senderID, filePath = process.cwd(), destinationPath) {
1169
1177
  const senderConnectionID = FileNetClientManager.getOnlineClient(senderID).id;
1170
1178
  const client = this.getClientFromID(senderConnectionID);
@@ -16,6 +16,28 @@ function pickData(data, keys) {
16
16
  }, {});
17
17
  }
18
18
  ;
19
+ function parseSizeString(str) {
20
+ if (typeof str === "number") {
21
+ return str;
22
+ }
23
+ if (typeof str !== "string") {
24
+ return 0;
25
+ }
26
+ const units = {
27
+ B: 1,
28
+ KB: 1024,
29
+ MB: 1024 ** 2,
30
+ GB: 1024 ** 3,
31
+ TB: 1024 ** 4
32
+ };
33
+ const match = str.trim().toUpperCase().match(/^([\d.]+)\s*(B|KB|MB|GB|TB)$/);
34
+ if (!match) {
35
+ return 0;
36
+ }
37
+ const [, numStr, unit] = match;
38
+ return parseFloat(numStr) * units[unit];
39
+ }
40
+ ;
19
41
  function aggregateMultiAverageChartData(events, {
20
42
  groupBy = ["user"],
21
43
  valueKey = "metadata.fileSize",
@@ -38,7 +60,17 @@ function aggregateMultiAverageChartData(events, {
38
60
  return getNestedData(event, path) ?? "unknown";
39
61
  });
40
62
  const label = labelParts.join(" | ");
41
- const value = getNestedData(event, valueKey);
63
+ let rawValue = getNestedData(event, valueKey);
64
+ let value;
65
+ if (mode === "sum") {
66
+ if (valueKey.includes("speed") || valueKey.includes("fileSize")) {
67
+ value = parseSizeString(rawValue);
68
+ } else {
69
+ value = parseFloat(rawValue) || 0;
70
+ }
71
+ } else {
72
+ value = 1;
73
+ }
42
74
  if (typeof value !== "number") {
43
75
  continue;
44
76
  }
@@ -100,7 +132,17 @@ function aggregateChartData(events, {
100
132
  label = event[typeKey] || "other";
101
133
  }
102
134
  const type = event[typeKey] || "other";
103
- const value = mode === "sum" ? getNestedData(event, valueKey) || 0 : 1;
135
+ let rawValue = mode === "sum" ? getNestedData(event, valueKey) || 0 : 1;
136
+ let value;
137
+ if (mode === "sum") {
138
+ if (valueKey.includes("speed") || valueKey.includes("fileSize")) {
139
+ value = parseSizeString(rawValue);
140
+ } else {
141
+ value = parseFloat(rawValue) || 0;
142
+ }
143
+ } else {
144
+ value = 1;
145
+ }
104
146
  if (!buckets[type]) {
105
147
  buckets[type] = {
106
148
  previewFileNames: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
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": {
@@ -34,11 +34,11 @@
34
34
  "author": "Steven Compton",
35
35
  "license": "See License in LICENSE.md",
36
36
  "dependencies": {
37
- "@trap_stevo/iotide": "^0.0.43",
38
- "@trap_stevo/iotide-client": "^0.0.25",
39
- "@trap_stevo/legendarybuilderpronodejs-utilities": "^1.0.48",
40
- "@trap_stevo/metrictide": "^0.0.3",
41
- "@trap_stevo/timelyst": "^0.0.5",
37
+ "@trap_stevo/iotide": "^0.0.44",
38
+ "@trap_stevo/iotide-client": "^0.0.26",
39
+ "@trap_stevo/legendarybuilderpronodejs-utilities": "^1.0.49",
40
+ "@trap_stevo/metrictide": "^0.0.4",
41
+ "@trap_stevo/timelyst": "^0.0.6",
42
42
  "chalk": "^4.1.2",
43
43
  "readline": "^1.3.0"
44
44
  },