@trap_stevo/filetide 0.0.71 → 0.0.73

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.
@@ -107,6 +107,9 @@ class FileMessager {
107
107
  async getTidalyticsSince(interval = "1d", source = "storage", filter = {}) {
108
108
  return await tidalytics.getMetricsSince(interval, source, filter);
109
109
  }
110
+ async getTidalyticsBetween(start, end, source = "both", filter = {}) {
111
+ return await tidalytics.getMetricsBetween(start, end, source, filter);
112
+ }
110
113
  async getStoredTidalytics(filter = {}) {
111
114
  return await tidalytics.getStoredMetrics(filter);
112
115
  }
@@ -288,26 +291,30 @@ class FileMessager {
288
291
  interval = "1d",
289
292
  limit = Infinity,
290
293
  filter = {},
291
- mode = "all"
294
+ rangeMode = "since",
295
+ mode = "all",
296
+ start = null,
297
+ end = null
292
298
  } = options;
293
299
  const sources = ["storage", "memory"];
294
- const [storedOnline, storedOffline] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
300
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
301
+ const [storedOnline, storedOffline] = await Promise.all([fetch({
295
302
  ...filter,
296
303
  tags: {
297
304
  "tider:online": "tider:online"
298
305
  }
299
- }), this.getTidalyticsSince(interval, sources[0], {
306
+ }, sources[0]), fetch({
300
307
  ...filter,
301
308
  tags: {
302
309
  "tider:offline": "tider:offline"
303
310
  }
304
- })]);
305
- const [liveOnline] = await Promise.all([this.getTidalyticsSince(interval, sources[1], {
311
+ }, sources[0])]);
312
+ const [liveOnline] = await Promise.all([fetch({
306
313
  ...filter,
307
314
  tags: {
308
315
  "tider:online": "tider:online"
309
316
  }
310
- })]);
317
+ }, sources[1])]);
311
318
  const onlineMetrics = [...storedOnline, ...liveOnline];
312
319
  const offlineMetrics = storedOffline;
313
320
  const sessionsByKey = {};
@@ -344,11 +351,14 @@ class FileMessager {
344
351
  }
