@adventurelabs/scout-core 1.5.4 → 2.0.0
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 +75 -0
- package/dist/client/index.js +82 -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/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 +63 -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 +175 -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 +4 -90
- 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 +77 -0
- package/dist/server/index.js +79 -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 +2 -2
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { collectArtifactStoragePaths, withArtifactMediaUrls, } from "./artifactMedia";
|
|
2
|
+
import { generateSignedUrlsBatchWithClient } from "./storage_internal";
|
|
3
|
+
import { isNonEmptyStorageFilePath } from "./storagePath";
|
|
4
|
+
export async function createSignedUrlMap(client, paths) {
|
|
5
|
+
const uniquePaths = Array.from(new Set(Array.from(paths).filter(isNonEmptyStorageFilePath)));
|
|
6
|
+
const urls = await generateSignedUrlsBatchWithClient(client, uniquePaths);
|
|
7
|
+
return new Map(uniquePaths.map((path, index) => [path, urls[index]]));
|
|
8
|
+
}
|
|
9
|
+
export async function addEventMediaUrls(client, events) {
|
|
10
|
+
const urlMap = await createSignedUrlMap(client, events.map((event) => event.file_path));
|
|
11
|
+
return events.map((event) => ({
|
|
12
|
+
...event,
|
|
13
|
+
media_url: isNonEmptyStorageFilePath(event.file_path)
|
|
14
|
+
? urlMap.get(event.file_path) ?? event.media_url ?? null
|
|
15
|
+
: event.media_url ?? null,
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
export async function addArtifactMediaUrls(client, artifacts) {
|
|
19
|
+
const urlMap = await createSignedUrlMap(client, collectArtifactStoragePaths(artifacts));
|
|
20
|
+
return artifacts.map((artifact) => withArtifactMediaUrls(artifact, urlMap));
|
|
21
|
+
}
|
package/dist/helpers/models.js
CHANGED
|
@@ -1,95 +1,23 @@
|
|
|
1
|
-
"use server";
|
|
2
1
|
import { newServerClient } from "../supabase/server";
|
|
3
|
-
import {
|
|
4
|
-
// function that fetches a single model by id; null if not found
|
|
2
|
+
import { create_models_per_jobs_per_herd_query, delete_models_per_jobs_per_herd_by_ids_query, get_model_by_id_query, get_models_by_ids_query, get_models_per_jobs_per_herd_by_herd_query, get_models_query, update_models_per_jobs_per_herd_query, } from "./models.queries";
|
|
5
3
|
export async function server_get_model_by_id(model_id) {
|
|
6
|
-
|
|
7
|
-
const { data, error } = await supabase
|
|
8
|
-
.from("models")
|
|
9
|
-
.select("*")
|
|
10
|
-
.eq("id", model_id)
|
|
11
|
-
.maybeSingle();
|
|
12
|
-
if (error) {
|
|
13
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: null };
|
|
14
|
-
}
|
|
15
|
-
return IWebResponse.success(data).to_compatible();
|
|
4
|
+
return get_model_by_id_query(await newServerClient(), model_id);
|
|
16
5
|
}
|
|
17
|
-
// function that fetches multiple models by id
|
|
18
6
|
export async function server_get_models_by_ids(model_ids) {
|
|
19
|
-
|
|
20
|
-
return IWebResponse.success([]).to_compatible();
|
|
21
|
-
}
|
|
22
|
-
const supabase = await newServerClient();
|
|
23
|
-
const { data, error } = await supabase
|
|
24
|
-
.from("models")
|
|
25
|
-
.select("*")
|
|
26
|
-
.in("id", model_ids);
|
|
27
|
-
if (error) {
|
|
28
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
29
|
-
}
|
|
30
|
-
return IWebResponse.success(data ?? []).to_compatible();
|
|
7
|
+
return get_models_by_ids_query(await newServerClient(), model_ids);
|
|
31
8
|
}
|
|
32
|
-
// function that lists models, active only by default
|
|
33
9
|
export async function server_get_models(options) {
|
|
34
|
-
|
|
35
|
-
let query = supabase.from("models").select("*").order("name");
|
|
36
|
-
if (!options?.include_inactive) {
|
|
37
|
-
query = query.eq("is_active", true);
|
|
38
|
-
}
|
|
39
|
-
const { data, error } = await query;
|
|
40
|
-
if (error) {
|
|
41
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
42
|
-
}
|
|
43
|
-
return IWebResponse.success(data ?? []).to_compatible();
|
|
10
|
+
return get_models_query(await newServerClient(), options);
|
|
44
11
|
}
|
|
45
|
-
// function that fetches the model activations for a herd
|
|
46
12
|
export async function server_get_models_per_jobs_per_herd_by_herd(herd_id) {
|
|
47
|
-
|
|
48
|
-
const { data, error } = await supabase
|
|
49
|
-
.from("models_per_jobs_per_herd")
|
|
50
|
-
.select("*")
|
|
51
|
-
.eq("herd_id", herd_id);
|
|
52
|
-
if (error) {
|
|
53
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
54
|
-
}
|
|
55
|
-
return IWebResponse.success(data ?? []).to_compatible();
|
|
13
|
+
return get_models_per_jobs_per_herd_by_herd_query(await newServerClient(), herd_id);
|
|
56
14
|
}
|
|
57
|
-
// function that creates a model activation
|
|
58
15
|
export async function server_create_models_per_jobs_per_herd(activation) {
|
|
59
|
-
|
|
60
|
-
const { data, error } = await supabase
|
|
61
|
-
.from("models_per_jobs_per_herd")
|
|
62
|
-
.insert(activation)
|
|
63
|
-
.select("*")
|
|
64
|
-
.single();
|
|
65
|
-
if (error) {
|
|
66
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: null };
|
|
67
|
-
}
|
|
68
|
-
return IWebResponse.success(data).to_compatible();
|
|
16
|
+
return create_models_per_jobs_per_herd_query(await newServerClient(), activation);
|
|
69
17
|
}
|
|
70
|
-
// function that updates a model activation
|
|
71
18
|
export async function server_update_models_per_jobs_per_herd(id, updates) {
|
|
72
|
-
|
|
73
|
-
const { data, error } = await supabase
|
|
74
|
-
.from("models_per_jobs_per_herd")
|
|
75
|
-
.update(updates)
|
|
76
|
-
.eq("id", id)
|
|
77
|
-
.select("*")
|
|
78
|
-
.single();
|
|
79
|
-
if (error) {
|
|
80
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: null };
|
|
81
|
-
}
|
|
82
|
-
return IWebResponse.success(data).to_compatible();
|
|
19
|
+
return update_models_per_jobs_per_herd_query(await newServerClient(), id, updates);
|
|
83
20
|
}
|
|
84
|
-
// function that deletes model activations by ids
|
|
85
21
|
export async function server_delete_models_per_jobs_per_herd_by_ids(ids) {
|
|
86
|
-
|
|
87
|
-
const { error } = await supabase
|
|
88
|
-
.from("models_per_jobs_per_herd")
|
|
89
|
-
.delete()
|
|
90
|
-
.in("id", ids);
|
|
91
|
-
if (error) {
|
|
92
|
-
return { status: EnumWebResponse.ERROR, msg: error.message, data: false };
|
|
93
|
-
}
|
|
94
|
-
return IWebResponse.success(true).to_compatible();
|
|
22
|
+
return delete_models_per_jobs_per_herd_by_ids_query(await newServerClient(), ids);
|
|
95
23
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { IModel, IModelsPerJobsPerHerd } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { Database } from "../types/supabase";
|
|
5
|
+
export declare function get_model_by_id_query(client: SupabaseClient<Database>, model_id: number): Promise<IWebResponseCompatible<IModel | null>>;
|
|
6
|
+
export declare function get_models_by_ids_query(client: SupabaseClient<Database>, model_ids: number[]): Promise<IWebResponseCompatible<IModel[]>>;
|
|
7
|
+
export declare function get_models_query(client: SupabaseClient<Database>, options?: {
|
|
8
|
+
include_inactive?: boolean;
|
|
9
|
+
}): Promise<IWebResponseCompatible<IModel[]>>;
|
|
10
|
+
export declare function get_models_per_jobs_per_herd_by_herd_query(client: SupabaseClient<Database>, herd_id: number): Promise<IWebResponseCompatible<IModelsPerJobsPerHerd[]>>;
|
|
11
|
+
export declare function create_models_per_jobs_per_herd_query(client: SupabaseClient<Database>, activation: Omit<IModelsPerJobsPerHerd, "id" | "inserted_at">): Promise<IWebResponseCompatible<IModelsPerJobsPerHerd>>;
|
|
12
|
+
export declare function update_models_per_jobs_per_herd_query(client: SupabaseClient<Database>, id: number, updates: Partial<Omit<IModelsPerJobsPerHerd, "id" | "inserted_at">>): Promise<IWebResponseCompatible<IModelsPerJobsPerHerd>>;
|
|
13
|
+
export declare function delete_models_per_jobs_per_herd_by_ids_query(client: SupabaseClient<Database>, ids: number[]): Promise<IWebResponseCompatible<boolean>>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { EnumWebResponse, IWebResponse, } from "../types/requests";
|
|
2
|
+
export async function get_model_by_id_query(client, model_id) {
|
|
3
|
+
const { data, error } = await client
|
|
4
|
+
.from("models")
|
|
5
|
+
.select("*")
|
|
6
|
+
.eq("id", model_id)
|
|
7
|
+
.maybeSingle();
|
|
8
|
+
if (error) {
|
|
9
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: null };
|
|
10
|
+
}
|
|
11
|
+
return IWebResponse.success(data).to_compatible();
|
|
12
|
+
}
|
|
13
|
+
export async function get_models_by_ids_query(client, model_ids) {
|
|
14
|
+
if (model_ids.length === 0) {
|
|
15
|
+
return IWebResponse.success([]).to_compatible();
|
|
16
|
+
}
|
|
17
|
+
const { data, error } = await client
|
|
18
|
+
.from("models")
|
|
19
|
+
.select("*")
|
|
20
|
+
.in("id", model_ids);
|
|
21
|
+
if (error) {
|
|
22
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
23
|
+
}
|
|
24
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
25
|
+
}
|
|
26
|
+
export async function get_models_query(client, options) {
|
|
27
|
+
let query = client.from("models").select("*").order("name");
|
|
28
|
+
if (!options?.include_inactive) {
|
|
29
|
+
query = query.eq("is_active", true);
|
|
30
|
+
}
|
|
31
|
+
const { data, error } = await query;
|
|
32
|
+
if (error) {
|
|
33
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
34
|
+
}
|
|
35
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
36
|
+
}
|
|
37
|
+
export async function get_models_per_jobs_per_herd_by_herd_query(client, herd_id) {
|
|
38
|
+
const { data, error } = await client
|
|
39
|
+
.from("models_per_jobs_per_herd")
|
|
40
|
+
.select("*")
|
|
41
|
+
.eq("herd_id", herd_id);
|
|
42
|
+
if (error) {
|
|
43
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: [] };
|
|
44
|
+
}
|
|
45
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
46
|
+
}
|
|
47
|
+
export async function create_models_per_jobs_per_herd_query(client, activation) {
|
|
48
|
+
const { data, error } = await client
|
|
49
|
+
.from("models_per_jobs_per_herd")
|
|
50
|
+
.insert(activation)
|
|
51
|
+
.select("*")
|
|
52
|
+
.single();
|
|
53
|
+
if (error) {
|
|
54
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: null };
|
|
55
|
+
}
|
|
56
|
+
return IWebResponse.success(data).to_compatible();
|
|
57
|
+
}
|
|
58
|
+
export async function update_models_per_jobs_per_herd_query(client, id, updates) {
|
|
59
|
+
const { data, error } = await client
|
|
60
|
+
.from("models_per_jobs_per_herd")
|
|
61
|
+
.update(updates)
|
|
62
|
+
.eq("id", id)
|
|
63
|
+
.select("*")
|
|
64
|
+
.single();
|
|
65
|
+
if (error) {
|
|
66
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: null };
|
|
67
|
+
}
|
|
68
|
+
return IWebResponse.success(data).to_compatible();
|
|
69
|
+
}
|
|
70
|
+
export async function delete_models_per_jobs_per_herd_by_ids_query(client, ids) {
|
|
71
|
+
const { error } = await client
|
|
72
|
+
.from("models_per_jobs_per_herd")
|
|
73
|
+
.delete()
|
|
74
|
+
.in("id", ids);
|
|
75
|
+
if (error) {
|
|
76
|
+
return { status: EnumWebResponse.ERROR, msg: error.message, data: false };
|
|
77
|
+
}
|
|
78
|
+
return IWebResponse.success(true).to_compatible();
|
|
79
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ObservationInsert, ObservationUpdate } from "../types/db";
|
|
2
|
+
export declare function server_get_observations_for_session(session_id: number): Promise<import("../types").IWebResponseCompatible<{
|
|
3
|
+
action_complete: boolean;
|
|
4
|
+
action_required: string | null;
|
|
5
|
+
description: string;
|
|
6
|
+
id: number;
|
|
7
|
+
inserted_at: string;
|
|
8
|
+
session_id: number;
|
|
9
|
+
timestamp: string | null;
|
|
10
|
+
updated_at: string | null;
|
|
11
|
+
}[]>>;
|
|
12
|
+
export declare function server_get_observation_by_id(observation_id: number): Promise<import("../types").IWebResponseCompatible<{
|
|
13
|
+
action_complete: boolean;
|
|
14
|
+
action_required: string | null;
|
|
15
|
+
description: string;
|
|
16
|
+
id: number;
|
|
17
|
+
inserted_at: string;
|
|
18
|
+
session_id: number;
|
|
19
|
+
timestamp: string | null;
|
|
20
|
+
updated_at: string | null;
|
|
21
|
+
} | null>>;
|
|
22
|
+
export declare function server_create_observation(row: ObservationInsert): Promise<import("../types").IWebResponseCompatible<{
|
|
23
|
+
action_complete: boolean;
|
|
24
|
+
action_required: string | null;
|
|
25
|
+
description: string;
|
|
26
|
+
id: number;
|
|
27
|
+
inserted_at: string;
|
|
28
|
+
session_id: number;
|
|
29
|
+
timestamp: string | null;
|
|
30
|
+
updated_at: string | null;
|
|
31
|
+
} | null>>;
|
|
32
|
+
export declare function server_update_observation(observation_id: number, patch: ObservationUpdate): Promise<import("../types").IWebResponseCompatible<{
|
|
33
|
+
action_complete: boolean;
|
|
34
|
+
action_required: string | null;
|
|
35
|
+
description: string;
|
|
36
|
+
id: number;
|
|
37
|
+
inserted_at: string;
|
|
38
|
+
session_id: number;
|
|
39
|
+
timestamp: string | null;
|
|
40
|
+
updated_at: string | null;
|
|
41
|
+
} | null>>;
|
|
42
|
+
export declare function server_delete_observation(observation_id: number): Promise<import("../types").IWebResponseCompatible<{
|
|
43
|
+
action_complete: boolean;
|
|
44
|
+
action_required: string | null;
|
|
45
|
+
description: string;
|
|
46
|
+
id: number;
|
|
47
|
+
inserted_at: string;
|
|
48
|
+
session_id: number;
|
|
49
|
+
timestamp: string | null;
|
|
50
|
+
updated_at: string | null;
|
|
51
|
+
} | null>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { newServerClient } from "../supabase/server";
|
|
2
|
+
import { create_observation, delete_observation, get_observation_by_id, get_observations_for_session, update_observation, } from "./observations";
|
|
3
|
+
export async function server_get_observations_for_session(session_id) {
|
|
4
|
+
const client = await newServerClient();
|
|
5
|
+
return get_observations_for_session(client, session_id);
|
|
6
|
+
}
|
|
7
|
+
export async function server_get_observation_by_id(observation_id) {
|
|
8
|
+
const client = await newServerClient();
|
|
9
|
+
return get_observation_by_id(client, observation_id);
|
|
10
|
+
}
|
|
11
|
+
export async function server_create_observation(row) {
|
|
12
|
+
const client = await newServerClient();
|
|
13
|
+
return create_observation(client, row);
|
|
14
|
+
}
|
|
15
|
+
export async function server_update_observation(observation_id, patch) {
|
|
16
|
+
const client = await newServerClient();
|
|
17
|
+
return update_observation(client, observation_id, patch);
|
|
18
|
+
}
|
|
19
|
+
export async function server_delete_observation(observation_id) {
|
|
20
|
+
const client = await newServerClient();
|
|
21
|
+
return delete_observation(client, observation_id);
|
|
22
|
+
}
|
|
@@ -1,231 +1,116 @@
|
|
|
1
|
-
"use server";
|
|
2
1
|
import { newServerClient } from "../supabase/server";
|
|
3
|
-
import
|
|
4
|
-
function error(message) {
|
|
5
|
-
return IWebResponse.error(message).to_compatible();
|
|
6
|
-
}
|
|
7
|
-
function page_limit(options) {
|
|
8
|
-
const limit = options?.limit ?? 100;
|
|
9
|
-
return limit < 1 || limit > 500 ? null : limit;
|
|
10
|
-
}
|
|
11
|
-
async function authenticated_user_id(client) {
|
|
12
|
-
const { data, error: authError } = await client.auth.getUser();
|
|
13
|
-
return authError ? null : (data.user?.id ?? null);
|
|
14
|
-
}
|
|
15
|
-
function with_lifecycle_actor(updates, user_id) {
|
|
16
|
-
return updates.lifecycle
|
|
17
|
-
? { ...updates, lifecycle_changed_by: user_id }
|
|
18
|
-
: updates;
|
|
19
|
-
}
|
|
20
|
-
function with_update_actor(updates, user_id) {
|
|
21
|
-
return { ...with_lifecycle_actor(updates, user_id), updated_by: user_id };
|
|
22
|
-
}
|
|
23
|
-
function update_error(updates) {
|
|
24
|
-
if (Object.keys(updates).length === 0)
|
|
25
|
-
return "no fields to update";
|
|
26
|
-
if (updates.lifecycle_reason !== undefined && updates.lifecycle === undefined) {
|
|
27
|
-
return "lifecycle_reason requires lifecycle";
|
|
28
|
-
}
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
async function list_by(table, column, value, options) {
|
|
32
|
-
const limit = page_limit(options);
|
|
33
|
-
if (limit == null)
|
|
34
|
-
return error("limit must be between 1 and 500");
|
|
35
|
-
const supabase = await newServerClient();
|
|
36
|
-
let query = supabase
|
|
37
|
-
.from(table)
|
|
38
|
-
.select("*")
|
|
39
|
-
.eq(column, value)
|
|
40
|
-
.order("id")
|
|
41
|
-
.limit(limit);
|
|
42
|
-
if (!options?.include_inactive)
|
|
43
|
-
query = query.eq("lifecycle", "active");
|
|
44
|
-
if (options?.after_id != null)
|
|
45
|
-
query = query.gt("id", options.after_id);
|
|
46
|
-
const { data, error: queryError } = await query;
|
|
47
|
-
return queryError
|
|
48
|
-
? error(queryError.message)
|
|
49
|
-
: IWebResponse.success((data ?? [])).to_compatible();
|
|
50
|
-
}
|
|
51
|
-
async function insert_row(table, row) {
|
|
52
|
-
const supabase = await newServerClient();
|
|
53
|
-
const { data, error: queryError } = await supabase
|
|
54
|
-
.from(table)
|
|
55
|
-
.insert(row)
|
|
56
|
-
.select("*")
|
|
57
|
-
.single();
|
|
58
|
-
return queryError
|
|
59
|
-
? error(queryError.message)
|
|
60
|
-
: IWebResponse.success(data).to_compatible();
|
|
61
|
-
}
|
|
62
|
-
async function insert_with_creator(table, row) {
|
|
63
|
-
const supabase = await newServerClient();
|
|
64
|
-
const user_id = await authenticated_user_id(supabase);
|
|
65
|
-
if (!user_id)
|
|
66
|
-
return error("authentication required");
|
|
67
|
-
const { data, error: queryError } = await supabase
|
|
68
|
-
.from(table)
|
|
69
|
-
.insert({ ...row, created_by: user_id })
|
|
70
|
-
.select("*")
|
|
71
|
-
.single();
|
|
72
|
-
return queryError
|
|
73
|
-
? error(queryError.message)
|
|
74
|
-
: IWebResponse.success(data).to_compatible();
|
|
75
|
-
}
|
|
76
|
-
async function patch_row(table, id, updates, actor) {
|
|
77
|
-
const invalid = update_error(updates);
|
|
78
|
-
if (invalid)
|
|
79
|
-
return error(invalid);
|
|
80
|
-
const supabase = await newServerClient();
|
|
81
|
-
const user_id = await authenticated_user_id(supabase);
|
|
82
|
-
if (!user_id)
|
|
83
|
-
return error("authentication required");
|
|
84
|
-
const payload = actor === "update"
|
|
85
|
-
? with_update_actor(updates, user_id)
|
|
86
|
-
: with_lifecycle_actor(updates, user_id);
|
|
87
|
-
const { data, error: queryError } = await supabase
|
|
88
|
-
.from(table)
|
|
89
|
-
.update(payload)
|
|
90
|
-
.eq("id", id)
|
|
91
|
-
.select("*")
|
|
92
|
-
.single();
|
|
93
|
-
return queryError
|
|
94
|
-
? error(queryError.message)
|
|
95
|
-
: IWebResponse.success(data).to_compatible();
|
|
96
|
-
}
|
|
2
|
+
import * as queries from "./operating_contexts.queries";
|
|
97
3
|
export async function server_get_document_conditions_by_localization(localization_id, options) {
|
|
98
|
-
return
|
|
4
|
+
return queries.get_document_conditions_by_localization_query(await newServerClient(), localization_id, options);
|
|
99
5
|
}
|
|
100
6
|
export async function server_create_document_condition(row) {
|
|
101
|
-
return
|
|
7
|
+
return queries.create_document_condition_query(await newServerClient(), row);
|
|
102
8
|
}
|
|
103
9
|
export async function server_update_document_condition(id, updates) {
|
|
104
|
-
return
|
|
10
|
+
return queries.update_document_condition_query(await newServerClient(), id, updates);
|
|
105
11
|
}
|
|
106
12
|
export async function server_get_operating_context_types_by_localization(localization_id, options) {
|
|
107
|
-
return
|
|
13
|
+
return queries.get_operating_context_types_by_localization_query(await newServerClient(), localization_id, options);
|
|
108
14
|
}
|
|
109
15
|
export async function server_create_operating_context_type(row) {
|
|
110
|
-
return
|
|
16
|
+
return queries.create_operating_context_type_query(await newServerClient(), row);
|
|
111
17
|
}
|
|
112
18
|
export async function server_update_operating_context_type(id, updates) {
|
|
113
|
-
return
|
|
19
|
+
return queries.update_operating_context_type_query(await newServerClient(), id, updates);
|
|
114
20
|
}
|
|
115
21
|
export async function server_get_operating_context_roles_by_localization(localization_id, options) {
|
|
116
|
-
return
|
|
22
|
+
return queries.get_operating_context_roles_by_localization_query(await newServerClient(), localization_id, options);
|
|
117
23
|
}
|
|
118
24
|
export async function server_create_operating_context_role(row) {
|
|
119
|
-
return
|
|
25
|
+
return queries.create_operating_context_role_query(await newServerClient(), row);
|
|
120
26
|
}
|
|
121
27
|
export async function server_update_operating_context_role(id, updates) {
|
|
122
|
-
return
|
|
28
|
+
return queries.update_operating_context_role_query(await newServerClient(), id, updates);
|
|
123
29
|
}
|
|
124
30
|
export async function server_get_operating_context_equipment_categories_by_localization(localization_id, options) {
|
|
125
|
-
return
|
|
31
|
+
return queries.get_operating_context_equipment_categories_by_localization_query(await newServerClient(), localization_id, options);
|
|
126
32
|
}
|
|
127
33
|
export async function server_create_operating_context_equipment_category(row) {
|
|
128
|
-
return
|
|
34
|
+
return queries.create_operating_context_equipment_category_query(await newServerClient(), row);
|
|
129
35
|
}
|
|
130
36
|
export async function server_update_operating_context_equipment_category(id, updates) {
|
|
131
|
-
return
|
|
37
|
+
return queries.update_operating_context_equipment_category_query(await newServerClient(), id, updates);
|
|
132
38
|
}
|
|
133
39
|
export async function server_get_operating_context_equipment_items_by_category(equipment_category_id, options) {
|
|
134
|
-
return
|
|
40
|
+
return queries.get_operating_context_equipment_items_by_category_query(await newServerClient(), equipment_category_id, options);
|
|
135
41
|
}
|
|
136
42
|
export async function server_create_operating_context_equipment_item(row) {
|
|
137
|
-
return
|
|
43
|
+
return queries.create_operating_context_equipment_item_query(await newServerClient(), row);
|
|
138
44
|
}
|
|
139
45
|
export async function server_update_operating_context_equipment_item(id, updates) {
|
|
140
|
-
return
|
|
46
|
+
return queries.update_operating_context_equipment_item_query(await newServerClient(), id, updates);
|
|
141
47
|
}
|
|
142
48
|
export async function server_get_operating_contexts_by_herd(herd_id, options) {
|
|
143
|
-
return
|
|
49
|
+
return queries.get_operating_contexts_by_herd_query(await newServerClient(), herd_id, options);
|
|
144
50
|
}
|
|
145
51
|
export async function server_get_operating_context_by_id(id) {
|
|
146
|
-
|
|
147
|
-
const { data, error: queryError } = await supabase
|
|
148
|
-
.from("operating_contexts")
|
|
149
|
-
.select("*")
|
|
150
|
-
.eq("id", id)
|
|
151
|
-
.maybeSingle();
|
|
152
|
-
return queryError
|
|
153
|
-
? error(queryError.message)
|
|
154
|
-
: IWebResponse.success(data).to_compatible();
|
|
52
|
+
return queries.get_operating_context_by_id_query(await newServerClient(), id);
|
|
155
53
|
}
|
|
156
54
|
export async function server_create_operating_context(row) {
|
|
157
|
-
return
|
|
55
|
+
return queries.create_operating_context_query(await newServerClient(), row);
|
|
158
56
|
}
|
|
159
57
|
export async function server_update_operating_context(id, updates) {
|
|
160
|
-
return
|
|
58
|
+
return queries.update_operating_context_query(await newServerClient(), id, updates);
|
|
161
59
|
}
|
|
162
60
|
export async function server_get_operating_context_payloads_by_operating_context(operating_context_id, options) {
|
|
163
|
-
return
|
|
61
|
+
return queries.get_operating_context_payloads_by_operating_context_query(await newServerClient(), operating_context_id, options);
|
|
164
62
|
}
|
|
165
63
|
export async function server_create_operating_context_payload(row) {
|
|
166
|
-
return
|
|
64
|
+
return queries.create_operating_context_payload_query(await newServerClient(), row);
|
|
167
65
|
}
|
|
168
66
|
export async function server_update_operating_context_payload(id, updates) {
|
|
169
|
-
return
|
|
67
|
+
return queries.update_operating_context_payload_query(await newServerClient(), id, updates);
|
|
170
68
|
}
|
|
171
69
|
export async function server_get_operating_context_role_assignments_by_operating_context(operating_context_id, options) {
|
|
172
|
-
return
|
|
70
|
+
return queries.get_operating_context_role_assignments_by_operating_context_query(await newServerClient(), operating_context_id, options);
|
|
173
71
|
}
|
|
174
72
|
export async function server_create_operating_context_role_assignment(row) {
|
|
175
|
-
return
|
|
73
|
+
return queries.create_operating_context_role_assignment_query(await newServerClient(), row);
|
|
176
74
|
}
|
|
177
75
|
export async function server_update_operating_context_role_assignment(id, updates) {
|
|
178
|
-
return
|
|
76
|
+
return queries.update_operating_context_role_assignment_query(await newServerClient(), id, updates);
|
|
179
77
|
}
|
|
180
78
|
export async function server_get_operating_context_devices_by_operating_context(operating_context_id, options) {
|
|
181
|
-
return
|
|
79
|
+
return queries.get_operating_context_devices_by_operating_context_query(await newServerClient(), operating_context_id, options);
|
|
182
80
|
}
|
|
183
81
|
export async function server_create_operating_context_device(row) {
|
|
184
|
-
return
|
|
82
|
+
return queries.create_operating_context_device_query(await newServerClient(), row);
|
|
185
83
|
}
|
|
186
84
|
export async function server_update_operating_context_device(id, updates) {
|
|
187
|
-
return
|
|
85
|
+
return queries.update_operating_context_device_query(await newServerClient(), id, updates);
|
|
188
86
|
}
|
|
189
87
|
export async function server_get_operating_context_equipment_requirements_by_operating_context(operating_context_id, options) {
|
|
190
|
-
return
|
|
88
|
+
return queries.get_operating_context_equipment_requirements_by_operating_context_query(await newServerClient(), operating_context_id, options);
|
|
191
89
|
}
|
|
192
90
|
export async function server_create_operating_context_equipment_requirement(row) {
|
|
193
|
-
return
|
|
91
|
+
return queries.create_operating_context_equipment_requirement_query(await newServerClient(), row);
|
|
194
92
|
}
|
|
195
93
|
export async function server_update_operating_context_equipment_requirement(id, updates) {
|
|
196
|
-
return
|
|
94
|
+
return queries.update_operating_context_equipment_requirement_query(await newServerClient(), id, updates);
|
|
197
95
|
}
|
|
198
96
|
export async function server_get_operating_context_regions_by_operating_context(operating_context_id, options) {
|
|
199
|
-
return
|
|
97
|
+
return queries.get_operating_context_regions_by_operating_context_query(await newServerClient(), operating_context_id, options);
|
|
200
98
|
}
|
|
201
99
|
export async function server_create_operating_context_region(row) {
|
|
202
|
-
return
|
|
100
|
+
return queries.create_operating_context_region_query(await newServerClient(), row);
|
|
203
101
|
}
|
|
204
102
|
export async function server_update_operating_context_region(id, updates) {
|
|
205
|
-
return
|
|
103
|
+
return queries.update_operating_context_region_query(await newServerClient(), id, updates);
|
|
206
104
|
}
|
|
207
105
|
export async function server_get_operating_context_risks_by_operating_context(operating_context_id, options) {
|
|
208
|
-
return
|
|
106
|
+
return queries.get_operating_context_risks_by_operating_context_query(await newServerClient(), operating_context_id, options);
|
|
209
107
|
}
|
|
210
108
|
export async function server_create_operating_context_risk(row) {
|
|
211
|
-
return
|
|
109
|
+
return queries.create_operating_context_risk_query(await newServerClient(), row);
|
|
212
110
|
}
|
|
213
111
|
export async function server_update_operating_context_risk(id, updates) {
|
|
214
|
-
return
|
|
112
|
+
return queries.update_operating_context_risk_query(await newServerClient(), id, updates);
|
|
215
113
|
}
|
|
216
114
|
export async function server_get_operating_context_weather_snapshots(operating_context_id, options) {
|
|
217
|
-
|
|
218
|
-
(options.limit < 1 || options.limit > 500)) {
|
|
219
|
-
return error("limit must be between 1 and 500");
|
|
220
|
-
}
|
|
221
|
-
const supabase = await newServerClient();
|
|
222
|
-
const { data, error: queryError } = await supabase.rpc("get_operating_context_weather_snapshots", {
|
|
223
|
-
operating_context_id_caller: operating_context_id,
|
|
224
|
-
limit_caller: options?.limit,
|
|
225
|
-
cursor_collected_at: options?.cursor?.collected_at,
|
|
226
|
-
cursor_id: options?.cursor?.id,
|
|
227
|
-
});
|
|
228
|
-
return queryError
|
|
229
|
-
? error(queryError.message)
|
|
230
|
-
: IWebResponse.success(data ?? []).to_compatible();
|
|
115
|
+
return queries.get_operating_context_weather_snapshots_query(await newServerClient(), operating_context_id, options);
|
|
231
116
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { DocumentConditionCreateInput, DocumentConditionUpdateInput, IDocumentCondition, IOperatingContext, IOperatingContextDevice, IOperatingContextEquipmentCategory, IOperatingContextEquipmentItem, IOperatingContextEquipmentRequirement, IOperatingContextPayload, IOperatingContextRegion, IOperatingContextRisk, IOperatingContextRole, IOperatingContextRoleAssignment, IOperatingContextType, IOperatingContextWeatherSnapshot, OperatingContextCreateInput, OperatingContextDeviceCreateInput, OperatingContextDeviceUpdateInput, OperatingContextEquipmentCategoryCreateInput, OperatingContextEquipmentCategoryUpdateInput, OperatingContextEquipmentItemCreateInput, OperatingContextEquipmentItemUpdateInput, OperatingContextEquipmentRequirementCreateInput, OperatingContextEquipmentRequirementUpdateInput, OperatingContextListOptions, OperatingContextPayloadCreateInput, OperatingContextPayloadUpdateInput, OperatingContextRegionCreateInput, OperatingContextRegionUpdateInput, OperatingContextRiskCreateInput, OperatingContextRiskUpdateInput, OperatingContextRoleAssignmentCreateInput, OperatingContextRoleAssignmentUpdateInput, OperatingContextRoleCreateInput, OperatingContextRoleUpdateInput, OperatingContextTypeCreateInput, OperatingContextTypeUpdateInput, OperatingContextUpdateInput } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { Database } from "../types/supabase";
|
|
5
|
+
export declare function get_document_conditions_by_localization_query(client: SupabaseClient<Database>, localization_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IDocumentCondition[]>>;
|
|
6
|
+
export declare function create_document_condition_query(client: SupabaseClient<Database>, row: DocumentConditionCreateInput): Promise<IWebResponseCompatible<IDocumentCondition | null>>;
|
|
7
|
+
export declare function update_document_condition_query(client: SupabaseClient<Database>, id: number, updates: DocumentConditionUpdateInput): Promise<IWebResponseCompatible<IDocumentCondition | null>>;
|
|
8
|
+
export declare function get_operating_context_types_by_localization_query(client: SupabaseClient<Database>, localization_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextType[]>>;
|
|
9
|
+
export declare function create_operating_context_type_query(client: SupabaseClient<Database>, row: OperatingContextTypeCreateInput): Promise<IWebResponseCompatible<IOperatingContextType | null>>;
|
|
10
|
+
export declare function update_operating_context_type_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextTypeUpdateInput): Promise<IWebResponseCompatible<IOperatingContextType | null>>;
|
|
11
|
+
export declare function get_operating_context_roles_by_localization_query(client: SupabaseClient<Database>, localization_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextRole[]>>;
|
|
12
|
+
export declare function create_operating_context_role_query(client: SupabaseClient<Database>, row: OperatingContextRoleCreateInput): Promise<IWebResponseCompatible<IOperatingContextRole | null>>;
|
|
13
|
+
export declare function update_operating_context_role_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextRoleUpdateInput): Promise<IWebResponseCompatible<IOperatingContextRole | null>>;
|
|
14
|
+
export declare function get_operating_context_equipment_categories_by_localization_query(client: SupabaseClient<Database>, localization_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextEquipmentCategory[]>>;
|
|
15
|
+
export declare function create_operating_context_equipment_category_query(client: SupabaseClient<Database>, row: OperatingContextEquipmentCategoryCreateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentCategory | null>>;
|
|
16
|
+
export declare function update_operating_context_equipment_category_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextEquipmentCategoryUpdateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentCategory | null>>;
|
|
17
|
+
export declare function get_operating_context_equipment_items_by_category_query(client: SupabaseClient<Database>, equipment_category_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextEquipmentItem[]>>;
|
|
18
|
+
export declare function create_operating_context_equipment_item_query(client: SupabaseClient<Database>, row: OperatingContextEquipmentItemCreateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentItem | null>>;
|
|
19
|
+
export declare function update_operating_context_equipment_item_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextEquipmentItemUpdateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentItem | null>>;
|
|
20
|
+
export declare function get_operating_contexts_by_herd_query(client: SupabaseClient<Database>, herd_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContext[]>>;
|
|
21
|
+
export declare function get_operating_context_by_id_query(client: SupabaseClient<Database>, id: number): Promise<IWebResponseCompatible<IOperatingContext | null>>;
|
|
22
|
+
export declare function create_operating_context_query(client: SupabaseClient<Database>, row: OperatingContextCreateInput): Promise<IWebResponseCompatible<IOperatingContext | null>>;
|
|
23
|
+
export declare function update_operating_context_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextUpdateInput): Promise<IWebResponseCompatible<IOperatingContext | null>>;
|
|
24
|
+
export declare function get_operating_context_payloads_by_operating_context_query(client: SupabaseClient<Database>, operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextPayload[]>>;
|
|
25
|
+
export declare function create_operating_context_payload_query(client: SupabaseClient<Database>, row: OperatingContextPayloadCreateInput): Promise<IWebResponseCompatible<IOperatingContextPayload | null>>;
|
|
26
|
+
export declare function update_operating_context_payload_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextPayloadUpdateInput): Promise<IWebResponseCompatible<IOperatingContextPayload | null>>;
|
|
27
|
+
export declare function get_operating_context_role_assignments_by_operating_context_query(client: SupabaseClient<Database>, operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextRoleAssignment[]>>;
|
|
28
|
+
export declare function create_operating_context_role_assignment_query(client: SupabaseClient<Database>, row: OperatingContextRoleAssignmentCreateInput): Promise<IWebResponseCompatible<IOperatingContextRoleAssignment | null>>;
|
|
29
|
+
export declare function update_operating_context_role_assignment_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextRoleAssignmentUpdateInput): Promise<IWebResponseCompatible<IOperatingContextRoleAssignment | null>>;
|
|
30
|
+
export declare function get_operating_context_devices_by_operating_context_query(client: SupabaseClient<Database>, operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextDevice[]>>;
|
|
31
|
+
export declare function create_operating_context_device_query(client: SupabaseClient<Database>, row: OperatingContextDeviceCreateInput): Promise<IWebResponseCompatible<IOperatingContextDevice | null>>;
|
|
32
|
+
export declare function update_operating_context_device_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextDeviceUpdateInput): Promise<IWebResponseCompatible<IOperatingContextDevice | null>>;
|
|
33
|
+
export declare function get_operating_context_equipment_requirements_by_operating_context_query(client: SupabaseClient<Database>, operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextEquipmentRequirement[]>>;
|
|
34
|
+
export declare function create_operating_context_equipment_requirement_query(client: SupabaseClient<Database>, row: OperatingContextEquipmentRequirementCreateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentRequirement | null>>;
|
|
35
|
+
export declare function update_operating_context_equipment_requirement_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextEquipmentRequirementUpdateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentRequirement | null>>;
|
|
36
|
+
export declare function get_operating_context_regions_by_operating_context_query(client: SupabaseClient<Database>, operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextRegion[]>>;
|
|
37
|
+
export declare function create_operating_context_region_query(client: SupabaseClient<Database>, row: OperatingContextRegionCreateInput): Promise<IWebResponseCompatible<IOperatingContextRegion | null>>;
|
|
38
|
+
export declare function update_operating_context_region_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextRegionUpdateInput): Promise<IWebResponseCompatible<IOperatingContextRegion | null>>;
|
|
39
|
+
export declare function get_operating_context_risks_by_operating_context_query(client: SupabaseClient<Database>, operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextRisk[]>>;
|
|
40
|
+
export declare function create_operating_context_risk_query(client: SupabaseClient<Database>, row: OperatingContextRiskCreateInput): Promise<IWebResponseCompatible<IOperatingContextRisk | null>>;
|
|
41
|
+
export declare function update_operating_context_risk_query(client: SupabaseClient<Database>, id: number, updates: OperatingContextRiskUpdateInput): Promise<IWebResponseCompatible<IOperatingContextRisk | null>>;
|
|
42
|
+
export declare function get_operating_context_weather_snapshots_query(client: SupabaseClient<Database>, operating_context_id: number, options?: {
|
|
43
|
+
limit?: number;
|
|
44
|
+
cursor?: {
|
|
45
|
+
collected_at: string;
|
|
46
|
+
id: number;
|
|
47
|
+
};
|
|
48
|
+
}): Promise<IWebResponseCompatible<IOperatingContextWeatherSnapshot[]>>;
|