@trap_stevo/filetide 0.0.90 → 0.0.91
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/dist/cjs/FileTide.js +8 -17
- package/package.json +1 -1
package/dist/cjs/FileTide.js
CHANGED
|
@@ -744,9 +744,6 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
744
744
|
client.clientTide.onEvent(userID, "transfer-complete", data => {
|
|
745
745
|
const savePath = FileUtilityManager.getTidePath(path.join(data.filePath, data.fileName));
|
|
746
746
|
try {
|
|
747
|
-
if (displayTransferOutput) {
|
|
748
|
-
_FileTide.outputGradient(`[${userID}] File transfer complete ~ ${data.fileName}`, significantMessageColors);
|
|
749
|
-
}
|
|
750
747
|
const transferState = FileTransferTrackingManager.getTransfer(data.fileName);
|
|
751
748
|
FileTideDebugUtilityManager.log("notice", true, `Transfer state ~ ${data.fileName} active | ${transferState !== null && transferState !== undefined ? true : false}`);
|
|
752
749
|
if (!transferState) {
|
|
@@ -754,11 +751,6 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
754
751
|
}
|
|
755
752
|
if (transferState.fileStream) {
|
|
756
753
|
fileTransferReceiver.completeTransfer(data, (transferData, transfers, success, error) => {
|
|
757
|
-
if (success && displayTransferOutput) {
|
|
758
|
-
_FileTide.outputGradient(`[${userID}] File saved at ~ ${savePath}\n`, significantMessageColors);
|
|
759
|
-
} else if (!success && displayTransferOutput) {
|
|
760
|
-
_FileTide.outputGradient(`[${userID}] Did not save file at ~ ${savePath}\n\t${error}\n`, errorMessageColors);
|
|
761
|
-
}
|
|
762
754
|
const transferStats = success ? this.transferStatsManager.completeTransfer(data.transferId || data.fileName) : this.transferStatsManager.failTransfer(data.transferId || data.fileName);
|
|
763
755
|
if (onTransferComplete) {
|
|
764
756
|
onTransferComplete({
|
|
@@ -766,15 +758,17 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
766
758
|
stats: transferStats
|
|
767
759
|
}, FileTransferTrackingManager.activeTransfers, success);
|
|
768
760
|
}
|
|
761
|
+
if (success && displayTransferOutput) {
|
|
762
|
+
_FileTide.outputGradient(`[${userID}] File saved at ~ ${savePath}\n`, significantMessageColors);
|
|
763
|
+
} else if (!success && displayTransferOutput) {
|
|
764
|
+
_FileTide.outputGradient(`[${userID}] Did not save file at ~ ${savePath}\n\t${error}\n`, errorMessageColors);
|
|
765
|
+
}
|
|
769
766
|
FileTransferTrackingManager.outputCurrentTransfers();
|
|
770
767
|
this.transferStatsManager.clearTransfer(data.transferId || data.fileName);
|
|
771
768
|
});
|
|
772
769
|
return;
|
|
773
770
|
}
|
|
774
771
|
FileTransferTrackingManager.untrackTransfer(data.fileName);
|
|
775
|
-
if (displayTransferOutput) {
|
|
776
|
-
_FileTide.outputGradient(`[${userID}] Transfer successfully sent to ~ ${data.recipientId} and saved at ~ ${path.join(data.filePath, data.fileName)}\n`, significantMessageColors);
|
|
777
|
-
}
|
|
778
772
|
const transferStats = this.transferStatsManager.completeTransfer(data.transferId || data.fileName);
|
|
779
773
|
if (onTransferComplete) {
|
|
780
774
|
onTransferComplete({
|
|
@@ -783,13 +777,11 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
783
777
|
}, FileTransferTrackingManager.activeTransfers, true);
|
|
784
778
|
}
|
|
785
779
|
if (displayTransferOutput) {
|
|
780
|
+
_FileTide.outputGradient(`[${userID}] Transfer successfully sent to ~ ${data.recipientId} and saved at ~ ${path.join(data.filePath, data.fileName)}\n`, significantMessageColors);
|
|
786
781
|
FileTransferTrackingManager.outputCurrentTransfers();
|
|
787
782
|
}
|
|
788
783
|
this.transferStatsManager.clearTransfer(data.transferId || data.fileName);
|
|
789
784
|
} catch (error) {
|
|
790
|
-
if (displayTransferOutput) {
|
|
791
|
-
_FileTide.outputGradient(`[${userID}] Did not save file at ~ ${savePath}\n${error}`, errorMessageColors);
|
|
792
|
-
}
|
|
793
785
|
const transferStats = this.transferStatsManager.failTransfer(data.transferId || data.fileName);
|
|
794
786
|
if (onTransferComplete) {
|
|
795
787
|
onTransferComplete({
|
|
@@ -798,6 +790,7 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
798
790
|
}, FileTransferTrackingManager.activeTransfers, false);
|
|
799
791
|
}
|
|
800
792
|
if (displayTransferOutput) {
|
|
793
|
+
_FileTide.outputGradient(`[${userID}] Did not save file at ~ ${savePath}\n${error}`, errorMessageColors);
|
|
801
794
|
FileTransferTrackingManager.outputCurrentTransfers();
|
|
802
795
|
}
|
|
803
796
|
this.transferStatsManager.clearTransfer(data.transferId || data.fileName);
|
|
@@ -805,9 +798,6 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
805
798
|
});
|
|
806
799
|
client.clientTide.onEvent(userID, "transfer-failed", async data => {
|
|
807
800
|
const transferState = FileTransferTrackingManager.getTransfer(data.fileName);
|
|
808
|
-
if (displayTransferOutput) {
|
|
809
|
-
_FileTide.outputGradient(`[${userID}] File transfer failed ~ ${data.fileName}${data.reason ? `\n${data.reason}` : ""}`, errorMessageColors);
|
|
810
|
-
}
|
|
811
801
|
if (transferState?.fileStream) {
|
|
812
802
|
try {
|
|
813
803
|
await new Promise(resolve => {
|
|
@@ -830,6 +820,7 @@ function _setupFileEventListeners(userID, client, onTransferProgress, onIncoming
|
|
|
830
820
|
onTransferComplete(failureData, FileTransferTrackingManager.activeTransfers, false);
|
|
831
821
|
}
|
|
832
822
|
if (displayTransferOutput) {
|
|
823
|
+
_FileTide.outputGradient(`[${userID}] File transfer failed ~ ${data.fileName}${data.reason ? `\n${data.reason}` : ""}`, errorMessageColors);
|
|
833
824
|
FileTransferTrackingManager.outputCurrentTransfers();
|
|
834
825
|
}
|
|
835
826
|
this.transferStatsManager.clearTransfer(data.transferId || data.fileName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trap_stevo/filetide",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.91",
|
|
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": {
|