@adventurelabs/scout-core 1.0.88 → 1.0.90
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/helpers/connectivity.d.ts +4 -0
- package/dist/helpers/connectivity.js +45 -0
- package/dist/helpers/devices.d.ts +1 -1
- package/dist/helpers/sessions.d.ts +0 -1
- package/dist/helpers/sessions.js +1 -21
- package/dist/helpers/time.d.ts +4 -0
- package/dist/helpers/time.js +23 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/useScoutRealtimeConnectivity.d.ts +3 -0
- package/dist/hooks/useScoutRealtimeConnectivity.js +157 -0
- package/dist/hooks/useScoutRealtimeDevices.d.ts +3 -0
- package/dist/hooks/useScoutRealtimeDevices.js +58 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/providers/ScoutRefreshProvider.d.ts +160 -22
- package/dist/providers/ScoutRefreshProvider.js +4 -2
- package/dist/store/scout.d.ts +7 -1
- package/dist/store/scout.js +6 -1
- package/dist/types/connectivity.d.ts +4 -0
- package/dist/types/connectivity.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/supabase.d.ts +165 -23
- package/dist/types/supabase.js +3 -0
- package/package.json +1 -1
|
@@ -115,6 +115,8 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
115
115
|
connectivity: {
|
|
116
116
|
Row: {
|
|
117
117
|
altitude: number;
|
|
118
|
+
battery_percentage: number | null;
|
|
119
|
+
device_id: number | null;
|
|
118
120
|
h11_index: string;
|
|
119
121
|
h12_index: string;
|
|
120
122
|
h13_index: string;
|
|
@@ -124,12 +126,14 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
124
126
|
inserted_at: string;
|
|
125
127
|
location: unknown;
|
|
126
128
|
noise: number;
|
|
127
|
-
session_id: number;
|
|
129
|
+
session_id: number | null;
|
|
128
130
|
signal: number;
|
|
129
131
|
timestamp_start: string;
|
|
130
132
|
};
|
|
131
133
|
Insert: {
|
|
132
134
|
altitude: number;
|
|
135
|
+
battery_percentage?: number | null;
|
|
136
|
+
device_id?: number | null;
|
|
133
137
|
h11_index: string;
|
|
134
138
|
h12_index: string;
|
|
135
139
|
h13_index: string;
|
|
@@ -139,12 +143,14 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
139
143
|
inserted_at?: string;
|
|
140
144
|
location: unknown;
|
|
141
145
|
noise: number;
|
|
142
|
-
session_id
|
|
146
|
+
session_id?: number | null;
|
|
143
147
|
signal: number;
|
|
144
148
|
timestamp_start: string;
|
|
145
149
|
};
|
|
146
150
|
Update: {
|
|
147
151
|
altitude?: number;
|
|
152
|
+
battery_percentage?: number | null;
|
|
153
|
+
device_id?: number | null;
|
|
148
154
|
h11_index?: string;
|
|
149
155
|
h12_index?: string;
|
|
150
156
|
h13_index?: string;
|
|
@@ -154,11 +160,17 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
154
160
|
inserted_at?: string;
|
|
155
161
|
location?: unknown;
|
|
156
162
|
noise?: number;
|
|
157
|
-
session_id?: number;
|
|
163
|
+
session_id?: number | null;
|
|
158
164
|
signal?: number;
|
|
159
165
|
timestamp_start?: string;
|
|
160
166
|
};
|
|
161
167
|
Relationships: [{
|
|
168
|
+
foreignKeyName: "connectivity_device_id_fkey";
|
|
169
|
+
columns: ["device_id"];
|
|
170
|
+
isOneToOne: false;
|
|
171
|
+
referencedRelation: "devices";
|
|
172
|
+
referencedColumns: ["id"];
|
|
173
|
+
}, {
|
|
162
174
|
foreignKeyName: "connectivity_session_id_fkey";
|
|
163
175
|
columns: ["session_id"];
|
|
164
176
|
isOneToOne: false;
|
|
@@ -177,7 +189,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
177
189
|
herd_id: number;
|
|
178
190
|
id: number;
|
|
179
191
|
inserted_at: string;
|
|
180
|
-
location: unknown
|
|
192
|
+
location: unknown;
|
|
181
193
|
name: string;
|
|
182
194
|
video_publisher_token: string | null;
|
|
183
195
|
video_subscriber_token: string | null;
|
|
@@ -192,7 +204,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
192
204
|
herd_id: number;
|
|
193
205
|
id?: number;
|
|
194
206
|
inserted_at?: string;
|
|
195
|
-
location?: unknown
|
|
207
|
+
location?: unknown;
|
|
196
208
|
name: string;
|
|
197
209
|
video_publisher_token?: string | null;
|
|
198
210
|
video_subscriber_token?: string | null;
|
|
@@ -207,7 +219,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
207
219
|
herd_id?: number;
|
|
208
220
|
id?: number;
|
|
209
221
|
inserted_at?: string;
|
|
210
|
-
location?: unknown
|
|
222
|
+
location?: unknown;
|
|
211
223
|
name?: string;
|
|
212
224
|
video_publisher_token?: string | null;
|
|
213
225
|
video_subscriber_token?: string | null;
|
|
@@ -236,7 +248,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
236
248
|
id: number;
|
|
237
249
|
inserted_at: string;
|
|
238
250
|
is_public: boolean;
|
|
239
|
-
location: unknown
|
|
251
|
+
location: unknown;
|
|
240
252
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
241
253
|
media_url: string | null;
|
|
242
254
|
message: string | null;
|
|
@@ -252,7 +264,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
252
264
|
id?: number;
|
|
253
265
|
inserted_at?: string;
|
|
254
266
|
is_public?: boolean;
|
|
255
|
-
location?: unknown
|
|
267
|
+
location?: unknown;
|
|
256
268
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
257
269
|
media_url?: string | null;
|
|
258
270
|
message?: string | null;
|
|
@@ -268,7 +280,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
268
280
|
id?: number;
|
|
269
281
|
inserted_at?: string;
|
|
270
282
|
is_public?: boolean;
|
|
271
|
-
location?: unknown
|
|
283
|
+
location?: unknown;
|
|
272
284
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
273
285
|
media_url?: string | null;
|
|
274
286
|
message?: string | null;
|
|
@@ -391,6 +403,45 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
391
403
|
referencedColumns: ["id"];
|
|
392
404
|
}];
|
|
393
405
|
};
|
|
406
|
+
operators: {
|
|
407
|
+
Row: {
|
|
408
|
+
action: string | null;
|
|
409
|
+
created_at: string;
|
|
410
|
+
id: number;
|
|
411
|
+
session_id: number | null;
|
|
412
|
+
timestamp: string | null;
|
|
413
|
+
user_id: string;
|
|
414
|
+
};
|
|
415
|
+
Insert: {
|
|
416
|
+
action?: string | null;
|
|
417
|
+
created_at?: string;
|
|
418
|
+
id?: number;
|
|
419
|
+
session_id?: number | null;
|
|
420
|
+
timestamp?: string | null;
|
|
421
|
+
user_id: string;
|
|
422
|
+
};
|
|
423
|
+
Update: {
|
|
424
|
+
action?: string | null;
|
|
425
|
+
created_at?: string;
|
|
426
|
+
id?: number;
|
|
427
|
+
session_id?: number | null;
|
|
428
|
+
timestamp?: string | null;
|
|
429
|
+
user_id?: string;
|
|
430
|
+
};
|
|
431
|
+
Relationships: [{
|
|
432
|
+
foreignKeyName: "operators_session_id_fkey";
|
|
433
|
+
columns: ["session_id"];
|
|
434
|
+
isOneToOne: false;
|
|
435
|
+
referencedRelation: "sessions";
|
|
436
|
+
referencedColumns: ["id"];
|
|
437
|
+
}, {
|
|
438
|
+
foreignKeyName: "operators_user_id_fkey";
|
|
439
|
+
columns: ["user_id"];
|
|
440
|
+
isOneToOne: false;
|
|
441
|
+
referencedRelation: "users";
|
|
442
|
+
referencedColumns: ["id"];
|
|
443
|
+
}];
|
|
444
|
+
};
|
|
394
445
|
plans: {
|
|
395
446
|
Row: {
|
|
396
447
|
herd_id: number;
|
|
@@ -468,7 +519,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
468
519
|
earthranger_url: string | null;
|
|
469
520
|
id: number;
|
|
470
521
|
inserted_at: string;
|
|
471
|
-
locations: unknown
|
|
522
|
+
locations: unknown;
|
|
472
523
|
software_version: string;
|
|
473
524
|
timestamp_end: string | null;
|
|
474
525
|
timestamp_start: string;
|
|
@@ -486,7 +537,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
486
537
|
earthranger_url?: string | null;
|
|
487
538
|
id?: number;
|
|
488
539
|
inserted_at?: string;
|
|
489
|
-
locations?: unknown
|
|
540
|
+
locations?: unknown;
|
|
490
541
|
software_version: string;
|
|
491
542
|
timestamp_end?: string | null;
|
|
492
543
|
timestamp_start: string;
|
|
@@ -504,7 +555,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
504
555
|
earthranger_url?: string | null;
|
|
505
556
|
id?: number;
|
|
506
557
|
inserted_at?: string;
|
|
507
|
-
locations?: unknown
|
|
558
|
+
locations?: unknown;
|
|
508
559
|
software_version?: string;
|
|
509
560
|
timestamp_end?: string | null;
|
|
510
561
|
timestamp_start?: string;
|
|
@@ -528,7 +579,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
528
579
|
height: number;
|
|
529
580
|
id: number;
|
|
530
581
|
inserted_at: string;
|
|
531
|
-
location: unknown
|
|
582
|
+
location: unknown;
|
|
532
583
|
observation_type: Database["public"]["Enums"]["tag_observation_type"];
|
|
533
584
|
width: number;
|
|
534
585
|
x: number;
|
|
@@ -541,7 +592,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
541
592
|
height?: number;
|
|
542
593
|
id?: number;
|
|
543
594
|
inserted_at?: string;
|
|
544
|
-
location?: unknown
|
|
595
|
+
location?: unknown;
|
|
545
596
|
observation_type: Database["public"]["Enums"]["tag_observation_type"];
|
|
546
597
|
width: number;
|
|
547
598
|
x: number;
|
|
@@ -554,7 +605,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
554
605
|
height?: number;
|
|
555
606
|
id?: number;
|
|
556
607
|
inserted_at?: string;
|
|
557
|
-
location?: unknown
|
|
608
|
+
location?: unknown;
|
|
558
609
|
observation_type?: Database["public"]["Enums"]["tag_observation_type"];
|
|
559
610
|
width?: number;
|
|
560
611
|
x?: number;
|
|
@@ -671,7 +722,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
671
722
|
id: number | null;
|
|
672
723
|
inserted_at: string | null;
|
|
673
724
|
is_public: boolean | null;
|
|
674
|
-
location: unknown
|
|
725
|
+
location: unknown;
|
|
675
726
|
media_type: Database["public"]["Enums"]["media_type"] | null;
|
|
676
727
|
media_url: string | null;
|
|
677
728
|
message: string | null;
|
|
@@ -710,7 +761,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
710
761
|
id: number | null;
|
|
711
762
|
inserted_at: string | null;
|
|
712
763
|
is_public: boolean | null;
|
|
713
|
-
location: unknown
|
|
764
|
+
location: unknown;
|
|
714
765
|
media_type: Database["public"]["Enums"]["media_type"] | null;
|
|
715
766
|
media_url: string | null;
|
|
716
767
|
message: string | null;
|
|
@@ -744,7 +795,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
744
795
|
herd_id: number | null;
|
|
745
796
|
id: number | null;
|
|
746
797
|
inserted_at: string | null;
|
|
747
|
-
region: unknown
|
|
798
|
+
region: unknown;
|
|
748
799
|
};
|
|
749
800
|
Relationships: [{
|
|
750
801
|
foreignKeyName: "zones_herd_id_fkey";
|
|
@@ -761,18 +812,49 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
761
812
|
session_id_caller: number;
|
|
762
813
|
};
|
|
763
814
|
Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
|
|
815
|
+
SetofOptions: {
|
|
816
|
+
from: "*";
|
|
817
|
+
to: "connectivity_with_coordinates";
|
|
818
|
+
isOneToOne: false;
|
|
819
|
+
isSetofReturn: true;
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
get_connectivity_with_coordinates_by_device_and_timestamp: {
|
|
823
|
+
Args: {
|
|
824
|
+
device_id_caller: number;
|
|
825
|
+
timestamp_filter: string;
|
|
826
|
+
};
|
|
827
|
+
Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
|
|
828
|
+
SetofOptions: {
|
|
829
|
+
from: "*";
|
|
830
|
+
to: "connectivity_with_coordinates";
|
|
831
|
+
isOneToOne: false;
|
|
832
|
+
isSetofReturn: true;
|
|
833
|
+
};
|
|
764
834
|
};
|
|
765
835
|
get_device_by_api_key: {
|
|
766
836
|
Args: {
|
|
767
837
|
device_api_key: string;
|
|
768
838
|
};
|
|
769
839
|
Returns: Database["public"]["CompositeTypes"]["device_pretty_location"];
|
|
840
|
+
SetofOptions: {
|
|
841
|
+
from: "*";
|
|
842
|
+
to: "device_pretty_location";
|
|
843
|
+
isOneToOne: true;
|
|
844
|
+
isSetofReturn: false;
|
|
845
|
+
};
|
|
770
846
|
};
|
|
771
847
|
get_device_by_id: {
|
|
772
848
|
Args: {
|
|
773
849
|
device_id_caller: number;
|
|
774
850
|
};
|
|
775
851
|
Returns: Database["public"]["CompositeTypes"]["device_pretty_location"];
|
|
852
|
+
SetofOptions: {
|
|
853
|
+
from: "*";
|
|
854
|
+
to: "device_pretty_location";
|
|
855
|
+
isOneToOne: true;
|
|
856
|
+
isSetofReturn: false;
|
|
857
|
+
};
|
|
776
858
|
};
|
|
777
859
|
get_device_id_from_key: {
|
|
778
860
|
Args: {
|
|
@@ -785,6 +867,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
785
867
|
herd_id_caller: number;
|
|
786
868
|
};
|
|
787
869
|
Returns: Database["public"]["CompositeTypes"]["device_pretty_location"][];
|
|
870
|
+
SetofOptions: {
|
|
871
|
+
from: "*";
|
|
872
|
+
to: "device_pretty_location";
|
|
873
|
+
isOneToOne: false;
|
|
874
|
+
isSetofReturn: true;
|
|
875
|
+
};
|
|
788
876
|
};
|
|
789
877
|
get_events_and_tags_for_device: {
|
|
790
878
|
Args: {
|
|
@@ -792,6 +880,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
792
880
|
limit_caller: number;
|
|
793
881
|
};
|
|
794
882
|
Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
|
|
883
|
+
SetofOptions: {
|
|
884
|
+
from: "*";
|
|
885
|
+
to: "event_and_tags_pretty_location";
|
|
886
|
+
isOneToOne: false;
|
|
887
|
+
isSetofReturn: true;
|
|
888
|
+
};
|
|
795
889
|
};
|
|
796
890
|
get_events_and_tags_for_devices_batch: {
|
|
797
891
|
Args: {
|
|
@@ -799,6 +893,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
799
893
|
limit_per_device?: number;
|
|
800
894
|
};
|
|
801
895
|
Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
|
|
896
|
+
SetofOptions: {
|
|
897
|
+
from: "*";
|
|
898
|
+
to: "event_and_tags_pretty_location";
|
|
899
|
+
isOneToOne: false;
|
|
900
|
+
isSetofReturn: true;
|
|
901
|
+
};
|
|
802
902
|
};
|
|
803
903
|
get_events_and_tags_for_herd: {
|
|
804
904
|
Args: {
|
|
@@ -807,6 +907,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
807
907
|
offset_caller: number;
|
|
808
908
|
};
|
|
809
909
|
Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
|
|
910
|
+
SetofOptions: {
|
|
911
|
+
from: "*";
|
|
912
|
+
to: "event_and_tags_pretty_location";
|
|
913
|
+
isOneToOne: false;
|
|
914
|
+
isSetofReturn: true;
|
|
915
|
+
};
|
|
810
916
|
};
|
|
811
917
|
get_events_and_tags_for_session: {
|
|
812
918
|
Args: {
|
|
@@ -815,6 +921,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
815
921
|
session_id_caller: number;
|
|
816
922
|
};
|
|
817
923
|
Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
|
|
924
|
+
SetofOptions: {
|
|
925
|
+
from: "*";
|
|
926
|
+
to: "event_and_tags_pretty_location";
|
|
927
|
+
isOneToOne: false;
|
|
928
|
+
isSetofReturn: true;
|
|
929
|
+
};
|
|
818
930
|
};
|
|
819
931
|
get_events_with_tags_for_herd: {
|
|
820
932
|
Args: {
|
|
@@ -823,18 +935,36 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
823
935
|
offset_caller: number;
|
|
824
936
|
};
|
|
825
937
|
Returns: Database["public"]["CompositeTypes"]["event_with_tags"][];
|
|
938
|
+
SetofOptions: {
|
|
939
|
+
from: "*";
|
|
940
|
+
to: "event_with_tags";
|
|
941
|
+
isOneToOne: false;
|
|
942
|
+
isSetofReturn: true;
|
|
943
|
+
};
|
|
826
944
|
};
|
|
827
945
|
get_sessions_with_coordinates: {
|
|
828
946
|
Args: {
|
|
829
947
|
herd_id_caller: number;
|
|
830
948
|
};
|
|
831
949
|
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
950
|
+
SetofOptions: {
|
|
951
|
+
from: "*";
|
|
952
|
+
to: "session_with_coordinates";
|
|
953
|
+
isOneToOne: false;
|
|
954
|
+
isSetofReturn: true;
|
|
955
|
+
};
|
|
832
956
|
};
|
|
833
957
|
get_sessions_with_coordinates_by_device: {
|
|
834
958
|
Args: {
|
|
835
959
|
device_id_caller: number;
|
|
836
960
|
};
|
|
837
961
|
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
962
|
+
SetofOptions: {
|
|
963
|
+
from: "*";
|
|
964
|
+
to: "session_with_coordinates";
|
|
965
|
+
isOneToOne: false;
|
|
966
|
+
isSetofReturn: true;
|
|
967
|
+
};
|
|
838
968
|
};
|
|
839
969
|
get_total_events_for_herd_with_session_filter: {
|
|
840
970
|
Args: {
|
|
@@ -856,6 +986,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
856
986
|
offset_caller: number;
|
|
857
987
|
};
|
|
858
988
|
Returns: Database["public"]["CompositeTypes"]["zones_and_actions_pretty_location"][];
|
|
989
|
+
SetofOptions: {
|
|
990
|
+
from: "*";
|
|
991
|
+
to: "zones_and_actions_pretty_location";
|
|
992
|
+
isOneToOne: false;
|
|
993
|
+
isSetofReturn: true;
|
|
994
|
+
};
|
|
859
995
|
};
|
|
860
996
|
load_api_keys: {
|
|
861
997
|
Args: {
|
|
@@ -880,13 +1016,13 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
880
1016
|
Returns: string[];
|
|
881
1017
|
};
|
|
882
1018
|
remove_rls_broadcast_triggers: {
|
|
883
|
-
Args:
|
|
1019
|
+
Args: never;
|
|
884
1020
|
Returns: undefined;
|
|
885
1021
|
};
|
|
886
1022
|
};
|
|
887
1023
|
Enums: {
|
|
888
1024
|
app_permission: "herds.delete" | "events.delete";
|
|
889
|
-
device_type: "trail_camera" | "drone_fixed_wing" | "drone_quad" | "gps_tracker" | "sentry_tower" | "smart_buoy" | "radio_mesh_base_station" | "radio_mesh_repeater" | "unknown";
|
|
1025
|
+
device_type: "trail_camera" | "drone_fixed_wing" | "drone_quad" | "gps_tracker" | "sentry_tower" | "smart_buoy" | "radio_mesh_base_station" | "radio_mesh_repeater" | "unknown" | "gps_tracker_vehicle" | "gps_tracker_person" | "radio_mesh_base_station_gateway";
|
|
890
1026
|
media_type: "image" | "video" | "audio" | "text";
|
|
891
1027
|
plan_type: "mission" | "fence" | "rally" | "markov";
|
|
892
1028
|
role: "admin" | "viewer" | "editor" | "operator";
|
|
@@ -897,6 +1033,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
897
1033
|
connectivity_with_coordinates: {
|
|
898
1034
|
id: number | null;
|
|
899
1035
|
session_id: number | null;
|
|
1036
|
+
device_id: number | null;
|
|
900
1037
|
inserted_at: string | null;
|
|
901
1038
|
timestamp_start: string | null;
|
|
902
1039
|
signal: number | null;
|
|
@@ -909,6 +1046,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
909
1046
|
h13_index: string | null;
|
|
910
1047
|
h12_index: string | null;
|
|
911
1048
|
h11_index: string | null;
|
|
1049
|
+
battery_percentage: number | null;
|
|
912
1050
|
};
|
|
913
1051
|
device_pretty_location: {
|
|
914
1052
|
id: number | null;
|
|
@@ -964,7 +1102,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
964
1102
|
inserted_at: string | null;
|
|
965
1103
|
message: string | null;
|
|
966
1104
|
media_url: string | null;
|
|
967
|
-
location: unknown
|
|
1105
|
+
location: unknown;
|
|
968
1106
|
earthranger_url: string | null;
|
|
969
1107
|
altitude: number | null;
|
|
970
1108
|
heading: number | null;
|
|
@@ -1018,7 +1156,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1018
1156
|
event_id: number | null;
|
|
1019
1157
|
class_name: string | null;
|
|
1020
1158
|
height: number | null;
|
|
1021
|
-
location: unknown
|
|
1159
|
+
location: unknown;
|
|
1022
1160
|
latitude: number | null;
|
|
1023
1161
|
longitude: number | null;
|
|
1024
1162
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useScoutRefresh } from "../hooks/useScoutRefresh";
|
|
4
|
-
import { useScoutDbListener } from "../hooks/useScoutDbListener";
|
|
5
4
|
import { createContext, useContext, useMemo, useRef } from "react";
|
|
6
5
|
import { createBrowserClient } from "@supabase/ssr";
|
|
6
|
+
import { useScoutRealtimeConnectivity } from "@/hooks/useScoutRealtimeConnectivity";
|
|
7
|
+
import { useScoutRealtimeDevices } from "@/hooks/useScoutRealtimeDevices";
|
|
7
8
|
// Create context for the Supabase client
|
|
8
9
|
const SupabaseContext = createContext(null);
|
|
9
10
|
const ConnectionStatusContext = createContext(null);
|
|
@@ -33,7 +34,8 @@ export function ScoutRefreshProvider({ children }) {
|
|
|
33
34
|
return createBrowserClient(urlRef.current, anonKeyRef.current);
|
|
34
35
|
}, []); // Empty dependency array ensures this only runs once
|
|
35
36
|
// Use the enhanced DB listener with connection status
|
|
36
|
-
|
|
37
|
+
useScoutRealtimeConnectivity(supabaseClient);
|
|
38
|
+
useScoutRealtimeDevices(supabaseClient);
|
|
37
39
|
useScoutRefresh();
|
|
38
40
|
// // Log connection status changes for debugging
|
|
39
41
|
// if (connectionStatus.lastError) {
|
package/dist/store/scout.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IUser } from "../types/db";
|
|
2
2
|
import { IHerdModule, EnumHerdModulesLoadingState } from "../types/herd_module";
|
|
3
3
|
import { EnumDataSource, IDataSourceInfo } from "../types/data_source";
|
|
4
|
+
import { MapDeviceIdToConnectivity } from "../types/connectivity";
|
|
4
5
|
export declare enum EnumScoutStateStatus {
|
|
5
6
|
LOADING = "LOADING",
|
|
6
7
|
DONE_LOADING = "DONE_LOADING"
|
|
@@ -20,6 +21,7 @@ export interface ScoutState {
|
|
|
20
21
|
user: IUser | null;
|
|
21
22
|
data_source: EnumDataSource;
|
|
22
23
|
data_source_info: IDataSourceInfo | null;
|
|
24
|
+
active_herd_gps_trackers_connectivity: MapDeviceIdToConnectivity;
|
|
23
25
|
}
|
|
24
26
|
export interface RootState {
|
|
25
27
|
scout: ScoutState;
|
|
@@ -153,7 +155,11 @@ export declare const scoutSlice: import("@reduxjs/toolkit").Slice<ScoutState, {
|
|
|
153
155
|
payload: any;
|
|
154
156
|
type: string;
|
|
155
157
|
}) => void;
|
|
158
|
+
setActiveHerdGpsTrackersConnectivity: (state: import("immer").WritableDraft<ScoutState>, action: {
|
|
159
|
+
payload: any;
|
|
160
|
+
type: string;
|
|
161
|
+
}) => void;
|
|
156
162
|
}, "scout", "scout", import("@reduxjs/toolkit").SliceSelectors<ScoutState>>;
|
|
157
|
-
export declare const setHerdModules: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModules">, setStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setStatus">, setHerdModulesLoadingState: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModulesLoadingState">, setHerdModulesLoadedInMs: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModulesLoadedInMs">, setHerdModulesApiDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModulesApiDuration">, setUserApiDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setUserApiDuration">, setDataProcessingDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setDataProcessingDuration">, setLocalStorageDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setLocalStorageDuration">, setActiveHerdId: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setActiveHerdId">, setActiveDeviceId: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setActiveDeviceId">, setDataSource: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setDataSource">, setDataSourceInfo: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setDataSourceInfo">, appendEventsToHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/appendEventsToHerdModule">, replaceEventsForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/replaceEventsForHerdModule">, updateEventValuesForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateEventValuesForHerdModule">, updatePageIndexForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updatePageIndexForHerdModule">, appendPlansToHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/appendPlansToHerdModule">, setUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setUser">, addTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addTag">, deleteTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deleteTag">, updateTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateTag">, addNewDeviceToHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addNewDeviceToHerdModule">, updateDeviceForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateDeviceForHerdModule">, addDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addDevice">, deleteDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deleteDevice">, updateDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateDevice">, addPlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addPlan">, deletePlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deletePlan">, updatePlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updatePlan">, addSessionToStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addSessionToStore">, deleteSessionFromStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deleteSessionFromStore">, updateSessionInStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateSessionInStore">;
|
|
163
|
+
export declare const setHerdModules: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModules">, setStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setStatus">, setHerdModulesLoadingState: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModulesLoadingState">, setHerdModulesLoadedInMs: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModulesLoadedInMs">, setHerdModulesApiDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setHerdModulesApiDuration">, setUserApiDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setUserApiDuration">, setDataProcessingDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setDataProcessingDuration">, setLocalStorageDuration: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setLocalStorageDuration">, setActiveHerdId: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setActiveHerdId">, setActiveDeviceId: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setActiveDeviceId">, setDataSource: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setDataSource">, setDataSourceInfo: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setDataSourceInfo">, appendEventsToHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/appendEventsToHerdModule">, replaceEventsForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/replaceEventsForHerdModule">, updateEventValuesForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateEventValuesForHerdModule">, updatePageIndexForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updatePageIndexForHerdModule">, appendPlansToHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/appendPlansToHerdModule">, setUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setUser">, addTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addTag">, deleteTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deleteTag">, updateTag: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateTag">, addNewDeviceToHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addNewDeviceToHerdModule">, updateDeviceForHerdModule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateDeviceForHerdModule">, addDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addDevice">, deleteDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deleteDevice">, updateDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateDevice">, addPlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addPlan">, deletePlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deletePlan">, updatePlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updatePlan">, addSessionToStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/addSessionToStore">, deleteSessionFromStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/deleteSessionFromStore">, updateSessionInStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/updateSessionInStore">, setActiveHerdGpsTrackersConnectivity: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scout/setActiveHerdGpsTrackersConnectivity">;
|
|
158
164
|
declare const _default: import("redux").Reducer<ScoutState>;
|
|
159
165
|
export default _default;
|
package/dist/store/scout.js
CHANGED
|
@@ -23,6 +23,7 @@ const initialState = {
|
|
|
23
23
|
// Initialize data source tracking
|
|
24
24
|
data_source: EnumDataSource.UNKNOWN,
|
|
25
25
|
data_source_info: null,
|
|
26
|
+
active_herd_gps_trackers_connectivity: {},
|
|
26
27
|
};
|
|
27
28
|
export const scoutSlice = createSlice({
|
|
28
29
|
name: "scout",
|
|
@@ -55,6 +56,7 @@ export const scoutSlice = createSlice({
|
|
|
55
56
|
},
|
|
56
57
|
setActiveHerdId: (state, action) => {
|
|
57
58
|
state.active_herd_id = action.payload;
|
|
59
|
+
state.active_herd_gps_trackers_connectivity = {};
|
|
58
60
|
},
|
|
59
61
|
setActiveDeviceId: (state, action) => {
|
|
60
62
|
state.active_device_id = action.payload;
|
|
@@ -261,8 +263,11 @@ export const scoutSlice = createSlice({
|
|
|
261
263
|
setUser: (state, action) => {
|
|
262
264
|
state.user = action.payload;
|
|
263
265
|
},
|
|
266
|
+
setActiveHerdGpsTrackersConnectivity: (state, action) => {
|
|
267
|
+
state.active_herd_gps_trackers_connectivity = action.payload;
|
|
268
|
+
},
|
|
264
269
|
},
|
|
265
270
|
});
|
|
266
271
|
// Action creators are generated for each case reducer function
|
|
267
|
-
export const { setHerdModules, setStatus, setHerdModulesLoadingState, setHerdModulesLoadedInMs, setHerdModulesApiDuration, setUserApiDuration, setDataProcessingDuration, setLocalStorageDuration, setActiveHerdId, setActiveDeviceId, setDataSource, setDataSourceInfo, appendEventsToHerdModule, replaceEventsForHerdModule, updateEventValuesForHerdModule, updatePageIndexForHerdModule, appendPlansToHerdModule, setUser, addTag, deleteTag, updateTag, addNewDeviceToHerdModule, updateDeviceForHerdModule, addDevice, deleteDevice, updateDevice, addPlan, deletePlan, updatePlan, addSessionToStore, deleteSessionFromStore, updateSessionInStore, } = scoutSlice.actions;
|
|
272
|
+
export const { setHerdModules, setStatus, setHerdModulesLoadingState, setHerdModulesLoadedInMs, setHerdModulesApiDuration, setUserApiDuration, setDataProcessingDuration, setLocalStorageDuration, setActiveHerdId, setActiveDeviceId, setDataSource, setDataSourceInfo, appendEventsToHerdModule, replaceEventsForHerdModule, updateEventValuesForHerdModule, updatePageIndexForHerdModule, appendPlansToHerdModule, setUser, addTag, deleteTag, updateTag, addNewDeviceToHerdModule, updateDeviceForHerdModule, addDevice, deleteDevice, updateDevice, addPlan, deletePlan, updatePlan, addSessionToStore, deleteSessionFromStore, updateSessionInStore, setActiveHerdGpsTrackersConnectivity, } = scoutSlice.actions;
|
|
268
273
|
export default scoutSlice.reducer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED