@adventurelabs/scout-core 1.4.70 → 1.4.72
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/auth.d.ts +3 -0
- package/dist/helpers/auth.js +12 -0
- package/dist/helpers/invitations.d.ts +2 -0
- package/dist/helpers/invitations.js +24 -0
- package/dist/helpers/lifecycle.d.ts +5 -1
- package/dist/helpers/lifecycle.js +20 -0
- package/dist/helpers/users.d.ts +1 -0
- package/dist/helpers/users.js +11 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/providers/ScoutRefreshProvider.d.ts +112 -0
- package/dist/types/supabase.d.ts +114 -0
- package/package.json +1 -1
package/dist/helpers/auth.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
2
|
import { Database } from "../types/supabase";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
/** Deprecated */
|
|
3
5
|
export declare function isEmailValidForLogin(email: string, approved_domains?: string[]): boolean;
|
|
4
6
|
export declare function isCurrentUserPlatformSuperadmin(client: SupabaseClient<Database>): Promise<boolean>;
|
|
7
|
+
export declare function is_scout_email_valid(client: SupabaseClient<Database>, email: string): Promise<IWebResponseCompatible<boolean>>;
|
package/dist/helpers/auth.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { validateEmail } from "./email";
|
|
2
|
+
import { IWebResponse } from "../types/requests";
|
|
2
3
|
const APPROVED_DOMAINS = ["adventurelabs.earth", "conservaition.ai"];
|
|
4
|
+
/** Deprecated */
|
|
3
5
|
export function isEmailValidForLogin(email, approved_domains = APPROVED_DOMAINS) {
|
|
4
6
|
return (validateEmail(email) && isEmailFromApprovedDomain(email, approved_domains));
|
|
5
7
|
}
|
|
8
|
+
/** Deprecated */
|
|
6
9
|
function isEmailFromApprovedDomain(email, approved_domains = APPROVED_DOMAINS) {
|
|
7
10
|
return approved_domains.filter((domain) => email.endsWith(domain)).length > 0;
|
|
8
11
|
}
|
|
@@ -14,3 +17,12 @@ export async function isCurrentUserPlatformSuperadmin(client) {
|
|
|
14
17
|
}
|
|
15
18
|
return data === true;
|
|
16
19
|
}
|
|
20
|
+
export async function is_scout_email_valid(client, email) {
|
|
21
|
+
const { data, error } = await client.rpc("is_scout_email_valid", {
|
|
22
|
+
p_email: email,
|
|
23
|
+
});
|
|
24
|
+
if (error) {
|
|
25
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
26
|
+
}
|
|
27
|
+
return IWebResponse.success(data ?? false).to_compatible();
|
|
28
|
+
}
|
|
@@ -6,3 +6,5 @@ export declare function server_create_herd_invitation(herd_id: number, email: st
|
|
|
6
6
|
export declare function accept_herd_invitations_for_current_user(invitation_ids: number[], supabaseClient?: SupabaseClient<Database>): Promise<IWebResponseCompatible<IHerdInvitation[]>>;
|
|
7
7
|
export declare function server_get_herd_invitations_for_current_user(): Promise<IWebResponseCompatible<IHerdInvitation[]>>;
|
|
8
8
|
export declare function server_get_herd_invitations_by_herd(herd_id: number, supabaseClient?: SupabaseClient<Database>): Promise<IWebResponseCompatible<IHerdInvitation[]>>;
|
|
9
|
+
export declare function reject_herd_invitations_for_current_user(invitation_ids: number[], supabaseClient?: SupabaseClient<Database>): Promise<IWebResponseCompatible<IHerdInvitation[]>>;
|
|
10
|
+
export declare function server_revoke_herd_invitations(invitation_ids: number[], supabaseClient?: SupabaseClient<Database>): Promise<IWebResponseCompatible<IHerdInvitation[]>>;
|
|
@@ -45,3 +45,27 @@ export async function server_get_herd_invitations_by_herd(herd_id, supabaseClien
|
|
|
45
45
|
}
|
|
46
46
|
return IWebResponse.success(data ?? []).to_compatible();
|
|
47
47
|
}
|
|
48
|
+
export async function reject_herd_invitations_for_current_user(invitation_ids, supabaseClient) {
|
|
49
|
+
if (invitation_ids.length === 0) {
|
|
50
|
+
return IWebResponse.error("At least one invitation id is required").to_compatible();
|
|
51
|
+
}
|
|
52
|
+
const supabase = supabaseClient ?? (await newServerClient());
|
|
53
|
+
const { data, error } = await supabase.rpc("reject_herd_invitations_for_current_user", { p_invitation_ids: invitation_ids });
|
|
54
|
+
if (error) {
|
|
55
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
56
|
+
}
|
|
57
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
58
|
+
}
|
|
59
|
+
export async function server_revoke_herd_invitations(invitation_ids, supabaseClient) {
|
|
60
|
+
if (invitation_ids.length === 0) {
|
|
61
|
+
return IWebResponse.error("At least one invitation id is required").to_compatible();
|
|
62
|
+
}
|
|
63
|
+
const supabase = supabaseClient ?? (await newServerClient());
|
|
64
|
+
const { data, error } = await supabase.rpc("revoke_herd_invitations", {
|
|
65
|
+
p_invitation_ids: invitation_ids,
|
|
66
|
+
});
|
|
67
|
+
if (error) {
|
|
68
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
69
|
+
}
|
|
70
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
71
|
+
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
2
|
import { Database } from "../types/supabase";
|
|
3
|
-
import { EntityLifecycle, IArtifact, IDeviceRow, IEvent, IPart, ISession, IUserProfileRow } from "../types/db";
|
|
3
|
+
import { EntityLifecycle, IArtifact, IDeviceRow, IEvent, IHerdAllowedDomain, IPart, ISession, IUserProfileRow, IUserRolePerHerd } from "../types/db";
|
|
4
4
|
import { IWebResponseCompatible } from "../types/requests";
|
|
5
5
|
export interface LifecycleUpdateOptions {
|
|
6
6
|
lifecycle_reason?: string | null;
|
|
7
7
|
lifecycle_changed_by?: string | null;
|
|
8
8
|
}
|
|
9
|
+
/** Matches DB auto-generated reason when an allowed domain is paused. */
|
|
10
|
+
export declare const AUTO_GENERATED_ALLOWED_DOMAIN_INACTIVE_REASON: "auto_generated_allowed_domain_inactive";
|
|
9
11
|
export declare function update_user_lifecycle(client: SupabaseClient<Database>, user_id: string, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IUserProfileRow | null>>;
|
|
10
12
|
export declare function update_device_lifecycle(client: SupabaseClient<Database>, device_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IDeviceRow | null>>;
|
|
11
13
|
export declare function update_session_lifecycle(client: SupabaseClient<Database>, session_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<ISession | null>>;
|
|
12
14
|
export declare function update_part_lifecycle(client: SupabaseClient<Database>, part_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IPart | null>>;
|
|
13
15
|
export declare function update_event_lifecycle(client: SupabaseClient<Database>, event_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IEvent | null>>;
|
|
14
16
|
export declare function update_artifact_lifecycle(client: SupabaseClient<Database>, artifact_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IArtifact | null>>;
|
|
17
|
+
export declare function update_user_role_per_herd_lifecycle(client: SupabaseClient<Database>, membership_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IUserRolePerHerd | null>>;
|
|
18
|
+
export declare function update_herd_allowed_domain_lifecycle(client: SupabaseClient<Database>, domain_id: number, lifecycle: EntityLifecycle, options?: LifecycleUpdateOptions): Promise<IWebResponseCompatible<IHerdAllowedDomain | null>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IWebResponse } from "../types/requests";
|
|
2
|
+
/** Matches DB auto-generated reason when an allowed domain is paused. */
|
|
3
|
+
export const AUTO_GENERATED_ALLOWED_DOMAIN_INACTIVE_REASON = "auto_generated_allowed_domain_inactive";
|
|
2
4
|
function build_lifecycle_patch(lifecycle, options) {
|
|
3
5
|
const patch = { lifecycle };
|
|
4
6
|
if (options && "lifecycle_reason" in options) {
|
|
@@ -72,3 +74,21 @@ export async function update_artifact_lifecycle(client, artifact_id, lifecycle,
|
|
|
72
74
|
.single();
|
|
73
75
|
return lifecycle_result(data, error, "Artifact not found or lifecycle update failed");
|
|
74
76
|
}
|
|
77
|
+
export async function update_user_role_per_herd_lifecycle(client, membership_id, lifecycle, options) {
|
|
78
|
+
const { data, error } = await client
|
|
79
|
+
.from("users_roles_per_herd")
|
|
80
|
+
.update(build_lifecycle_patch(lifecycle, options))
|
|
81
|
+
.eq("id", membership_id)
|
|
82
|
+
.select("*")
|
|
83
|
+
.single();
|
|
84
|
+
return lifecycle_result(data, error, "Herd membership not found or lifecycle update failed");
|
|
85
|
+
}
|
|
86
|
+
export async function update_herd_allowed_domain_lifecycle(client, domain_id, lifecycle, options) {
|
|
87
|
+
const { data, error } = await client
|
|
88
|
+
.from("herd_allowed_domains")
|
|
89
|
+
.update(build_lifecycle_patch(lifecycle, options))
|
|
90
|
+
.eq("id", domain_id)
|
|
91
|
+
.select("*")
|
|
92
|
+
.single();
|
|
93
|
+
return lifecycle_result(data, error, "Allowed domain not found or lifecycle update failed");
|
|
94
|
+
}
|
package/dist/helpers/users.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export declare function server_get_users_with_herd_access(herd_id: number, supab
|
|
|
8
8
|
export declare function server_upsert_user_with_role(herd_id: number, username: string, role: Role): Promise<IWebResponseCompatible<IUserAndRole | null>>;
|
|
9
9
|
export type UserProfileUpdate = Database["public"]["Tables"]["users"]["Update"];
|
|
10
10
|
export declare function update_user_profile(client: SupabaseClient<Database>, user_id: string, patch: UserProfileUpdate): Promise<IWebResponseCompatible<IUserProfileRow | null>>;
|
|
11
|
+
export declare function leave_herd_for_current_user(herd_id: number, supabaseClient?: SupabaseClient<Database>): Promise<IWebResponseCompatible<IUserRolePerHerd | null>>;
|
package/dist/helpers/users.js
CHANGED
|
@@ -31,7 +31,7 @@ export async function server_get_users_with_herd_access(herd_id, supabaseClient)
|
|
|
31
31
|
.from("users_roles_per_herd")
|
|
32
32
|
.select(`
|
|
33
33
|
role,
|
|
34
|
-
users (*)
|
|
34
|
+
users!users_roles_per_herd_user_id_fkey (*)
|
|
35
35
|
`)
|
|
36
36
|
.eq("herd_id", herd_id);
|
|
37
37
|
if (error) {
|
|
@@ -89,3 +89,13 @@ export async function update_user_profile(client, user_id, patch) {
|
|
|
89
89
|
}
|
|
90
90
|
return IWebResponse.success(data).to_compatible();
|
|
91
91
|
}
|
|
92
|
+
export async function leave_herd_for_current_user(herd_id, supabaseClient) {
|
|
93
|
+
const supabase = supabaseClient ?? (await newServerClient());
|
|
94
|
+
const { data, error } = await supabase.rpc("leave_herd_for_current_user", {
|
|
95
|
+
p_herd_id: herd_id,
|
|
96
|
+
});
|
|
97
|
+
if (error) {
|
|
98
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
99
|
+
}
|
|
100
|
+
return IWebResponse.success(data).to_compatible();
|
|
101
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export * from "./helpers/operators";
|
|
|
53
53
|
export * from "./helpers/versions_software";
|
|
54
54
|
export * from "./helpers/versions_software_server";
|
|
55
55
|
export * from "./helpers/parts";
|
|
56
|
+
export * from "./helpers/lifecycle";
|
|
56
57
|
export * from "./helpers/storagePath";
|
|
57
58
|
export * from "./hooks/useScoutRealtimeConnectivity";
|
|
58
59
|
export * from "./hooks/useScoutRealtimeDevices";
|
|
@@ -75,5 +76,5 @@ export * from "./supabase/middleware";
|
|
|
75
76
|
export * from "./supabase/server";
|
|
76
77
|
export * from "./api_keys/actions";
|
|
77
78
|
export type { HerdModule, IHerdModule } from "./types/herd_module";
|
|
78
|
-
export type { IDevice, IEvent, IUser, IHerd, IHerdPrettyLocation, IEventWithTags, IZoneWithActions, ICredential, CredentialInsert, CredentialUpdate, ICertificate, CertificateInsert, CertificateUpdate, IUserAndRole, IUserProfileRow, IHerdInvitation, IHerdAllowedDomain, HerdInvitationStatus, IApiKeyScout, ILayer, IHeartbeat, IProvider, IConnectivity, ISession, ISessionWithCoordinates, IConnectivityWithCoordinates, IObservation, ObservationInsert, ObservationUpdate, IAnalysisJob, IAnalysisTask, AnalysisWorkStatus, } from "./types/db";
|
|
79
|
+
export type { IDevice, IEvent, IUser, IHerd, IHerdPrettyLocation, IEventWithTags, IZoneWithActions, ICredential, CredentialInsert, CredentialUpdate, ICertificate, CertificateInsert, CertificateUpdate, IUserAndRole, IUserProfileRow, IHerdInvitation, IHerdAllowedDomain, IUserRolePerHerd, HerdInvitationStatus, IApiKeyScout, ILayer, IHeartbeat, IProvider, IConnectivity, ISession, ISessionWithCoordinates, IConnectivityWithCoordinates, IObservation, ObservationInsert, ObservationUpdate, IAnalysisJob, IAnalysisTask, AnalysisWorkStatus, } from "./types/db";
|
|
79
80
|
export { EnumSessionsVisibility } from "./types/events";
|
package/dist/index.js
CHANGED
|
@@ -56,6 +56,7 @@ export * from "./helpers/operators";
|
|
|
56
56
|
export * from "./helpers/versions_software";
|
|
57
57
|
export * from "./helpers/versions_software_server";
|
|
58
58
|
export * from "./helpers/parts";
|
|
59
|
+
export * from "./helpers/lifecycle";
|
|
59
60
|
export * from "./helpers/storagePath";
|
|
60
61
|
// Hooks
|
|
61
62
|
export * from "./hooks/useScoutRealtimeConnectivity";
|
|
@@ -755,18 +755,30 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
755
755
|
domain: string;
|
|
756
756
|
herd_id: number;
|
|
757
757
|
id: number;
|
|
758
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
759
|
+
lifecycle_changed_at: string;
|
|
760
|
+
lifecycle_changed_by: string | null;
|
|
761
|
+
lifecycle_reason: string | null;
|
|
758
762
|
};
|
|
759
763
|
Insert: {
|
|
760
764
|
created_at?: string;
|
|
761
765
|
domain: string;
|
|
762
766
|
herd_id: number;
|
|
763
767
|
id?: number;
|
|
768
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
769
|
+
lifecycle_changed_at?: string;
|
|
770
|
+
lifecycle_changed_by?: string | null;
|
|
771
|
+
lifecycle_reason?: string | null;
|
|
764
772
|
};
|
|
765
773
|
Update: {
|
|
766
774
|
created_at?: string;
|
|
767
775
|
domain?: string;
|
|
768
776
|
herd_id?: number;
|
|
769
777
|
id?: number;
|
|
778
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
779
|
+
lifecycle_changed_at?: string;
|
|
780
|
+
lifecycle_changed_by?: string | null;
|
|
781
|
+
lifecycle_reason?: string | null;
|
|
770
782
|
};
|
|
771
783
|
Relationships: [{
|
|
772
784
|
foreignKeyName: "herd_allowed_domains_herd_id_fkey";
|
|
@@ -774,6 +786,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
774
786
|
isOneToOne: false;
|
|
775
787
|
referencedRelation: "herds";
|
|
776
788
|
referencedColumns: ["id"];
|
|
789
|
+
}, {
|
|
790
|
+
foreignKeyName: "herd_allowed_domains_lifecycle_changed_by_fkey";
|
|
791
|
+
columns: ["lifecycle_changed_by"];
|
|
792
|
+
isOneToOne: false;
|
|
793
|
+
referencedRelation: "users";
|
|
794
|
+
referencedColumns: ["id"];
|
|
777
795
|
}];
|
|
778
796
|
};
|
|
779
797
|
herd_invitations: {
|
|
@@ -1588,6 +1606,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1588
1606
|
herd_id: number;
|
|
1589
1607
|
id: number;
|
|
1590
1608
|
inserted_at: string;
|
|
1609
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
1610
|
+
lifecycle_changed_at: string;
|
|
1611
|
+
lifecycle_changed_by: string | null;
|
|
1612
|
+
lifecycle_reason: string | null;
|
|
1591
1613
|
role: Database["public"]["Enums"]["role"];
|
|
1592
1614
|
user_id: string;
|
|
1593
1615
|
};
|
|
@@ -1595,6 +1617,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1595
1617
|
herd_id: number;
|
|
1596
1618
|
id?: number;
|
|
1597
1619
|
inserted_at?: string;
|
|
1620
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
1621
|
+
lifecycle_changed_at?: string;
|
|
1622
|
+
lifecycle_changed_by?: string | null;
|
|
1623
|
+
lifecycle_reason?: string | null;
|
|
1598
1624
|
role: Database["public"]["Enums"]["role"];
|
|
1599
1625
|
user_id: string;
|
|
1600
1626
|
};
|
|
@@ -1602,6 +1628,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1602
1628
|
herd_id?: number;
|
|
1603
1629
|
id?: number;
|
|
1604
1630
|
inserted_at?: string;
|
|
1631
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
1632
|
+
lifecycle_changed_at?: string;
|
|
1633
|
+
lifecycle_changed_by?: string | null;
|
|
1634
|
+
lifecycle_reason?: string | null;
|
|
1605
1635
|
role?: Database["public"]["Enums"]["role"];
|
|
1606
1636
|
user_id?: string;
|
|
1607
1637
|
};
|
|
@@ -1611,6 +1641,12 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1611
1641
|
isOneToOne: false;
|
|
1612
1642
|
referencedRelation: "herds";
|
|
1613
1643
|
referencedColumns: ["id"];
|
|
1644
|
+
}, {
|
|
1645
|
+
foreignKeyName: "users_roles_per_herd_lifecycle_changed_by_fkey";
|
|
1646
|
+
columns: ["lifecycle_changed_by"];
|
|
1647
|
+
isOneToOne: false;
|
|
1648
|
+
referencedRelation: "users";
|
|
1649
|
+
referencedColumns: ["id"];
|
|
1614
1650
|
}, {
|
|
1615
1651
|
foreignKeyName: "users_roles_per_herd_user_id_fkey";
|
|
1616
1652
|
columns: ["user_id"];
|
|
@@ -1921,6 +1957,10 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
1921
1957
|
timestamp_start: string;
|
|
1922
1958
|
}[];
|
|
1923
1959
|
};
|
|
1960
|
+
expire_herd_invitations: {
|
|
1961
|
+
Args: never;
|
|
1962
|
+
Returns: number;
|
|
1963
|
+
};
|
|
1924
1964
|
fix_all_sessions_missing_distance: {
|
|
1925
1965
|
Args: never;
|
|
1926
1966
|
Returns: {
|
|
@@ -2966,6 +3006,34 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
2966
3006
|
Args: never;
|
|
2967
3007
|
Returns: boolean;
|
|
2968
3008
|
};
|
|
3009
|
+
is_scout_email_valid: {
|
|
3010
|
+
Args: {
|
|
3011
|
+
p_email: string;
|
|
3012
|
+
};
|
|
3013
|
+
Returns: boolean;
|
|
3014
|
+
};
|
|
3015
|
+
leave_herd_for_current_user: {
|
|
3016
|
+
Args: {
|
|
3017
|
+
p_herd_id: number;
|
|
3018
|
+
};
|
|
3019
|
+
Returns: {
|
|
3020
|
+
herd_id: number;
|
|
3021
|
+
id: number;
|
|
3022
|
+
inserted_at: string;
|
|
3023
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
3024
|
+
lifecycle_changed_at: string;
|
|
3025
|
+
lifecycle_changed_by: string | null;
|
|
3026
|
+
lifecycle_reason: string | null;
|
|
3027
|
+
role: Database["public"]["Enums"]["role"];
|
|
3028
|
+
user_id: string;
|
|
3029
|
+
};
|
|
3030
|
+
SetofOptions: {
|
|
3031
|
+
from: "*";
|
|
3032
|
+
to: "users_roles_per_herd";
|
|
3033
|
+
isOneToOne: true;
|
|
3034
|
+
isSetofReturn: false;
|
|
3035
|
+
};
|
|
3036
|
+
};
|
|
2969
3037
|
load_api_keys: {
|
|
2970
3038
|
Args: {
|
|
2971
3039
|
id_of_device: number;
|
|
@@ -3067,10 +3135,54 @@ export declare function useSupabase(): SupabaseClient<Database, "public", "publi
|
|
|
3067
3135
|
status: string;
|
|
3068
3136
|
}[];
|
|
3069
3137
|
};
|
|
3138
|
+
reject_herd_invitations_for_current_user: {
|
|
3139
|
+
Args: {
|
|
3140
|
+
p_invitation_ids: number[];
|
|
3141
|
+
};
|
|
3142
|
+
Returns: {
|
|
3143
|
+
accepted_at: string | null;
|
|
3144
|
+
created_at: string;
|
|
3145
|
+
email: string;
|
|
3146
|
+
expires_at: string | null;
|
|
3147
|
+
herd_id: number;
|
|
3148
|
+
id: number;
|
|
3149
|
+
invited_by: string;
|
|
3150
|
+
role: Database["public"]["Enums"]["role"];
|
|
3151
|
+
status: Database["public"]["Enums"]["herd_invitation_status"];
|
|
3152
|
+
}[];
|
|
3153
|
+
SetofOptions: {
|
|
3154
|
+
from: "*";
|
|
3155
|
+
to: "herd_invitations";
|
|
3156
|
+
isOneToOne: false;
|
|
3157
|
+
isSetofReturn: true;
|
|
3158
|
+
};
|
|
3159
|
+
};
|
|
3070
3160
|
remove_rls_broadcast_triggers: {
|
|
3071
3161
|
Args: never;
|
|
3072
3162
|
Returns: undefined;
|
|
3073
3163
|
};
|
|
3164
|
+
revoke_herd_invitations: {
|
|
3165
|
+
Args: {
|
|
3166
|
+
p_invitation_ids: number[];
|
|
3167
|
+
};
|
|
3168
|
+
Returns: {
|
|
3169
|
+
accepted_at: string | null;
|
|
3170
|
+
created_at: string;
|
|
3171
|
+
email: string;
|
|
3172
|
+
expires_at: string | null;
|
|
3173
|
+
herd_id: number;
|
|
3174
|
+
id: number;
|
|
3175
|
+
invited_by: string;
|
|
3176
|
+
role: Database["public"]["Enums"]["role"];
|
|
3177
|
+
status: Database["public"]["Enums"]["herd_invitation_status"];
|
|
3178
|
+
}[];
|
|
3179
|
+
SetofOptions: {
|
|
3180
|
+
from: "*";
|
|
3181
|
+
to: "herd_invitations";
|
|
3182
|
+
isOneToOne: false;
|
|
3183
|
+
isSetofReturn: true;
|
|
3184
|
+
};
|
|
3185
|
+
};
|
|
3074
3186
|
revoke_pubsub_jwt_public_key: {
|
|
3075
3187
|
Args: {
|
|
3076
3188
|
p_kid: string;
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -791,18 +791,30 @@ export type Database = {
|
|
|
791
791
|
domain: string;
|
|
792
792
|
herd_id: number;
|
|
793
793
|
id: number;
|
|
794
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
795
|
+
lifecycle_changed_at: string;
|
|
796
|
+
lifecycle_changed_by: string | null;
|
|
797
|
+
lifecycle_reason: string | null;
|
|
794
798
|
};
|
|
795
799
|
Insert: {
|
|
796
800
|
created_at?: string;
|
|
797
801
|
domain: string;
|
|
798
802
|
herd_id: number;
|
|
799
803
|
id?: number;
|
|
804
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
805
|
+
lifecycle_changed_at?: string;
|
|
806
|
+
lifecycle_changed_by?: string | null;
|
|
807
|
+
lifecycle_reason?: string | null;
|
|
800
808
|
};
|
|
801
809
|
Update: {
|
|
802
810
|
created_at?: string;
|
|
803
811
|
domain?: string;
|
|
804
812
|
herd_id?: number;
|
|
805
813
|
id?: number;
|
|
814
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
815
|
+
lifecycle_changed_at?: string;
|
|
816
|
+
lifecycle_changed_by?: string | null;
|
|
817
|
+
lifecycle_reason?: string | null;
|
|
806
818
|
};
|
|
807
819
|
Relationships: [
|
|
808
820
|
{
|
|
@@ -811,6 +823,13 @@ export type Database = {
|
|
|
811
823
|
isOneToOne: false;
|
|
812
824
|
referencedRelation: "herds";
|
|
813
825
|
referencedColumns: ["id"];
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
foreignKeyName: "herd_allowed_domains_lifecycle_changed_by_fkey";
|
|
829
|
+
columns: ["lifecycle_changed_by"];
|
|
830
|
+
isOneToOne: false;
|
|
831
|
+
referencedRelation: "users";
|
|
832
|
+
referencedColumns: ["id"];
|
|
814
833
|
}
|
|
815
834
|
];
|
|
816
835
|
};
|
|
@@ -1668,6 +1687,10 @@ export type Database = {
|
|
|
1668
1687
|
herd_id: number;
|
|
1669
1688
|
id: number;
|
|
1670
1689
|
inserted_at: string;
|
|
1690
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
1691
|
+
lifecycle_changed_at: string;
|
|
1692
|
+
lifecycle_changed_by: string | null;
|
|
1693
|
+
lifecycle_reason: string | null;
|
|
1671
1694
|
role: Database["public"]["Enums"]["role"];
|
|
1672
1695
|
user_id: string;
|
|
1673
1696
|
};
|
|
@@ -1675,6 +1698,10 @@ export type Database = {
|
|
|
1675
1698
|
herd_id: number;
|
|
1676
1699
|
id?: number;
|
|
1677
1700
|
inserted_at?: string;
|
|
1701
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
1702
|
+
lifecycle_changed_at?: string;
|
|
1703
|
+
lifecycle_changed_by?: string | null;
|
|
1704
|
+
lifecycle_reason?: string | null;
|
|
1678
1705
|
role: Database["public"]["Enums"]["role"];
|
|
1679
1706
|
user_id: string;
|
|
1680
1707
|
};
|
|
@@ -1682,6 +1709,10 @@ export type Database = {
|
|
|
1682
1709
|
herd_id?: number;
|
|
1683
1710
|
id?: number;
|
|
1684
1711
|
inserted_at?: string;
|
|
1712
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
1713
|
+
lifecycle_changed_at?: string;
|
|
1714
|
+
lifecycle_changed_by?: string | null;
|
|
1715
|
+
lifecycle_reason?: string | null;
|
|
1685
1716
|
role?: Database["public"]["Enums"]["role"];
|
|
1686
1717
|
user_id?: string;
|
|
1687
1718
|
};
|
|
@@ -1693,6 +1724,13 @@ export type Database = {
|
|
|
1693
1724
|
referencedRelation: "herds";
|
|
1694
1725
|
referencedColumns: ["id"];
|
|
1695
1726
|
},
|
|
1727
|
+
{
|
|
1728
|
+
foreignKeyName: "users_roles_per_herd_lifecycle_changed_by_fkey";
|
|
1729
|
+
columns: ["lifecycle_changed_by"];
|
|
1730
|
+
isOneToOne: false;
|
|
1731
|
+
referencedRelation: "users";
|
|
1732
|
+
referencedColumns: ["id"];
|
|
1733
|
+
},
|
|
1696
1734
|
{
|
|
1697
1735
|
foreignKeyName: "users_roles_per_herd_user_id_fkey";
|
|
1698
1736
|
columns: ["user_id"];
|
|
@@ -2016,6 +2054,10 @@ export type Database = {
|
|
|
2016
2054
|
timestamp_start: string;
|
|
2017
2055
|
}[];
|
|
2018
2056
|
};
|
|
2057
|
+
expire_herd_invitations: {
|
|
2058
|
+
Args: never;
|
|
2059
|
+
Returns: number;
|
|
2060
|
+
};
|
|
2019
2061
|
fix_all_sessions_missing_distance: {
|
|
2020
2062
|
Args: never;
|
|
2021
2063
|
Returns: {
|
|
@@ -3061,6 +3103,34 @@ export type Database = {
|
|
|
3061
3103
|
Args: never;
|
|
3062
3104
|
Returns: boolean;
|
|
3063
3105
|
};
|
|
3106
|
+
is_scout_email_valid: {
|
|
3107
|
+
Args: {
|
|
3108
|
+
p_email: string;
|
|
3109
|
+
};
|
|
3110
|
+
Returns: boolean;
|
|
3111
|
+
};
|
|
3112
|
+
leave_herd_for_current_user: {
|
|
3113
|
+
Args: {
|
|
3114
|
+
p_herd_id: number;
|
|
3115
|
+
};
|
|
3116
|
+
Returns: {
|
|
3117
|
+
herd_id: number;
|
|
3118
|
+
id: number;
|
|
3119
|
+
inserted_at: string;
|
|
3120
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
3121
|
+
lifecycle_changed_at: string;
|
|
3122
|
+
lifecycle_changed_by: string | null;
|
|
3123
|
+
lifecycle_reason: string | null;
|
|
3124
|
+
role: Database["public"]["Enums"]["role"];
|
|
3125
|
+
user_id: string;
|
|
3126
|
+
};
|
|
3127
|
+
SetofOptions: {
|
|
3128
|
+
from: "*";
|
|
3129
|
+
to: "users_roles_per_herd";
|
|
3130
|
+
isOneToOne: true;
|
|
3131
|
+
isSetofReturn: false;
|
|
3132
|
+
};
|
|
3133
|
+
};
|
|
3064
3134
|
load_api_keys: {
|
|
3065
3135
|
Args: {
|
|
3066
3136
|
id_of_device: number;
|
|
@@ -3162,10 +3232,54 @@ export type Database = {
|
|
|
3162
3232
|
status: string;
|
|
3163
3233
|
}[];
|
|
3164
3234
|
};
|
|
3235
|
+
reject_herd_invitations_for_current_user: {
|
|
3236
|
+
Args: {
|
|
3237
|
+
p_invitation_ids: number[];
|
|
3238
|
+
};
|
|
3239
|
+
Returns: {
|
|
3240
|
+
accepted_at: string | null;
|
|
3241
|
+
created_at: string;
|
|
3242
|
+
email: string;
|
|
3243
|
+
expires_at: string | null;
|
|
3244
|
+
herd_id: number;
|
|
3245
|
+
id: number;
|
|
3246
|
+
invited_by: string;
|
|
3247
|
+
role: Database["public"]["Enums"]["role"];
|
|
3248
|
+
status: Database["public"]["Enums"]["herd_invitation_status"];
|
|
3249
|
+
}[];
|
|
3250
|
+
SetofOptions: {
|
|
3251
|
+
from: "*";
|
|
3252
|
+
to: "herd_invitations";
|
|
3253
|
+
isOneToOne: false;
|
|
3254
|
+
isSetofReturn: true;
|
|
3255
|
+
};
|
|
3256
|
+
};
|
|
3165
3257
|
remove_rls_broadcast_triggers: {
|
|
3166
3258
|
Args: never;
|
|
3167
3259
|
Returns: undefined;
|
|
3168
3260
|
};
|
|
3261
|
+
revoke_herd_invitations: {
|
|
3262
|
+
Args: {
|
|
3263
|
+
p_invitation_ids: number[];
|
|
3264
|
+
};
|
|
3265
|
+
Returns: {
|
|
3266
|
+
accepted_at: string | null;
|
|
3267
|
+
created_at: string;
|
|
3268
|
+
email: string;
|
|
3269
|
+
expires_at: string | null;
|
|
3270
|
+
herd_id: number;
|
|
3271
|
+
id: number;
|
|
3272
|
+
invited_by: string;
|
|
3273
|
+
role: Database["public"]["Enums"]["role"];
|
|
3274
|
+
status: Database["public"]["Enums"]["herd_invitation_status"];
|
|
3275
|
+
}[];
|
|
3276
|
+
SetofOptions: {
|
|
3277
|
+
from: "*";
|
|
3278
|
+
to: "herd_invitations";
|
|
3279
|
+
isOneToOne: false;
|
|
3280
|
+
isSetofReturn: true;
|
|
3281
|
+
};
|
|
3282
|
+
};
|
|
3169
3283
|
revoke_pubsub_jwt_public_key: {
|
|
3170
3284
|
Args: {
|
|
3171
3285
|
p_kid: string;
|