@adventurelabs/scout-core 1.0.27 → 1.0.28
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
2
|
import { Database } from "../types/supabase";
|
|
3
|
-
import { ISession, IConnectivity, IEvent } from "../types/db";
|
|
3
|
+
import { ISession, IConnectivity, IEvent, ISessionWithCoordinates, IConnectivityWithCoordinates } from "../types/db";
|
|
4
4
|
export type SessionInput = Omit<ISession, "id" | "inserted_at">;
|
|
5
5
|
export type SessionUpdateInput = Partial<SessionInput> & {
|
|
6
6
|
id: number;
|
|
@@ -11,19 +11,19 @@ export type ConnectivityUpdateInput = Partial<ConnectivityInput> & {
|
|
|
11
11
|
id: number;
|
|
12
12
|
};
|
|
13
13
|
export type ConnectivityUpsertInput = ConnectivityInput | ConnectivityUpdateInput;
|
|
14
|
-
export declare function getSessionsByHerdId(supabase: SupabaseClient<Database>, herdId: number): Promise<
|
|
15
|
-
export declare function getConnectivityBySessionId(supabase: SupabaseClient<Database>, sessionId: number): Promise<
|
|
14
|
+
export declare function getSessionsByHerdId(supabase: SupabaseClient<Database>, herdId: number): Promise<ISessionWithCoordinates[]>;
|
|
15
|
+
export declare function getConnectivityBySessionId(supabase: SupabaseClient<Database>, sessionId: number): Promise<IConnectivityWithCoordinates[]>;
|
|
16
16
|
export declare function getEventsBySessionId(supabase: SupabaseClient<Database>, sessionId: number): Promise<IEvent[]>;
|
|
17
17
|
export declare function upsertSession(supabase: SupabaseClient<Database>, sessionData: SessionUpsertInput): Promise<ISession>;
|
|
18
18
|
export declare function upsertSessions(supabase: SupabaseClient<Database>, sessionsData: SessionUpsertInput[]): Promise<ISession[]>;
|
|
19
19
|
export declare function upsertConnectivity(supabase: SupabaseClient<Database>, connectivityData: ConnectivityUpsertInput): Promise<IConnectivity>;
|
|
20
20
|
export declare function upsertConnectivityBatch(supabase: SupabaseClient<Database>, connectivityDataArray: ConnectivityUpsertInput[]): Promise<IConnectivity[]>;
|
|
21
21
|
export declare function getSessionWithConnectivityAndEvents(supabase: SupabaseClient<Database>, sessionId: number): Promise<{
|
|
22
|
-
session:
|
|
23
|
-
connectivity:
|
|
22
|
+
session: ISessionWithCoordinates | null;
|
|
23
|
+
connectivity: IConnectivityWithCoordinates[];
|
|
24
24
|
events: IEvent[];
|
|
25
25
|
}>;
|
|
26
|
-
export declare function getSessionsByDeviceId(supabase: SupabaseClient<Database>, deviceId: number): Promise<
|
|
26
|
+
export declare function getSessionsByDeviceId(supabase: SupabaseClient<Database>, deviceId: number): Promise<ISessionWithCoordinates[]>;
|
|
27
27
|
export declare function deleteSession(supabase: SupabaseClient<Database>, sessionId: number): Promise<void>;
|
|
28
28
|
export declare function deleteSessions(supabase: SupabaseClient<Database>, sessionIds: number[]): Promise<void>;
|
|
29
29
|
export declare function deleteConnectivity(supabase: SupabaseClient<Database>, connectivityId: number): Promise<void>;
|
package/dist/helpers/sessions.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
// Get sessions by herd id
|
|
1
|
+
// Get sessions by herd id using RPC function with coordinates
|
|
2
2
|
export async function getSessionsByHerdId(supabase, herdId) {
|
|
3
|
-
const { data, error } = await supabase
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*,
|
|
7
|
-
devices!inner(herd_id)
|
|
8
|
-
`)
|
|
9
|
-
.eq("devices.herd_id", herdId)
|
|
10
|
-
.order("timestamp_start", { ascending: false });
|
|
3
|
+
const { data, error } = await supabase.rpc("get_sessions_with_coordinates", {
|
|
4
|
+
herd_id_caller: herdId,
|
|
5
|
+
});
|
|
11
6
|
if (error) {
|
|
12
7
|
throw new Error(`Failed to get sessions by herd id: ${error.message}`);
|
|
13
8
|
}
|
|
14
|
-
|
|
9
|
+
// Sort by timestamp_start in descending order
|
|
10
|
+
const sortedSessions = (data || []).sort((a, b) => {
|
|
11
|
+
if (!a.timestamp_start || !b.timestamp_start)
|
|
12
|
+
return 0;
|
|
13
|
+
return (new Date(b.timestamp_start).getTime() -
|
|
14
|
+
new Date(a.timestamp_start).getTime());
|
|
15
|
+
});
|
|
16
|
+
return sortedSessions;
|
|
15
17
|
}
|
|
16
|
-
// Get connectivity by session id
|
|
18
|
+
// Get connectivity by session id using RPC function with coordinates
|
|
17
19
|
export async function getConnectivityBySessionId(supabase, sessionId) {
|
|
18
|
-
const { data, error } = await supabase
|
|
19
|
-
.from("connectivity")
|
|
20
|
-
.select("*")
|
|
21
|
-
.eq("session_id", sessionId)
|
|
22
|
-
.order("timestamp_start", { ascending: true });
|
|
20
|
+
const { data, error } = await supabase.rpc("get_connectivity_with_coordinates", { session_id_caller: sessionId });
|
|
23
21
|
if (error) {
|
|
24
22
|
throw new Error(`Failed to get connectivity by session id: ${error.message}`);
|
|
25
23
|
}
|
|
26
|
-
|
|
24
|
+
// Sort by timestamp_start in ascending order
|
|
25
|
+
const sortedConnectivity = (data || []).sort((a, b) => {
|
|
26
|
+
if (!a.timestamp_start || !b.timestamp_start)
|
|
27
|
+
return 0;
|
|
28
|
+
return (new Date(a.timestamp_start).getTime() -
|
|
29
|
+
new Date(b.timestamp_start).getTime());
|
|
30
|
+
});
|
|
31
|
+
return sortedConnectivity;
|
|
27
32
|
}
|
|
28
33
|
// Get events by session id
|
|
29
34
|
export async function getEventsBySessionId(supabase, sessionId) {
|
|
@@ -165,29 +170,50 @@ export async function upsertConnectivityBatch(supabase, connectivityDataArray) {
|
|
|
165
170
|
}
|
|
166
171
|
return results;
|
|
167
172
|
}
|
|
168
|
-
// Get session with connectivity and events
|
|
173
|
+
// Get session with connectivity and events using RPC functions
|
|
169
174
|
export async function getSessionWithConnectivityAndEvents(supabase, sessionId) {
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
// Get the session from the sessions table first to get the device_id
|
|
176
|
+
const { data: sessionData, error: sessionError } = await supabase
|
|
177
|
+
.from("sessions")
|
|
178
|
+
.select("*")
|
|
179
|
+
.eq("id", sessionId)
|
|
180
|
+
.single();
|
|
181
|
+
if (sessionError) {
|
|
182
|
+
throw new Error(`Failed to get session: ${sessionError.message}`);
|
|
183
|
+
}
|
|
184
|
+
// Get the device to find its herd_id
|
|
185
|
+
const { data: device, error: deviceError } = await supabase
|
|
186
|
+
.from("devices")
|
|
187
|
+
.select("herd_id")
|
|
188
|
+
.eq("id", sessionData.device_id)
|
|
189
|
+
.single();
|
|
190
|
+
if (deviceError) {
|
|
191
|
+
throw new Error(`Failed to get device: ${deviceError.message}`);
|
|
192
|
+
}
|
|
193
|
+
// Get sessions with coordinates for the herd and find our specific session
|
|
194
|
+
const { data: allSessionsWithCoords, error: sessionsError } = await supabase.rpc("get_sessions_with_coordinates", {
|
|
195
|
+
herd_id_caller: device.herd_id,
|
|
196
|
+
});
|
|
197
|
+
if (sessionsError) {
|
|
198
|
+
throw new Error(`Failed to get session with coordinates: ${sessionsError.message}`);
|
|
199
|
+
}
|
|
200
|
+
// Find the specific session in the results
|
|
201
|
+
const sessionWithCoords = allSessionsWithCoords?.find((s) => s.id === sessionId) || null;
|
|
202
|
+
const [connectivityResult, eventsResult] = await Promise.all([
|
|
172
203
|
getConnectivityBySessionId(supabase, sessionId),
|
|
173
204
|
getEventsBySessionId(supabase, sessionId),
|
|
174
205
|
]);
|
|
175
|
-
if (sessionResult.error) {
|
|
176
|
-
throw new Error(`Failed to get session: ${sessionResult.error.message}`);
|
|
177
|
-
}
|
|
178
206
|
return {
|
|
179
|
-
session:
|
|
207
|
+
session: sessionWithCoords,
|
|
180
208
|
connectivity: connectivityResult,
|
|
181
209
|
events: eventsResult,
|
|
182
210
|
};
|
|
183
211
|
}
|
|
184
|
-
// Get sessions for a device
|
|
212
|
+
// Get sessions for a device using RPC function
|
|
185
213
|
export async function getSessionsByDeviceId(supabase, deviceId) {
|
|
186
|
-
const { data, error } = await supabase
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.eq("device_id", deviceId)
|
|
190
|
-
.order("timestamp_start", { ascending: false });
|
|
214
|
+
const { data, error } = await supabase.rpc("get_sessions_with_coordinates_by_device", {
|
|
215
|
+
device_id_caller: deviceId,
|
|
216
|
+
});
|
|
191
217
|
if (error) {
|
|
192
218
|
throw new Error(`Failed to get sessions by device id: ${error.message}`);
|
|
193
219
|
}
|
|
@@ -559,6 +559,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
559
559
|
};
|
|
560
560
|
Returns: import("../types/supabase").Json;
|
|
561
561
|
};
|
|
562
|
+
get_connectivity_with_coordinates: {
|
|
563
|
+
Args: {
|
|
564
|
+
session_id_caller: number;
|
|
565
|
+
};
|
|
566
|
+
Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
|
|
567
|
+
};
|
|
562
568
|
get_device_by_id: {
|
|
563
569
|
Args: {
|
|
564
570
|
device_id_caller: number;
|
|
@@ -647,6 +653,18 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
647
653
|
};
|
|
648
654
|
Returns: Database["public"]["CompositeTypes"]["event_with_tags"][];
|
|
649
655
|
};
|
|
656
|
+
get_sessions_with_coordinates: {
|
|
657
|
+
Args: {
|
|
658
|
+
herd_id_caller: number;
|
|
659
|
+
};
|
|
660
|
+
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
661
|
+
};
|
|
662
|
+
get_sessions_with_coordinates_by_device: {
|
|
663
|
+
Args: {
|
|
664
|
+
device_id_caller: number;
|
|
665
|
+
};
|
|
666
|
+
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
667
|
+
};
|
|
650
668
|
get_total_events_for_herd: {
|
|
651
669
|
Args: {
|
|
652
670
|
herd_id_caller: number;
|
|
@@ -677,6 +695,22 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
677
695
|
user_status: "ONLINE" | "OFFLINE";
|
|
678
696
|
};
|
|
679
697
|
CompositeTypes: {
|
|
698
|
+
connectivity_with_coordinates: {
|
|
699
|
+
id: number | null;
|
|
700
|
+
session_id: number | null;
|
|
701
|
+
inserted_at: string | null;
|
|
702
|
+
timestamp_start: string | null;
|
|
703
|
+
signal: number | null;
|
|
704
|
+
noise: number | null;
|
|
705
|
+
altitude: number | null;
|
|
706
|
+
heading: number | null;
|
|
707
|
+
latitude: number | null;
|
|
708
|
+
longitude: number | null;
|
|
709
|
+
h14_index: number | null;
|
|
710
|
+
h13_index: number | null;
|
|
711
|
+
h12_index: number | null;
|
|
712
|
+
h11_index: number | null;
|
|
713
|
+
};
|
|
680
714
|
device_pretty_location: {
|
|
681
715
|
id: number | null;
|
|
682
716
|
inserted_at: string | null;
|
|
@@ -757,6 +791,23 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
757
791
|
is_public: boolean | null;
|
|
758
792
|
tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
|
|
759
793
|
};
|
|
794
|
+
session_with_coordinates: {
|
|
795
|
+
id: number | null;
|
|
796
|
+
device_id: number | null;
|
|
797
|
+
timestamp_start: string | null;
|
|
798
|
+
timestamp_end: string | null;
|
|
799
|
+
inserted_at: string | null;
|
|
800
|
+
software_version: string | null;
|
|
801
|
+
locations_geojson: import("../types/supabase").Json | null;
|
|
802
|
+
altitude_max: number | null;
|
|
803
|
+
altitude_min: number | null;
|
|
804
|
+
altitude_average: number | null;
|
|
805
|
+
velocity_max: number | null;
|
|
806
|
+
velocity_min: number | null;
|
|
807
|
+
velocity_average: number | null;
|
|
808
|
+
distance_total: number | null;
|
|
809
|
+
distance_max_from_start: number | null;
|
|
810
|
+
};
|
|
760
811
|
zones_and_actions_pretty_location: {
|
|
761
812
|
id: number | null;
|
|
762
813
|
inserted_at: string | null;
|
|
@@ -557,6 +557,12 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
557
557
|
};
|
|
558
558
|
Returns: import("../types/supabase").Json;
|
|
559
559
|
};
|
|
560
|
+
get_connectivity_with_coordinates: {
|
|
561
|
+
Args: {
|
|
562
|
+
session_id_caller: number;
|
|
563
|
+
};
|
|
564
|
+
Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
|
|
565
|
+
};
|
|
560
566
|
get_device_by_id: {
|
|
561
567
|
Args: {
|
|
562
568
|
device_id_caller: number;
|
|
@@ -645,6 +651,18 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
645
651
|
};
|
|
646
652
|
Returns: Database["public"]["CompositeTypes"]["event_with_tags"][];
|
|
647
653
|
};
|
|
654
|
+
get_sessions_with_coordinates: {
|
|
655
|
+
Args: {
|
|
656
|
+
herd_id_caller: number;
|
|
657
|
+
};
|
|
658
|
+
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
659
|
+
};
|
|
660
|
+
get_sessions_with_coordinates_by_device: {
|
|
661
|
+
Args: {
|
|
662
|
+
device_id_caller: number;
|
|
663
|
+
};
|
|
664
|
+
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
665
|
+
};
|
|
648
666
|
get_total_events_for_herd: {
|
|
649
667
|
Args: {
|
|
650
668
|
herd_id_caller: number;
|
|
@@ -675,6 +693,22 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
675
693
|
user_status: "ONLINE" | "OFFLINE";
|
|
676
694
|
};
|
|
677
695
|
CompositeTypes: {
|
|
696
|
+
connectivity_with_coordinates: {
|
|
697
|
+
id: number | null;
|
|
698
|
+
session_id: number | null;
|
|
699
|
+
inserted_at: string | null;
|
|
700
|
+
timestamp_start: string | null;
|
|
701
|
+
signal: number | null;
|
|
702
|
+
noise: number | null;
|
|
703
|
+
altitude: number | null;
|
|
704
|
+
heading: number | null;
|
|
705
|
+
latitude: number | null;
|
|
706
|
+
longitude: number | null;
|
|
707
|
+
h14_index: number | null;
|
|
708
|
+
h13_index: number | null;
|
|
709
|
+
h12_index: number | null;
|
|
710
|
+
h11_index: number | null;
|
|
711
|
+
};
|
|
678
712
|
device_pretty_location: {
|
|
679
713
|
id: number | null;
|
|
680
714
|
inserted_at: string | null;
|
|
@@ -755,6 +789,23 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
755
789
|
is_public: boolean | null;
|
|
756
790
|
tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
|
|
757
791
|
};
|
|
792
|
+
session_with_coordinates: {
|
|
793
|
+
id: number | null;
|
|
794
|
+
device_id: number | null;
|
|
795
|
+
timestamp_start: string | null;
|
|
796
|
+
timestamp_end: string | null;
|
|
797
|
+
inserted_at: string | null;
|
|
798
|
+
software_version: string | null;
|
|
799
|
+
locations_geojson: import("../types/supabase").Json | null;
|
|
800
|
+
altitude_max: number | null;
|
|
801
|
+
altitude_min: number | null;
|
|
802
|
+
altitude_average: number | null;
|
|
803
|
+
velocity_max: number | null;
|
|
804
|
+
velocity_min: number | null;
|
|
805
|
+
velocity_average: number | null;
|
|
806
|
+
distance_total: number | null;
|
|
807
|
+
distance_max_from_start: number | null;
|
|
808
|
+
};
|
|
758
809
|
zones_and_actions_pretty_location: {
|
|
759
810
|
id: number | null;
|
|
760
811
|
inserted_at: string | null;
|
package/dist/types/db.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export type IEventWithTags = Database["public"]["CompositeTypes"]["event_with_ta
|
|
|
25
25
|
export type IDevicePrettyLocation = Database["public"]["CompositeTypes"]["device_pretty_location"];
|
|
26
26
|
export type IEventAndTagsPrettyLocation = Database["public"]["CompositeTypes"]["event_and_tags_pretty_location"];
|
|
27
27
|
export type IZonesAndActionsPrettyLocation = Database["public"]["CompositeTypes"]["zones_and_actions_pretty_location"];
|
|
28
|
+
export type ISessionWithCoordinates = Database["public"]["CompositeTypes"]["session_with_coordinates"];
|
|
29
|
+
export type IConnectivityWithCoordinates = Database["public"]["CompositeTypes"]["connectivity_with_coordinates"];
|
|
28
30
|
export interface IZoneWithActions extends IZone {
|
|
29
31
|
actions: IAction[];
|
|
30
32
|
}
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export type Json = string | number | boolean | null | {
|
|
|
2
2
|
[key: string]: Json | undefined;
|
|
3
3
|
} | Json[];
|
|
4
4
|
export type Database = {
|
|
5
|
+
__InternalSupabase: {
|
|
6
|
+
PostgrestVersion: "12.2.3 (519615d)";
|
|
7
|
+
};
|
|
5
8
|
graphql_public: {
|
|
6
9
|
Tables: {
|
|
7
10
|
[_ in never]: never;
|
|
@@ -615,6 +618,12 @@ export type Database = {
|
|
|
615
618
|
};
|
|
616
619
|
Returns: Json;
|
|
617
620
|
};
|
|
621
|
+
get_connectivity_with_coordinates: {
|
|
622
|
+
Args: {
|
|
623
|
+
session_id_caller: number;
|
|
624
|
+
};
|
|
625
|
+
Returns: Database["public"]["CompositeTypes"]["connectivity_with_coordinates"][];
|
|
626
|
+
};
|
|
618
627
|
get_device_by_id: {
|
|
619
628
|
Args: {
|
|
620
629
|
device_id_caller: number;
|
|
@@ -703,6 +712,18 @@ export type Database = {
|
|
|
703
712
|
};
|
|
704
713
|
Returns: Database["public"]["CompositeTypes"]["event_with_tags"][];
|
|
705
714
|
};
|
|
715
|
+
get_sessions_with_coordinates: {
|
|
716
|
+
Args: {
|
|
717
|
+
herd_id_caller: number;
|
|
718
|
+
};
|
|
719
|
+
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
720
|
+
};
|
|
721
|
+
get_sessions_with_coordinates_by_device: {
|
|
722
|
+
Args: {
|
|
723
|
+
device_id_caller: number;
|
|
724
|
+
};
|
|
725
|
+
Returns: Database["public"]["CompositeTypes"]["session_with_coordinates"][];
|
|
726
|
+
};
|
|
706
727
|
get_total_events_for_herd: {
|
|
707
728
|
Args: {
|
|
708
729
|
herd_id_caller: number;
|
|
@@ -733,6 +754,22 @@ export type Database = {
|
|
|
733
754
|
user_status: "ONLINE" | "OFFLINE";
|
|
734
755
|
};
|
|
735
756
|
CompositeTypes: {
|
|
757
|
+
connectivity_with_coordinates: {
|
|
758
|
+
id: number | null;
|
|
759
|
+
session_id: number | null;
|
|
760
|
+
inserted_at: string | null;
|
|
761
|
+
timestamp_start: string | null;
|
|
762
|
+
signal: number | null;
|
|
763
|
+
noise: number | null;
|
|
764
|
+
altitude: number | null;
|
|
765
|
+
heading: number | null;
|
|
766
|
+
latitude: number | null;
|
|
767
|
+
longitude: number | null;
|
|
768
|
+
h14_index: number | null;
|
|
769
|
+
h13_index: number | null;
|
|
770
|
+
h12_index: number | null;
|
|
771
|
+
h11_index: number | null;
|
|
772
|
+
};
|
|
736
773
|
device_pretty_location: {
|
|
737
774
|
id: number | null;
|
|
738
775
|
inserted_at: string | null;
|
|
@@ -813,6 +850,23 @@ export type Database = {
|
|
|
813
850
|
is_public: boolean | null;
|
|
814
851
|
tags: Database["public"]["Tables"]["tags"]["Row"][] | null;
|
|
815
852
|
};
|
|
853
|
+
session_with_coordinates: {
|
|
854
|
+
id: number | null;
|
|
855
|
+
device_id: number | null;
|
|
856
|
+
timestamp_start: string | null;
|
|
857
|
+
timestamp_end: string | null;
|
|
858
|
+
inserted_at: string | null;
|
|
859
|
+
software_version: string | null;
|
|
860
|
+
locations_geojson: Json | null;
|
|
861
|
+
altitude_max: number | null;
|
|
862
|
+
altitude_min: number | null;
|
|
863
|
+
altitude_average: number | null;
|
|
864
|
+
velocity_max: number | null;
|
|
865
|
+
velocity_min: number | null;
|
|
866
|
+
velocity_average: number | null;
|
|
867
|
+
distance_total: number | null;
|
|
868
|
+
distance_max_from_start: number | null;
|
|
869
|
+
};
|
|
816
870
|
zones_and_actions_pretty_location: {
|
|
817
871
|
id: number | null;
|
|
818
872
|
inserted_at: string | null;
|
|
@@ -823,54 +877,55 @@ export type Database = {
|
|
|
823
877
|
};
|
|
824
878
|
};
|
|
825
879
|
};
|
|
826
|
-
type
|
|
880
|
+
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
|
|
881
|
+
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
|
|
827
882
|
export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
|
|
828
|
-
schema: keyof
|
|
883
|
+
schema: keyof DatabaseWithoutInternals;
|
|
829
884
|
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
830
|
-
schema: keyof
|
|
831
|
-
} ? keyof (
|
|
832
|
-
schema: keyof
|
|
833
|
-
} ? (
|
|
885
|
+
schema: keyof DatabaseWithoutInternals;
|
|
886
|
+
} ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
887
|
+
schema: keyof DatabaseWithoutInternals;
|
|
888
|
+
} ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
834
889
|
Row: infer R;
|
|
835
890
|
} ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
|
|
836
891
|
Row: infer R;
|
|
837
892
|
} ? R : never : never;
|
|
838
893
|
export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
|
|
839
|
-
schema: keyof
|
|
894
|
+
schema: keyof DatabaseWithoutInternals;
|
|
840
895
|
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
841
|
-
schema: keyof
|
|
842
|
-
} ? keyof
|
|
843
|
-
schema: keyof
|
|
844
|
-
} ?
|
|
896
|
+
schema: keyof DatabaseWithoutInternals;
|
|
897
|
+
} ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
898
|
+
schema: keyof DatabaseWithoutInternals;
|
|
899
|
+
} ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
845
900
|
Insert: infer I;
|
|
846
901
|
} ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
|
|
847
902
|
Insert: infer I;
|
|
848
903
|
} ? I : never : never;
|
|
849
904
|
export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
|
|
850
|
-
schema: keyof
|
|
905
|
+
schema: keyof DatabaseWithoutInternals;
|
|
851
906
|
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
852
|
-
schema: keyof
|
|
853
|
-
} ? keyof
|
|
854
|
-
schema: keyof
|
|
855
|
-
} ?
|
|
907
|
+
schema: keyof DatabaseWithoutInternals;
|
|
908
|
+
} ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
909
|
+
schema: keyof DatabaseWithoutInternals;
|
|
910
|
+
} ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
856
911
|
Update: infer U;
|
|
857
912
|
} ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
|
|
858
913
|
Update: infer U;
|
|
859
914
|
} ? U : never : never;
|
|
860
915
|
export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
|
|
861
|
-
schema: keyof
|
|
916
|
+
schema: keyof DatabaseWithoutInternals;
|
|
862
917
|
}, EnumName extends DefaultSchemaEnumNameOrOptions extends {
|
|
863
|
-
schema: keyof
|
|
864
|
-
} ? keyof
|
|
865
|
-
schema: keyof
|
|
866
|
-
} ?
|
|
918
|
+
schema: keyof DatabaseWithoutInternals;
|
|
919
|
+
} ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
|
|
920
|
+
schema: keyof DatabaseWithoutInternals;
|
|
921
|
+
} ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
|
|
867
922
|
export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
|
|
868
|
-
schema: keyof
|
|
923
|
+
schema: keyof DatabaseWithoutInternals;
|
|
869
924
|
}, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
|
|
870
|
-
schema: keyof
|
|
871
|
-
} ? keyof
|
|
872
|
-
schema: keyof
|
|
873
|
-
} ?
|
|
925
|
+
schema: keyof DatabaseWithoutInternals;
|
|
926
|
+
} ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
|
|
927
|
+
schema: keyof DatabaseWithoutInternals;
|
|
928
|
+
} ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
|
|
874
929
|
export declare const Constants: {
|
|
875
930
|
readonly graphql_public: {
|
|
876
931
|
readonly Enums: {};
|