@adventurelabs/scout-core 1.4.87 → 1.4.89
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
|
@@ -4691,6 +4691,8 @@ export type Database = {
|
|
|
4691
4691
|
longitude: number | null;
|
|
4692
4692
|
auto_delete_media_with_humans: boolean | null;
|
|
4693
4693
|
auto_delete_media_with_no_tracks: boolean | null;
|
|
4694
|
+
localization_id: number | null;
|
|
4695
|
+
localization_region: string | null;
|
|
4694
4696
|
};
|
|
4695
4697
|
pins_pretty_location: {
|
|
4696
4698
|
id: number | null;
|