@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/auth-server.cjs +1043 -1041
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +1043 -1041
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +1053 -1051
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +1053 -1051
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +12 -837
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.mjs +12 -837
- package/dist/clients.mjs.map +1 -1
- package/dist/index.cjs +1081 -1079
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -20
- package/dist/index.d.ts +0 -20
- package/dist/index.mjs +1081 -1079
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/client.gen.ts +3 -2
- package/src/_api/generated/helpers/auth.ts +64 -47
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
|
|