@adventurelabs/scout-core 1.0.19 → 1.0.21

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.
@@ -171,19 +171,6 @@ export async function get_event_and_tags_by_event_id(event_id) {
171
171
  data: null,
172
172
  };
173
173
  }
174
- // Debug the raw event data from database
175
- console.log("Raw event data from DB:", {
176
- eventId: data[0].id,
177
- mediaUrl: data[0].media_url,
178
- filePath: data[0].file_path,
179
- message: data[0].message,
180
- deviceId: data[0].device_id,
181
- location: data[0].location,
182
- locationType: typeof data[0].location,
183
- hasCoordinates: data[0].location &&
184
- typeof data[0].location === "object" &&
185
- "coordinates" in data[0].location,
186
- });
187
174
  // Transform location to latitude/longitude with better error handling
188
175
  let latitude = null;
189
176
  let longitude = null;
@@ -236,20 +223,7 @@ export async function get_event_and_tags_by_event_id(event_id) {
236
223
  earthranger_url: data[0].earthranger_url,
237
224
  file_path: data[0].file_path,
238
225
  };
239
- // Debug before signed URL generation
240
- console.log("Before signed URL generation:", {
241
- eventId: transformedData.id,
242
- mediaUrl: transformedData.media_url,
243
- filePath: transformedData.file_path,
244
- hasFilePath: !!transformedData.file_path,
245
- });
246
226
  // Add signed URL to event using the same client
247
227
  const eventWithSignedUrl = await addSignedUrlToEvent(transformedData, supabase);
248
- // Debug after signed URL generation
249
- console.log("After signed URL generation:", {
250
- eventId: eventWithSignedUrl.id,
251
- mediaUrl: eventWithSignedUrl.media_url,
252
- filePath: eventWithSignedUrl.file_path,
253
- });
254
228
  return IWebResponse.success(eventWithSignedUrl).to_compatible();
255
229
  }
@@ -11,15 +11,19 @@ export function useScoutDbListener() {
11
11
  const supabase = useRef(null);
12
12
  const dispatch = useAppDispatch();
13
13
  function handleTagInserts(payload) {
14
+ console.log("[DB Listener] Tag INSERT received:", payload.new);
14
15
  dispatch(addTag(payload.new));
15
16
  }
16
17
  function handleTagDeletes(payload) {
18
+ console.log("[DB Listener] Tag DELETE received:", payload.old);
17
19
  dispatch(deleteTag(payload.old));
18
20
  }
19
21
  function handleTagUpdates(payload) {
22
+ console.log("[DB Listener] Tag UPDATE received:", payload.new);
20
23
  dispatch(updateTag(payload.new));
21
24
  }
22
25
  async function handleDeviceInserts(payload) {
26
+ console.log("[DB Listener] Device INSERT received:", payload.new);
23
27
  const response_device = await get_device_by_id(payload.new.id);
24
28
  if (response_device.status == EnumWebResponse.SUCCESS &&
25
29
  response_device.data) {
@@ -30,9 +34,11 @@ export function useScoutDbListener() {
30
34
  }
31
35
  }
32
36
  function handleDeviceDeletes(payload) {
37
+ console.log("[DB Listener] Device DELETE received:", payload.old);
33
38
  dispatch(deleteDevice(payload.old));
34
39
  }
35
40
  async function handleDeviceUpdates(payload) {
41
+ console.log("[DB Listener] Device UPDATE received:", payload.new);
36
42
  const response_device = await get_device_by_id(payload.new.id);
37
43
  if (response_device.status == EnumWebResponse.SUCCESS &&
38
44
  response_device.data) {
@@ -43,12 +49,15 @@ export function useScoutDbListener() {
43
49
  }
44
50
  }
45
51
  function handlePlanInserts(payload) {
52
+ console.log("[DB Listener] Plan INSERT received:", payload.new);
46
53
  dispatch(addPlan(payload.new));
47
54
  }
48
55
  function handlePlanDeletes(payload) {
56
+ console.log("[DB Listener] Plan DELETE received:", payload.old);
49
57
  dispatch(deletePlan(payload.old));
50
58
  }
51
59
  function handlePlanUpdates(payload) {
60
+ console.log("[DB Listener] Plan UPDATE received:", payload.new);
52
61
  dispatch(updatePlan(payload.new));
53
62
  }
54
63
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adventurelabs/scout-core",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Core utilities and helpers for Adventure Labs Scout applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",