saltfish 0.2.68 → 0.2.69

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.
@@ -1256,6 +1256,8 @@ const saltfishStore = createStore()(
1256
1256
  playlistOptions: null,
1257
1257
  backendPlaylists: [],
1258
1258
  // Renamed state for playlists from backend
1259
+ isAdmin: false,
1260
+ // Admin privileges flag from backend
1259
1261
  isMuted: false,
1260
1262
  // Global mute state that persists across video transitions
1261
1263
  abTests: [],
@@ -1828,6 +1830,10 @@ class PlayerInitializationService {
1828
1830
  const store = useSaltfishStore.getState();
1829
1831
  store.initialize(updatedConfig);
1830
1832
  this.managers.analyticsManager.initialize(config, this.managers.sessionManager.getSessionId());
1833
+ if (data.isAdmin) {
1834
+ store.isAdmin = true;
1835
+ log("[PlayerInitializationService.initialize] Admin token detected");
1836
+ }
1831
1837
  if (data.playlists && Array.isArray(data.playlists) && store.setBackendPlaylists) {
1832
1838
  log("[PlayerInitializationService.initialize] Found data.playlists, attempting to store:", data.playlists);
1833
1839
  store.setBackendPlaylists(data.playlists);
@@ -1838,7 +1844,7 @@ class PlayerInitializationService {
1838
1844
  log("[PlayerInitializationService.initialize] Initializing A/B tests:", data.abTests);
1839
1845
  this.managers.abTestManager.initializeTests(data.abTests);
1840
1846
  }
1841
- } else {
1847
+ } else if (!data.isAdmin) {
1842
1848
  throw ErrorHandler.handleInitializationError(
1843
1849
  "Backend validation successful, but no playlists array provided in the response. Cannot initialize player.",
1844
1850
  {
@@ -2275,6 +2281,15 @@ class PlaylistValidator {
2275
2281
  error: "Saltfish Player must be initialized before starting a playlist"
2276
2282
  };
2277
2283
  }
2284
+ if (store.isAdmin === true) {
2285
+ log(`[PlaylistValidator] Admin token detected. Allowing direct access to playlist '${playlistId}'`);
2286
+ const manifestPath = `https://storage.saltfish.ai/flows2/drafts/${playlistId}.json`;
2287
+ return {
2288
+ isValid: true,
2289
+ manifestPath,
2290
+ updatedOptions: options
2291
+ };
2292
+ }
2278
2293
  const backendPlaylists = store.backendPlaylists;
2279
2294
  if (!backendPlaylists || backendPlaylists.length === 0) {
2280
2295
  ErrorHandler.handlePlaylistError(
@@ -10693,7 +10708,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
10693
10708
  __proto__: null,
10694
10709
  SaltfishPlayer
10695
10710
  }, Symbol.toStringTag, { value: "Module" }));
10696
- const version = "0.2.68";
10711
+ const version = "0.2.69";
10697
10712
  const packageJson = {
10698
10713
  version
10699
10714
  };