@proveanything/smartlinks 2.0.0-alpha.5 → 2.0.0-alpha.6
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/docs/API_SUMMARY.md +1 -1
- package/dist/http.d.ts +7 -7
- package/dist/http.js +1 -1
- package/docs/API_SUMMARY.md +1 -1
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
type Logger = {
|
|
2
|
+
debug?: (...args: any[]) => void;
|
|
3
|
+
info?: (...args: any[]) => void;
|
|
4
|
+
warn?: (...args: any[]) => void;
|
|
5
|
+
error?: (...args: any[]) => void;
|
|
6
|
+
log?: (...args: any[]) => void;
|
|
7
|
+
} | ((...args: any[]) => void);
|
|
1
8
|
/** Snapshot of cache counters + current keys. Call from the console via `window.__slHttpDiag()`. */
|
|
2
9
|
export declare function getHttpCacheDiagnostics(): {
|
|
3
10
|
size: number;
|
|
@@ -18,13 +25,6 @@ export declare function getHttpCacheDiagnostics(): {
|
|
|
18
25
|
};
|
|
19
26
|
/** Reset the diagnostics counters (does not touch the cache itself). */
|
|
20
27
|
export declare function resetHttpCacheDiagnostics(): void;
|
|
21
|
-
type Logger = {
|
|
22
|
-
debug?: (...args: any[]) => void;
|
|
23
|
-
info?: (...args: any[]) => void;
|
|
24
|
-
warn?: (...args: any[]) => void;
|
|
25
|
-
error?: (...args: any[]) => void;
|
|
26
|
-
log?: (...args: any[]) => void;
|
|
27
|
-
} | ((...args: any[]) => void);
|
|
28
28
|
/** Return whether proxy mode is currently enabled. */
|
|
29
29
|
export declare function isProxyEnabled(): boolean;
|
|
30
30
|
export declare function initializeApi(options: {
|
package/dist/http.js
CHANGED
|
@@ -79,6 +79,7 @@ const TOKEN_STORAGE_KEY = 'sl:token';
|
|
|
79
79
|
let cachePersistenceTtlMs = 7 * 24 * 60 * 60000;
|
|
80
80
|
/** When true (default), serve stale L2 data via SmartlinksOfflineError on network failure. */
|
|
81
81
|
let cacheServeStaleOnOffline = true;
|
|
82
|
+
let logger;
|
|
82
83
|
const httpCacheStats = {
|
|
83
84
|
l1Hits: 0, inflightDedups: 0, l2Hits: 0, networkFetches: 0, skips: 0,
|
|
84
85
|
clears: 0, lastClearReason: null, lastClearAt: 0,
|
|
@@ -278,7 +279,6 @@ function isNetworkError(err) {
|
|
|
278
279
|
// fetch() throws TypeError on network failure; SmartlinksApiError is not a TypeError
|
|
279
280
|
return err instanceof TypeError;
|
|
280
281
|
}
|
|
281
|
-
let logger;
|
|
282
282
|
function logDebug(...args) {
|
|
283
283
|
if (!logger)
|
|
284
284
|
return;
|
package/docs/API_SUMMARY.md
CHANGED