@djangocfg/api 2.1.332 → 2.1.333

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.d.cts CHANGED
@@ -12,23 +12,12 @@ type StorageMode = 'localStorage' | 'cookie';
12
12
  *
13
13
  * @example
14
14
  * import { auth } from '@your/api';
15
- *
16
- * // After login
17
15
  * auth.setToken(jwt);
18
- * auth.setRefreshToken(refresh);
19
- *
20
- * // After logout
21
16
  * auth.clearTokens();
22
- *
23
- * // Switch to cookie storage (call once during app init)
24
17
  * auth.setStorageMode('cookie');
25
18
  */
26
19
  declare const auth: {
27
20
  getStorageMode(): StorageMode;
28
- /**
29
- * Switch the storage backend. Existing values in the *previous*
30
- * backend are NOT migrated — set fresh values after switching.
31
- */
32
21
  setStorageMode(mode: StorageMode): void;
33
22
  getToken(): string | null;
34
23
  setToken(token: string | null): void;
@@ -36,25 +25,16 @@ declare const auth: {
36
25
  setRefreshToken(token: string | null): void;
37
26
  clearTokens(): void;
38
27
  isAuthenticated(): boolean;
39
- /** In-memory API key. Falls back to storage, then NEXT_PUBLIC_API_KEY. */
40
28
  getApiKey(): string | null;
41
- /** In-memory only (cleared on reload). */
42
29
  setApiKey(key: string | null): void;
43
- /** Persist to active storage backend (localStorage or cookie). */
44
30
  setApiKeyPersist(key: string | null): void;
45
31
  clearApiKey(): void;
46
- /** Override locale → falls back to NEXT_LOCALE cookie / navigator.language. */
47
32
  getLocale(): string | null;
48
33
  setLocale(locale: string | null): void;
49
34
  getBaseUrl(): string;
50
35
  setBaseUrl(url: string | null): void;
51
36
  getWithCredentials(): boolean;
52
37
  setWithCredentials(value: boolean): void;
53
- /**
54
- * Register a callback fired on every 401 response. Use this to wire
55
- * a token-refresh flow or a forced logout. Setting `null` removes
56
- * the handler.
57
- */
58
38
  onUnauthorized(cb: ((response: Response) => void) | null): void;
59
39
  };
60
40
 
package/dist/index.d.ts CHANGED
@@ -12,23 +12,12 @@ type StorageMode = 'localStorage' | 'cookie';
12
12
  *
13
13
  * @example
14
14
  * import { auth } from '@your/api';
15
- *
16
- * // After login
17
15
  * auth.setToken(jwt);
18
- * auth.setRefreshToken(refresh);
19
- *
20
- * // After logout
21
16
  * auth.clearTokens();
22
- *
23
- * // Switch to cookie storage (call once during app init)
24
17
  * auth.setStorageMode('cookie');
25
18
  */
26
19
  declare const auth: {
27
20
  getStorageMode(): StorageMode;
28
- /**
29
- * Switch the storage backend. Existing values in the *previous*
30
- * backend are NOT migrated — set fresh values after switching.
31
- */
32
21
  setStorageMode(mode: StorageMode): void;
33
22
  getToken(): string | null;
34
23
  setToken(token: string | null): void;
@@ -36,25 +25,16 @@ declare const auth: {
36
25
  setRefreshToken(token: string | null): void;
37
26
  clearTokens(): void;
38
27
  isAuthenticated(): boolean;
39
- /** In-memory API key. Falls back to storage, then NEXT_PUBLIC_API_KEY. */
40
28
  getApiKey(): string | null;
41
- /** In-memory only (cleared on reload). */
42
29
  setApiKey(key: string | null): void;
43
- /** Persist to active storage backend (localStorage or cookie). */
44
30
  setApiKeyPersist(key: string | null): void;
45
31
  clearApiKey(): void;
46
- /** Override locale → falls back to NEXT_LOCALE cookie / navigator.language. */
47
32
  getLocale(): string | null;
48
33
  setLocale(locale: string | null): void;
49
34
  getBaseUrl(): string;
50
35
  setBaseUrl(url: string | null): void;
51
36
  getWithCredentials(): boolean;
52
37
  setWithCredentials(value: boolean): void;
53
- /**
54
- * Register a callback fired on every 401 response. Use this to wire
55
- * a token-refresh flow or a forced logout. Setting `null` removes
56
- * the handler.
57
- */
58
38
  onUnauthorized(cb: ((response: Response) => void) | null): void;
59
39
  };
60
40