@swell/apps-sdk 1.0.162 → 1.0.163

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/src/api.d.ts CHANGED
@@ -28,6 +28,10 @@ export declare class Swell {
28
28
  swellHeaders: Record<string, string | undefined>;
29
29
  };
30
30
  static formatQueryParams(queryParams?: URLSearchParams | Record<string, string | undefined>): qs.ParsedQs;
31
+ /**
32
+ * Checks if cache bypass is requested via X-Cache-Bypass header
33
+ */
34
+ private shouldBypassCache;
31
35
  /**
32
36
  * Fetches a resource.
33
37
  * First attempts to fetch from cache.
@@ -12,7 +12,16 @@ export declare class Cache {
12
12
  private client;
13
13
  private workerCtx?;
14
14
  constructor(options?: CreateCacheOptions);
15
- fetch<T>(key: string, fetchFn: () => T | Promise<T>, ttl?: number): Promise<T>;
15
+ /**
16
+ * Always fetches fresh data and updates cache
17
+ * Deduplicates concurrent requests with the same key
18
+ *
19
+ * @param key Cache key
20
+ * @param fetchFn Function to fetch fresh data
21
+ * @param ttl Time to live in milliseconds (default: DEFAULT_SWR_TTL)
22
+ * @param isCacheable Whether to store result in cache (default: true)
23
+ */
24
+ fetch<T>(key: string, fetchFn: () => T | Promise<T>, ttl?: number, isCacheable?: boolean): Promise<T>;
16
25
  /**
17
26
  * Fetch cache using SWR (stale-while-revalidate)
18
27
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swell/apps-sdk",
3
3
  "type": "module",
4
- "version": "1.0.162",
4
+ "version": "1.0.163",
5
5
  "description": "Swell SDK for building isomorphic apps.",
6
6
  "author": "Swell",
7
7
  "license": "MIT",