345
352
  async getAlreadyOnlineVisualData(options = {}) {
346
353
  const {
354
+ chartConfig = {},
347
355
  interval = "1d",
348
356
  filter = {},
349
357
  limit = Infinity,
350
358
  format = "raw",
351
- chartConfig = {}
359
+ rangeMode = "since",
360
+ start = null,
361
+ end = null
352
362
  } = options;
353
363
  const fullChartConfig = {
354
364
  groupBy: "metadata.user",
@@ -359,17 +369,18 @@ class FileMessager {
359
369
  ...chartConfig
360
370
  };
361
371
  const sources = ["storage", "memory"];
362
- const [alreadyOnlineEvents, onlineJoins] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
372
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
373
+ const [alreadyOnlineEvents, onlineJoins] = await Promise.all([fetch({
363
374
  ...filter,
364
375
  tags: {
365
376
  "tider:already-online": "tider:already-online"
366
377
  }
367
- }), this.getTidalyticsSince(interval, sources[0], {
378
+ }, sources[0]), fetch({
368
379
  ...filter,
369
380
  tags: {
370
381
  "tider:online": "tider:online"
371
382
  }
372
- })]);
383
+ }, sources[0])]);
373
384
  const entries = alreadyOnlineEvents.map(e => ({
374
385
  ...e,
375
386
  type: "already-online"
@@ -404,11 +415,14 @@ class FileMessager {
404
415
  }
405
416
  async getTiderBanVisualData(options = {}) {
406
417
  const {
418
+ chartConfig = {},
407
419
  interval = "1d",
408
420
  filter = {},
409
421
  limit = Infinity,
410
422
  format = "raw",
411
- chartConfig = {}
423
+ rangeMode = "since",
424
+ start = null,
425
+ end = null
412
426
  } = options;
413
427
  const fullChartConfig = {
414
428
  groupBy: "type",
@@ -416,22 +430,23 @@ class FileMessager {
416
430
  ...chartConfig
417
431
  };
418
432
  const sources = ["storage", "memory"];
419
- const [banned, kicked, unbanned] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
433
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
434
+ const [banned, kicked, unbanned] = await Promise.all([fetch({
420
435
  ...filter,
421
436
  tags: {
422
437
  "tider:banned": "tider:banned"
423
438
  }
424
- }), this.getTidalyticsSince(interval, sources[0], {
439
+ }, sources[0]), fetch({
425
440
  ...filter,
426
441
  tags: {
427
442
  "tider:kicked": "tider:kicked"
428
443
  }
429
- }), this.getTidalyticsSince(interval, sources[0], {
444
+ }, sources[0]), fetch({
430
445
  ...filter,
431
446
  tags: {
432
447
  "tider:unbanned": "tider:unbanned"
433
448
  }
434
- })]);
449
+ }, sources[0])]);
435
450
  const entries = [...banned.map(e => ({
436
451
  ...e,
437
452
  type: "banned"
@@ -455,11 +470,14 @@ class FileMessager {
455
470
  }
456
471
  async getTideFileTransferVisualData(options = {}) {
457
472
  const {
473
+ chartConfig = {},
458
474
  interval = "1d",
459
475
  filter = {},
460
476
  limit = Infinity,
461
477
  format = "raw",
462
- chartConfig = {}
478
+ rangeMode = "since",
479
+ start = null,
480
+ end = null
463
481
  } = options;
464
482
  const fullChartConfig = {
465
483
  groupBy: "type",
@@ -467,22 +485,23 @@ class FileMessager {
467
485
  ...chartConfig
468
486
  };
469
487
  const sources = ["storage", "memory"];
470
- const [incomingTransfers, incoming, completed] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
488
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
489
+ const [incomingTransfers, incoming, completed] = await Promise.all([fetch({
471
490
  ...filter,
472
491
  tags: {
473
492
  "tide:incoming-transfer": "tide:incoming-transfer"
474
493
  }
475
- }), this.getTidalyticsSince(interval, sources[0], {
494
+ }, sources[0]), fetch({
476
495
  ...filter,
477
496
  tags: {
478
497
  "tide:incoming-file": "tide:incoming-file"
479
498
  }
480
- }), this.getTidalyticsSince(interval, sources[0], {
499
+ }, sources[0]), fetch({
481
500
  ...filter,
482
501
  tags: {
483
502
  "tide:completed-transfer": "tide:completed-transfer"
484
503
  }
485
- })]);
504
+ }, sources[0])]);
486
505
  const entries = [...incomingTransfers.map(e => ({
487
506
  ...e,
488
507
  type: "incoming-transfer"
@@ -506,11 +525,14 @@ class FileMessager {
506
525
  }
507
526
  async getTideTransferStateVisualData(options = {}) {
508
527
  const {
528
+ chartConfig = {},
509
529
  interval = "1d",
510
530
  filter = {},
511
531
  limit = Infinity,
512
532
  format = "raw",
513
- chartConfig = {}
533
+ rangeMode = "since",
534
+ start = null,
535
+ end = null
514
536
  } = options;
515
537
  const fullChartConfig = {
516
538
  groupBy: "metadata.transferStateID",
@@ -521,12 +543,13 @@ class FileMessager {
521
543
  ...chartConfig
522
544
  };
523
545
  const sources = ["storage", "memory"];
524
- const [transferStates] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
546
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
547
+ const [transferStates] = await Promise.all([fetch({
525
548
  ...filter,
526
549
  tags: {
527
550
  "tide:transfer-state": "tide:transfer-state"
528
551
  }
529
- })]);
552
+ }, sources[0])]);
530
553
  const entries = transferStates.map(e => ({
531
554
  ...e,
532
555
  type: "transfer-state"
@@ -544,11 +567,14 @@ class FileMessager {
544
567
  }
545
568
  async getFileListActivityVisualData(options = {}) {
546
569
  const {
570
+ chartConfig = {},
547
571
  interval = "1d",
548
572
  filter = {},
549
573
  limit = Infinity,
550
574
  format = "raw",
551
- chartConfig = {}
575
+ rangeMode = "since",
576
+ start = null,
577
+ end = null
552
578
  } = options;
553
579
  const fullChartConfig = {
554
580
  groupBy: "type",
@@ -556,17 +582,18 @@ class FileMessager {
556
582
  ...chartConfig
557
583
  };
558
584
  const sources = ["storage", "memory"];
559
- const [requested, received] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
585
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
586
+ const [requested, received] = await Promise.all([fetch({
560
587
  ...filter,
561
588
  tags: {
562
589
  "file-list:request": "file-list:request"
563
590
  }
564
- }), this.getTidalyticsSince(interval, sources[0], {
591
+ }, sources[0]), fetch({
565
592
  ...filter,
566
593
  tags: {
567
594
  "file-list:received": "file-list:received"
568
595
  }
569
- })]);
596
+ }, sources[0])]);
570
597
  const entries = [...requested.map(e => ({
571
598
  ...e,
572
599
  type: "requested"
@@ -587,11 +614,14 @@ class FileMessager {
587
614
  }
588
615
  async getTideBarrierVisualData(options = {}) {
589
616
  const {
617
+ chartConfig = {},
590
618
  interval = "1d",
591
619
  filter = {},
592
620
  limit = Infinity,
593
621
  format = "raw",
594
- chartConfig = {}
622
+ rangeMode = "since",
623
+ start = null,
624
+ end = null
595
625
  } = options;
596
626
  const fullChartConfig = {
597
627
  groupBy: "type",
@@ -599,17 +629,18 @@ class FileMessager {
599
629
  ...chartConfig
600
630
  };
601
631
  const sources = ["storage", "memory"];
602
- const [accepted, denied] = await Promise.all([this.getTidalyticsSince(interval, sources[0], {
632
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
633
+ const [accepted, denied] = await Promise.all([fetch({
603
634
  ...filter,
604
635
  tags: {
605
636
  "tide-barrier:accepted": "tide-barrier:accepted"
606
637
  }
607
- }), this.getTidalyticsSince(interval, sources[0], {
638
+ }, sources[0]), fetch({
608
639
  ...filter,
609
640
  tags: {
610
641
  "tide-barrier:denied": "tide-barrier:denied"
611
642
  }
612
- })]);
643
+ }, sources[0])]);
613
644
  const entries = [...accepted.map(e => ({
614
645
  ...e,
615
646
  type: "accepted"
@@ -631,18 +662,23 @@ class FileMessager {
631
662
 
632
663
  // --- File Messager Tide Actions Management ---
633
664
 
634
- async getTideCompletedTransferActions({
635
- interval = "1d",
636
- limit = 50,
637
- source = "storage",
638
- filter = {}
639
- } = {}) {
640
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
665
+ async getTideCompletedTransferActions(options = {}) {
666
+ const {
667
+ interval = "1d",
668
+ limit = 50,
669
+ source = "storage",
670
+ filter = {},
671
+ rangeMode = "since",
672
+ start = null,
673
+ end = null
674
+ } = options;
675
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
676
+ const rawMetrics = await fetch({
641
677
  ...filter,
642
678
  tags: {
643
679
  "tide:completed-transfer": "tide:completed-transfer"
644
680
  }
645
- });
681
+ }, source);
646
682
  if (!Array.isArray(rawMetrics)) {
647
683
  return [];
648
684
  }
@@ -662,18 +698,23 @@ class FileMessager {
662
698
  }
663
699
  }));
664
700
  }
665
- async getTideTransferStateActions({
666
- interval = "1d",
667
- limit = Infinity,
668
- source = "storage",
669
- filter = {}
670
- } = {}) {
671
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
701
+ async getTideTransferStateActions(options = {}) {
702
+ const {
703
+ interval = "1d",
704
+ limit = Infinity,
705
+ source = "storage",
706
+ filter = {},
707
+ rangeMode = "since",
708
+ start = null,
709
+ end = null
710
+ } = options;
711
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
712
+ const rawMetrics = await fetch({
672
713
  ...filter,
673
714
  tags: {
674
715
  "tide:transfer-state": "tide:transfer-state"
675
716
  }
676
- });
717
+ }, source);
677
718
  if (!Array.isArray(rawMetrics)) {
678
719
  return [];
679
720
  }
@@ -696,18 +737,23 @@ class FileMessager {
696
737
  }
697
738
  }));
698
739
  }
699
- async getTideIncomingFileActions({
700
- interval = "1d",
701
- limit = 50,
702
- source = "storage",
703
- filter = {}
704
- } = {}) {
705
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
740
+ async getTideIncomingFileActions(options = {}) {
741
+ const {
742
+ interval = "1d",
743
+ limit = 50,
744
+ source = "storage",
745
+ filter = {},
746
+ rangeMode = "since",
747
+ start = null,
748
+ end = null
749
+ } = options;
750
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
751
+ const rawMetrics = await fetch({
706
752
  ...filter,
707
753
  tags: {
708
754
  "tide:incoming-file": "tide:incoming-file"
709
755
  }
710
- });
756
+ }, source);
711
757
  if (!Array.isArray(rawMetrics)) {
712
758
  return [];
713
759
  }
@@ -726,18 +772,23 @@ class FileMessager {
726
772
  }
727
773
  }));
728
774
  }
729
- async getTideIncomingTransferActions({
730
- interval = "1d",
731
- limit = 50,
732
- source = "storage",
733
- filter = {}
734
- } = {}) {
735
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
775
+ async getTideIncomingTransferActions(options = {}) {
776
+ const {
777
+ interval = "1d",
778
+ limit = 50,
779
+ source = "storage",
780
+ filter = {},
781
+ rangeMode = "since",
782
+ start = null,
783
+ end = null
784
+ } = options;
785
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
786
+ const rawMetrics = await fetch({
736
787
  ...filter,
737
788
  tags: {
738
789
  "tide:incoming-transfer": "tide:incoming-transfer"
739
790
  }
740
- });
791
+ }, source);
741
792
  if (!Array.isArray(rawMetrics)) {
742
793
  return [];
743
794
  }
@@ -755,18 +806,23 @@ class FileMessager {
755
806
  }
756
807
  }));
757
808
  }
758
- async getTideBarrierAcceptedActions({
759
- interval = "1d",
760
- limit = 50,
761
- source = "storage",
762
- filter = {}
763
- } = {}) {
764
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
809
+ async getTideBarrierAcceptedActions(options = {}) {
810
+ const {
811
+ interval = "1d",
812
+ limit = 50,
813
+ source = "storage",
814
+ filter = {},
815
+ rangeMode = "since",
816
+ start = null,
817
+ end = null
818
+ } = options;
819
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
820
+ const rawMetrics = await fetch({
765
821
  ...filter,
766
822
  tags: {
767
823
  "tide-barrier:accepted": "tide-barrier:accepted"
768
824
  }
769
- });
825
+ }, source);
770
826
  if (!Array.isArray(rawMetrics)) {
771
827
  return [];
772
828
  }
@@ -787,18 +843,23 @@ class FileMessager {
787
843
  }
788
844
  }));
