@swell/apps-sdk 1.0.154 → 1.0.155

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/index.cjs CHANGED
@@ -7774,7 +7774,7 @@ var MAX_TTL = YEAR;
7774
7774
  var SHORT_TTL = 5 * SECOND;
7775
7775
 
7776
7776
  // src/cache/worker-cache-proxy.ts
7777
- var CACHE_NAME = "swell-cache-v1";
7777
+ var CACHE_NAME = "swell-cache-v011";
7778
7778
  var CACHE_KEY_ORIGIN = "https://cache.swell.store";
7779
7779
  var WorkerCacheProxy = class {
7780
7780
  swell;
@@ -7823,6 +7823,7 @@ var WorkerCacheProxy = class {
7823
7823
  }
7824
7824
  });
7825
7825
  await cache.put(keyUrl, response);
7826
+ logger.debug("[SDK] cache put done", { keyUrl });
7826
7827
  } catch {
7827
7828
  }
7828
7829
  }
@@ -20644,9 +20645,9 @@ var ThemeLoader = class {
20644
20645
  fields: "id, name, type, file, file_path, hash"
20645
20646
  // NO file_data
20646
20647
  };
20648
+ const cache = new WorkerCacheProxy(this.swell);
20649
+ const versionHash = this.swell.swellHeaders["theme-version-hash"];
20647
20650
  try {
20648
- const cache = new WorkerCacheProxy(this.swell);
20649
- const versionHash = this.swell.swellHeaders["theme-version-hash"];
20650
20651
  const cached = await cache.get(
20651
20652
  "/:themes:configs",
20652
20653
  query,
@@ -20667,14 +20668,13 @@ var ThemeLoader = class {
20667
20668
  query
20668
20669
  );
20669
20670
  const configs = response?.results || [];
20670
- try {
20671
- const cache = new WorkerCacheProxy(this.swell);
20672
- const versionHash = this.swell.swellHeaders["theme-version-hash"];
20673
- await cache.put("/:themes:configs", query, configs, {
20674
- version: versionHash || null
20675
- });
20676
- } catch (err) {
20677
- logger.warn("[ThemeLoader] Cache write failed", err);
20671
+ const ctx = this.swell.workerCtx || globalThis.executionContext;
20672
+ if (ctx && typeof ctx.waitUntil === "function") {
20673
+ ctx.waitUntil(
20674
+ cache.put("/:themes:configs", query, configs, {
20675
+ version: versionHash || null
20676
+ })
20677
+ );
20678
20678
  }
20679
20679
  return configs;
20680
20680
  }