@trops/dash-core 0.1.239 → 0.1.240

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.
@@ -30983,6 +30983,7 @@ var schedulerController_1 = schedulerController$2;
30983
30983
  const { dynamicWidgetLoader } = dynamicWidgetLoaderExports;
30984
30984
  const { compileWidget, findWidgetsDir } = widgetCompiler$1;
30985
30985
  const { toPackageId, parsePackageId } = packageId;
30986
+ const { getStoredToken } = registryAuthController$1;
30986
30987
 
30987
30988
  let WIDGETS_CACHE_DIR = null;
30988
30989
  let REGISTRY_CONFIG_FILE = null;
@@ -31422,7 +31423,22 @@ var schedulerController_1 = schedulerController$2;
31422
31423
  `[WidgetRegistry] Downloading widget: ${widgetName} from ${downloadUrl}`,
31423
31424
  );
31424
31425
 
31425
- const response = await fetch(downloadUrl);
31426
+ // Add auth header for registry API download endpoints
31427
+ const fetchOpts = {};
31428
+ const registryBase =
31429
+ process.env.DASH_REGISTRY_API_URL ||
31430
+ "https://main.d919rwhuzp7rj.amplifyapp.com";
31431
+ if (
31432
+ downloadUrl.includes(registryBase) ||
31433
+ downloadUrl.includes("/api/packages/")
31434
+ ) {
31435
+ const auth = getStoredToken();
31436
+ if (auth?.token) {
31437
+ fetchOpts.headers = { Authorization: `Bearer ${auth.token}` };
31438
+ }
31439
+ }
31440
+
31441
+ const response = await fetch(downloadUrl, fetchOpts);
31426
31442
  if (!response.ok)
31427
31443
  throw new Error(`Failed to fetch: ${response.statusText}`);
31428
31444