@adventurelabs/scout-core 1.4.83 → 1.4.84
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/herd_credentials.d.ts +9 -0
- package/dist/helpers/herd_credentials.js +85 -0
- package/dist/helpers/herds.js +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +2 -0
- package/dist/helpers/user_credentials.d.ts +9 -0
- package/dist/helpers/user_credentials.js +85 -0
- package/dist/hooks/useDeviceDisplayName.d.ts +8 -0
- package/dist/hooks/useDeviceDisplayName.js +49 -0
- package/dist/types/db.d.ts +9 -0
- package/dist/types/supabase.d.ts +146 -21
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Database } from "../types/supabase";
|
|
2
|
+
import { CredentialQueryArgs, IHerdCredential, HerdCredentialInsert, HerdCredentialUpdate } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
5
|
+
export declare function get_herd_credentials_by_herd_id(client: SupabaseClient<Database>, herd_id: number, args?: CredentialQueryArgs): Promise<IWebResponseCompatible<IHerdCredential[]>>;
|
|
6
|
+
export declare function get_herd_credential_by_id(client: SupabaseClient<Database>, credential_id: number): Promise<IWebResponseCompatible<IHerdCredential | null>>;
|
|
7
|
+
export declare function create_herd_credential(client: SupabaseClient<Database>, row: HerdCredentialInsert): Promise<IWebResponseCompatible<IHerdCredential | null>>;
|
|
8
|
+
export declare function update_herd_credential(client: SupabaseClient<Database>, credential_id: number, patch: HerdCredentialUpdate): Promise<IWebResponseCompatible<IHerdCredential | null>>;
|
|
9
|
+
export declare function delete_herd_credential(client: SupabaseClient<Database>, credential_id: number): Promise<IWebResponseCompatible<IHerdCredential | null>>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IWebResponse } from "../types/requests";
|
|
2
|
+
export async function get_herd_credentials_by_herd_id(client, herd_id, args) {
|
|
3
|
+
let query = client
|
|
4
|
+
.from("herd_credentials")
|
|
5
|
+
.select("*")
|
|
6
|
+
.eq("herd_id", herd_id);
|
|
7
|
+
if (args?.type)
|
|
8
|
+
query = query.eq("type", args.type);
|
|
9
|
+
const { data, error } = await query.order("created_at", { ascending: false });
|
|
10
|
+
if (error) {
|
|
11
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
12
|
+
}
|
|
13
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
14
|
+
}
|
|
15
|
+
export async function get_herd_credential_by_id(client, credential_id) {
|
|
16
|
+
const { data, error } = await client
|
|
17
|
+
.from("herd_credentials")
|
|
18
|
+
.select("*")
|
|
19
|
+
.eq("id", credential_id)
|
|
20
|
+
.single();
|
|
21
|
+
if (error) {
|
|
22
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
23
|
+
}
|
|
24
|
+
if (!data) {
|
|
25
|
+
return IWebResponse.error("Herd credential not found").to_compatible();
|
|
26
|
+
}
|
|
27
|
+
return IWebResponse.success(data).to_compatible();
|
|
28
|
+
}
|
|
29
|
+
export async function create_herd_credential(client, row) {
|
|
30
|
+
if (!row.herd_id) {
|
|
31
|
+
return IWebResponse.error("herd_id is required").to_compatible();
|
|
32
|
+
}
|
|
33
|
+
if (!row.issuer?.trim()) {
|
|
34
|
+
return IWebResponse.error("issuer is required").to_compatible();
|
|
35
|
+
}
|
|
36
|
+
if (!row.type?.trim()) {
|
|
37
|
+
return IWebResponse.error("type is required").to_compatible();
|
|
38
|
+
}
|
|
39
|
+
const { data, error } = await client
|
|
40
|
+
.from("herd_credentials")
|
|
41
|
+
.insert([row])
|
|
42
|
+
.select("*")
|
|
43
|
+
.single();
|
|
44
|
+
if (error) {
|
|
45
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
46
|
+
}
|
|
47
|
+
if (!data) {
|
|
48
|
+
return IWebResponse.error("Failed to create herd credential").to_compatible();
|
|
49
|
+
}
|
|
50
|
+
return IWebResponse.success(data).to_compatible();
|
|
51
|
+
}
|
|
52
|
+
export async function update_herd_credential(client, credential_id, patch) {
|
|
53
|
+
const { id: _id, herd_id: _hid, created_at: _ca, ...updateData } = patch;
|
|
54
|
+
if (Object.keys(updateData).length === 0) {
|
|
55
|
+
return IWebResponse.error("No valid fields to update").to_compatible();
|
|
56
|
+
}
|
|
57
|
+
const { data, error } = await client
|
|
58
|
+
.from("herd_credentials")
|
|
59
|
+
.update(updateData)
|
|
60
|
+
.eq("id", credential_id)
|
|
61
|
+
.select("*")
|
|
62
|
+
.single();
|
|
63
|
+
if (error) {
|
|
64
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
65
|
+
}
|
|
66
|
+
if (!data) {
|
|
67
|
+
return IWebResponse.error("Herd credential not found").to_compatible();
|
|
68
|
+
}
|
|
69
|
+
return IWebResponse.success(data).to_compatible();
|
|
70
|
+
}
|
|
71
|
+
export async function delete_herd_credential(client, credential_id) {
|
|
72
|
+
const { data, error } = await client
|
|
73
|
+
.from("herd_credentials")
|
|
74
|
+
.delete()
|
|
75
|
+
.eq("id", credential_id)
|
|
76
|
+
.select("*")
|
|
77
|
+
.single();
|
|
78
|
+
if (error) {
|
|
79
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
80
|
+
}
|
|
81
|
+
if (!data) {
|
|
82
|
+
return IWebResponse.error("Herd credential not found").to_compatible();
|
|
83
|
+
}
|
|
84
|
+
return IWebResponse.success(data).to_compatible();
|
|
85
|
+
}
|
package/dist/helpers/herds.js
CHANGED
|
@@ -45,7 +45,7 @@ export async function get_herd_by_slug(slug) {
|
|
|
45
45
|
}
|
|
46
46
|
export async function deleteHerd(herd_id) {
|
|
47
47
|
const supabase = await newServerClient();
|
|
48
|
-
const { error } = await supabase.from("herds").delete().match({ id:
|
|
48
|
+
const { error } = await supabase.from("herds").delete().match({ id: herd_id });
|
|
49
49
|
if (error) {
|
|
50
50
|
return {
|
|
51
51
|
status: EnumWebResponse.ERROR,
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export * from "./bounding_boxes";
|
|
|
4
4
|
export * from "./chat";
|
|
5
5
|
export * from "./certificates";
|
|
6
6
|
export * from "./credentials";
|
|
7
|
+
export * from "./user_credentials";
|
|
8
|
+
export * from "./herd_credentials";
|
|
7
9
|
export * from "./db";
|
|
8
10
|
export * from "./devices";
|
|
9
11
|
export * from "./email";
|
package/dist/helpers/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export * from "./bounding_boxes";
|
|
|
4
4
|
export * from "./chat";
|
|
5
5
|
export * from "./certificates";
|
|
6
6
|
export * from "./credentials";
|
|
7
|
+
export * from "./user_credentials";
|
|
8
|
+
export * from "./herd_credentials";
|
|
7
9
|
export * from "./db";
|
|
8
10
|
export * from "./devices";
|
|
9
11
|
export * from "./email";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Database } from "../types/supabase";
|
|
2
|
+
import { CredentialQueryArgs, IUserCredential, UserCredentialInsert, UserCredentialUpdate } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
5
|
+
export declare function get_user_credentials_by_user_id(client: SupabaseClient<Database>, user_id: string, args?: CredentialQueryArgs): Promise<IWebResponseCompatible<IUserCredential[]>>;
|
|
6
|
+
export declare function get_user_credential_by_id(client: SupabaseClient<Database>, credential_id: number): Promise<IWebResponseCompatible<IUserCredential | null>>;
|
|
7
|
+
export declare function create_user_credential(client: SupabaseClient<Database>, row: UserCredentialInsert): Promise<IWebResponseCompatible<IUserCredential | null>>;
|
|
8
|
+
export declare function update_user_credential(client: SupabaseClient<Database>, credential_id: number, patch: UserCredentialUpdate): Promise<IWebResponseCompatible<IUserCredential | null>>;
|
|
9
|
+
export declare function delete_user_credential(client: SupabaseClient<Database>, credential_id: number): Promise<IWebResponseCompatible<IUserCredential | null>>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IWebResponse } from "../types/requests";
|
|
2
|
+
export async function get_user_credentials_by_user_id(client, user_id, args) {
|
|
3
|
+
let query = client
|
|
4
|
+
.from("user_credentials")
|
|
5
|
+
.select("*")
|
|
6
|
+
.eq("user_id", user_id);
|
|
7
|
+
if (args?.type)
|
|
8
|
+
query = query.eq("type", args.type);
|
|
9
|
+
const { data, error } = await query.order("created_at", { ascending: false });
|
|
10
|
+
if (error) {
|
|
11
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
12
|
+
}
|
|
13
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
14
|
+
}
|
|
15
|
+
export async function get_user_credential_by_id(client, credential_id) {
|
|
16
|
+
const { data, error } = await client
|
|
17
|
+
.from("user_credentials")
|
|
18
|
+
.select("*")
|
|
19
|
+
.eq("id", credential_id)
|
|
20
|
+
.single();
|
|
21
|
+
if (error) {
|
|
22
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
23
|
+
}
|
|
24
|
+
if (!data) {
|
|
25
|
+
return IWebResponse.error("User credential not found").to_compatible();
|
|
26
|
+
}
|
|
27
|
+
return IWebResponse.success(data).to_compatible();
|
|
28
|
+
}
|
|
29
|
+
export async function create_user_credential(client, row) {
|
|
30
|
+
if (!row.user_id) {
|
|
31
|
+
return IWebResponse.error("user_id is required").to_compatible();
|
|
32
|
+
}
|
|
33
|
+
if (!row.issuer?.trim()) {
|
|
34
|
+
return IWebResponse.error("issuer is required").to_compatible();
|
|
35
|
+
}
|
|
36
|
+
if (!row.type?.trim()) {
|
|
37
|
+
return IWebResponse.error("type is required").to_compatible();
|
|
38
|
+
}
|
|
39
|
+
const { data, error } = await client
|
|
40
|
+
.from("user_credentials")
|
|
41
|
+
.insert([row])
|
|
42
|
+
.select("*")
|
|
43
|
+
.single();
|
|
44
|
+
if (error) {
|
|
45
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
46
|
+
}
|
|
47
|
+
if (!data) {
|
|
48
|
+
return IWebResponse.error("Failed to create user credential").to_compatible();
|
|
49
|
+
}
|
|
50
|
+
return IWebResponse.success(data).to_compatible();
|
|
51
|
+
}
|
|
52
|
+
export async function update_user_credential(client, credential_id, patch) {
|
|
53
|
+
const { id: _id, user_id: _uid, created_at: _ca, ...updateData } = patch;
|
|
54
|
+
if (Object.keys(updateData).length === 0) {
|
|
55
|
+
return IWebResponse.error("No valid fields to update").to_compatible();
|
|
56
|
+
}
|
|
57
|
+
const { data, error } = await client
|
|
58
|
+
.from("user_credentials")
|
|
59
|
+
.update(updateData)
|
|
60
|
+
.eq("id", credential_id)
|
|
61
|
+
.select("*")
|
|
62
|
+
.single();
|
|
63
|
+
if (error) {
|
|
64
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
65
|
+
}
|
|
66
|
+
if (!data) {
|
|
67
|
+
return IWebResponse.error("User credential not found").to_compatible();
|
|
68
|
+
}
|
|
69
|
+
return IWebResponse.success(data).to_compatible();
|
|
70
|
+
}
|
|
71
|
+
export async function delete_user_credential(client, credential_id) {
|
|
72
|
+
const { data, error } = await client
|
|
73
|
+
.from("user_credentials")
|
|
74
|
+
.delete()
|
|
75
|
+
.eq("id", credential_id)
|
|
76
|
+
.select("*")
|
|
77
|
+
.single();
|
|
78
|
+
if (error) {
|
|
79
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
80
|
+
}
|
|
81
|
+
if (!data) {
|
|
82
|
+
return IWebResponse.error("User credential not found").to_compatible();
|
|
83
|
+
}
|
|
84
|
+
return IWebResponse.success(data).to_compatible();
|
|
85
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import type { IDevice } from "../types/db";
|
|
3
|
+
import type { IHerdModule } from "../types/herd_module";
|
|
4
|
+
export declare function primeDeviceDisplayNameCache(devices: Iterable<IDevice>): void;
|
|
5
|
+
export declare function useDeviceDisplayName(deviceId: number | null | undefined, options?: {
|
|
6
|
+
herdModules?: IHerdModule[];
|
|
7
|
+
supabase?: SupabaseClient;
|
|
8
|
+
}): string | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { formatDeviceDisplayName } from "../helpers/ui";
|
|
4
|
+
const labelByDeviceId = new Map();
|
|
5
|
+
function rememberDevice(device) {
|
|
6
|
+
if (device.id == null)
|
|
7
|
+
return;
|
|
8
|
+
labelByDeviceId.set(device.id, formatDeviceDisplayName(device));
|
|
9
|
+
}
|
|
10
|
+
export function primeDeviceDisplayNameCache(devices) {
|
|
11
|
+
for (const device of devices)
|
|
12
|
+
rememberDevice(device);
|
|
13
|
+
}
|
|
14
|
+
export function useDeviceDisplayName(deviceId, options = {}) {
|
|
15
|
+
const [, setTick] = useState(0);
|
|
16
|
+
const bump = () => setTick(t => t + 1);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!options.herdModules?.length)
|
|
19
|
+
return;
|
|
20
|
+
for (const hm of options.herdModules) {
|
|
21
|
+
for (const device of hm.devices ?? [])
|
|
22
|
+
rememberDevice(device);
|
|
23
|
+
}
|
|
24
|
+
bump();
|
|
25
|
+
}, [options.herdModules]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (deviceId == null || labelByDeviceId.has(deviceId) || !options.supabase) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let cancelled = false;
|
|
31
|
+
options.supabase
|
|
32
|
+
.from("devices")
|
|
33
|
+
.select("id, name, domain_name, description")
|
|
34
|
+
.eq("id", deviceId)
|
|
35
|
+
.maybeSingle()
|
|
36
|
+
.then(({ data }) => {
|
|
37
|
+
if (cancelled || !data)
|
|
38
|
+
return;
|
|
39
|
+
rememberDevice(data);
|
|
40
|
+
bump();
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
cancelled = true;
|
|
44
|
+
};
|
|
45
|
+
}, [deviceId, options.supabase]);
|
|
46
|
+
if (deviceId == null)
|
|
47
|
+
return null;
|
|
48
|
+
return labelByDeviceId.get(deviceId) ?? `Device ${deviceId}`;
|
|
49
|
+
}
|
package/dist/types/db.d.ts
CHANGED
|
@@ -59,6 +59,8 @@ export type IObservation = Database["public"]["Tables"]["observations"]["Row"];
|
|
|
59
59
|
export type IProvider = Database["public"]["Tables"]["providers"]["Row"];
|
|
60
60
|
export type IPart = Database["public"]["Tables"]["parts"]["Row"];
|
|
61
61
|
export type ICredential = Database["public"]["Tables"]["credentials"]["Row"];
|
|
62
|
+
export type IUserCredential = Database["public"]["Tables"]["user_credentials"]["Row"];
|
|
63
|
+
export type IHerdCredential = Database["public"]["Tables"]["herd_credentials"]["Row"];
|
|
62
64
|
export type IPointsForUser = Database["public"]["Tables"]["points_for_user"]["Row"];
|
|
63
65
|
export type ICertificate = Database["public"]["Tables"]["certificates"]["Row"];
|
|
64
66
|
export type IVersionsSoftware = Database["public"]["Tables"]["versions_software"]["Row"];
|
|
@@ -102,6 +104,13 @@ export type ISessionUsageOverTime = Database["public"]["Functions"]["get_session
|
|
|
102
104
|
export type PartInsert = Database["public"]["Tables"]["parts"]["Insert"];
|
|
103
105
|
export type CredentialInsert = Database["public"]["Tables"]["credentials"]["Insert"];
|
|
104
106
|
export type CredentialUpdate = Database["public"]["Tables"]["credentials"]["Update"];
|
|
107
|
+
export type UserCredentialInsert = Database["public"]["Tables"]["user_credentials"]["Insert"];
|
|
108
|
+
export type UserCredentialUpdate = Database["public"]["Tables"]["user_credentials"]["Update"];
|
|
109
|
+
export type HerdCredentialInsert = Database["public"]["Tables"]["herd_credentials"]["Insert"];
|
|
110
|
+
export type HerdCredentialUpdate = Database["public"]["Tables"]["herd_credentials"]["Update"];
|
|
111
|
+
export interface CredentialQueryArgs {
|
|
112
|
+
type?: string;
|
|
113
|
+
}
|
|
105
114
|
export type PointsForUserInsert = Database["public"]["Tables"]["points_for_user"]["Insert"];
|
|
106
115
|
export type PointsForUserUpdate = Database["public"]["Tables"]["points_for_user"]["Update"];
|
|
107
116
|
export type CertificateInsert = Database["public"]["Tables"]["certificates"]["Insert"];
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type Json = string | number | boolean | null | {
|
|
|
3
3
|
} | Json[];
|
|
4
4
|
export type Database = {
|
|
5
5
|
__InternalSupabase: {
|
|
6
|
-
PostgrestVersion: "14.
|
|
6
|
+
PostgrestVersion: "14.5";
|
|
7
7
|
};
|
|
8
8
|
public: {
|
|
9
9
|
Tables: {
|
|
@@ -932,6 +932,69 @@ export type Database = {
|
|
|
932
932
|
}
|
|
933
933
|
];
|
|
934
934
|
};
|
|
935
|
+
herd_credentials: {
|
|
936
|
+
Row: {
|
|
937
|
+
created_at: string;
|
|
938
|
+
expiration: string | null;
|
|
939
|
+
file_uri: string | null;
|
|
940
|
+
herd_id: number;
|
|
941
|
+
id: number;
|
|
942
|
+
issuer: string;
|
|
943
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
944
|
+
lifecycle_changed_at: string;
|
|
945
|
+
lifecycle_changed_by: string | null;
|
|
946
|
+
lifecycle_reason: string | null;
|
|
947
|
+
tracking_number: string | null;
|
|
948
|
+
type: string;
|
|
949
|
+
updated_at: string;
|
|
950
|
+
};
|
|
951
|
+
Insert: {
|
|
952
|
+
created_at?: string;
|
|
953
|
+
expiration?: string | null;
|
|
954
|
+
file_uri?: string | null;
|
|
955
|
+
herd_id: number;
|
|
956
|
+
id?: number;
|
|
957
|
+
issuer: string;
|
|
958
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
959
|
+
lifecycle_changed_at?: string;
|
|
960
|
+
lifecycle_changed_by?: string | null;
|
|
961
|
+
lifecycle_reason?: string | null;
|
|
962
|
+
tracking_number?: string | null;
|
|
963
|
+
type: string;
|
|
964
|
+
updated_at?: string;
|
|
965
|
+
};
|
|
966
|
+
Update: {
|
|
967
|
+
created_at?: string;
|
|
968
|
+
expiration?: string | null;
|
|
969
|
+
file_uri?: string | null;
|
|
970
|
+
herd_id?: number;
|
|
971
|
+
id?: number;
|
|
972
|
+
issuer?: string;
|
|
973
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
974
|
+
lifecycle_changed_at?: string;
|
|
975
|
+
lifecycle_changed_by?: string | null;
|
|
976
|
+
lifecycle_reason?: string | null;
|
|
977
|
+
tracking_number?: string | null;
|
|
978
|
+
type?: string;
|
|
979
|
+
updated_at?: string;
|
|
980
|
+
};
|
|
981
|
+
Relationships: [
|
|
982
|
+
{
|
|
983
|
+
foreignKeyName: "herd_credentials_herd_id_fkey";
|
|
984
|
+
columns: ["herd_id"];
|
|
985
|
+
isOneToOne: false;
|
|
986
|
+
referencedRelation: "herds";
|
|
987
|
+
referencedColumns: ["id"];
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
foreignKeyName: "herd_credentials_lifecycle_changed_by_fkey";
|
|
991
|
+
columns: ["lifecycle_changed_by"];
|
|
992
|
+
isOneToOne: false;
|
|
993
|
+
referencedRelation: "users";
|
|
994
|
+
referencedColumns: ["id"];
|
|
995
|
+
}
|
|
996
|
+
];
|
|
997
|
+
};
|
|
935
998
|
herd_invitations: {
|
|
936
999
|
Row: {
|
|
937
1000
|
accepted_at: string | null;
|
|
@@ -1943,6 +2006,69 @@ export type Database = {
|
|
|
1943
2006
|
}
|
|
1944
2007
|
];
|
|
1945
2008
|
};
|
|
2009
|
+
user_credentials: {
|
|
2010
|
+
Row: {
|
|
2011
|
+
created_at: string;
|
|
2012
|
+
expiration: string | null;
|
|
2013
|
+
file_uri: string | null;
|
|
2014
|
+
id: number;
|
|
2015
|
+
issuer: string;
|
|
2016
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
2017
|
+
lifecycle_changed_at: string;
|
|
2018
|
+
lifecycle_changed_by: string | null;
|
|
2019
|
+
lifecycle_reason: string | null;
|
|
2020
|
+
tracking_number: string | null;
|
|
2021
|
+
type: string;
|
|
2022
|
+
updated_at: string;
|
|
2023
|
+
user_id: string;
|
|
2024
|
+
};
|
|
2025
|
+
Insert: {
|
|
2026
|
+
created_at?: string;
|
|
2027
|
+
expiration?: string | null;
|
|
2028
|
+
file_uri?: string | null;
|
|
2029
|
+
id?: number;
|
|
2030
|
+
issuer: string;
|
|
2031
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
2032
|
+
lifecycle_changed_at?: string;
|
|
2033
|
+
lifecycle_changed_by?: string | null;
|
|
2034
|
+
lifecycle_reason?: string | null;
|
|
2035
|
+
tracking_number?: string | null;
|
|
2036
|
+
type: string;
|
|
2037
|
+
updated_at?: string;
|
|
2038
|
+
user_id: string;
|
|
2039
|
+
};
|
|
2040
|
+
Update: {
|
|
2041
|
+
created_at?: string;
|
|
2042
|
+
expiration?: string | null;
|
|
2043
|
+
file_uri?: string | null;
|
|
2044
|
+
id?: number;
|
|
2045
|
+
issuer?: string;
|
|
2046
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
2047
|
+
lifecycle_changed_at?: string;
|
|
2048
|
+
lifecycle_changed_by?: string | null;
|
|
2049
|
+
lifecycle_reason?: string | null;
|
|
2050
|
+
tracking_number?: string | null;
|
|
2051
|
+
type?: string;
|
|
2052
|
+
updated_at?: string;
|
|
2053
|
+
user_id?: string;
|
|
2054
|
+
};
|
|
2055
|
+
Relationships: [
|
|
2056
|
+
{
|
|
2057
|
+
foreignKeyName: "user_credentials_lifecycle_changed_by_fkey";
|
|
2058
|
+
columns: ["lifecycle_changed_by"];
|
|
2059
|
+
isOneToOne: false;
|
|
2060
|
+
referencedRelation: "users";
|
|
2061
|
+
referencedColumns: ["id"];
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
foreignKeyName: "user_credentials_user_id_fkey";
|
|
2065
|
+
columns: ["user_id"];
|
|
2066
|
+
isOneToOne: false;
|
|
2067
|
+
referencedRelation: "users";
|
|
2068
|
+
referencedColumns: ["id"];
|
|
2069
|
+
}
|
|
2070
|
+
];
|
|
2071
|
+
};
|
|
1946
2072
|
users: {
|
|
1947
2073
|
Row: {
|
|
1948
2074
|
auto_approve_sessions: boolean;
|
|
@@ -2313,6 +2439,10 @@ export type Database = {
|
|
|
2313
2439
|
isSetofReturn: true;
|
|
2314
2440
|
};
|
|
2315
2441
|
};
|
|
2442
|
+
auto_assign_session_post_approver: {
|
|
2443
|
+
Args: never;
|
|
2444
|
+
Returns: number;
|
|
2445
|
+
};
|
|
2316
2446
|
check_realtime_schema_status: {
|
|
2317
2447
|
Args: never;
|
|
2318
2448
|
Returns: {
|
|
@@ -3237,16 +3367,6 @@ export type Database = {
|
|
|
3237
3367
|
};
|
|
3238
3368
|
};
|
|
3239
3369
|
get_session_summaries: {
|
|
3240
|
-
Args: {
|
|
3241
|
-
device_id_caller?: number;
|
|
3242
|
-
end_date_caller?: string;
|
|
3243
|
-
herd_id_caller?: number;
|
|
3244
|
-
min_distance_meters_caller?: number;
|
|
3245
|
-
min_duration_minutes_caller?: number;
|
|
3246
|
-
start_date_caller?: string;
|
|
3247
|
-
};
|
|
3248
|
-
Returns: Json;
|
|
3249
|
-
} | {
|
|
3250
3370
|
Args: {
|
|
3251
3371
|
device_id_caller?: number;
|
|
3252
3372
|
end_date_caller?: string;
|
|
@@ -3259,16 +3379,6 @@ export type Database = {
|
|
|
3259
3379
|
Returns: Json;
|
|
3260
3380
|
};
|
|
3261
3381
|
get_session_usage_over_time: {
|
|
3262
|
-
Args: {
|
|
3263
|
-
device_id_caller?: number;
|
|
3264
|
-
end_date_caller?: string;
|
|
3265
|
-
herd_id_caller?: number;
|
|
3266
|
-
min_distance_meters_caller?: number;
|
|
3267
|
-
min_duration_minutes_caller?: number;
|
|
3268
|
-
start_date_caller?: string;
|
|
3269
|
-
};
|
|
3270
|
-
Returns: Json;
|
|
3271
|
-
} | {
|
|
3272
3382
|
Args: {
|
|
3273
3383
|
device_id_caller?: number;
|
|
3274
3384
|
end_date_caller?: string;
|
|
@@ -3534,6 +3644,21 @@ export type Database = {
|
|
|
3534
3644
|
isSetofReturn: true;
|
|
3535
3645
|
};
|
|
3536
3646
|
};
|
|
3647
|
+
migrate_conservaition_users_to_sentala: {
|
|
3648
|
+
Args: {
|
|
3649
|
+
preview?: boolean;
|
|
3650
|
+
source_domains?: string[];
|
|
3651
|
+
target_domain?: string;
|
|
3652
|
+
};
|
|
3653
|
+
Returns: {
|
|
3654
|
+
action: string;
|
|
3655
|
+
detail: string;
|
|
3656
|
+
source_email: string;
|
|
3657
|
+
source_user_id: string;
|
|
3658
|
+
target_email: string;
|
|
3659
|
+
target_user_id: string;
|
|
3660
|
+
}[];
|
|
3661
|
+
};
|
|
3537
3662
|
preview_fix_all_sessions_missing_distance: {
|
|
3538
3663
|
Args: never;
|
|
3539
3664
|
Returns: {
|