@adventurelabs/scout-core 1.0.126 → 1.0.127

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.
@@ -1,6 +1,6 @@
1
1
  "use server";
2
2
  import { newServerClient } from "../supabase/server";
3
- import { BUCKET_NAME_SCOUT, SIGNED_URL_EXPIRATION_SECONDS, } from "../constants/db";
3
+ import { SIGNED_URL_EXPIRATION_SECONDS, } from "../constants/db";
4
4
  /**
5
5
  * Splits file path into bucket name and path. Must be at leaast one slash in your file path
6
6
  * @param filePath
@@ -49,9 +49,14 @@ export async function generateSignedUrlsBatch(filePaths, expiresIn = SIGNED_URL_
49
49
  const supabase = supabaseClient || (await newServerClient());
50
50
  const signedUrlPromises = filePaths.map(async (filePath) => {
51
51
  try {
52
+ const parts = getPartsFromFilePath(filePath);
53
+ if (!parts) {
54
+ console.error("Invalid file path:", filePath);
55
+ return null;
56
+ }
52
57
  const { data, error } = await supabase.storage
53
- .from(BUCKET_NAME_SCOUT)
54
- .createSignedUrl(filePath, expiresIn);
58
+ .from(parts.bucket_name)
59
+ .createSignedUrl(parts.path, expiresIn);
55
60
  if (error) {
56
61
  console.error(`Error generating signed URL for ${filePath}:`, error.message);
57
62
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adventurelabs/scout-core",
3
- "version": "1.0.126",
3
+ "version": "1.0.127",
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",