789
845
  }
790
- async getTideBarrierDeniedActions({
791
- interval = "1d",
792
- limit = 50,
793
- source = "storage",
794
- filter = {}
795
- } = {}) {
796
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
846
+ async getTideBarrierDeniedActions(options = {}) {
847
+ const {
848
+ interval = "1d",
849
+ limit = 50,
850
+ source = "storage",
851
+ filter = {},
852
+ rangeMode = "since",
853
+ start = null,
854
+ end = null
855
+ } = options;
856
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
857
+ const rawMetrics = await fetch({
797
858
  ...filter,
798
859
  tags: {
799
860
  "tide-barrier:denied": "tide-barrier:denied"
800
861
  }
801
- });
862
+ }, source);
802
863
  if (!Array.isArray(rawMetrics)) {
803
864
  return [];
804
865
  }
@@ -819,18 +880,23 @@ class FileMessager {
819
880
  }
820
881
  }));
821
882
  }
822
- async getFileListReceivedActions({
823
- interval = "1d",
824
- limit = 50,
825
- source = "storage",
826
- filter = {}
827
- } = {}) {
828
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
883
+ async getFileListReceivedActions(options = {}) {
884
+ const {
885
+ interval = "1d",
886
+ limit = 50,
887
+ source = "storage",
888
+ filter = {},
889
+ rangeMode = "since",
890
+ start = null,
891
+ end = null
892
+ } = options;
893
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
894
+ const rawMetrics = await fetch({
829
895
  ...filter,
830
896
  tags: {
831
897
  "file-list:received": "file-list:received"
832
898
  }
833
- });
899
+ }, source);
834
900
  if (!Array.isArray(rawMetrics)) {
835
901
  return [];
836
902
  }
