@adventurelabs/scout-core 1.5.5 → 2.0.1
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/README.md +47 -0
- package/dist/api_keys/actions.d.ts +0 -1
- package/dist/api_keys/actions.js +0 -14
- package/dist/client/index.d.ts +76 -0
- package/dist/client/index.js +83 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/helpers/analysis_usage/jobs_server.d.ts +25 -0
- package/dist/helpers/analysis_usage/jobs_server.js +10 -0
- package/dist/helpers/analysis_usage/tasks_server.d.ts +63 -0
- package/dist/helpers/analysis_usage/tasks_server.js +14 -0
- package/dist/helpers/artifacts.d.ts +0 -1
- package/dist/helpers/artifacts.js +10 -147
- package/dist/helpers/artifacts.queries.d.ts +26 -0
- package/dist/helpers/{artifacts.internal.js → artifacts.queries.js} +24 -41
- package/dist/helpers/auth.d.ts +1 -1
- package/dist/helpers/auth.js +2 -3
- package/dist/helpers/auth_server.d.ts +2 -0
- package/dist/helpers/auth_server.js +10 -0
- package/dist/helpers/certificates_server.d.ts +101 -0
- package/dist/helpers/certificates_server.js +42 -0
- package/dist/helpers/chat.d.ts +1 -2
- package/dist/helpers/chat.js +3 -38
- package/dist/helpers/chat.queries.d.ts +13 -0
- package/dist/helpers/chat.queries.js +39 -0
- package/dist/helpers/client_abilities_jwt_keys.js +0 -1
- package/dist/helpers/client_abilities_token_server.d.ts +1 -0
- package/dist/helpers/client_abilities_token_server.js +5 -2
- package/dist/helpers/compliance.d.ts +26 -0
- package/dist/helpers/compliance.js +74 -0
- package/dist/helpers/compliance.queries.d.ts +28 -0
- package/dist/helpers/compliance.queries.js +167 -0
- package/dist/helpers/connectivity.d.ts +1 -5
- package/dist/helpers/connectivity.js +7 -140
- package/dist/helpers/connectivity.queries.d.ts +18 -0
- package/dist/helpers/connectivity.queries.js +121 -0
- package/dist/helpers/contacts_server.d.ts +75 -0
- package/dist/helpers/contacts_server.js +18 -0
- package/dist/helpers/deviceTransfer.js +2 -11
- package/dist/helpers/deviceTransfer.queries.d.ts +4 -0
- package/dist/helpers/deviceTransfer.queries.js +11 -0
- package/dist/helpers/devices.js +4 -61
- package/dist/helpers/devices.queries.d.ts +4 -1
- package/dist/helpers/devices.queries.js +52 -0
- package/dist/helpers/document_templates.js +6 -52
- package/dist/helpers/document_templates.queries.d.ts +9 -0
- package/dist/helpers/document_templates.queries.js +56 -0
- package/dist/helpers/documents_server.d.ts +226 -0
- package/dist/helpers/documents_server.js +38 -0
- package/dist/helpers/email.d.ts +0 -6
- package/dist/helpers/email.js +1 -19
- package/dist/helpers/embeddings.d.ts +0 -5
- package/dist/helpers/embeddings.js +2 -19
- package/dist/helpers/embeddings.queries.d.ts +7 -0
- package/dist/helpers/{embeddings.internal.js → embeddings.queries.js} +2 -2
- package/dist/helpers/eventUtils.d.ts +3 -12
- package/dist/helpers/eventUtils.js +0 -10
- package/dist/helpers/events.d.ts +0 -1
- package/dist/helpers/events.js +7 -107
- package/dist/helpers/events.queries.d.ts +17 -0
- package/dist/helpers/{events.internal.js → events.queries.js} +24 -15
- package/dist/helpers/health_metrics.js +3 -38
- package/dist/helpers/health_metrics.queries.d.ts +12 -0
- package/dist/helpers/health_metrics.queries.js +39 -0
- package/dist/helpers/heartbeats.js +4 -83
- package/dist/helpers/heartbeats.queries.d.ts +11 -0
- package/dist/helpers/heartbeats.queries.js +76 -0
- package/dist/helpers/herd_allowed_domains.js +2 -12
- package/dist/helpers/{herd_allowed_domains_internal.d.ts → herd_allowed_domains.queries.d.ts} +1 -1
- package/dist/helpers/{herd_allowed_domains_internal.js → herd_allowed_domains.queries.js} +2 -2
- package/dist/helpers/herd_credentials_server.d.ts +76 -0
- package/dist/helpers/herd_credentials_server.js +22 -0
- package/dist/helpers/herd_modules.queries.js +10 -7
- package/dist/helpers/herd_roles.js +13 -148
- package/dist/helpers/herd_roles.queries.d.ts +18 -0
- package/dist/helpers/{herd_roles_internal.js → herd_roles.queries.js} +28 -28
- package/dist/helpers/herds.js +5 -47
- package/dist/helpers/herds.queries.d.ts +8 -1
- package/dist/helpers/herds.queries.js +48 -0
- package/dist/helpers/invitations.js +7 -58
- package/dist/helpers/invitations.queries.d.ts +10 -0
- package/dist/helpers/{invitations_internal.js → invitations.queries.js} +12 -12
- package/dist/helpers/issuers.js +6 -52
- package/dist/helpers/issuers.queries.d.ts +9 -0
- package/dist/helpers/issuers.queries.js +53 -0
- package/dist/helpers/layers.js +2 -20
- package/dist/helpers/layers.queries.d.ts +2 -1
- package/dist/helpers/layers.queries.js +9 -13
- package/dist/helpers/lifecycle_server.d.ts +178 -0
- package/dist/helpers/lifecycle_server.js +38 -0
- package/dist/helpers/localizations.js +5 -42
- package/dist/helpers/localizations.queries.d.ts +8 -0
- package/dist/helpers/localizations.queries.js +45 -0
- package/dist/helpers/maintenance_requests_server.d.ts +124 -0
- package/dist/helpers/maintenance_requests_server.js +34 -0
- package/dist/helpers/manufacturers.js +5 -43
- package/dist/helpers/manufacturers.queries.d.ts +10 -0
- package/dist/helpers/manufacturers.queries.js +46 -0
- package/dist/helpers/media_urls.d.ts +13 -0
- package/dist/helpers/media_urls.js +21 -0
- package/dist/helpers/models.js +8 -80
- package/dist/helpers/models.queries.d.ts +13 -0
- package/dist/helpers/models.queries.js +79 -0
- package/dist/helpers/observations_server.d.ts +51 -0
- package/dist/helpers/observations_server.js +22 -0
- package/dist/helpers/operating_contexts.js +39 -154
- package/dist/helpers/operating_contexts.queries.d.ts +48 -0
- package/dist/helpers/operating_contexts.queries.js +223 -0
- package/dist/helpers/operators.js +4 -57
- package/dist/helpers/operators.queries.d.ts +7 -0
- package/dist/helpers/operators.queries.js +55 -0
- package/dist/helpers/parts.d.ts +0 -87
- package/dist/helpers/parts.js +1 -89
- package/dist/helpers/parts_server.d.ts +260 -0
- package/dist/helpers/parts_server.js +71 -0
- package/dist/helpers/pins_server.d.ts +118 -0
- package/dist/helpers/pins_server.js +38 -0
- package/dist/helpers/plans.js +4 -56
- package/dist/helpers/plans.queries.d.ts +4 -1
- package/dist/helpers/plans.queries.js +39 -12
- package/dist/helpers/points_for_user_server.d.ts +9 -0
- package/dist/helpers/points_for_user_server.js +14 -0
- package/dist/helpers/product_compatibilities.js +6 -78
- package/dist/helpers/product_compatibilities.queries.d.ts +9 -0
- package/dist/helpers/product_compatibilities.queries.js +83 -0
- package/dist/helpers/product_numbers.js +6 -55
- package/dist/helpers/product_numbers.queries.d.ts +9 -0
- package/dist/helpers/product_numbers.queries.js +58 -0
- package/dist/helpers/products.js +6 -54
- package/dist/helpers/products.queries.d.ts +11 -0
- package/dist/helpers/products.queries.js +58 -0
- package/dist/helpers/providers.js +5 -71
- package/dist/helpers/providers.queries.d.ts +5 -1
- package/dist/helpers/providers.queries.js +52 -11
- package/dist/helpers/pubsub_token_server.d.ts +1 -0
- package/dist/helpers/pubsub_token_server.js +5 -2
- package/dist/helpers/segmentations_sam3.js +5 -78
- package/dist/helpers/segmentations_sam3.queries.d.ts +16 -0
- package/dist/helpers/segmentations_sam3.queries.js +81 -0
- package/dist/helpers/sensor_poses_server.d.ts +98 -0
- package/dist/helpers/sensor_poses_server.js +26 -0
- package/dist/helpers/session_incidents_server.d.ts +106 -0
- package/dist/helpers/session_incidents_server.js +22 -0
- package/dist/helpers/session_summaries.d.ts +2 -0
- package/dist/helpers/session_summaries.js +7 -23
- package/dist/helpers/session_summaries.queries.d.ts +6 -3
- package/dist/helpers/session_summaries.queries.js +27 -0
- package/dist/helpers/sessions.js +8 -122
- package/dist/helpers/sessions.queries.d.ts +14 -2
- package/dist/helpers/sessions.queries.js +88 -1
- package/dist/helpers/storage.js +0 -1
- package/dist/helpers/supabase_auth.d.ts +6 -0
- package/dist/helpers/supabase_auth.js +37 -0
- package/dist/helpers/tags.d.ts +0 -1
- package/dist/helpers/tags.js +13 -559
- package/dist/helpers/tags.queries.d.ts +33 -0
- package/dist/helpers/tags.queries.js +454 -0
- package/dist/helpers/user_credentials_server.d.ts +76 -0
- package/dist/helpers/user_credentials_server.js +22 -0
- package/dist/helpers/users.d.ts +2 -2
- package/dist/helpers/users.js +8 -107
- package/dist/helpers/users.queries.d.ts +9 -1
- package/dist/helpers/users.queries.js +107 -0
- package/dist/helpers/versions_software.d.ts +3 -1
- package/dist/helpers/versions_software.js +24 -0
- package/dist/helpers/versions_software_server.d.ts +83 -4
- package/dist/helpers/versions_software_server.js +23 -50
- package/dist/helpers/zones.d.ts +1 -16
- package/dist/helpers/zones.js +4 -104
- package/dist/helpers/zones.queries.d.ts +6 -0
- package/dist/helpers/zones.queries.js +78 -0
- package/dist/hooks/useAuthorizedRealtimeTopics.js +8 -2
- package/dist/hooks/useInfiniteQuery.js +18 -14
- package/dist/hooks/useScoutRealtimeBroadcast.js +8 -6
- package/dist/hooks/useScoutRealtimeDocuments.js +3 -2
- package/dist/hooks/useScoutRefresh.d.ts +9 -25
- package/dist/hooks/useScoutRefresh.js +33 -213
- package/dist/providers/ScoutRefreshProvider.d.ts +1 -1
- package/dist/providers/ScoutRefreshProvider.js +56 -13
- package/dist/server/index.d.ts +78 -0
- package/dist/server/index.js +80 -0
- package/dist/server/middleware.d.ts +2 -0
- package/dist/server/middleware.js +2 -0
- package/dist/server/supabase.d.ts +2 -0
- package/dist/server/supabase.js +2 -0
- package/dist/store/api.d.ts +40 -40
- package/dist/store/api.js +38 -109
- package/dist/store/configureStore.d.ts +0 -55
- package/dist/store/configureStore.js +1 -8
- package/dist/store/hooks.js +1 -0
- package/dist/supabase/client.d.ts +3 -0
- package/dist/supabase/client.js +10 -0
- package/dist/supabase/middleware.d.ts +1 -0
- package/dist/supabase/middleware.js +6 -20
- package/dist/supabase/server.d.ts +7 -2
- package/dist/supabase/server.js +13 -1
- package/dist/types/db.d.ts +47 -3
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/supabase.d.ts +512 -0
- package/package.json +53 -4
- package/dist/api_keys/index.d.ts +0 -1
- package/dist/api_keys/index.js +0 -1
- package/dist/helpers/artifacts.internal.d.ts +0 -22
- package/dist/helpers/client_abilities_jwt_keys_internal.d.ts +0 -9
- package/dist/helpers/client_abilities_jwt_keys_internal.js +0 -20
- package/dist/helpers/connectivity.internal.d.ts +0 -10
- package/dist/helpers/connectivity.internal.js +0 -47
- package/dist/helpers/credentials.d.ts +0 -9
- package/dist/helpers/credentials.js +0 -92
- package/dist/helpers/embeddings.internal.d.ts +0 -5
- package/dist/helpers/events.internal.d.ts +0 -13
- package/dist/helpers/herd_roles_internal.d.ts +0 -18
- package/dist/helpers/index.d.ts +0 -56
- package/dist/helpers/index.js +0 -56
- package/dist/helpers/invitations_internal.d.ts +0 -10
- package/dist/helpers/versions_software_internal.d.ts +0 -6
- package/dist/helpers/versions_software_internal.js +0 -53
- package/dist/hooks/useDeviceDisplayName.d.ts +0 -8
- package/dist/hooks/useDeviceDisplayName.js +0 -49
- package/dist/index.d.ts +0 -108
- package/dist/index.js +0 -114
- package/dist/supabase/index.d.ts +0 -2
- package/dist/supabase/index.js +0 -2
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the media URL for an event (signed URL if file_path exists, otherwise media_url)
|
|
3
|
-
* @param event - Event object that may have file_path or media_url
|
|
4
|
-
* @returns string | null - The media URL or null if none available
|
|
5
|
-
*/
|
|
6
1
|
export function getEventMediaUrl(event) {
|
|
7
2
|
return event.media_url || null;
|
|
8
3
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Checks if an event has any media URL available
|
|
11
|
-
* @param event - Event object
|
|
12
|
-
* @returns boolean - True if event has any media URL
|
|
13
|
-
*/
|
|
14
4
|
export function hasEventMedia(event) {
|
|
15
5
|
return !!(event.media_url || event.file_path);
|
|
16
6
|
}
|
package/dist/helpers/events.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare function server_update_event(events: (EventUpdate & {
|
|
|
10
10
|
id: number;
|
|
11
11
|
})[]): Promise<IWebResponseCompatible<IEvent[]>>;
|
|
12
12
|
export declare function server_delete_event(id: number | number[]): Promise<IWebResponseCompatible<boolean>>;
|
|
13
|
-
/** Semantic search over events using Vertex multimodal embedding (embedding_vertex_mm_01). */
|
|
14
13
|
export declare function server_match_events_by_vertex_embedding(query_embedding: number[], match_threshold: number, match_count: number, options?: {
|
|
15
14
|
herd_id?: number | null;
|
|
16
15
|
}): Promise<IWebResponseCompatible<IEvent[]>>;
|
package/dist/helpers/events.js
CHANGED
|
@@ -1,120 +1,20 @@
|
|
|
1
|
-
"use server";
|
|
2
1
|
import { newServerClient } from "../supabase/server";
|
|
3
|
-
import {
|
|
4
|
-
import { EnumSessionsVisibility } from "../types/events";
|
|
5
|
-
import { generateSignedUrlWithClient } from "./storage_internal";
|
|
6
|
-
import { isNonEmptyStorageFilePath } from "./storagePath";
|
|
2
|
+
import { delete_event_query, get_event_by_id_query, get_total_events_by_herd_query, insert_event_query, match_events_by_vertex_embedding_query, update_event_query, } from "./events.queries";
|
|
7
3
|
export async function server_get_event_by_id(id) {
|
|
8
|
-
|
|
9
|
-
const { data, error } = await client
|
|
10
|
-
.from("events")
|
|
11
|
-
.select("*")
|
|
12
|
-
.eq("id", id)
|
|
13
|
-
.single();
|
|
14
|
-
if (error) {
|
|
15
|
-
return IWebResponse.error(error.message).to_compatible();
|
|
16
|
-
}
|
|
17
|
-
if (!data) {
|
|
18
|
-
return IWebResponse.success(null).to_compatible();
|
|
19
|
-
}
|
|
20
|
-
const event = data;
|
|
21
|
-
let media_url = null;
|
|
22
|
-
if (isNonEmptyStorageFilePath(event.file_path)) {
|
|
23
|
-
media_url = await generateSignedUrlWithClient(client, event.file_path);
|
|
24
|
-
}
|
|
25
|
-
return IWebResponse.success({
|
|
26
|
-
...event,
|
|
27
|
-
media_url,
|
|
28
|
-
}).to_compatible();
|
|
4
|
+
return get_event_by_id_query(await newServerClient(), id);
|
|
29
5
|
}
|
|
30
|
-
// function to get total number of events for a herd
|
|
31
6
|
export async function server_get_total_events_by_herd(herd_id, sessions_visibility) {
|
|
32
|
-
|
|
33
|
-
// Convert sessions_visibility to exclude_session_events boolean
|
|
34
|
-
const exclude_session_events = sessions_visibility === EnumSessionsVisibility.Exclude;
|
|
35
|
-
const { data, error } = (await supabase.rpc("get_total_events_for_herd_with_session_filter", {
|
|
36
|
-
herd_id_caller: herd_id,
|
|
37
|
-
exclude_session_events: exclude_session_events,
|
|
38
|
-
}));
|
|
39
|
-
if (error) {
|
|
40
|
-
return {
|
|
41
|
-
status: EnumWebResponse.ERROR,
|
|
42
|
-
msg: error.message,
|
|
43
|
-
data: 0,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
return IWebResponse.success(data || 0).to_compatible();
|
|
48
|
-
}
|
|
7
|
+
return get_total_events_by_herd_query(await newServerClient(), herd_id, sessions_visibility);
|
|
49
8
|
}
|
|
50
|
-
// Insert new events (accepts array for batch operations)
|
|
51
9
|
export async function server_insert_event(events) {
|
|
52
|
-
|
|
53
|
-
const eventsArray = Array.isArray(events) ? events : [events];
|
|
54
|
-
const { data, error } = await client
|
|
55
|
-
.from("events")
|
|
56
|
-
.insert(eventsArray)
|
|
57
|
-
.select("*");
|
|
58
|
-
if (error) {
|
|
59
|
-
console.warn("Error inserting events:", error.message);
|
|
60
|
-
return {
|
|
61
|
-
status: EnumWebResponse.ERROR,
|
|
62
|
-
msg: error.message,
|
|
63
|
-
data: [],
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
return IWebResponse.success(data || []).to_compatible();
|
|
10
|
+
return insert_event_query(await newServerClient(), events);
|
|
67
11
|
}
|
|
68
|
-
// Update existing events (accepts array for batch operations)
|
|
69
|
-
// Each event in the array must include an 'id' field
|
|
70
12
|
export async function server_update_event(events) {
|
|
71
|
-
|
|
72
|
-
const eventsArray = Array.isArray(events) ? events : [events];
|
|
73
|
-
const updatedEvents = [];
|
|
74
|
-
for (const event of eventsArray) {
|
|
75
|
-
const { id, ...updateData } = event;
|
|
76
|
-
delete updateData.inserted_at;
|
|
77
|
-
const { data, error } = await client
|
|
78
|
-
.from("events")
|
|
79
|
-
.update(updateData)
|
|
80
|
-
.eq("id", id)
|
|
81
|
-
.select("*")
|
|
82
|
-
.single();
|
|
83
|
-
if (error) {
|
|
84
|
-
console.warn("Error updating event:", error.message);
|
|
85
|
-
return {
|
|
86
|
-
status: EnumWebResponse.ERROR,
|
|
87
|
-
msg: error.message,
|
|
88
|
-
data: [],
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
if (data) {
|
|
92
|
-
updatedEvents.push(data);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return IWebResponse.success(updatedEvents).to_compatible();
|
|
13
|
+
return update_event_query(await newServerClient(), events);
|
|
96
14
|
}
|
|
97
15
|
export async function server_delete_event(id) {
|
|
98
|
-
|
|
99
|
-
const ids = Array.isArray(id) ? id : [id];
|
|
100
|
-
const { error } = await client.from("events").delete().in("id", ids);
|
|
101
|
-
if (error) {
|
|
102
|
-
return IWebResponse.error(error.message).to_compatible();
|
|
103
|
-
}
|
|
104
|
-
return IWebResponse.success(true).to_compatible();
|
|
16
|
+
return delete_event_query(await newServerClient(), id);
|
|
105
17
|
}
|
|
106
|
-
/** Semantic search over events using Vertex multimodal embedding (embedding_vertex_mm_01). */
|
|
107
18
|
export async function server_match_events_by_vertex_embedding(query_embedding, match_threshold, match_count, options) {
|
|
108
|
-
|
|
109
|
-
const rpcName = "match_events_by_vertex_embedding";
|
|
110
|
-
const { data, error } = await client.rpc(rpcName, {
|
|
111
|
-
query_embedding: JSON.stringify(query_embedding),
|
|
112
|
-
match_threshold,
|
|
113
|
-
match_count,
|
|
114
|
-
herd_id_caller: options?.herd_id ?? undefined,
|
|
115
|
-
});
|
|
116
|
-
if (error) {
|
|
117
|
-
return IWebResponse.error(error.message).to_compatible();
|
|
118
|
-
}
|
|
119
|
-
return IWebResponse.success((data ?? [])).to_compatible();
|
|
19
|
+
return match_events_by_vertex_embedding_query(await newServerClient(), query_embedding, match_threshold, match_count, options);
|
|
120
20
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { EventInsert, EventUpdate, IEvent, IEventWithMediaUrl } from "../types/db";
|
|
3
|
+
import { EnumSessionsVisibility } from "../types/events";
|
|
4
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
5
|
+
import { Database } from "../types/supabase";
|
|
6
|
+
export declare function get_event_by_id_query(client: SupabaseClient<Database>, id: number): Promise<IWebResponseCompatible<IEventWithMediaUrl | null>>;
|
|
7
|
+
export declare function get_total_events_by_herd_query(client: SupabaseClient<Database>, herd_id: number, sessions_visibility: EnumSessionsVisibility): Promise<IWebResponseCompatible<number>>;
|
|
8
|
+
export declare function insert_event_query(client: SupabaseClient<Database>, events: EventInsert | EventInsert[]): Promise<IWebResponseCompatible<IEvent[]>>;
|
|
9
|
+
export declare function update_event_query(client: SupabaseClient<Database>, events: (EventUpdate & {
|
|
10
|
+
id: number;
|
|
11
|
+
}) | (EventUpdate & {
|
|
12
|
+
id: number;
|
|
13
|
+
})[]): Promise<IWebResponseCompatible<IEvent[]>>;
|
|
14
|
+
export declare function delete_event_query(client: SupabaseClient<Database>, id: number | number[]): Promise<IWebResponseCompatible<boolean>>;
|
|
15
|
+
export declare function match_events_by_vertex_embedding_query(client: SupabaseClient<Database>, query_embedding: number[], match_threshold: number, match_count: number, options?: {
|
|
16
|
+
herd_id?: number | null;
|
|
17
|
+
}): Promise<IWebResponseCompatible<IEvent[]>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { EnumSessionsVisibility } from "../types/events";
|
|
1
2
|
import { EnumWebResponse, IWebResponse, } from "../types/requests";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export async function getEventByIdWithClient(client, id) {
|
|
3
|
+
import { addEventMediaUrls } from "./media_urls";
|
|
4
|
+
export async function get_event_by_id_query(client, id) {
|
|
5
5
|
const { data, error } = await client
|
|
6
6
|
.from("events")
|
|
7
7
|
.select("*")
|
|
@@ -14,16 +14,25 @@ export async function getEventByIdWithClient(client, id) {
|
|
|
14
14
|
return IWebResponse.success(null).to_compatible();
|
|
15
15
|
}
|
|
16
16
|
const event = data;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const [eventWithUrl] = await addEventMediaUrls(client, [event]);
|
|
18
|
+
return IWebResponse.success(eventWithUrl).to_compatible();
|
|
19
|
+
}
|
|
20
|
+
export async function get_total_events_by_herd_query(client, herd_id, sessions_visibility) {
|
|
21
|
+
const exclude_session_events = sessions_visibility === EnumSessionsVisibility.Exclude;
|
|
22
|
+
const { data, error } = (await client.rpc("get_total_events_for_herd_with_session_filter", {
|
|
23
|
+
herd_id_caller: herd_id,
|
|
24
|
+
exclude_session_events,
|
|
25
|
+
}));
|
|
26
|
+
if (error) {
|
|
27
|
+
return {
|
|
28
|
+
status: EnumWebResponse.ERROR,
|
|
29
|
+
msg: error.message,
|
|
30
|
+
data: 0,
|
|
31
|
+
};
|
|
20
32
|
}
|
|
21
|
-
return IWebResponse.success(
|
|
22
|
-
...event,
|
|
23
|
-
media_url,
|
|
24
|
-
}).to_compatible();
|
|
33
|
+
return IWebResponse.success(data || 0).to_compatible();
|
|
25
34
|
}
|
|
26
|
-
export async function
|
|
35
|
+
export async function insert_event_query(client, events) {
|
|
27
36
|
const eventsArray = Array.isArray(events) ? events : [events];
|
|
28
37
|
const { data, error } = await client
|
|
29
38
|
.from("events")
|
|
@@ -39,7 +48,7 @@ export async function insertEventWithClient(client, events) {
|
|
|
39
48
|
}
|
|
40
49
|
return IWebResponse.success(data || []).to_compatible();
|
|
41
50
|
}
|
|
42
|
-
export async function
|
|
51
|
+
export async function update_event_query(client, events) {
|
|
43
52
|
const eventsArray = Array.isArray(events) ? events : [events];
|
|
44
53
|
const updatedEvents = [];
|
|
45
54
|
for (const event of eventsArray) {
|
|
@@ -65,7 +74,7 @@ export async function updateEventWithClient(client, events) {
|
|
|
65
74
|
}
|
|
66
75
|
return IWebResponse.success(updatedEvents).to_compatible();
|
|
67
76
|
}
|
|
68
|
-
export async function
|
|
77
|
+
export async function delete_event_query(client, id) {
|
|
69
78
|
const ids = Array.isArray(id) ? id : [id];
|
|
70
79
|
const { error } = await client.from("events").delete().in("id", ids);
|
|
71
80
|
if (error) {
|
|
@@ -73,13 +82,13 @@ export async function deleteEventWithClient(client, id) {
|
|
|
73
82
|
}
|
|
74
83
|
return IWebResponse.success(true).to_compatible();
|
|
75
84
|
}
|
|
76
|
-
export async function
|
|
85
|
+
export async function match_events_by_vertex_embedding_query(client, query_embedding, match_threshold, match_count, options) {
|
|
77
86
|
const rpcName = "match_events_by_vertex_embedding";
|
|
78
87
|
const { data, error } = await client.rpc(rpcName, {
|
|
79
88
|
query_embedding: JSON.stringify(query_embedding),
|
|
80
89
|
match_threshold,
|
|
81
90
|
match_count,
|
|
82
|
-
herd_id_caller: herd_id ?? undefined,
|
|
91
|
+
herd_id_caller: options?.herd_id ?? undefined,
|
|
83
92
|
});
|
|
84
93
|
if (error) {
|
|
85
94
|
return IWebResponse.error(error.message).to_compatible();
|
|
@@ -1,43 +1,8 @@
|
|
|
1
|
-
"use server";
|
|
2
1
|
import { newServerClient } from "../supabase/server";
|
|
3
|
-
import {
|
|
2
|
+
import { get_health_metrics_query, get_health_metrics_summary_query, } from "./health_metrics.queries";
|
|
4
3
|
export async function server_get_health_metrics(device_id, options) {
|
|
5
|
-
|
|
6
|
-
const lookbackMs = options.lookbackSeconds * 1000;
|
|
7
|
-
const anchorMs = options.timestampAnchor != null && options.timestampAnchor !== ""
|
|
8
|
-
? new Date(options.timestampAnchor).getTime()
|
|
9
|
-
: Date.now();
|
|
10
|
-
const startMs = anchorMs - lookbackMs;
|
|
11
|
-
const startISO = new Date(startMs).toISOString();
|
|
12
|
-
const endISO = new Date(anchorMs).toISOString();
|
|
13
|
-
let query = supabase
|
|
14
|
-
.from("health_metrics")
|
|
15
|
-
.select("*")
|
|
16
|
-
.eq("device_id", device_id)
|
|
17
|
-
.gte("timestamp", startISO)
|
|
18
|
-
.lt("timestamp", endISO)
|
|
19
|
-
.order("timestamp", { ascending: false })
|
|
20
|
-
.limit(options.maxCount);
|
|
21
|
-
if (options.source != null && options.source !== "") {
|
|
22
|
-
query = query.eq("source", options.source);
|
|
23
|
-
}
|
|
24
|
-
if (options.metricName != null && options.metricName !== "") {
|
|
25
|
-
query = query.eq("metric_name", options.metricName);
|
|
26
|
-
}
|
|
27
|
-
const { data, error } = await query;
|
|
28
|
-
if (error) {
|
|
29
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
30
|
-
}
|
|
31
|
-
return IWebResponse.success(data ?? []).to_compatible();
|
|
4
|
+
return get_health_metrics_query(await newServerClient(), device_id, options);
|
|
32
5
|
}
|
|
33
6
|
export async function server_get_health_metrics_summary(device_id, lookbackMinutes = 60) {
|
|
34
|
-
|
|
35
|
-
const { data, error } = await supabase.rpc("get_health_metrics_summary", {
|
|
36
|
-
p_device_id: device_id,
|
|
37
|
-
p_lookback_minutes: lookbackMinutes,
|
|
38
|
-
});
|
|
39
|
-
if (error) {
|
|
40
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
41
|
-
}
|
|
42
|
-
return IWebResponse.success(data ?? []).to_compatible();
|
|
7
|
+
return get_health_metrics_summary_query(await newServerClient(), device_id, lookbackMinutes);
|
|
43
8
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { IHealthMetric, IHealthMetricSummaryRow } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { Database } from "../types/supabase";
|
|
5
|
+
export declare function get_health_metrics_query(client: SupabaseClient<Database>, device_id: number, options: {
|
|
6
|
+
lookbackSeconds: number;
|
|
7
|
+
maxCount: number;
|
|
8
|
+
timestampAnchor?: string | null;
|
|
9
|
+
source?: string | null;
|
|
10
|
+
metricName?: string | null;
|
|
11
|
+
}): Promise<IWebResponseCompatible<IHealthMetric[]>>;
|
|
12
|
+
export declare function get_health_metrics_summary_query(client: SupabaseClient<Database>, device_id: number, lookbackMinutes?: number): Promise<IWebResponseCompatible<IHealthMetricSummaryRow[]>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { EnumWebResponse, IWebResponse, } from "../types/requests";
|
|
2
|
+
export async function get_health_metrics_query(client, device_id, options) {
|
|
3
|
+
const lookbackMs = options.lookbackSeconds * 1000;
|
|
4
|
+
const anchorMs = options.timestampAnchor != null && options.timestampAnchor !== ""
|
|
5
|
+
? new Date(options.timestampAnchor).getTime()
|
|
6
|
+
: Date.now();
|
|
7
|
+
const startMs = anchorMs - lookbackMs;
|
|
8
|
+
const startISO = new Date(startMs).toISOString();
|
|
9
|
+
const endISO = new Date(anchorMs).toISOString();
|
|
10
|
+
let query = client
|
|
11
|
+
.from("health_metrics")
|
|
12
|
+
.select("*")
|
|
13
|
+
.eq("device_id", device_id)
|
|
14
|
+
.gte("timestamp", startISO)
|
|
15
|
+
.lt("timestamp", endISO)
|
|
16
|
+
.order("timestamp", { ascending: false })
|
|
17
|
+
.limit(options.maxCount);
|
|
18
|
+
if (options.source != null && options.source !== "") {
|
|
19
|
+
query = query.eq("source", options.source);
|
|
20
|
+
}
|
|
21
|
+
if (options.metricName != null && options.metricName !== "") {
|
|
22
|
+
query = query.eq("metric_name", options.metricName);
|
|
23
|
+
}
|
|
24
|
+
const { data, error } = await query;
|
|
25
|
+
if (error) {
|
|
26
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
27
|
+
}
|
|
28
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
29
|
+
}
|
|
30
|
+
export async function get_health_metrics_summary_query(client, device_id, lookbackMinutes = 60) {
|
|
31
|
+
const { data, error } = await client.rpc("get_health_metrics_summary", {
|
|
32
|
+
p_device_id: device_id,
|
|
33
|
+
p_lookback_minutes: lookbackMinutes,
|
|
34
|
+
});
|
|
35
|
+
if (error) {
|
|
36
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
37
|
+
}
|
|
38
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
39
|
+
}
|
|
@@ -1,90 +1,11 @@
|
|
|
1
|
-
"use server";
|
|
2
1
|
import { newServerClient } from "../supabase/server";
|
|
3
|
-
import {
|
|
4
|
-
// Function to get the last heartbeat for a device
|
|
2
|
+
import { check_device_online_status_query, get_heartbeats_by_device_query, get_last_heartbeat_by_device_query, } from "./heartbeats.queries";
|
|
5
3
|
export async function server_get_last_heartbeat_by_device(device_id) {
|
|
6
|
-
|
|
7
|
-
const { data, error } = await supabase
|
|
8
|
-
.from("heartbeats")
|
|
9
|
-
.select("*")
|
|
10
|
-
.eq("device_id", device_id)
|
|
11
|
-
.order("timestamp", { ascending: false })
|
|
12
|
-
.limit(1)
|
|
13
|
-
.single();
|
|
14
|
-
if (error) {
|
|
15
|
-
// If no heartbeats found, return null data instead of error
|
|
16
|
-
if (error.code === "PGRST116") {
|
|
17
|
-
return {
|
|
18
|
-
status: EnumWebResponse.SUCCESS,
|
|
19
|
-
msg: null,
|
|
20
|
-
data: null,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
status: EnumWebResponse.ERROR,
|
|
25
|
-
msg: error.message,
|
|
26
|
-
data: null,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return IWebResponse.success(data).to_compatible();
|
|
31
|
-
}
|
|
4
|
+
return get_last_heartbeat_by_device_query(await newServerClient(), device_id);
|
|
32
5
|
}
|
|
33
|
-
// Function to get all heartbeats for a device
|
|
34
6
|
export async function server_get_heartbeats_by_device(device_id, limit) {
|
|
35
|
-
|
|
36
|
-
let query = supabase
|
|
37
|
-
.from("heartbeats")
|
|
38
|
-
.select("*")
|
|
39
|
-
.eq("device_id", device_id)
|
|
40
|
-
.order("timestamp", { ascending: false });
|
|
41
|
-
if (limit) {
|
|
42
|
-
query = query.limit(limit);
|
|
43
|
-
}
|
|
44
|
-
const { data, error } = await query;
|
|
45
|
-
if (error) {
|
|
46
|
-
return {
|
|
47
|
-
status: EnumWebResponse.ERROR,
|
|
48
|
-
msg: error.message,
|
|
49
|
-
data: [],
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return IWebResponse.success(data || []).to_compatible();
|
|
54
|
-
}
|
|
7
|
+
return get_heartbeats_by_device_query(await newServerClient(), device_id, limit);
|
|
55
8
|
}
|
|
56
|
-
// Function to check if a device is online based on heartbeat recency
|
|
57
9
|
export async function server_check_device_online_status(device_id, offline_threshold_minutes = 5) {
|
|
58
|
-
|
|
59
|
-
const { data, error } = await supabase
|
|
60
|
-
.from("heartbeats")
|
|
61
|
-
.select("*")
|
|
62
|
-
.eq("device_id", device_id)
|
|
63
|
-
.order("timestamp", { ascending: false })
|
|
64
|
-
.limit(1)
|
|
65
|
-
.single();
|
|
66
|
-
if (error) {
|
|
67
|
-
// If no heartbeats found
|
|
68
|
-
if (error.code === "PGRST116") {
|
|
69
|
-
return IWebResponse.success({
|
|
70
|
-
is_online: false,
|
|
71
|
-
last_heartbeat: null,
|
|
72
|
-
minutes_since_last_heartbeat: null,
|
|
73
|
-
}).to_compatible();
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
status: EnumWebResponse.ERROR,
|
|
77
|
-
msg: error.message,
|
|
78
|
-
data: null,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
const now = new Date();
|
|
82
|
-
const heartbeatTime = new Date(data.timestamp);
|
|
83
|
-
const minutesSinceLastHeartbeat = Math.floor((now.getTime() - heartbeatTime.getTime()) / (1000 * 60));
|
|
84
|
-
const isOnline = minutesSinceLastHeartbeat <= offline_threshold_minutes;
|
|
85
|
-
return IWebResponse.success({
|
|
86
|
-
is_online: isOnline,
|
|
87
|
-
last_heartbeat: data,
|
|
88
|
-
minutes_since_last_heartbeat: minutesSinceLastHeartbeat,
|
|
89
|
-
}).to_compatible();
|
|
10
|
+
return check_device_online_status_query(await newServerClient(), device_id, offline_threshold_minutes);
|
|
90
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { IHeartbeat } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { Database } from "../types/supabase";
|
|
5
|
+
export declare function get_last_heartbeat_by_device_query(client: SupabaseClient<Database>, device_id: number): Promise<IWebResponseCompatible<IHeartbeat | null>>;
|
|
6
|
+
export declare function get_heartbeats_by_device_query(client: SupabaseClient<Database>, device_id: number, limit?: number): Promise<IWebResponseCompatible<IHeartbeat[]>>;
|
|
7
|
+
export declare function check_device_online_status_query(client: SupabaseClient<Database>, device_id: number, offline_threshold_minutes?: number): Promise<IWebResponseCompatible<{
|
|
8
|
+
is_online: boolean;
|
|
9
|
+
last_heartbeat: IHeartbeat | null;
|
|
10
|
+
minutes_since_last_heartbeat: number | null;
|
|
11
|
+
}>>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { EnumWebResponse, IWebResponse, } from "../types/requests";
|
|
2
|
+
export async function get_last_heartbeat_by_device_query(client, device_id) {
|
|
3
|
+
const { data, error } = await client
|
|
4
|
+
.from("heartbeats")
|
|
5
|
+
.select("*")
|
|
6
|
+
.eq("device_id", device_id)
|
|
7
|
+
.order("timestamp", { ascending: false })
|
|
8
|
+
.limit(1)
|
|
9
|
+
.single();
|
|
10
|
+
if (error) {
|
|
11
|
+
if (error.code === "PGRST116") {
|
|
12
|
+
return {
|
|
13
|
+
status: EnumWebResponse.SUCCESS,
|
|
14
|
+
msg: null,
|
|
15
|
+
data: null,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
status: EnumWebResponse.ERROR,
|
|
20
|
+
msg: error.message,
|
|
21
|
+
data: null,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return IWebResponse.success(data).to_compatible();
|
|
25
|
+
}
|
|
26
|
+
export async function get_heartbeats_by_device_query(client, device_id, limit) {
|
|
27
|
+
let query = client
|
|
28
|
+
.from("heartbeats")
|
|
29
|
+
.select("*")
|
|
30
|
+
.eq("device_id", device_id)
|
|
31
|
+
.order("timestamp", { ascending: false });
|
|
32
|
+
if (limit) {
|
|
33
|
+
query = query.limit(limit);
|
|
34
|
+
}
|
|
35
|
+
const { data, error } = await query;
|
|
36
|
+
if (error) {
|
|
37
|
+
return {
|
|
38
|
+
status: EnumWebResponse.ERROR,
|
|
39
|
+
msg: error.message,
|
|
40
|
+
data: [],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return IWebResponse.success(data || []).to_compatible();
|
|
44
|
+
}
|
|
45
|
+
export async function check_device_online_status_query(client, device_id, offline_threshold_minutes = 5) {
|
|
46
|
+
const { data, error } = await client
|
|
47
|
+
.from("heartbeats")
|
|
48
|
+
.select("*")
|
|
49
|
+
.eq("device_id", device_id)
|
|
50
|
+
.order("timestamp", { ascending: false })
|
|
51
|
+
.limit(1)
|
|
52
|
+
.single();
|
|
53
|
+
if (error) {
|
|
54
|
+
if (error.code === "PGRST116") {
|
|
55
|
+
return IWebResponse.success({
|
|
56
|
+
is_online: false,
|
|
57
|
+
last_heartbeat: null,
|
|
58
|
+
minutes_since_last_heartbeat: null,
|
|
59
|
+
}).to_compatible();
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
status: EnumWebResponse.ERROR,
|
|
63
|
+
msg: error.message,
|
|
64
|
+
data: null,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const now = new Date();
|
|
68
|
+
const heartbeatTime = new Date(data.timestamp);
|
|
69
|
+
const minutesSinceLastHeartbeat = Math.floor((now.getTime() - heartbeatTime.getTime()) / (1000 * 60));
|
|
70
|
+
const isOnline = minutesSinceLastHeartbeat <= offline_threshold_minutes;
|
|
71
|
+
return IWebResponse.success({
|
|
72
|
+
is_online: isOnline,
|
|
73
|
+
last_heartbeat: data,
|
|
74
|
+
minutes_since_last_heartbeat: minutesSinceLastHeartbeat,
|
|
75
|
+
}).to_compatible();
|
|
76
|
+
}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
"use server";
|
|
2
1
|
import { newServerClient } from "../supabase/server";
|
|
3
|
-
import {
|
|
2
|
+
import { get_herd_allowed_domains_query } from "./herd_allowed_domains.queries";
|
|
4
3
|
export async function server_get_herd_allowed_domains(herd_id) {
|
|
5
|
-
|
|
6
|
-
const { data, error } = await supabase
|
|
7
|
-
.from("herd_allowed_domains")
|
|
8
|
-
.select("*")
|
|
9
|
-
.eq("herd_id", herd_id)
|
|
10
|
-
.order("domain", { ascending: true });
|
|
11
|
-
if (error) {
|
|
12
|
-
return IWebResponse.error(error.message).to_compatible();
|
|
13
|
-
}
|
|
14
|
-
return IWebResponse.success(data ?? []).to_compatible();
|
|
4
|
+
return get_herd_allowed_domains_query(await newServerClient(), herd_id);
|
|
15
5
|
}
|
package/dist/helpers/{herd_allowed_domains_internal.d.ts → herd_allowed_domains.queries.d.ts}
RENAMED
|
@@ -2,4 +2,4 @@ import { SupabaseClient } from "@supabase/supabase-js";
|
|
|
2
2
|
import { IHerdAllowedDomain } from "../types/db";
|
|
3
3
|
import { IWebResponseCompatible } from "../types/requests";
|
|
4
4
|
import { Database } from "../types/supabase";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function get_herd_allowed_domains_query(client: SupabaseClient<Database>, herd_id: number): Promise<IWebResponseCompatible<IHerdAllowedDomain[]>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IWebResponse } from "../types/requests";
|
|
2
|
-
export async function
|
|
3
|
-
const { data, error } = await
|
|
2
|
+
export async function get_herd_allowed_domains_query(client, herd_id) {
|
|
3
|
+
const { data, error } = await client
|
|
4
4
|
.from("herd_allowed_domains")
|
|
5
5
|
.select("*")
|
|
6
6
|
.eq("herd_id", herd_id)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { CredentialQueryArgs, HerdCredentialInsert, HerdCredentialUpdate } from "../types/db";
|
|
2
|
+
export declare function server_get_herd_credentials_by_herd_id(herd_id: number, args?: CredentialQueryArgs): Promise<import("../types").IWebResponseCompatible<{
|
|
3
|
+
created_at: string;
|
|
4
|
+
expiration: string | null;
|
|
5
|
+
file_uri: string | null;
|
|
6
|
+
herd_id: number;
|
|
7
|
+
id: number;
|
|
8
|
+
issuer: string;
|
|
9
|
+
lifecycle: import("../types").Database["public"]["Enums"]["entity_lifecycle"];
|
|
10
|
+
lifecycle_changed_at: string;
|
|
11
|
+
lifecycle_changed_by: string | null;
|
|
12
|
+
lifecycle_reason: string | null;
|
|
13
|
+
tracking_number: string | null;
|
|
14
|
+
type: string;
|
|
15
|
+
updated_at: string;
|
|
16
|
+
}[]>>;
|
|
17
|
+
export declare function server_get_herd_credential_by_id(credential_id: number): Promise<import("../types").IWebResponseCompatible<{
|
|
18
|
+
created_at: string;
|
|
19
|
+
expiration: string | null;
|
|
20
|
+
file_uri: string | null;
|
|
21
|
+
herd_id: number;
|
|
22
|
+
id: number;
|
|
23
|
+
issuer: string;
|
|
24
|
+
lifecycle: import("../types").Database["public"]["Enums"]["entity_lifecycle"];
|
|
25
|
+
lifecycle_changed_at: string;
|
|
26
|
+
lifecycle_changed_by: string | null;
|
|
27
|
+
lifecycle_reason: string | null;
|
|
28
|
+
tracking_number: string | null;
|
|
29
|
+
type: string;
|
|
30
|
+
updated_at: string;
|
|
31
|
+
} | null>>;
|
|
32
|
+
export declare function server_create_herd_credential(row: HerdCredentialInsert): Promise<import("../types").IWebResponseCompatible<{
|
|
33
|
+
created_at: string;
|
|
34
|
+
expiration: string | null;
|
|
35
|
+
file_uri: string | null;
|
|
36
|
+
herd_id: number;
|
|
37
|
+
id: number;
|
|
38
|
+
issuer: string;
|
|
39
|
+
lifecycle: import("../types").Database["public"]["Enums"]["entity_lifecycle"];
|
|
40
|
+
lifecycle_changed_at: string;
|
|
41
|
+
lifecycle_changed_by: string | null;
|
|
42
|
+
lifecycle_reason: string | null;
|
|
43
|
+
tracking_number: string | null;
|
|
44
|
+
type: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
} | null>>;
|
|
47
|
+
export declare function server_update_herd_credential(credential_id: number, patch: HerdCredentialUpdate): Promise<import("../types").IWebResponseCompatible<{
|
|
48
|
+
created_at: string;
|
|
49
|
+
expiration: string | null;
|
|
50
|
+
file_uri: string | null;
|
|
51
|
+
herd_id: number;
|
|
52
|
+
id: number;
|
|
53
|
+
issuer: string;
|
|
54
|
+
lifecycle: import("../types").Database["public"]["Enums"]["entity_lifecycle"];
|
|
55
|
+
lifecycle_changed_at: string;
|
|
56
|
+
lifecycle_changed_by: string | null;
|
|
57
|
+
lifecycle_reason: string | null;
|
|
58
|
+
tracking_number: string | null;
|
|
59
|
+
type: string;
|
|
60
|
+
updated_at: string;
|
|
61
|
+
} | null>>;
|
|
62
|
+
export declare function server_delete_herd_credential(credential_id: number): Promise<import("../types").IWebResponseCompatible<{
|
|
63
|
+
created_at: string;
|
|
64
|
+
expiration: string | null;
|
|
65
|
+
file_uri: string | null;
|
|
66
|
+
herd_id: number;
|
|
67
|
+
id: number;
|
|
68
|
+
issuer: string;
|
|
69
|
+
lifecycle: import("../types").Database["public"]["Enums"]["entity_lifecycle"];
|
|
70
|
+
lifecycle_changed_at: string;
|
|
71
|
+
lifecycle_changed_by: string | null;
|
|
72
|
+
lifecycle_reason: string | null;
|
|
73
|
+
tracking_number: string | null;
|
|
74
|
+
type: string;
|
|
75
|
+
updated_at: string;
|
|
76
|
+
} | null>>;
|