@adventurelabs/scout-core 1.5.2 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +2 -0
- package/dist/helpers/operating_contexts.d.ts +4 -1
- package/dist/helpers/operating_contexts.js +9 -0
- package/dist/helpers/product_compatibilities.d.ts +7 -0
- package/dist/helpers/product_compatibilities.js +89 -0
- package/dist/helpers/sensor_poses.d.ts +16 -0
- package/dist/helpers/sensor_poses.js +97 -0
- package/dist/hooks/useScoutRealtimeOperatingContexts.d.ts +3 -3
- package/dist/hooks/useScoutRealtimeOperatingContexts.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/types/db.d.ts +8 -0
- package/dist/types/supabase.d.ts +127 -0
- package/package.json +1 -1
package/dist/helpers/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./models";
|
|
|
19
19
|
export * from "./manufacturers";
|
|
20
20
|
export * from "./products";
|
|
21
21
|
export * from "./product_numbers";
|
|
22
|
+
export * from "./product_compatibilities";
|
|
22
23
|
export * from "./localizations";
|
|
23
24
|
export * from "./issuers";
|
|
24
25
|
export * from "./document_templates";
|
|
@@ -40,6 +41,7 @@ export * from "./cache";
|
|
|
40
41
|
export * from "./observations";
|
|
41
42
|
export * from "./operators";
|
|
42
43
|
export * from "./parts";
|
|
44
|
+
export * from "./sensor_poses";
|
|
43
45
|
export * from "./versions_software";
|
|
44
46
|
export * from "./versions_software_server";
|
|
45
47
|
export * from "./artifacts";
|
package/dist/helpers/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./models";
|
|
|
19
19
|
export * from "./manufacturers";
|
|
20
20
|
export * from "./products";
|
|
21
21
|
export * from "./product_numbers";
|
|
22
|
+
export * from "./product_compatibilities";
|
|
22
23
|
export * from "./localizations";
|
|
23
24
|
export * from "./issuers";
|
|
24
25
|
export * from "./document_templates";
|
|
@@ -40,6 +41,7 @@ export * from "./cache";
|
|
|
40
41
|
export * from "./observations";
|
|
41
42
|
export * from "./operators";
|
|
42
43
|
export * from "./parts";
|
|
44
|
+
export * from "./sensor_poses";
|
|
43
45
|
export * from "./versions_software";
|
|
44
46
|
export * from "./versions_software_server";
|
|
45
47
|
export * from "./artifacts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentConditionCreateInput, DocumentConditionUpdateInput, IDocumentCondition, IOperatingContext, IOperatingContextEquipmentCategory, IOperatingContextEquipmentItem, IOperatingContextEquipmentRequirement, IOperatingContextPayload, IOperatingContextRegion, IOperatingContextRisk, IOperatingContextRole, IOperatingContextRoleAssignment, IOperatingContextType, IOperatingContextWeatherSnapshot, OperatingContextCreateInput, OperatingContextEquipmentCategoryCreateInput, OperatingContextEquipmentCategoryUpdateInput, OperatingContextEquipmentItemCreateInput, OperatingContextEquipmentItemUpdateInput, OperatingContextEquipmentRequirementCreateInput, OperatingContextEquipmentRequirementUpdateInput, OperatingContextListOptions, OperatingContextPayloadCreateInput, OperatingContextPayloadUpdateInput, OperatingContextRegionCreateInput, OperatingContextRegionUpdateInput, OperatingContextRiskCreateInput, OperatingContextRiskUpdateInput, OperatingContextRoleAssignmentCreateInput, OperatingContextRoleAssignmentUpdateInput, OperatingContextRoleCreateInput, OperatingContextRoleUpdateInput, OperatingContextTypeCreateInput, OperatingContextTypeUpdateInput, OperatingContextUpdateInput } from "../types/db";
|
|
1
|
+
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";
|
|
2
2
|
import { IWebResponseCompatible } from "../types/requests";
|
|
3
3
|
export declare function server_get_document_conditions_by_localization(localization_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IDocumentCondition[]>>;
|
|
4
4
|
export declare function server_create_document_condition(row: DocumentConditionCreateInput): Promise<IWebResponseCompatible<IDocumentCondition | null>>;
|
|
@@ -25,6 +25,9 @@ export declare function server_update_operating_context_payload(id: number, upda
|
|
|
25
25
|
export declare function server_get_operating_context_role_assignments_by_operating_context(operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextRoleAssignment[]>>;
|
|
26
26
|
export declare function server_create_operating_context_role_assignment(row: OperatingContextRoleAssignmentCreateInput): Promise<IWebResponseCompatible<IOperatingContextRoleAssignment | null>>;
|
|
27
27
|
export declare function server_update_operating_context_role_assignment(id: number, updates: OperatingContextRoleAssignmentUpdateInput): Promise<IWebResponseCompatible<IOperatingContextRoleAssignment | null>>;
|
|
28
|
+
export declare function server_get_operating_context_devices_by_operating_context(operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextDevice[]>>;
|
|
29
|
+
export declare function server_create_operating_context_device(row: OperatingContextDeviceCreateInput): Promise<IWebResponseCompatible<IOperatingContextDevice | null>>;
|
|
30
|
+
export declare function server_update_operating_context_device(id: number, updates: OperatingContextDeviceUpdateInput): Promise<IWebResponseCompatible<IOperatingContextDevice | null>>;
|
|
28
31
|
export declare function server_get_operating_context_equipment_requirements_by_operating_context(operating_context_id: number, options?: OperatingContextListOptions): Promise<IWebResponseCompatible<IOperatingContextEquipmentRequirement[]>>;
|
|
29
32
|
export declare function server_create_operating_context_equipment_requirement(row: OperatingContextEquipmentRequirementCreateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentRequirement | null>>;
|
|
30
33
|
export declare function server_update_operating_context_equipment_requirement(id: number, updates: OperatingContextEquipmentRequirementUpdateInput): Promise<IWebResponseCompatible<IOperatingContextEquipmentRequirement | null>>;
|
|
@@ -177,6 +177,15 @@ export async function server_create_operating_context_role_assignment(row) {
|
|
|
177
177
|
export async function server_update_operating_context_role_assignment(id, updates) {
|
|
178
178
|
return patch_row("operating_context_role_assignments", id, updates, "lifecycle");
|
|
179
179
|
}
|
|
180
|
+
export async function server_get_operating_context_devices_by_operating_context(operating_context_id, options) {
|
|
181
|
+
return list_by("operating_contexts_devices", "operating_context_id", operating_context_id, options);
|
|
182
|
+
}
|
|
183
|
+
export async function server_create_operating_context_device(row) {
|
|
184
|
+
return insert_row("operating_contexts_devices", row);
|
|
185
|
+
}
|
|
186
|
+
export async function server_update_operating_context_device(id, updates) {
|
|
187
|
+
return patch_row("operating_contexts_devices", id, updates, "lifecycle");
|
|
188
|
+
}
|
|
180
189
|
export async function server_get_operating_context_equipment_requirements_by_operating_context(operating_context_id, options) {
|
|
181
190
|
return list_by("operating_context_equipment_requirements", "operating_context_id", operating_context_id, options);
|
|
182
191
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IProductCompatibility, ProductCompatibilityInsert, ProductCompatibilityUpdate } from "../types/db";
|
|
2
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
3
|
+
export declare function server_get_product_compatibilities(primary_product_number: string, role: string): Promise<IWebResponseCompatible<IProductCompatibility[]>>;
|
|
4
|
+
export declare function server_get_auto_assign_accessory_product_number(primary_product_number: string, role: string): Promise<IWebResponseCompatible<string | null>>;
|
|
5
|
+
export declare function server_create_product_compatibility(compatibility: ProductCompatibilityInsert): Promise<IWebResponseCompatible<IProductCompatibility | null>>;
|
|
6
|
+
export declare function server_update_product_compatibility(primary_product_id: number, role: string, accessory_product_number: string, updates: ProductCompatibilityUpdate): Promise<IWebResponseCompatible<IProductCompatibility | null>>;
|
|
7
|
+
export declare function server_delete_product_compatibility(primary_product_id: number, role: string, accessory_product_number: string): Promise<IWebResponseCompatible<boolean>>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { newServerClient } from "../supabase/server";
|
|
3
|
+
import { EnumWebResponse, IWebResponse, } from "../types/requests";
|
|
4
|
+
export async function server_get_product_compatibilities(primary_product_number, role) {
|
|
5
|
+
const supabase = await newServerClient();
|
|
6
|
+
const { data: primary, error: primaryError } = await supabase
|
|
7
|
+
.from("product_numbers")
|
|
8
|
+
.select("product_id, products!inner(manufacturers!inner(id))")
|
|
9
|
+
.eq("product_number", primary_product_number)
|
|
10
|
+
.eq("lifecycle", "active")
|
|
11
|
+
.eq("products.lifecycle", "active")
|
|
12
|
+
.eq("products.manufacturers.lifecycle", "active")
|
|
13
|
+
.maybeSingle();
|
|
14
|
+
if (primaryError) {
|
|
15
|
+
return IWebResponse.error(primaryError.message).to_compatible();
|
|
16
|
+
}
|
|
17
|
+
if (!primary) {
|
|
18
|
+
return IWebResponse.success([]).to_compatible();
|
|
19
|
+
}
|
|
20
|
+
const { data, error } = await supabase
|
|
21
|
+
.from("product_compatibilities")
|
|
22
|
+
.select("*, product_numbers!product_compatibilities_accessory_product_number_fkey!inner(products!inner(manufacturers!inner(id)))")
|
|
23
|
+
.eq("primary_product_id", primary.product_id)
|
|
24
|
+
.eq("role", role)
|
|
25
|
+
.eq("product_numbers.lifecycle", "active")
|
|
26
|
+
.eq("product_numbers.products.lifecycle", "active")
|
|
27
|
+
.eq("product_numbers.products.manufacturers.lifecycle", "active")
|
|
28
|
+
.order("accessory_product_number");
|
|
29
|
+
if (error) {
|
|
30
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
31
|
+
}
|
|
32
|
+
const compatibilities = (data ?? []).map(({ primary_product_id, role, accessory_product_number, auto_assign, inserted_at, }) => ({
|
|
33
|
+
primary_product_id,
|
|
34
|
+
role,
|
|
35
|
+
accessory_product_number,
|
|
36
|
+
auto_assign,
|
|
37
|
+
inserted_at,
|
|
38
|
+
}));
|
|
39
|
+
return IWebResponse.success(compatibilities).to_compatible();
|
|
40
|
+
}
|
|
41
|
+
export async function server_get_auto_assign_accessory_product_number(primary_product_number, role) {
|
|
42
|
+
const response = await server_get_product_compatibilities(primary_product_number, role);
|
|
43
|
+
if (response.status !== EnumWebResponse.SUCCESS) {
|
|
44
|
+
return IWebResponse.error(response.msg ?? "Unable to load product compatibilities").to_compatible();
|
|
45
|
+
}
|
|
46
|
+
const productNumber = response.data?.find((compatibility) => compatibility.auto_assign)
|
|
47
|
+
?.accessory_product_number ?? null;
|
|
48
|
+
return IWebResponse.success(productNumber).to_compatible();
|
|
49
|
+
}
|
|
50
|
+
export async function server_create_product_compatibility(compatibility) {
|
|
51
|
+
const supabase = await newServerClient();
|
|
52
|
+
const { data, error } = await supabase
|
|
53
|
+
.from("product_compatibilities")
|
|
54
|
+
.insert(compatibility)
|
|
55
|
+
.select("*")
|
|
56
|
+
.single();
|
|
57
|
+
if (error) {
|
|
58
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
59
|
+
}
|
|
60
|
+
return IWebResponse.success(data).to_compatible();
|
|
61
|
+
}
|
|
62
|
+
export async function server_update_product_compatibility(primary_product_id, role, accessory_product_number, updates) {
|
|
63
|
+
const supabase = await newServerClient();
|
|
64
|
+
const { data, error } = await supabase
|
|
65
|
+
.from("product_compatibilities")
|
|
66
|
+
.update(updates)
|
|
67
|
+
.eq("primary_product_id", primary_product_id)
|
|
68
|
+
.eq("role", role)
|
|
69
|
+
.eq("accessory_product_number", accessory_product_number)
|
|
70
|
+
.select("*")
|
|
71
|
+
.single();
|
|
72
|
+
if (error) {
|
|
73
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
74
|
+
}
|
|
75
|
+
return IWebResponse.success(data).to_compatible();
|
|
76
|
+
}
|
|
77
|
+
export async function server_delete_product_compatibility(primary_product_id, role, accessory_product_number) {
|
|
78
|
+
const supabase = await newServerClient();
|
|
79
|
+
const { error } = await supabase
|
|
80
|
+
.from("product_compatibilities")
|
|
81
|
+
.delete()
|
|
82
|
+
.eq("primary_product_id", primary_product_id)
|
|
83
|
+
.eq("role", role)
|
|
84
|
+
.eq("accessory_product_number", accessory_product_number);
|
|
85
|
+
if (error) {
|
|
86
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
87
|
+
}
|
|
88
|
+
return IWebResponse.success(true).to_compatible();
|
|
89
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Database } from "../types/supabase";
|
|
2
|
+
import { ISensorPose, SensorPoseInsert, SensorPoseUpdate } from "../types/db";
|
|
3
|
+
import { IWebResponseCompatible } from "../types/requests";
|
|
4
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
5
|
+
interface SensorPoseTimeRangeOptions {
|
|
6
|
+
start_timestamp?: string;
|
|
7
|
+
end_timestamp?: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function get_sensor_poses_by_part_id(client: SupabaseClient<Database>, part_id: number, options?: SensorPoseTimeRangeOptions): Promise<IWebResponseCompatible<ISensorPose[]>>;
|
|
11
|
+
export declare function get_sensor_pose_by_id(client: SupabaseClient<Database>, sensor_pose_id: number): Promise<IWebResponseCompatible<ISensorPose | null>>;
|
|
12
|
+
export declare function create_sensor_pose(client: SupabaseClient<Database>, row: SensorPoseInsert): Promise<IWebResponseCompatible<ISensorPose | null>>;
|
|
13
|
+
export declare function create_sensor_poses(client: SupabaseClient<Database>, rows: SensorPoseInsert[]): Promise<IWebResponseCompatible<ISensorPose[]>>;
|
|
14
|
+
export declare function update_sensor_pose(client: SupabaseClient<Database>, sensor_pose_id: number, patch: SensorPoseUpdate): Promise<IWebResponseCompatible<ISensorPose | null>>;
|
|
15
|
+
export declare function delete_sensor_pose(client: SupabaseClient<Database>, sensor_pose_id: number): Promise<IWebResponseCompatible<ISensorPose | null>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { IWebResponse } from "../types/requests";
|
|
2
|
+
export async function get_sensor_poses_by_part_id(client, part_id, options) {
|
|
3
|
+
let query = client
|
|
4
|
+
.from("sensor_poses")
|
|
5
|
+
.select("*")
|
|
6
|
+
.eq("part_id", part_id)
|
|
7
|
+
.order("timestamp_observation", { ascending: true });
|
|
8
|
+
if (options?.start_timestamp) {
|
|
9
|
+
query = query.gte("timestamp_observation", options.start_timestamp);
|
|
10
|
+
}
|
|
11
|
+
if (options?.end_timestamp) {
|
|
12
|
+
query = query.lte("timestamp_observation", options.end_timestamp);
|
|
13
|
+
}
|
|
14
|
+
if (options?.limit != null) {
|
|
15
|
+
query = query.limit(options.limit);
|
|
16
|
+
}
|
|
17
|
+
const { data, error } = await query;
|
|
18
|
+
if (error) {
|
|
19
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
20
|
+
}
|
|
21
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
22
|
+
}
|
|
23
|
+
export async function get_sensor_pose_by_id(client, sensor_pose_id) {
|
|
24
|
+
const { data, error } = await client
|
|
25
|
+
.from("sensor_poses")
|
|
26
|
+
.select("*")
|
|
27
|
+
.eq("id", sensor_pose_id)
|
|
28
|
+
.maybeSingle();
|
|
29
|
+
if (error) {
|
|
30
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
31
|
+
}
|
|
32
|
+
if (!data) {
|
|
33
|
+
return IWebResponse.error("Sensor pose not found").to_compatible();
|
|
34
|
+
}
|
|
35
|
+
return IWebResponse.success(data).to_compatible();
|
|
36
|
+
}
|
|
37
|
+
export async function create_sensor_pose(client, row) {
|
|
38
|
+
const { data, error } = await client
|
|
39
|
+
.from("sensor_poses")
|
|
40
|
+
.insert([row])
|
|
41
|
+
.select("*")
|
|
42
|
+
.single();
|
|
43
|
+
if (error) {
|
|
44
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
45
|
+
}
|
|
46
|
+
if (!data) {
|
|
47
|
+
return IWebResponse.error("Failed to create sensor pose").to_compatible();
|
|
48
|
+
}
|
|
49
|
+
return IWebResponse.success(data).to_compatible();
|
|
50
|
+
}
|
|
51
|
+
export async function create_sensor_poses(client, rows) {
|
|
52
|
+
if (rows.length === 0) {
|
|
53
|
+
return IWebResponse.success([]).to_compatible();
|
|
54
|
+
}
|
|
55
|
+
const { data, error } = await client
|
|
56
|
+
.from("sensor_poses")
|
|
57
|
+
.insert(rows)
|
|
58
|
+
.select("*");
|
|
59
|
+
if (error) {
|
|
60
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
61
|
+
}
|
|
62
|
+
return IWebResponse.success(data ?? []).to_compatible();
|
|
63
|
+
}
|
|
64
|
+
export async function update_sensor_pose(client, sensor_pose_id, patch) {
|
|
65
|
+
const { id: _id, inserted_at: _ia, ...updateData } = patch;
|
|
66
|
+
if (Object.keys(updateData).length === 0) {
|
|
67
|
+
return IWebResponse.error("No valid fields to update").to_compatible();
|
|
68
|
+
}
|
|
69
|
+
const { data, error } = await client
|
|
70
|
+
.from("sensor_poses")
|
|
71
|
+
.update(updateData)
|
|
72
|
+
.eq("id", sensor_pose_id)
|
|
73
|
+
.select("*")
|
|
74
|
+
.single();
|
|
75
|
+
if (error) {
|
|
76
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
77
|
+
}
|
|
78
|
+
if (!data) {
|
|
79
|
+
return IWebResponse.error("Sensor pose not found or update failed").to_compatible();
|
|
80
|
+
}
|
|
81
|
+
return IWebResponse.success(data).to_compatible();
|
|
82
|
+
}
|
|
83
|
+
export async function delete_sensor_pose(client, sensor_pose_id) {
|
|
84
|
+
const { data, error } = await client
|
|
85
|
+
.from("sensor_poses")
|
|
86
|
+
.delete()
|
|
87
|
+
.eq("id", sensor_pose_id)
|
|
88
|
+
.select("*")
|
|
89
|
+
.single();
|
|
90
|
+
if (error) {
|
|
91
|
+
return IWebResponse.error(error.message).to_compatible();
|
|
92
|
+
}
|
|
93
|
+
if (!data) {
|
|
94
|
+
return IWebResponse.error("Sensor pose not found or deletion failed").to_compatible();
|
|
95
|
+
}
|
|
96
|
+
return IWebResponse.success(data).to_compatible();
|
|
97
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
2
2
|
import { Database } from "../types/supabase";
|
|
3
|
-
import { IOperatingContext, IOperatingContextEquipmentRequirement, IOperatingContextPayload, IOperatingContextRegion, IOperatingContextRisk, IOperatingContextRoleAssignment } from "../types/db";
|
|
3
|
+
import { IOperatingContext, IOperatingContextDevice, IOperatingContextEquipmentRequirement, IOperatingContextPayload, IOperatingContextRegion, IOperatingContextRisk, IOperatingContextRoleAssignment } from "../types/db";
|
|
4
4
|
import { RealtimeData } from "../types/realtime";
|
|
5
5
|
import { ScoutRealtimeBroadcastOptions } from "./useScoutRealtimeBroadcast";
|
|
6
|
-
export type OperatingContextRealtimeRow = IOperatingContext | IOperatingContextPayload | IOperatingContextRoleAssignment | IOperatingContextEquipmentRequirement | IOperatingContextRegion | IOperatingContextRisk;
|
|
6
|
+
export type OperatingContextRealtimeRow = IOperatingContext | IOperatingContextDevice | IOperatingContextPayload | IOperatingContextRoleAssignment | IOperatingContextEquipmentRequirement | IOperatingContextRegion | IOperatingContextRisk;
|
|
7
7
|
type OperatingContextRealtimeChange<T, Table extends string> = Omit<RealtimeData<T>, "table"> & {
|
|
8
8
|
table: Table;
|
|
9
9
|
};
|
|
10
|
-
export type OperatingContextRealtimeData = OperatingContextRealtimeChange<IOperatingContext, "operating_contexts"> | OperatingContextRealtimeChange<IOperatingContextPayload, "operating_context_payloads"> | OperatingContextRealtimeChange<IOperatingContextRoleAssignment, "operating_context_role_assignments"> | OperatingContextRealtimeChange<IOperatingContextEquipmentRequirement, "operating_context_equipment_requirements"> | OperatingContextRealtimeChange<IOperatingContextRegion, "operating_context_regions"> | OperatingContextRealtimeChange<IOperatingContextRisk, "operating_context_risks">;
|
|
10
|
+
export type OperatingContextRealtimeData = OperatingContextRealtimeChange<IOperatingContext, "operating_contexts"> | OperatingContextRealtimeChange<IOperatingContextDevice, "operating_contexts_devices"> | OperatingContextRealtimeChange<IOperatingContextPayload, "operating_context_payloads"> | OperatingContextRealtimeChange<IOperatingContextRoleAssignment, "operating_context_role_assignments"> | OperatingContextRealtimeChange<IOperatingContextEquipmentRequirement, "operating_context_equipment_requirements"> | OperatingContextRealtimeChange<IOperatingContextRegion, "operating_context_regions"> | OperatingContextRealtimeChange<IOperatingContextRisk, "operating_context_risks">;
|
|
11
11
|
export declare function useScoutRealtimeOperatingContexts(scoutSupabase: SupabaseClient<Database>, options?: ScoutRealtimeBroadcastOptions): [OperatingContextRealtimeData | null, () => void];
|
|
12
12
|
export {};
|
|
@@ -4,6 +4,7 @@ import { useSelector } from "react-redux";
|
|
|
4
4
|
import { useScoutRealtimeBroadcast, } from "./useScoutRealtimeBroadcast";
|
|
5
5
|
const TABLE_MARKERS = [
|
|
6
6
|
["operating_contexts", "operating_context_type_id"],
|
|
7
|
+
["operating_contexts_devices", "device_id"],
|
|
7
8
|
["operating_context_payloads", "payload_type"],
|
|
8
9
|
["operating_context_role_assignments", "membership_id"],
|
|
9
10
|
["operating_context_equipment_requirements", "equipment_item_id"],
|
package/dist/index.d.ts
CHANGED
|
@@ -62,9 +62,11 @@ export * from "./helpers/operators";
|
|
|
62
62
|
export * from "./helpers/versions_software";
|
|
63
63
|
export * from "./helpers/versions_software_server";
|
|
64
64
|
export * from "./helpers/parts";
|
|
65
|
+
export * from "./helpers/sensor_poses";
|
|
65
66
|
export * from "./helpers/manufacturers";
|
|
66
67
|
export * from "./helpers/products";
|
|
67
68
|
export * from "./helpers/product_numbers";
|
|
69
|
+
export * from "./helpers/product_compatibilities";
|
|
68
70
|
export * from "./helpers/localizations";
|
|
69
71
|
export * from "./helpers/issuers";
|
|
70
72
|
export * from "./helpers/document_templates";
|
package/dist/index.js
CHANGED
|
@@ -65,9 +65,11 @@ export * from "./helpers/operators";
|
|
|
65
65
|
export * from "./helpers/versions_software";
|
|
66
66
|
export * from "./helpers/versions_software_server";
|
|
67
67
|
export * from "./helpers/parts";
|
|
68
|
+
export * from "./helpers/sensor_poses";
|
|
68
69
|
export * from "./helpers/manufacturers";
|
|
69
70
|
export * from "./helpers/products";
|
|
70
71
|
export * from "./helpers/product_numbers";
|
|
72
|
+
export * from "./helpers/product_compatibilities";
|
|
71
73
|
export * from "./helpers/localizations";
|
|
72
74
|
export * from "./helpers/issuers";
|
|
73
75
|
export * from "./helpers/document_templates";
|
package/dist/types/db.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export type IPart = Database["public"]["Tables"]["parts"]["Row"];
|
|
|
62
62
|
export type IManufacturer = Database["public"]["Tables"]["manufacturers"]["Row"];
|
|
63
63
|
export type IProduct = Database["public"]["Tables"]["products"]["Row"];
|
|
64
64
|
export type IProductNumber = Database["public"]["Tables"]["product_numbers"]["Row"];
|
|
65
|
+
export type IProductCompatibility = Database["public"]["Tables"]["product_compatibilities"]["Row"];
|
|
65
66
|
export type ISensorPose = Database["public"]["Tables"]["sensor_poses"]["Row"];
|
|
66
67
|
export type ICalibration = Database["public"]["Tables"]["calibrations"]["Row"];
|
|
67
68
|
export type ILocalization = Database["public"]["Tables"]["localizations"]["Row"];
|
|
@@ -80,6 +81,7 @@ export type IOperatingContextEquipmentItem = Database["public"]["Tables"]["opera
|
|
|
80
81
|
export type IOperatingContext = Database["public"]["Tables"]["operating_contexts"]["Row"];
|
|
81
82
|
export type IOperatingContextPayload = Database["public"]["Tables"]["operating_context_payloads"]["Row"];
|
|
82
83
|
export type IOperatingContextRoleAssignment = Database["public"]["Tables"]["operating_context_role_assignments"]["Row"];
|
|
84
|
+
export type IOperatingContextDevice = Database["public"]["Tables"]["operating_contexts_devices"]["Row"];
|
|
83
85
|
export type IOperatingContextEquipmentRequirement = Database["public"]["Tables"]["operating_context_equipment_requirements"]["Row"];
|
|
84
86
|
export type IOperatingContextRegion = Database["public"]["Tables"]["operating_context_regions"]["Row"];
|
|
85
87
|
export type IOperatingContextRisk = Database["public"]["Tables"]["operating_context_risks"]["Row"];
|
|
@@ -120,6 +122,8 @@ export type OperatingContextPayloadCreateInput = Pick<OperatingContextPayloadIns
|
|
|
120
122
|
export type OperatingContextPayloadUpdateInput = Partial<Omit<OperatingContextPayloadCreateInput, "operating_context_id">> & LifecyclePatch;
|
|
121
123
|
export type OperatingContextRoleAssignmentCreateInput = Pick<OperatingContextRoleAssignmentInsert, "operating_context_id" | "membership_id" | "role_id" | "herd_id">;
|
|
122
124
|
export type OperatingContextRoleAssignmentUpdateInput = Partial<Pick<OperatingContextRoleAssignmentCreateInput, "membership_id" | "role_id">> & LifecyclePatch;
|
|
125
|
+
export type OperatingContextDeviceCreateInput = Pick<OperatingContextDeviceInsert, "operating_context_id" | "device_id" | "herd_id">;
|
|
126
|
+
export type OperatingContextDeviceUpdateInput = Partial<Pick<OperatingContextDeviceCreateInput, "device_id">> & LifecyclePatch;
|
|
123
127
|
export type OperatingContextEquipmentRequirementCreateInput = Pick<OperatingContextEquipmentRequirementInsert, "operating_context_id" | "equipment_item_id">;
|
|
124
128
|
export type OperatingContextEquipmentRequirementUpdateInput = Partial<Pick<OperatingContextEquipmentRequirementCreateInput, "equipment_item_id">> & LifecyclePatch;
|
|
125
129
|
export interface OperatingContextRegionCreateInput {
|
|
@@ -187,6 +191,8 @@ export type ProductInsert = Database["public"]["Tables"]["products"]["Insert"];
|
|
|
187
191
|
export type ProductUpdate = Database["public"]["Tables"]["products"]["Update"];
|
|
188
192
|
export type ProductNumberInsert = Database["public"]["Tables"]["product_numbers"]["Insert"];
|
|
189
193
|
export type ProductNumberUpdate = Database["public"]["Tables"]["product_numbers"]["Update"];
|
|
194
|
+
export type ProductCompatibilityInsert = Database["public"]["Tables"]["product_compatibilities"]["Insert"];
|
|
195
|
+
export type ProductCompatibilityUpdate = Database["public"]["Tables"]["product_compatibilities"]["Update"];
|
|
190
196
|
export type SensorPoseInsert = Database["public"]["Tables"]["sensor_poses"]["Insert"];
|
|
191
197
|
export type SensorPoseUpdate = Database["public"]["Tables"]["sensor_poses"]["Update"];
|
|
192
198
|
export type CalibrationInsert = Database["public"]["Tables"]["calibrations"]["Insert"];
|
|
@@ -225,6 +231,8 @@ export type OperatingContextPayloadInsert = Database["public"]["Tables"]["operat
|
|
|
225
231
|
export type OperatingContextPayloadUpdate = Database["public"]["Tables"]["operating_context_payloads"]["Update"];
|
|
226
232
|
export type OperatingContextRoleAssignmentInsert = Database["public"]["Tables"]["operating_context_role_assignments"]["Insert"];
|
|
227
233
|
export type OperatingContextRoleAssignmentUpdate = Database["public"]["Tables"]["operating_context_role_assignments"]["Update"];
|
|
234
|
+
export type OperatingContextDeviceInsert = Database["public"]["Tables"]["operating_contexts_devices"]["Insert"];
|
|
235
|
+
export type OperatingContextDeviceUpdate = Database["public"]["Tables"]["operating_contexts_devices"]["Update"];
|
|
228
236
|
export type OperatingContextEquipmentRequirementInsert = Database["public"]["Tables"]["operating_context_equipment_requirements"]["Insert"];
|
|
229
237
|
export type OperatingContextEquipmentRequirementUpdate = Database["public"]["Tables"]["operating_context_equipment_requirements"]["Update"];
|
|
230
238
|
export type OperatingContextRegionInsert = Database["public"]["Tables"]["operating_context_regions"]["Insert"];
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -257,6 +257,8 @@ export type Database = {
|
|
|
257
257
|
lifecycle_changed_by: string | null;
|
|
258
258
|
lifecycle_reason: string | null;
|
|
259
259
|
modality: string | null;
|
|
260
|
+
processing_blocked_at: string | null;
|
|
261
|
+
processing_blocked_reason: string | null;
|
|
260
262
|
proxy_file_path: string | null;
|
|
261
263
|
proxy_generated_at: string | null;
|
|
262
264
|
segmented_at: string | null;
|
|
@@ -281,6 +283,8 @@ export type Database = {
|
|
|
281
283
|
lifecycle_changed_by?: string | null;
|
|
282
284
|
lifecycle_reason?: string | null;
|
|
283
285
|
modality?: string | null;
|
|
286
|
+
processing_blocked_at?: string | null;
|
|
287
|
+
processing_blocked_reason?: string | null;
|
|
284
288
|
proxy_file_path?: string | null;
|
|
285
289
|
proxy_generated_at?: string | null;
|
|
286
290
|
segmented_at?: string | null;
|
|
@@ -305,6 +309,8 @@ export type Database = {
|
|
|
305
309
|
lifecycle_changed_by?: string | null;
|
|
306
310
|
lifecycle_reason?: string | null;
|
|
307
311
|
modality?: string | null;
|
|
312
|
+
processing_blocked_at?: string | null;
|
|
313
|
+
processing_blocked_reason?: string | null;
|
|
308
314
|
proxy_file_path?: string | null;
|
|
309
315
|
proxy_generated_at?: string | null;
|
|
310
316
|
segmented_at?: string | null;
|
|
@@ -1146,6 +1152,8 @@ export type Database = {
|
|
|
1146
1152
|
origin_location: unknown;
|
|
1147
1153
|
origin_pitch: number | null;
|
|
1148
1154
|
origin_roll: number | null;
|
|
1155
|
+
processing_blocked_at: string | null;
|
|
1156
|
+
processing_blocked_reason: string | null;
|
|
1149
1157
|
segmented_at: string | null;
|
|
1150
1158
|
sensor_pitch: number | null;
|
|
1151
1159
|
sensor_roll: number | null;
|
|
@@ -1178,6 +1186,8 @@ export type Database = {
|
|
|
1178
1186
|
origin_location?: unknown;
|
|
1179
1187
|
origin_pitch?: number | null;
|
|
1180
1188
|
origin_roll?: number | null;
|
|
1189
|
+
processing_blocked_at?: string | null;
|
|
1190
|
+
processing_blocked_reason?: string | null;
|
|
1181
1191
|
segmented_at?: string | null;
|
|
1182
1192
|
sensor_pitch?: number | null;
|
|
1183
1193
|
sensor_roll?: number | null;
|
|
@@ -1210,6 +1220,8 @@ export type Database = {
|
|
|
1210
1220
|
origin_location?: unknown;
|
|
1211
1221
|
origin_pitch?: number | null;
|
|
1212
1222
|
origin_roll?: number | null;
|
|
1223
|
+
processing_blocked_at?: string | null;
|
|
1224
|
+
processing_blocked_reason?: string | null;
|
|
1213
1225
|
segmented_at?: string | null;
|
|
1214
1226
|
sensor_pitch?: number | null;
|
|
1215
1227
|
sensor_roll?: number | null;
|
|
@@ -2693,6 +2705,64 @@ export type Database = {
|
|
|
2693
2705
|
}
|
|
2694
2706
|
];
|
|
2695
2707
|
};
|
|
2708
|
+
operating_contexts_devices: {
|
|
2709
|
+
Row: {
|
|
2710
|
+
device_id: number;
|
|
2711
|
+
herd_id: number;
|
|
2712
|
+
id: number;
|
|
2713
|
+
inserted_at: string;
|
|
2714
|
+
lifecycle: Database["public"]["Enums"]["entity_lifecycle"];
|
|
2715
|
+
lifecycle_changed_at: string;
|
|
2716
|
+
lifecycle_changed_by: string | null;
|
|
2717
|
+
lifecycle_reason: string | null;
|
|
2718
|
+
operating_context_id: number;
|
|
2719
|
+
};
|
|
2720
|
+
Insert: {
|
|
2721
|
+
device_id: number;
|
|
2722
|
+
herd_id: number;
|
|
2723
|
+
id?: number;
|
|
2724
|
+
inserted_at?: string;
|
|
2725
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
2726
|
+
lifecycle_changed_at?: string;
|
|
2727
|
+
lifecycle_changed_by?: string | null;
|
|
2728
|
+
lifecycle_reason?: string | null;
|
|
2729
|
+
operating_context_id: number;
|
|
2730
|
+
};
|
|
2731
|
+
Update: {
|
|
2732
|
+
device_id?: number;
|
|
2733
|
+
herd_id?: number;
|
|
2734
|
+
id?: number;
|
|
2735
|
+
inserted_at?: string;
|
|
2736
|
+
lifecycle?: Database["public"]["Enums"]["entity_lifecycle"];
|
|
2737
|
+
lifecycle_changed_at?: string;
|
|
2738
|
+
lifecycle_changed_by?: string | null;
|
|
2739
|
+
lifecycle_reason?: string | null;
|
|
2740
|
+
operating_context_id?: number;
|
|
2741
|
+
};
|
|
2742
|
+
Relationships: [
|
|
2743
|
+
{
|
|
2744
|
+
foreignKeyName: "operating_context_device_context_fkey";
|
|
2745
|
+
columns: ["operating_context_id", "herd_id"];
|
|
2746
|
+
isOneToOne: false;
|
|
2747
|
+
referencedRelation: "operating_contexts";
|
|
2748
|
+
referencedColumns: ["id", "herd_id"];
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
foreignKeyName: "operating_context_device_device_fkey";
|
|
2752
|
+
columns: ["device_id"];
|
|
2753
|
+
isOneToOne: false;
|
|
2754
|
+
referencedRelation: "devices";
|
|
2755
|
+
referencedColumns: ["id"];
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
foreignKeyName: "operating_contexts_devices_lifecycle_changed_by_fkey";
|
|
2759
|
+
columns: ["lifecycle_changed_by"];
|
|
2760
|
+
isOneToOne: false;
|
|
2761
|
+
referencedRelation: "users";
|
|
2762
|
+
referencedColumns: ["id"];
|
|
2763
|
+
}
|
|
2764
|
+
];
|
|
2765
|
+
};
|
|
2696
2766
|
operators: {
|
|
2697
2767
|
Row: {
|
|
2698
2768
|
action: string | null;
|
|
@@ -2999,6 +3069,45 @@ export type Database = {
|
|
|
2999
3069
|
}
|
|
3000
3070
|
];
|
|
3001
3071
|
};
|
|
3072
|
+
product_compatibilities: {
|
|
3073
|
+
Row: {
|
|
3074
|
+
accessory_product_number: string;
|
|
3075
|
+
auto_assign: boolean;
|
|
3076
|
+
inserted_at: string;
|
|
3077
|
+
primary_product_id: number;
|
|
3078
|
+
role: string;
|
|
3079
|
+
};
|
|
3080
|
+
Insert: {
|
|
3081
|
+
accessory_product_number: string;
|
|
3082
|
+
auto_assign?: boolean;
|
|
3083
|
+
inserted_at?: string;
|
|
3084
|
+
primary_product_id: number;
|
|
3085
|
+
role: string;
|
|
3086
|
+
};
|
|
3087
|
+
Update: {
|
|
3088
|
+
accessory_product_number?: string;
|
|
3089
|
+
auto_assign?: boolean;
|
|
3090
|
+
inserted_at?: string;
|
|
3091
|
+
primary_product_id?: number;
|
|
3092
|
+
role?: string;
|
|
3093
|
+
};
|
|
3094
|
+
Relationships: [
|
|
3095
|
+
{
|
|
3096
|
+
foreignKeyName: "product_compatibilities_accessory_product_number_fkey";
|
|
3097
|
+
columns: ["accessory_product_number"];
|
|
3098
|
+
isOneToOne: false;
|
|
3099
|
+
referencedRelation: "product_numbers";
|
|
3100
|
+
referencedColumns: ["product_number"];
|
|
3101
|
+
},
|
|
3102
|
+
{
|
|
3103
|
+
foreignKeyName: "product_compatibilities_primary_product_id_fkey";
|
|
3104
|
+
columns: ["primary_product_id"];
|
|
3105
|
+
isOneToOne: false;
|
|
3106
|
+
referencedRelation: "products";
|
|
3107
|
+
referencedColumns: ["id"];
|
|
3108
|
+
}
|
|
3109
|
+
];
|
|
3110
|
+
};
|
|
3002
3111
|
product_numbers: {
|
|
3003
3112
|
Row: {
|
|
3004
3113
|
gtin: string | null;
|
|
@@ -4243,6 +4352,8 @@ export type Database = {
|
|
|
4243
4352
|
lifecycle_changed_by: string | null;
|
|
4244
4353
|
lifecycle_reason: string | null;
|
|
4245
4354
|
modality: string | null;
|
|
4355
|
+
processing_blocked_at: string | null;
|
|
4356
|
+
processing_blocked_reason: string | null;
|
|
4246
4357
|
proxy_file_path: string | null;
|
|
4247
4358
|
proxy_generated_at: string | null;
|
|
4248
4359
|
segmented_at: string | null;
|
|
@@ -4279,6 +4390,8 @@ export type Database = {
|
|
|
4279
4390
|
lifecycle_changed_by: string | null;
|
|
4280
4391
|
lifecycle_reason: string | null;
|
|
4281
4392
|
modality: string | null;
|
|
4393
|
+
processing_blocked_at: string | null;
|
|
4394
|
+
processing_blocked_reason: string | null;
|
|
4282
4395
|
proxy_file_path: string | null;
|
|
4283
4396
|
proxy_generated_at: string | null;
|
|
4284
4397
|
segmented_at: string | null;
|
|
@@ -4316,6 +4429,8 @@ export type Database = {
|
|
|
4316
4429
|
lifecycle_changed_by: string | null;
|
|
4317
4430
|
lifecycle_reason: string | null;
|
|
4318
4431
|
modality: string | null;
|
|
4432
|
+
processing_blocked_at: string | null;
|
|
4433
|
+
processing_blocked_reason: string | null;
|
|
4319
4434
|
proxy_file_path: string | null;
|
|
4320
4435
|
proxy_generated_at: string | null;
|
|
4321
4436
|
segmented_at: string | null;
|
|
@@ -4353,6 +4468,8 @@ export type Database = {
|
|
|
4353
4468
|
lifecycle_changed_by: string | null;
|
|
4354
4469
|
lifecycle_reason: string | null;
|
|
4355
4470
|
modality: string | null;
|
|
4471
|
+
processing_blocked_at: string | null;
|
|
4472
|
+
processing_blocked_reason: string | null;
|
|
4356
4473
|
proxy_file_path: string | null;
|
|
4357
4474
|
proxy_generated_at: string | null;
|
|
4358
4475
|
segmented_at: string | null;
|
|
@@ -4391,6 +4508,8 @@ export type Database = {
|
|
|
4391
4508
|
lifecycle_changed_by: string | null;
|
|
4392
4509
|
lifecycle_reason: string | null;
|
|
4393
4510
|
modality: string | null;
|
|
4511
|
+
processing_blocked_at: string | null;
|
|
4512
|
+
processing_blocked_reason: string | null;
|
|
4394
4513
|
proxy_file_path: string | null;
|
|
4395
4514
|
proxy_generated_at: string | null;
|
|
4396
4515
|
segmented_at: string | null;
|
|
@@ -4429,6 +4548,8 @@ export type Database = {
|
|
|
4429
4548
|
lifecycle_changed_by: string | null;
|
|
4430
4549
|
lifecycle_reason: string | null;
|
|
4431
4550
|
modality: string | null;
|
|
4551
|
+
processing_blocked_at: string | null;
|
|
4552
|
+
processing_blocked_reason: string | null;
|
|
4432
4553
|
proxy_file_path: string | null;
|
|
4433
4554
|
proxy_generated_at: string | null;
|
|
4434
4555
|
segmented_at: string | null;
|
|
@@ -4468,6 +4589,8 @@ export type Database = {
|
|
|
4468
4589
|
lifecycle_changed_by: string | null;
|
|
4469
4590
|
lifecycle_reason: string | null;
|
|
4470
4591
|
modality: string | null;
|
|
4592
|
+
processing_blocked_at: string | null;
|
|
4593
|
+
processing_blocked_reason: string | null;
|
|
4471
4594
|
proxy_file_path: string | null;
|
|
4472
4595
|
proxy_generated_at: string | null;
|
|
4473
4596
|
segmented_at: string | null;
|
|
@@ -4506,6 +4629,8 @@ export type Database = {
|
|
|
4506
4629
|
lifecycle_changed_by: string | null;
|
|
4507
4630
|
lifecycle_reason: string | null;
|
|
4508
4631
|
modality: string | null;
|
|
4632
|
+
processing_blocked_at: string | null;
|
|
4633
|
+
processing_blocked_reason: string | null;
|
|
4509
4634
|
proxy_file_path: string | null;
|
|
4510
4635
|
proxy_generated_at: string | null;
|
|
4511
4636
|
segmented_at: string | null;
|
|
@@ -4545,6 +4670,8 @@ export type Database = {
|
|
|
4545
4670
|
lifecycle_changed_by: string | null;
|
|
4546
4671
|
lifecycle_reason: string | null;
|
|
4547
4672
|
modality: string | null;
|
|
4673
|
+
processing_blocked_at: string | null;
|
|
4674
|
+
processing_blocked_reason: string | null;
|
|
4548
4675
|
proxy_file_path: string | null;
|
|
4549
4676
|
proxy_generated_at: string | null;
|
|
4550
4677
|
segmented_at: string | null;
|