@@ -846,18 +912,23 @@ class FileMessager {
846
912
  }
847
913
  }));
848
914
  }
849
- async getFileListRequestActions({
850
- interval = "1d",
851
- limit = 50,
852
- source = "storage",
853
- filter = {}
854
- } = {}) {
855
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
915
+ async getFileListRequestActions(options = {}) {
916
+ const {
917
+ interval = "1d",
918
+ limit = 50,
919
+ source = "storage",
920
+ filter = {},
921
+ rangeMode = "since",
922
+ start = null,
923
+ end = null
924
+ } = options;
925
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
926
+ const rawMetrics = await fetch({
856
927
  ...filter,
857
928
  tags: {
858
929
  "file-list:request": "file-list:request"
859
930
  }
860
- });
931
+ }, source);
861
932
  if (!Array.isArray(rawMetrics)) {
862
933
  return [];
863
934
  }
@@ -872,18 +943,23 @@ class FileMessager {
872
943
  }
873
944
  }));
874
945
  }
875
- async getTiderBannedActions({
876
- interval = "1d",
877
- limit = 50,
878
- source = "storage",
879
- filter = {}
880
- } = {}) {
881
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
946
+ async getTiderBannedActions(options = {}) {
947
+ const {
948
+ interval = "1d",
949
+ limit = 50,
950
+ source = "storage",
951
+ filter = {},
952
+ rangeMode = "since",
953
+ start = null,
954
+ end = null
955
+ } = options;
956
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
957
+ const rawMetrics = await fetch({
882
958
  ...filter,
883
959
  tags: {
884
960
  "tider:banned": "tider:banned"
885
961
  }
886
- });
962
+ }, source);
887
963
  if (!Array.isArray(rawMetrics)) {
888
964
  return [];
889
965
  }
