@adventurelabs/scout-core 1.4.39 → 1.4.41
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/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useInfiniteQuery.d.ts +8 -1
- package/dist/hooks/useInfiniteQuery.js +143 -0
- package/dist/providers/ScoutRefreshProvider.d.ts +170 -0
- package/dist/store/api.d.ts +45 -132
- package/dist/store/api.js +28 -8
- package/dist/store/configureStore.d.ts +8 -48
- package/dist/types/supabase.d.ts +170 -0
- package/package.json +1 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export { useScoutRealtimeSessions } from "./useScoutRealtimeSessions";
|
|
|
8
8
|
export { useScoutRealtimePlans } from "./useScoutRealtimePlans";
|
|
9
9
|
export { useScoutRealtimePins } from "./useScoutRealtimePins";
|
|
10
10
|
export { useScoutRealtimeParts } from "./useScoutRealtimeParts";
|
|
11
|
-
export { useInfiniteSessionsByHerd, useInfiniteSessionsByDevice, useInfiniteEventsByHerd, useInfiniteEventsByDevice, useInfiniteArtifactsByHerd, useInfiniteArtifactsByDevice, useIntersectionObserver, } from "./useInfiniteQuery";
|
|
11
|
+
export { useInfiniteSessionsByHerd, useInfiniteSessionsByDevice, useInfiniteEventsByHerd, useInfiniteEventsByDevice, useInfiniteArtifactsByHerd, useInfiniteArtifactsByDevice, useInfiniteFeedByHerd, useInfiniteFeedByDevice, useIntersectionObserver, type UseInfiniteScrollOptions, } from "./useInfiniteQuery";
|
|
12
12
|
export { useLoadingPerformance, useSessionSummariesByHerd, useHasSessionSummaries, } from "../store/hooks";
|
package/dist/hooks/index.js
CHANGED
|
@@ -9,6 +9,6 @@ export { useScoutRealtimePlans } from "./useScoutRealtimePlans";
|
|
|
9
9
|
export { useScoutRealtimePins } from "./useScoutRealtimePins";
|
|
10
10
|
export { useScoutRealtimeParts } from "./useScoutRealtimeParts";
|
|
11
11
|
// RTK Query infinite scroll hooks
|
|
12
|
-
export { useInfiniteSessionsByHerd, useInfiniteSessionsByDevice, useInfiniteEventsByHerd, useInfiniteEventsByDevice, useInfiniteArtifactsByHerd, useInfiniteArtifactsByDevice, useIntersectionObserver, } from "./useInfiniteQuery";
|
|
12
|
+
export { useInfiniteSessionsByHerd, useInfiniteSessionsByDevice, useInfiniteEventsByHerd, useInfiniteEventsByDevice, useInfiniteArtifactsByHerd, useInfiniteArtifactsByDevice, useInfiniteFeedByHerd, useInfiniteFeedByDevice, useIntersectionObserver, } from "./useInfiniteQuery";
|
|
13
13
|
// Session summaries and performance hooks
|
|
14
14
|
export { useLoadingPerformance, useSessionSummariesByHerd, useHasSessionSummaries, } from "../store/hooks";
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
2
|
import { IArtifactWithMediaUrl, ISessionWithCoordinates, IEventAndTagsPrettyLocation, IFeedItem } from "../types/db";
|
|
3
|
-
interface UseInfiniteScrollOptions {
|
|
3
|
+
export interface UseInfiniteScrollOptions {
|
|
4
4
|
limit?: number;
|
|
5
5
|
enabled?: boolean;
|
|
6
6
|
supabase: SupabaseClient;
|
|
7
|
+
/** Inclusive time window in iso format */
|
|
8
|
+
rangeStart?: string | null;
|
|
9
|
+
rangeEnd?: string | null;
|
|
10
|
+
/** [Sessions only] minimum flight duration in minutez */
|
|
11
|
+
minFlightTimeMinutes?: number | null;
|
|
12
|
+
/** [Sessions only] minimum distance_total in meterz */
|
|
13
|
+
minFlightDistanceMeters?: number | null;
|
|
7
14
|
}
|
|
8
15
|
interface InfiniteScrollData<T> {
|
|
9
16
|
items: T[];
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { useState, useCallback, useMemo, useEffect, useRef } from "react";
|
|
2
2
|
import { useGetSessionsInfiniteByHerdQuery, useGetSessionsInfiniteByDeviceQuery, useGetEventsInfiniteByHerdQuery, useGetEventsInfiniteByDeviceQuery, useGetArtifactsInfiniteByHerdQuery, useGetArtifactsInfiniteByDeviceQuery, useGetFeedInfiniteByHerdQuery, useGetFeedInfiniteByDeviceQuery, } from "../store/api";
|
|
3
|
+
function useInfiniteFiltersKey(options) {
|
|
4
|
+
return useMemo(() => JSON.stringify({
|
|
5
|
+
rangeStart: options.rangeStart ?? null,
|
|
6
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
7
|
+
minFlightTimeMinutes: options.minFlightTimeMinutes ?? null,
|
|
8
|
+
minFlightDistanceMeters: options.minFlightDistanceMeters ?? null,
|
|
9
|
+
}), [
|
|
10
|
+
options.rangeStart,
|
|
11
|
+
options.rangeEnd,
|
|
12
|
+
options.minFlightTimeMinutes,
|
|
13
|
+
options.minFlightDistanceMeters,
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
3
16
|
// =====================================================
|
|
4
17
|
// SESSIONS INFINITE SCROLL HOOKS
|
|
5
18
|
// =====================================================
|
|
@@ -7,11 +20,17 @@ export const useInfiniteSessionsByHerd = (herdId, options) => {
|
|
|
7
20
|
const [pages, setPages] = useState([]);
|
|
8
21
|
const [currentCursor, setCurrentCursor] = useState(null);
|
|
9
22
|
const prevHerdIdRef = useRef();
|
|
23
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
24
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
10
25
|
const currentQuery = useGetSessionsInfiniteByHerdQuery({
|
|
11
26
|
herdId,
|
|
12
27
|
limit: options.limit || 20,
|
|
13
28
|
cursor: currentCursor,
|
|
14
29
|
supabase: options.supabase,
|
|
30
|
+
rangeStart: options.rangeStart ?? null,
|
|
31
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
32
|
+
minFlightTimeMinutes: options.minFlightTimeMinutes ?? null,
|
|
33
|
+
minFlightDistanceMeters: options.minFlightDistanceMeters ?? null,
|
|
15
34
|
}, {
|
|
16
35
|
skip: !options.enabled || !herdId,
|
|
17
36
|
});
|
|
@@ -26,6 +45,17 @@ export const useInfiniteSessionsByHerd = (herdId, options) => {
|
|
|
26
45
|
}
|
|
27
46
|
prevHerdIdRef.current = herdId;
|
|
28
47
|
}, [herdId, options.enabled]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
50
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
54
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
55
|
+
setPages([]);
|
|
56
|
+
setCurrentCursor(null);
|
|
57
|
+
}
|
|
58
|
+
}, [infiniteFiltersKey]);
|
|
29
59
|
// Update pages when new data arrives
|
|
30
60
|
useEffect(() => {
|
|
31
61
|
if (currentQuery.data && !currentQuery.isLoading) {
|
|
@@ -75,11 +105,17 @@ export const useInfiniteSessionsByDevice = (deviceId, options) => {
|
|
|
75
105
|
const [pages, setPages] = useState([]);
|
|
76
106
|
const [currentCursor, setCurrentCursor] = useState(null);
|
|
77
107
|
const prevDeviceIdRef = useRef();
|
|
108
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
109
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
78
110
|
const currentQuery = useGetSessionsInfiniteByDeviceQuery({
|
|
79
111
|
deviceId,
|
|
80
112
|
limit: options.limit || 20,
|
|
81
113
|
cursor: currentCursor,
|
|
82
114
|
supabase: options.supabase,
|
|
115
|
+
rangeStart: options.rangeStart ?? null,
|
|
116
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
117
|
+
minFlightTimeMinutes: options.minFlightTimeMinutes ?? null,
|
|
118
|
+
minFlightDistanceMeters: options.minFlightDistanceMeters ?? null,
|
|
83
119
|
}, {
|
|
84
120
|
skip: !options.enabled || !deviceId,
|
|
85
121
|
});
|
|
@@ -94,6 +130,17 @@ export const useInfiniteSessionsByDevice = (deviceId, options) => {
|
|
|
94
130
|
}
|
|
95
131
|
prevDeviceIdRef.current = deviceId;
|
|
96
132
|
}, [deviceId, options.enabled]);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
135
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
139
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
140
|
+
setPages([]);
|
|
141
|
+
setCurrentCursor(null);
|
|
142
|
+
}
|
|
143
|
+
}, [infiniteFiltersKey]);
|
|
97
144
|
useEffect(() => {
|
|
98
145
|
if (currentQuery.data && !currentQuery.isLoading) {
|
|
99
146
|
setPages((prev) => {
|
|
@@ -144,11 +191,15 @@ export const useInfiniteEventsByHerd = (herdId, options) => {
|
|
|
144
191
|
const [pages, setPages] = useState([]);
|
|
145
192
|
const [currentCursor, setCurrentCursor] = useState(null);
|
|
146
193
|
const prevHerdIdRef = useRef();
|
|
194
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
195
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
147
196
|
const currentQuery = useGetEventsInfiniteByHerdQuery({
|
|
148
197
|
herdId,
|
|
149
198
|
limit: options.limit || 20,
|
|
150
199
|
cursor: currentCursor,
|
|
151
200
|
supabase: options.supabase,
|
|
201
|
+
rangeStart: options.rangeStart ?? null,
|
|
202
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
152
203
|
}, {
|
|
153
204
|
skip: !options.enabled || !herdId,
|
|
154
205
|
});
|
|
@@ -163,6 +214,17 @@ export const useInfiniteEventsByHerd = (herdId, options) => {
|
|
|
163
214
|
}
|
|
164
215
|
prevHerdIdRef.current = herdId;
|
|
165
216
|
}, [herdId, options.enabled]);
|
|
217
|
+
useEffect(() => {
|
|
218
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
219
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
223
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
224
|
+
setPages([]);
|
|
225
|
+
setCurrentCursor(null);
|
|
226
|
+
}
|
|
227
|
+
}, [infiniteFiltersKey]);
|
|
166
228
|
useEffect(() => {
|
|
167
229
|
if (currentQuery.data && !currentQuery.isLoading) {
|
|
168
230
|
setPages((prev) => {
|
|
@@ -210,11 +272,15 @@ export const useInfiniteEventsByDevice = (deviceId, options) => {
|
|
|
210
272
|
const [pages, setPages] = useState([]);
|
|
211
273
|
const [currentCursor, setCurrentCursor] = useState(null);
|
|
212
274
|
const prevDeviceIdRef = useRef();
|
|
275
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
276
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
213
277
|
const currentQuery = useGetEventsInfiniteByDeviceQuery({
|
|
214
278
|
deviceId,
|
|
215
279
|
limit: options.limit || 20,
|
|
216
280
|
cursor: currentCursor,
|
|
217
281
|
supabase: options.supabase,
|
|
282
|
+
rangeStart: options.rangeStart ?? null,
|
|
283
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
218
284
|
}, {
|
|
219
285
|
skip: !options.enabled || !deviceId,
|
|
220
286
|
});
|
|
@@ -229,6 +295,17 @@ export const useInfiniteEventsByDevice = (deviceId, options) => {
|
|
|
229
295
|
}
|
|
230
296
|
prevDeviceIdRef.current = deviceId;
|
|
231
297
|
}, [deviceId, options.enabled]);
|
|
298
|
+
useEffect(() => {
|
|
299
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
300
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
304
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
305
|
+
setPages([]);
|
|
306
|
+
setCurrentCursor(null);
|
|
307
|
+
}
|
|
308
|
+
}, [infiniteFiltersKey]);
|
|
232
309
|
useEffect(() => {
|
|
233
310
|
if (currentQuery.data && !currentQuery.isLoading) {
|
|
234
311
|
setPages((prev) => {
|
|
@@ -279,11 +356,15 @@ export const useInfiniteArtifactsByHerd = (herdId, options) => {
|
|
|
279
356
|
const [pages, setPages] = useState([]);
|
|
280
357
|
const [currentCursor, setCurrentCursor] = useState(null);
|
|
281
358
|
const prevHerdIdRef = useRef();
|
|
359
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
360
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
282
361
|
const currentQuery = useGetArtifactsInfiniteByHerdQuery({
|
|
283
362
|
herdId,
|
|
284
363
|
limit: options.limit || 20,
|
|
285
364
|
cursor: currentCursor,
|
|
286
365
|
supabase: options.supabase,
|
|
366
|
+
rangeStart: options.rangeStart ?? null,
|
|
367
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
287
368
|
}, {
|
|
288
369
|
skip: !options.enabled || !herdId,
|
|
289
370
|
});
|
|
@@ -298,6 +379,17 @@ export const useInfiniteArtifactsByHerd = (herdId, options) => {
|
|
|
298
379
|
}
|
|
299
380
|
prevHerdIdRef.current = herdId;
|
|
300
381
|
}, [herdId, options.enabled]);
|
|
382
|
+
useEffect(() => {
|
|
383
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
384
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
388
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
389
|
+
setPages([]);
|
|
390
|
+
setCurrentCursor(null);
|
|
391
|
+
}
|
|
392
|
+
}, [infiniteFiltersKey]);
|
|
301
393
|
useEffect(() => {
|
|
302
394
|
if (currentQuery.data && !currentQuery.isLoading) {
|
|
303
395
|
setPages((prev) => {
|
|
@@ -345,11 +437,15 @@ export const useInfiniteArtifactsByDevice = (deviceId, options) => {
|
|
|
345
437
|
const [pages, setPages] = useState([]);
|
|
346
438
|
const [currentCursor, setCurrentCursor] = useState(null);
|
|
347
439
|
const prevDeviceIdRef = useRef();
|
|
440
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
441
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
348
442
|
const currentQuery = useGetArtifactsInfiniteByDeviceQuery({
|
|
349
443
|
deviceId,
|
|
350
444
|
limit: options.limit || 20,
|
|
351
445
|
cursor: currentCursor,
|
|
352
446
|
supabase: options.supabase,
|
|
447
|
+
rangeStart: options.rangeStart ?? null,
|
|
448
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
353
449
|
}, {
|
|
354
450
|
skip: !options.enabled || !deviceId,
|
|
355
451
|
});
|
|
@@ -364,6 +460,17 @@ export const useInfiniteArtifactsByDevice = (deviceId, options) => {
|
|
|
364
460
|
}
|
|
365
461
|
prevDeviceIdRef.current = deviceId;
|
|
366
462
|
}, [deviceId, options.enabled]);
|
|
463
|
+
useEffect(() => {
|
|
464
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
465
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
469
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
470
|
+
setPages([]);
|
|
471
|
+
setCurrentCursor(null);
|
|
472
|
+
}
|
|
473
|
+
}, [infiniteFiltersKey]);
|
|
367
474
|
useEffect(() => {
|
|
368
475
|
if (currentQuery.data && !currentQuery.isLoading) {
|
|
369
476
|
setPages((prev) => {
|
|
@@ -428,12 +535,16 @@ export const useInfiniteFeedByHerd = (herdId, options) => {
|
|
|
428
535
|
const pagesLengthRef = useRef(0);
|
|
429
536
|
/** When true, pass null to the query so we don't request (newHerdId, oldCursor) before state commits. */
|
|
430
537
|
const forceNullCursorRef = useRef(false);
|
|
538
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
539
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
431
540
|
const cursorForQuery = forceNullCursorRef.current ? null : currentCursor;
|
|
432
541
|
const currentQuery = useGetFeedInfiniteByHerdQuery({
|
|
433
542
|
herdId,
|
|
434
543
|
limit,
|
|
435
544
|
cursor: cursorForQuery,
|
|
436
545
|
supabase: options.supabase,
|
|
546
|
+
rangeStart: options.rangeStart ?? null,
|
|
547
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
437
548
|
}, { skip: !enabled });
|
|
438
549
|
const isLoading = currentQuery.isLoading;
|
|
439
550
|
useEffect(() => {
|
|
@@ -453,6 +564,20 @@ export const useInfiniteFeedByHerd = (herdId, options) => {
|
|
|
453
564
|
}
|
|
454
565
|
prevHerdIdRef.current = herdId;
|
|
455
566
|
}, [herdId, enabled]);
|
|
567
|
+
useEffect(() => {
|
|
568
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
569
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
573
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
574
|
+
forceNullCursorRef.current = true;
|
|
575
|
+
setPages([]);
|
|
576
|
+
setCurrentCursor(null);
|
|
577
|
+
setCurrentResult(null);
|
|
578
|
+
lastAddedCursorRef.current = undefined;
|
|
579
|
+
}
|
|
580
|
+
}, [infiniteFiltersKey]);
|
|
456
581
|
// When cursor changes, clear ref so we merge the new response
|
|
457
582
|
useEffect(() => {
|
|
458
583
|
lastAddedCursorRef.current = undefined;
|
|
@@ -572,12 +697,16 @@ export const useInfiniteFeedByDevice = (deviceId, options) => {
|
|
|
572
697
|
const lastAddedCursorRef = useRef(undefined);
|
|
573
698
|
const pagesLengthRef = useRef(0);
|
|
574
699
|
const forceNullCursorRef = useRef(false);
|
|
700
|
+
const infiniteFiltersKey = useInfiniteFiltersKey(options);
|
|
701
|
+
const prevInfiniteFiltersKeyRef = useRef(null);
|
|
575
702
|
const cursorForQuery = forceNullCursorRef.current ? null : currentCursor;
|
|
576
703
|
const currentQuery = useGetFeedInfiniteByDeviceQuery({
|
|
577
704
|
deviceId,
|
|
578
705
|
limit: options.limit || 20,
|
|
579
706
|
cursor: cursorForQuery,
|
|
580
707
|
supabase: options.supabase,
|
|
708
|
+
rangeStart: options.rangeStart ?? null,
|
|
709
|
+
rangeEnd: options.rangeEnd ?? null,
|
|
581
710
|
}, { skip: !options.enabled || !deviceId });
|
|
582
711
|
useEffect(() => {
|
|
583
712
|
pagesLengthRef.current = pages.length;
|
|
@@ -594,6 +723,20 @@ export const useInfiniteFeedByDevice = (deviceId, options) => {
|
|
|
594
723
|
}
|
|
595
724
|
prevDeviceIdRef.current = deviceId;
|
|
596
725
|
}, [deviceId]);
|
|
726
|
+
useEffect(() => {
|
|
727
|
+
if (prevInfiniteFiltersKeyRef.current === null) {
|
|
728
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
if (prevInfiniteFiltersKeyRef.current !== infiniteFiltersKey) {
|
|
732
|
+
prevInfiniteFiltersKeyRef.current = infiniteFiltersKey;
|
|
733
|
+
forceNullCursorRef.current = true;
|
|
734
|
+
setPages([]);
|
|
735
|
+
setCurrentCursor(null);
|
|
736
|
+
lastAddedCursorRef.current = undefined;
|
|
737
|
+
setLastResult(null);
|
|
738
|
+
}
|
|
739
|
+
}, [infiniteFiltersKey]);
|
|
597
740
|
// When we request a new page (cursor changed), clear ref so we merge the new response
|
|
598
741
|
useEffect(() => {
|
|
599
742
|
lastAddedCursorRef.current = undefined;
|
|
@@ -61,6 +61,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
61
61
|
tagged_at: string | null;
|
|
62
62
|
timestamp_observation: string | null;
|
|
63
63
|
timestamp_observation_end: string;
|
|
64
|
+
tracked_at: string | null;
|
|
64
65
|
updated_at: string | null;
|
|
65
66
|
};
|
|
66
67
|
Insert: {
|
|
@@ -76,6 +77,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
76
77
|
tagged_at?: string | null;
|
|
77
78
|
timestamp_observation?: string | null;
|
|
78
79
|
timestamp_observation_end?: string;
|
|
80
|
+
tracked_at?: string | null;
|
|
79
81
|
updated_at?: string | null;
|
|
80
82
|
};
|
|
81
83
|
Update: {
|
|
@@ -91,6 +93,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
91
93
|
tagged_at?: string | null;
|
|
92
94
|
timestamp_observation?: string | null;
|
|
93
95
|
timestamp_observation_end?: string;
|
|
96
|
+
tracked_at?: string | null;
|
|
94
97
|
updated_at?: string | null;
|
|
95
98
|
};
|
|
96
99
|
Relationships: [{
|
|
@@ -456,6 +459,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
456
459
|
session_id: number | null;
|
|
457
460
|
tagged_at: string | null;
|
|
458
461
|
timestamp_observation: string;
|
|
462
|
+
tracked_at: string | null;
|
|
459
463
|
};
|
|
460
464
|
Insert: {
|
|
461
465
|
altitude?: number;
|
|
@@ -475,6 +479,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
475
479
|
session_id?: number | null;
|
|
476
480
|
tagged_at?: string | null;
|
|
477
481
|
timestamp_observation?: string;
|
|
482
|
+
tracked_at?: string | null;
|
|
478
483
|
};
|
|
479
484
|
Update: {
|
|
480
485
|
altitude?: number;
|
|
@@ -494,6 +499,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
494
499
|
session_id?: number | null;
|
|
495
500
|
tagged_at?: string | null;
|
|
496
501
|
timestamp_observation?: string;
|
|
502
|
+
tracked_at?: string | null;
|
|
497
503
|
};
|
|
498
504
|
Relationships: [{
|
|
499
505
|
foreignKeyName: "events_device_id_fkey";
|
|
@@ -1423,6 +1429,13 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1423
1429
|
};
|
|
1424
1430
|
};
|
|
1425
1431
|
Functions: {
|
|
1432
|
+
ack_queue_message: {
|
|
1433
|
+
Args: {
|
|
1434
|
+
message_id: number;
|
|
1435
|
+
queue_name: string;
|
|
1436
|
+
};
|
|
1437
|
+
Returns: boolean;
|
|
1438
|
+
};
|
|
1426
1439
|
analyze_device_heartbeats: {
|
|
1427
1440
|
Args: {
|
|
1428
1441
|
p_device_id: number;
|
|
@@ -1559,6 +1572,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1559
1572
|
tagged_at: string | null;
|
|
1560
1573
|
timestamp_observation: string | null;
|
|
1561
1574
|
timestamp_observation_end: string;
|
|
1575
|
+
tracked_at: string | null;
|
|
1562
1576
|
updated_at: string | null;
|
|
1563
1577
|
}[];
|
|
1564
1578
|
SetofOptions: {
|
|
@@ -1586,6 +1600,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1586
1600
|
tagged_at: string | null;
|
|
1587
1601
|
timestamp_observation: string | null;
|
|
1588
1602
|
timestamp_observation_end: string;
|
|
1603
|
+
tracked_at: string | null;
|
|
1589
1604
|
updated_at: string | null;
|
|
1590
1605
|
}[];
|
|
1591
1606
|
SetofOptions: {
|
|
@@ -1614,6 +1629,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1614
1629
|
tagged_at: string | null;
|
|
1615
1630
|
timestamp_observation: string | null;
|
|
1616
1631
|
timestamp_observation_end: string;
|
|
1632
|
+
tracked_at: string | null;
|
|
1617
1633
|
updated_at: string | null;
|
|
1618
1634
|
}[];
|
|
1619
1635
|
SetofOptions: {
|
|
@@ -1642,6 +1658,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1642
1658
|
tagged_at: string | null;
|
|
1643
1659
|
timestamp_observation: string | null;
|
|
1644
1660
|
timestamp_observation_end: string;
|
|
1661
|
+
tracked_at: string | null;
|
|
1645
1662
|
updated_at: string | null;
|
|
1646
1663
|
}[];
|
|
1647
1664
|
SetofOptions: {
|
|
@@ -1671,6 +1688,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1671
1688
|
tagged_at: string | null;
|
|
1672
1689
|
timestamp_observation: string | null;
|
|
1673
1690
|
timestamp_observation_end: string;
|
|
1691
|
+
tracked_at: string | null;
|
|
1674
1692
|
updated_at: string | null;
|
|
1675
1693
|
}[];
|
|
1676
1694
|
SetofOptions: {
|
|
@@ -1700,6 +1718,38 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1700
1718
|
tagged_at: string | null;
|
|
1701
1719
|
timestamp_observation: string | null;
|
|
1702
1720
|
timestamp_observation_end: string;
|
|
1721
|
+
tracked_at: string | null;
|
|
1722
|
+
updated_at: string | null;
|
|
1723
|
+
}[];
|
|
1724
|
+
SetofOptions: {
|
|
1725
|
+
from: "*";
|
|
1726
|
+
to: "artifacts";
|
|
1727
|
+
isOneToOne: false;
|
|
1728
|
+
isSetofReturn: true;
|
|
1729
|
+
};
|
|
1730
|
+
} | {
|
|
1731
|
+
Args: {
|
|
1732
|
+
cursor_id?: number;
|
|
1733
|
+
cursor_timestamp?: string;
|
|
1734
|
+
device_id_caller: number;
|
|
1735
|
+
limit_caller?: number;
|
|
1736
|
+
range_end?: string;
|
|
1737
|
+
range_start?: string;
|
|
1738
|
+
};
|
|
1739
|
+
Returns: {
|
|
1740
|
+
created_at: string;
|
|
1741
|
+
device_id: number;
|
|
1742
|
+
embedded_at: string | null;
|
|
1743
|
+
file_path: string;
|
|
1744
|
+
file_size_bytes: number | null;
|
|
1745
|
+
id: number;
|
|
1746
|
+
modality: string | null;
|
|
1747
|
+
segmented_at: string | null;
|
|
1748
|
+
session_id: number | null;
|
|
1749
|
+
tagged_at: string | null;
|
|
1750
|
+
timestamp_observation: string | null;
|
|
1751
|
+
timestamp_observation_end: string;
|
|
1752
|
+
tracked_at: string | null;
|
|
1703
1753
|
updated_at: string | null;
|
|
1704
1754
|
}[];
|
|
1705
1755
|
SetofOptions: {
|
|
@@ -1729,6 +1779,38 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1729
1779
|
tagged_at: string | null;
|
|
1730
1780
|
timestamp_observation: string | null;
|
|
1731
1781
|
timestamp_observation_end: string;
|
|
1782
|
+
tracked_at: string | null;
|
|
1783
|
+
updated_at: string | null;
|
|
1784
|
+
}[];
|
|
1785
|
+
SetofOptions: {
|
|
1786
|
+
from: "*";
|
|
1787
|
+
to: "artifacts";
|
|
1788
|
+
isOneToOne: false;
|
|
1789
|
+
isSetofReturn: true;
|
|
1790
|
+
};
|
|
1791
|
+
} | {
|
|
1792
|
+
Args: {
|
|
1793
|
+
cursor_id?: number;
|
|
1794
|
+
cursor_timestamp?: string;
|
|
1795
|
+
herd_id_caller: number;
|
|
1796
|
+
limit_caller?: number;
|
|
1797
|
+
range_end?: string;
|
|
1798
|
+
range_start?: string;
|
|
1799
|
+
};
|
|
1800
|
+
Returns: {
|
|
1801
|
+
created_at: string;
|
|
1802
|
+
device_id: number;
|
|
1803
|
+
embedded_at: string | null;
|
|
1804
|
+
file_path: string;
|
|
1805
|
+
file_size_bytes: number | null;
|
|
1806
|
+
id: number;
|
|
1807
|
+
modality: string | null;
|
|
1808
|
+
segmented_at: string | null;
|
|
1809
|
+
session_id: number | null;
|
|
1810
|
+
tagged_at: string | null;
|
|
1811
|
+
timestamp_observation: string | null;
|
|
1812
|
+
timestamp_observation_end: string;
|
|
1813
|
+
tracked_at: string | null;
|
|
1732
1814
|
updated_at: string | null;
|
|
1733
1815
|
}[];
|
|
1734
1816
|
SetofOptions: {
|
|
@@ -1944,6 +2026,22 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1944
2026
|
isOneToOne: false;
|
|
1945
2027
|
isSetofReturn: true;
|
|
1946
2028
|
};
|
|
2029
|
+
} | {
|
|
2030
|
+
Args: {
|
|
2031
|
+
cursor_id?: number;
|
|
2032
|
+
cursor_timestamp?: string;
|
|
2033
|
+
device_id_caller: number;
|
|
2034
|
+
limit_caller?: number;
|
|
2035
|
+
range_end?: string;
|
|
2036
|
+
range_start?: string;
|
|
2037
|
+
};
|
|
2038
|
+
Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
|
|
2039
|
+
SetofOptions: {
|
|
2040
|
+
from: "*";
|
|
2041
|
+
to: "event_and_tags_pretty_location";
|
|
2042
|
+
isOneToOne: false;
|
|
2043
|
+
isSetofReturn: true;
|
|
2044
|
+
};
|
|
1947
2045
|
};
|
|
1948
2046
|
get_events_infinite_by_herd: {
|
|
1949
2047
|
Args: {
|
|
@@ -1959,6 +2057,22 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1959
2057
|
isOneToOne: false;
|
|
1960
2058
|
isSetofReturn: true;
|
|
1961
2059
|
};
|
|
2060
|
+
} | {
|
|
2061
|
+
Args: {
|
|
2062
|
+
cursor_id?: number;
|
|
2063
|
+
cursor_timestamp?: string;
|
|
2064
|
+
herd_id_caller: number;
|
|
2065
|
+
limit_caller?: number;
|
|
2066
|
+
range_end?: string;
|
|
2067
|
+
range_start?: string;
|
|
2068
|
+
};
|
|
2069
|
+
Returns: Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"][];
|
|
2070
|
+
SetofOptions: {
|
|
2071
|
+
from: "*";
|
|
2072
|
+
to: "event_and_tags_pretty_location";
|
|
2073
|
+
isOneToOne: false;
|
|
2074
|
+
isSetofReturn: true;
|
|
2075
|
+
};
|
|
1962
2076
|
};
|
|
1963
2077
|
get_events_with_tags_for_herd: {
|
|
1964
2078
|
Args: {
|
|
@@ -1989,6 +2103,23 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1989
2103
|
isOneToOne: false;
|
|
1990
2104
|
isSetofReturn: true;
|
|
1991
2105
|
};
|
|
2106
|
+
} | {
|
|
2107
|
+
Args: {
|
|
2108
|
+
cursor_feed_type?: string;
|
|
2109
|
+
cursor_id?: number;
|
|
2110
|
+
cursor_timestamp?: string;
|
|
2111
|
+
device_id_caller: number;
|
|
2112
|
+
limit_caller?: number;
|
|
2113
|
+
range_end?: string;
|
|
2114
|
+
range_start?: string;
|
|
2115
|
+
};
|
|
2116
|
+
Returns: Database["public"]["CompositeTypes"]["feed_item"][];
|
|
2117
|
+
SetofOptions: {
|
|
2118
|
+
from: "*";
|
|
2119
|
+
to: "feed_item";
|
|
2120
|
+
isOneToOne: false;
|
|
2121
|
+
isSetofReturn: true;
|
|
2122
|
+
};
|
|
1992
2123
|
};
|
|
1993
2124
|
get_feed_infinite_by_herd: {
|
|
1994
2125
|
Args: {
|
|
@@ -2005,6 +2136,23 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2005
2136
|
isOneToOne: false;
|
|
2006
2137
|
isSetofReturn: true;
|
|
2007
2138
|
};
|
|
2139
|
+
} | {
|
|
2140
|
+
Args: {
|
|
2141
|
+
cursor_feed_type?: string;
|
|
2142
|
+
cursor_id?: number;
|
|
2143
|
+
cursor_timestamp?: string;
|
|
2144
|
+
herd_id_caller: number;
|
|
2145
|
+
limit_caller?: number;
|
|
2146
|
+
range_end?: string;
|
|
2147
|
+
range_start?: string;
|
|
2148
|
+
};
|
|
2149
|
+
Returns: Database["public"]["CompositeTypes"]["feed_item"][];
|
|
2150
|
+
SetofOptions: {
|
|
2151
|
+
from: "*";
|
|
2152
|
+
to: "feed_item";
|
|
2153
|
+
isOneToOne: false;
|
|
2154
|
+
isSetofReturn: true;
|
|
2155
|
+
};
|
|
2008
2156
|
};
|
|
2009
2157
|
get_health_metrics_summary: {
|
|
2010
2158
|
Args: {
|
|
@@ -2093,6 +2241,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2093
2241
|
cursor_timestamp?: string;
|
|
2094
2242
|
device_id_caller: number;
|
|
2095
2243
|
limit_caller?: number;
|
|
2244
|
+
min_flight_distance_meters?: number;
|
|
2245
|
+
min_flight_time_minutes?: number;
|
|
2246
|
+
range_end?: string;
|
|
2247
|
+
range_start?: string;
|
|
2096
2248
|
};
|
|
2097
2249
|
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
2098
2250
|
SetofOptions: {
|
|
@@ -2108,6 +2260,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2108
2260
|
cursor_timestamp?: string;
|
|
2109
2261
|
herd_id_caller: number;
|
|
2110
2262
|
limit_caller?: number;
|
|
2263
|
+
min_flight_distance_meters?: number;
|
|
2264
|
+
min_flight_time_minutes?: number;
|
|
2265
|
+
range_end?: string;
|
|
2266
|
+
range_start?: string;
|
|
2111
2267
|
};
|
|
2112
2268
|
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
2113
2269
|
SetofOptions: {
|
|
@@ -2302,6 +2458,20 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2302
2458
|
};
|
|
2303
2459
|
Returns: undefined;
|
|
2304
2460
|
};
|
|
2461
|
+
sync_orphan_session_links: {
|
|
2462
|
+
Args: {
|
|
2463
|
+
preview?: boolean;
|
|
2464
|
+
};
|
|
2465
|
+
Returns: {
|
|
2466
|
+
assigned_session_id: number;
|
|
2467
|
+
candidate_session_count: number;
|
|
2468
|
+
device_id: number;
|
|
2469
|
+
entity_id: number;
|
|
2470
|
+
entity_type: string;
|
|
2471
|
+
old_session_id: number;
|
|
2472
|
+
status: string;
|
|
2473
|
+
}[];
|
|
2474
|
+
};
|
|
2305
2475
|
};
|
|
2306
2476
|
Enums: {
|
|
2307
2477
|
app_permission: "herds.delete" | "events.delete";
|