@adventurelabs/scout-core 1.0.40 → 1.0.41
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/tags.js +19 -41
- package/dist/providers/ScoutRefreshProvider.d.ts +15 -22
- package/dist/supabase/server.d.ts +15 -22
- package/dist/types/supabase.d.ts +15 -22
- package/package.json +1 -1
package/dist/helpers/tags.js
CHANGED
|
@@ -172,47 +172,25 @@ export async function server_get_events_and_tags_for_devices_batch(device_ids, l
|
|
|
172
172
|
if (!eventsByDevice[device_id]) {
|
|
173
173
|
eventsByDevice[device_id] = [];
|
|
174
174
|
}
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
timestamp_observation: row.event_timestamp_observation,
|
|
195
|
-
is_public: row.event_is_public,
|
|
196
|
-
earthranger_url: row.event_earthranger_url,
|
|
197
|
-
tags: [],
|
|
198
|
-
};
|
|
199
|
-
eventsByDevice[device_id].push(event);
|
|
200
|
-
}
|
|
201
|
-
// Add tag if it exists
|
|
202
|
-
if (row.tag_id) {
|
|
203
|
-
event.tags.push({
|
|
204
|
-
id: row.tag_id,
|
|
205
|
-
x: row.tag_x || 0,
|
|
206
|
-
y: row.tag_y || 0,
|
|
207
|
-
width: row.tag_width || 0,
|
|
208
|
-
height: row.tag_height || 0,
|
|
209
|
-
class_name: row.tag_class_name || "",
|
|
210
|
-
conf: row.tag_conf || 0,
|
|
211
|
-
observation_type: row.tag_observation_type || "manual",
|
|
212
|
-
event_id: row.event_id,
|
|
213
|
-
inserted_at: row.tag_inserted_at || row.event_inserted_at,
|
|
214
|
-
});
|
|
215
|
-
}
|
|
175
|
+
// Create event object from the new structure
|
|
176
|
+
const event = {
|
|
177
|
+
id: row.event_id,
|
|
178
|
+
inserted_at: row.inserted_at,
|
|
179
|
+
message: row.message,
|
|
180
|
+
media_url: row.media_url,
|
|
181
|
+
file_path: row.file_path,
|
|
182
|
+
latitude: row.latitude,
|
|
183
|
+
longitude: row.longitude,
|
|
184
|
+
altitude: row.altitude,
|
|
185
|
+
heading: row.heading,
|
|
186
|
+
media_type: row.media_type,
|
|
187
|
+
device_id: device_id,
|
|
188
|
+
timestamp_observation: row.timestamp_observation,
|
|
189
|
+
is_public: row.is_public,
|
|
190
|
+
earthranger_url: row.earthranger_url,
|
|
191
|
+
tags: Array.isArray(row.tags) ? row.tags : [],
|
|
192
|
+
};
|
|
193
|
+
eventsByDevice[device_id].push(event);
|
|
216
194
|
});
|
|
217
195
|
// Add signed URLs to all events
|
|
218
196
|
const result = {};
|
|
@@ -760,29 +760,22 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
760
760
|
limit_per_device: number;
|
|
761
761
|
};
|
|
762
762
|
Returns: {
|
|
763
|
-
device_id: number;
|
|
764
763
|
event_id: number;
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
tag_width: number | null;
|
|
781
|
-
tag_height: number | null;
|
|
782
|
-
tag_class_name: string | null;
|
|
783
|
-
tag_conf: number | null;
|
|
784
|
-
tag_observation_type: string | null;
|
|
785
|
-
tag_inserted_at: string | null;
|
|
764
|
+
inserted_at: string;
|
|
765
|
+
message: string | null;
|
|
766
|
+
media_url: string | null;
|
|
767
|
+
file_path: string | null;
|
|
768
|
+
latitude: number | null;
|
|
769
|
+
longitude: number | null;
|
|
770
|
+
earthranger_url: string | null;
|
|
771
|
+
altitude: number;
|
|
772
|
+
heading: number;
|
|
773
|
+
media_type: string;
|
|
774
|
+
device_id: number;
|
|
775
|
+
timestamp_observation: string;
|
|
776
|
+
is_public: boolean;
|
|
777
|
+
tags: import("../types/supabase").Json;
|
|
778
|
+
herd_id: number | null;
|
|
786
779
|
}[];
|
|
787
780
|
};
|
|
788
781
|
};
|
|
@@ -751,29 +751,22 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
751
751
|
limit_per_device: number;
|
|
752
752
|
};
|
|
753
753
|
Returns: {
|
|
754
|
-
device_id: number;
|
|
755
754
|
event_id: number;
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
tag_width: number | null;
|
|
772
|
-
tag_height: number | null;
|
|
773
|
-
tag_class_name: string | null;
|
|
774
|
-
tag_conf: number | null;
|
|
775
|
-
tag_observation_type: string | null;
|
|
776
|
-
tag_inserted_at: string | null;
|
|
755
|
+
inserted_at: string;
|
|
756
|
+
message: string | null;
|
|
757
|
+
media_url: string | null;
|
|
758
|
+
file_path: string | null;
|
|
759
|
+
latitude: number | null;
|
|
760
|
+
longitude: number | null;
|
|
761
|
+
earthranger_url: string | null;
|
|
762
|
+
altitude: number;
|
|
763
|
+
heading: number;
|
|
764
|
+
media_type: string;
|
|
765
|
+
device_id: number;
|
|
766
|
+
timestamp_observation: string;
|
|
767
|
+
is_public: boolean;
|
|
768
|
+
tags: import("../types/supabase").Json;
|
|
769
|
+
herd_id: number | null;
|
|
777
770
|
}[];
|
|
778
771
|
};
|
|
779
772
|
};
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -818,29 +818,22 @@ export type Database = {
|
|
|
818
818
|
limit_per_device: number;
|
|
819
819
|
};
|
|
820
820
|
Returns: {
|
|
821
|
-
device_id: number;
|
|
822
821
|
event_id: number;
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
tag_width: number | null;
|
|
839
|
-
tag_height: number | null;
|
|
840
|
-
tag_class_name: string | null;
|
|
841
|
-
tag_conf: number | null;
|
|
842
|
-
tag_observation_type: string | null;
|
|
843
|
-
tag_inserted_at: string | null;
|
|
822
|
+
inserted_at: string;
|
|
823
|
+
message: string | null;
|
|
824
|
+
media_url: string | null;
|
|
825
|
+
file_path: string | null;
|
|
826
|
+
latitude: number | null;
|
|
827
|
+
longitude: number | null;
|
|
828
|
+
earthranger_url: string | null;
|
|
829
|
+
altitude: number;
|
|
830
|
+
heading: number;
|
|
831
|
+
media_type: string;
|
|
832
|
+
device_id: number;
|
|
833
|
+
timestamp_observation: string;
|
|
834
|
+
is_public: boolean;
|
|
835
|
+
tags: Json;
|
|
836
|
+
herd_id: number | null;
|
|
844
837
|
}[];
|
|
845
838
|
};
|
|
846
839
|
};
|