@@ -897,18 +973,23 @@ class FileMessager {
897
973
  }
898
974
  }));
899
975
  }
900
- async getTiderKickedActions({
901
- interval = "1d",
902
- limit = 50,
903
- source = "storage",
904
- filter = {}
905
- } = {}) {
906
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
976
+ async getTiderKickedActions(options = {}) {
977
+ const {
978
+ interval = "1d",
979
+ limit = 50,
980
+ source = "storage",
981
+ filter = {},
982
+ rangeMode = "since",
983
+ start = null,
984
+ end = null
985
+ } = options;
986
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
987
+ const rawMetrics = await fetch({
907
988
  ...filter,
908
989
  tags: {
909
990
  "tider:kicked": "tider:kicked"
910
991
  }
911
- });
992
+ }, source);
912
993
  if (!Array.isArray(rawMetrics)) {
913
994
  return [];
914
995
  }
@@ -922,18 +1003,23 @@ class FileMessager {
922
1003
  }
923
1004
  }));
924
1005
  }
925
- async getTiderUnbannedActions({
926
- interval = "1d",
927
- limit = 50,
928
- source = "storage",
929
- filter = {}
930
- } = {}) {
931
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
1006
+ async getTiderUnbannedActions(options = {}) {
1007
+ const {
1008
+ interval = "1d",
1009
+ limit = 50,
1010
+ source = "storage",
1011
+ filter = {},
1012
+ rangeMode = "since",
1013
+ start = null,
1014
+ end = null
1015
+ } = options;
1016
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
1017
+ const rawMetrics = await fetch({
932
1018
  ...filter,
933
1019
  tags: {
934
1020
  "tider:unbanned": "tider:unbanned"
935
1021
  }
936
- });
1022
+ }, source);
937
1023
  if (!Array.isArray(rawMetrics)) {
938
1024
  return [];
939
1025
  }
@@ -946,18 +1032,23 @@ class FileMessager {
946
1032
  }
947
1033
  }));
948
1034
  }
949
- async getTiderAlreadyOnlineActions({
950
- interval = "1d",
951
- limit = 50,
952
- source = "storage",
953
- filter = {}
954
- } = {}) {
955
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
1035
+ async getTiderAlreadyOnlineActions(options = {}) {
1036
+ const {
1037
+ interval = "1d",
1038
+ limit = 50,
1039
+ source = "storage",
1040
+ filter = {},
1041
+ rangeMode = "since",
1042
+ start = null,
1043
+ end = null
1044
+ } = options;
1045
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
1046
+ const rawMetrics = await fetch({
956
1047
  ...filter,
957
1048
  tags: {
958
1049
  "tider:already-online": "tider:already-online"
959
1050
  }
960
- });
1051
+ }, source);
961
1052
  if (!Array.isArray(rawMetrics)) {
962
1053
  return [];
963
1054
  }
