@adventurelabs/scout-core 1.4.88 → 1.4.90
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/parts.js
CHANGED
|
@@ -107,9 +107,10 @@ export const get_parts_by_status = get_parts_by_lifecycle;
|
|
|
107
107
|
* @param newPart - Part data to create
|
|
108
108
|
*/
|
|
109
109
|
export async function create_part(client, newPart) {
|
|
110
|
-
//
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
// part is scoped to exactly one of a device or a herd.
|
|
111
|
+
const scope_count = [newPart.device_id, newPart.herd_id].filter((scope) => scope != null).length;
|
|
112
|
+
if (scope_count !== 1) {
|
|
113
|
+
return IWebResponse.error("exactly one of device_id or herd_id is required").to_compatible();
|
|
113
114
|
}
|
|
114
115
|
if (!newPart.serial_number) {
|
|
115
116
|
return IWebResponse.error("Serial number is required").to_compatible();
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -4519,7 +4519,7 @@ export type Database = {
|
|
|
4519
4519
|
Enums: {
|
|
4520
4520
|
analysis_work_status: "waiting" | "cancelled" | "processing" | "failed" | "success";
|
|
4521
4521
|
app_permission: "herds.delete" | "events.delete";
|
|
4522
|
-
device_type: "trail_camera" | "drone_fixed_wing" | "drone_quad" | "gps_tracker" | "sentry_tower" | "smart_buoy" | "radio_mesh_base_station" | "radio_mesh_repeater" | "unknown" | "gps_tracker_vehicle" | "gps_tracker_person" | "radio_mesh_base_station_gateway";
|
|
4522
|
+
device_type: "trail_camera" | "drone_fixed_wing" | "drone_quad" | "gps_tracker" | "sentry_tower" | "smart_buoy" | "radio_mesh_base_station" | "radio_mesh_repeater" | "unknown" | "gps_tracker_vehicle" | "gps_tracker_person" | "radio_mesh_base_station_gateway" | "remote_controller" | "docking_station" | "smart_battery" | "charging_station";
|
|
4523
4523
|
entity_lifecycle: "active" | "retired" | "deleted";
|
|
4524
4524
|
health_item: "healthy" | "repairable" | "unrepairable";
|
|
4525
4525
|
herd_invitation_status: "pending" | "accepted" | "revoked" | "expired";
|
|
@@ -4843,7 +4843,7 @@ export declare const Constants: {
|
|
|
4843
4843
|
readonly Enums: {
|
|
4844
4844
|
readonly analysis_work_status: readonly ["waiting", "cancelled", "processing", "failed", "success"];
|
|
4845
4845
|
readonly app_permission: readonly ["herds.delete", "events.delete"];
|
|
4846
|
-
readonly device_type: readonly ["trail_camera", "drone_fixed_wing", "drone_quad", "gps_tracker", "sentry_tower", "smart_buoy", "radio_mesh_base_station", "radio_mesh_repeater", "unknown", "gps_tracker_vehicle", "gps_tracker_person", "radio_mesh_base_station_gateway"];
|
|
4846
|
+
readonly device_type: readonly ["trail_camera", "drone_fixed_wing", "drone_quad", "gps_tracker", "sentry_tower", "smart_buoy", "radio_mesh_base_station", "radio_mesh_repeater", "unknown", "gps_tracker_vehicle", "gps_tracker_person", "radio_mesh_base_station_gateway", "remote_controller", "docking_station", "smart_battery", "charging_station"];
|
|
4847
4847
|
readonly entity_lifecycle: readonly ["active", "retired", "deleted"];
|
|
4848
4848
|
readonly health_item: readonly ["healthy", "repairable", "unrepairable"];
|
|
4849
4849
|
readonly herd_invitation_status: readonly ["pending", "accepted", "revoked", "expired"];
|
package/dist/types/supabase.js
CHANGED
|
@@ -22,6 +22,10 @@ export const Constants = {
|
|
|
22
22
|
"gps_tracker_vehicle",
|
|
23
23
|
"gps_tracker_person",
|
|
24
24
|
"radio_mesh_base_station_gateway",
|
|
25
|
+
"remote_controller",
|
|
26
|
+
"docking_station",
|
|
27
|
+
"smart_battery",
|
|
28
|
+
"charging_station",
|
|
25
29
|
],
|
|
26
30
|
entity_lifecycle: ["active", "retired", "deleted"],
|
|
27
31
|
health_item: ["healthy", "repairable", "unrepairable"],
|