@@ -976,18 +1067,23 @@ class FileMessager {
976
1067
  }
977
1068
  }));
978
1069
  }
979
- async getTiderOnlineActions({
980
- interval = "1d",
981
- limit = 50,
982
- source = "storage",
983
- filter = {}
984
- } = {}) {
985
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
1070
+ async getTiderOnlineActions(options = {}) {
1071
+ const {
1072
+ interval = "1d",
1073
+ limit = 50,
1074
+ source = "storage",
1075
+ filter = {},
1076
+ rangeMode = "since",
1077
+ start = null,
1078
+ end = null
1079
+ } = options;
1080
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
1081
+ const rawMetrics = await fetch({
986
1082
  ...filter,
987
1083
  tags: {
988
1084
  "tider:online": "tider:online"
989
1085
  }
990
- });
1086
+ }, source);
991
1087
  if (!rawMetrics || !Array.isArray(rawMetrics)) {
992
1088
  return [];
993
1089
  }
@@ -1006,18 +1102,23 @@ class FileMessager {
1006
1102
  }
1007
1103
  }));
1008
1104
  }
1009
- async getTiderOfflineActions({
1010
- interval = "1d",
1011
- limit = 50,
1012
- source = "storage",
1013
- filter = {}
1014
- } = {}) {
1015
- const rawMetrics = await this.getTidalyticsSince(interval, source, {
1105
+ async getTiderOfflineActions(options = {}) {
1106
+ const {
1107
+ interval = "1d",
1108
+ limit = 50,
1109
+ source = "storage",
1110
+ filter = {},
1111
+ rangeMode = "since",
1112
+ start = null,
1113
+ end = null
1114
+ } = options;
1115
+ const fetch = _assertClassBrand(_FileMessager_brand, this, _getTidalyticsRangeFetcher).call(this, interval, rangeMode, start, end);
1116
+ const rawMetrics = await fetch({
1016
1117
  ...filter,
1017
1118
  tags: {
1018
1119
  "tider:offline": "tider:offline"
1019
1120
  }
1020
- });
1121
+ }, source);
1021
1122
  if (!rawMetrics || !Array.isArray(rawMetrics)) {
1022
1123
  return [];
1023
1124
  }
@@ -2166,5 +2267,20 @@ function _log(...message) {
2166
2267
  }
2167
2268
  console.log(...message);
2168
2269
  }
2270
+ function _getTidalyticsRangeFetcher(interval, rangeMode, start, end) {
2271
+ return async (tagFilter, source) => {
2272
+ const effectiveFilter = {
2273
+ ...tagFilter
2274
+ };
2275
+ if (rangeMode === "between") {
2276
+ if (start == null || end == null) {
2277
+ console.log("[FileTide | Tidalytics] ~ Missing start or end time for 'between' mode.");
2278
+ return [];
2279
+ }
2280
+ return await this.getTidalyticsBetween(start, end, source, effectiveFilter);
2281
+ }
2282
+ return await this.getTidalyticsSince(interval, source, effectiveFilter);
2283
+ };
2284
+ }
2169
2285
  ;
2170
2286
  module.exports = FileMessager;
@@ -135,7 +135,7 @@ class TideTokenEnforcementManager {
135
135
  assumePreviouslyValid: true,
136
136
  fallbackIfOffline: true,
137
137
  autoRemoveExpired: true,
138
- storeInvalid: true
138
+ storeInvalid: false
139
139
  });
140
140
  }
141
141
  async validate(key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
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": {
@@ -40,8 +40,8 @@
40
40
  "@trap_stevo/legendarybuilderpronodejs-utilities": "^1.0.49",
41
41
  "@trap_stevo/lockline": "^0.0.11",
42
42
  "@trap_stevo/logictide": "^0.0.1",
43
- "@trap_stevo/metrictide": "^0.0.4",
44
- "@trap_stevo/timelyst": "^0.0.6",
43
+ "@trap_stevo/metrictide": "^0.0.5",
44
+ "@trap_stevo/timelyst": "^0.0.7",
45
45
  "chalk": "^4.1.2",
46
46
  "readline": "^1.3.0"
47
47
  },