@djangocfg/api 2.1.331 → 2.1.332

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "2.1.331",
3
+ "version": "2.1.332",
4
4
  "description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
5
5
  "keywords": [
6
6
  "django",
@@ -79,7 +79,7 @@
79
79
  "devDependencies": {
80
80
  "@types/node": "^24.7.2",
81
81
  "@types/react": "^19.1.0",
82
- "@djangocfg/typescript-config": "^2.1.331",
82
+ "@djangocfg/typescript-config": "^2.1.332",
83
83
  "next": "^16.2.2",
84
84
  "react": "^19.1.0",
85
85
  "tsup": "^8.5.0",
@@ -1,36 +1,16 @@
1
1
  // AUTO-GENERATED by django_generator / ts_extras.wrapper
2
- // Self-contained API wrapper for this group. DO NOT EDIT — re-run `make gen`.
2
+ // Thin per-group proxy over the global `auth` store. All actual auth
3
+ // wiring lives in `helpers/auth.ts` (one interceptor, one source of
4
+ // truth). DO NOT EDIT — re-run `make gen`.
3
5
 
4
- import { client } from '../client.gen';
5
- import type { StorageAdapter } from '../helpers/storage';
6
- import { LocalStorageAdapter } from '../helpers/storage';
6
+ import { auth } from '../helpers/auth';
7
7
  import { APILogger, type LoggerConfig } from '../helpers/logger';
8
8
 
9
9
 
10
10
 
11
11
 
12
- const ACCESS_KEY = 'cfg.access_token';
13
- const REFRESH_KEY = 'cfg.refresh_token';
14
-
15
-
16
-
17
- /** Auto-detect locale from cookie NEXT_LOCALE or navigator.language. */
18
- function detectLocale(): string | null {
19
- try {
20
- if (typeof document !== 'undefined') {
21
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
22
- if (m) return decodeURIComponent(m[1]);
23
- }
24
- if (typeof navigator !== 'undefined' && navigator.language) {
25
- return navigator.language;
26
- }
27
- } catch {}
28
- return null;
29
- }
30
12
 
31
13
  export interface APIOptions {
32
- /** Override storage backend (LocalStorage by default; Memory for SSR/tests). */
33
- storage?: StorageAdapter;
34
14
  /** Logger config (defaults to dev-only). */
35
15
  logger?: Partial<LoggerConfig>;
36
16
  /** Locale for `Accept-Language`. If omitted, auto-detected from cookie/navigator. */
@@ -42,79 +22,46 @@ export interface APIOptions {
42
22
  }
43
23
 
44
24
  /**
45
- * Self-contained API wrapper for this group.
25
+ * Per-group ergonomic facade.
46
26
  *
47
- * Each group has its own client + interceptor + token store. The interceptor
48
- * automatically attaches:
49
- * - `Authorization: Bearer <jwt>` from storage
50
- * - `Accept-Language` from `opts.locale` or `NEXT_LOCALE` cookie
51
- * - `X-API-Key` from `opts.apiKey` or `NEXT_PUBLIC_API_KEY`
52
- * - `credentials: 'include'` for Django session/CSRF cookies (toggle via opts)
27
+ * Calling `setToken/setApiKey/setLocale/setBaseUrl` proxies to the
28
+ * global `auth` store — the change applies to **every** group's API
29
+ * instance because they share the same HTTP client and interceptor.
30
+ *
31
+ * Use the global `auth` object directly when you don't need a group
32
+ * facade: `import { auth } from '@your/api'; auth.setToken(jwt);`
53
33
  */
54
34
  export class API {
55
- private baseUrl: string;
56
- private storage: StorageAdapter;
57
- private locale: string | null;
58
- private apiKey: string | null;
59
35
  readonly logger: APILogger;
60
36
 
61
37
 
62
38
 
63
- constructor(baseUrl: string, opts: APIOptions = {}) {
64
- this.baseUrl = baseUrl.replace(/\/$/, '');
65
- this.storage = opts.storage ?? new LocalStorageAdapter();
39
+ constructor(_baseUrl?: string, opts: APIOptions = {}) {
66
40
  this.logger = new APILogger(opts.logger);
67
- this.locale = opts.locale ?? null;
68
- this.apiKey = opts.apiKey ?? (typeof process !== 'undefined' ? (process.env?.NEXT_PUBLIC_API_KEY ?? null) : null);
69
-
70
- const credentials: RequestCredentials = (opts.withCredentials ?? true) ? 'include' : 'same-origin';
71
- client.setConfig({ baseUrl: this.baseUrl, credentials });
72
-
73
- client.interceptors.request.use((request) => {
74
- const access = this.getToken();
75
- if (access) request.headers.set('Authorization', `Bearer ${access}`);
76
-
77
- const locale = this.locale ?? detectLocale();
78
- if (locale) request.headers.set('Accept-Language', locale);
79
-
80
- if (this.apiKey) request.headers.set('X-API-Key', this.apiKey);
81
-
82
- return request;
83
- });
84
-
85
-
41
+ if (_baseUrl) auth.setBaseUrl(_baseUrl);
42
+ if (opts.locale !== undefined) auth.setLocale(opts.locale);
43
+ if (opts.apiKey !== undefined) auth.setApiKey(opts.apiKey);
44
+ if (opts.withCredentials !== undefined) auth.setWithCredentials(opts.withCredentials);
86
45
  }
87
46
 
88
47
  // ── Base URL ────────────────────────────────────────────────────────────
89
- getBaseUrl(): string { return this.baseUrl; }
90
- setBaseUrl(url: string): void {
91
- this.baseUrl = url.replace(/\/$/, '');
92
- client.setConfig({ baseUrl: this.baseUrl });
93
- }
48
+ getBaseUrl(): string { return auth.getBaseUrl(); }
49
+ setBaseUrl(url: string): void { auth.setBaseUrl(url); }
94
50
 
95
51
  // ── Tokens ──────────────────────────────────────────────────────────────
96
- getToken(): string | null { return this.storage.getItem(ACCESS_KEY); }
97
- setToken(token: string | null): void {
98
- if (token) this.storage.setItem(ACCESS_KEY, token);
99
- else this.storage.removeItem(ACCESS_KEY);
100
- }
101
- getRefreshToken(): string | null { return this.storage.getItem(REFRESH_KEY); }
102
- setRefreshToken(token: string | null): void {
103
- if (token) this.storage.setItem(REFRESH_KEY, token);
104
- else this.storage.removeItem(REFRESH_KEY);
105
- }
106
- clearToken(): void {
107
- this.storage.removeItem(ACCESS_KEY);
108
- this.storage.removeItem(REFRESH_KEY);
109
- }
110
- isAuthenticated(): boolean { return this.getToken() !== null; }
52
+ getToken(): string | null { return auth.getToken(); }
53
+ setToken(token: string | null): void { auth.setToken(token); }
54
+ getRefreshToken(): string | null { return auth.getRefreshToken(); }
55
+ setRefreshToken(token: string | null): void { auth.setRefreshToken(token); }
56
+ clearToken(): void { auth.clearTokens(); }
57
+ isAuthenticated(): boolean { return auth.isAuthenticated(); }
111
58
 
112
59
  // ── Locale / API key ────────────────────────────────────────────────────
113
- getLocale(): string | null { return this.locale ?? detectLocale(); }
114
- setLocale(locale: string | null): void { this.locale = locale; }
115
- getApiKey(): string | null { return this.apiKey; }
116
- setApiKey(key: string | null): void { this.apiKey = key; }
60
+ getLocale(): string | null { return auth.getLocale(); }
61
+ setLocale(locale: string | null): void { auth.setLocale(locale); }
62
+ getApiKey(): string | null { return auth.getApiKey(); }
63
+ setApiKey(key: string | null): void { auth.setApiKey(key); }
117
64
  }
118
65
 
119
66
  export { };
120
- export { client };
67
+ export { auth };
@@ -1,10 +1,10 @@
1
1
  // AUTO-GENERATED by django_generator / ts_extras.wrapper
2
2
  // Group barrel. DO NOT EDIT — re-run `make gen`.
3
3
 
4
- // Wrapper class + per-group SDK re-exports
5
- export { API, type APIOptions, } from './api';
4
+ // Wrapper class + per-group SDK re-exports + global auth.
5
+ export { API, type APIOptions, auth, } from './api';
6
6
 
7
- // Shared utilities (storage / errors / logger / validation events)
7
+ // Shared utilities.
8
8
  export {
9
9
  type StorageAdapter,
10
10
  LocalStorageAdapter,
@@ -25,5 +25,5 @@ export {
25
25
  type ValidationErrorEvent,
26
26
  } from '../helpers';
27
27
 
28
- // Generated artifacts (Hey API)
28
+ // Generated artifacts (Hey API).
29
29
  export type * from '../types.gen';
@@ -1,36 +1,16 @@
1
1
  // AUTO-GENERATED by django_generator / ts_extras.wrapper
2
- // Self-contained API wrapper for this group. DO NOT EDIT — re-run `make gen`.
2
+ // Thin per-group proxy over the global `auth` store. All actual auth
3
+ // wiring lives in `helpers/auth.ts` (one interceptor, one source of
4
+ // truth). DO NOT EDIT — re-run `make gen`.
3
5
 
4
- import { client } from '../client.gen';
5
- import type { StorageAdapter } from '../helpers/storage';
6
- import { LocalStorageAdapter } from '../helpers/storage';
6
+ import { auth } from '../helpers/auth';
7
7
  import { APILogger, type LoggerConfig } from '../helpers/logger';
8
8
 
9
9
 
10
10
 
11
11
 
12
- const ACCESS_KEY = 'cfg.access_token';
13
- const REFRESH_KEY = 'cfg.refresh_token';
14
-
15
-
16
-
17
- /** Auto-detect locale from cookie NEXT_LOCALE or navigator.language. */
18
- function detectLocale(): string | null {
19
- try {
20
- if (typeof document !== 'undefined') {
21
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
22
- if (m) return decodeURIComponent(m[1]);
23
- }
24
- if (typeof navigator !== 'undefined' && navigator.language) {
25
- return navigator.language;
26
- }
27
- } catch {}
28
- return null;
29
- }
30
12
 
31
13
  export interface APIOptions {
32
- /** Override storage backend (LocalStorage by default; Memory for SSR/tests). */
33
- storage?: StorageAdapter;
34
14
  /** Logger config (defaults to dev-only). */
35
15
  logger?: Partial<LoggerConfig>;
36
16
  /** Locale for `Accept-Language`. If omitted, auto-detected from cookie/navigator. */
@@ -42,79 +22,46 @@ export interface APIOptions {
42
22
  }
43
23
 
44
24
  /**
45
- * Self-contained API wrapper for this group.
25
+ * Per-group ergonomic facade.
46
26
  *
47
- * Each group has its own client + interceptor + token store. The interceptor
48
- * automatically attaches:
49
- * - `Authorization: Bearer <jwt>` from storage
50
- * - `Accept-Language` from `opts.locale` or `NEXT_LOCALE` cookie
51
- * - `X-API-Key` from `opts.apiKey` or `NEXT_PUBLIC_API_KEY`
52
- * - `credentials: 'include'` for Django session/CSRF cookies (toggle via opts)
27
+ * Calling `setToken/setApiKey/setLocale/setBaseUrl` proxies to the
28
+ * global `auth` store — the change applies to **every** group's API
29
+ * instance because they share the same HTTP client and interceptor.
30
+ *
31
+ * Use the global `auth` object directly when you don't need a group
32
+ * facade: `import { auth } from '@your/api'; auth.setToken(jwt);`
53
33
  */
54
34
  export class API {
55
- private baseUrl: string;
56
- private storage: StorageAdapter;
57
- private locale: string | null;
58
- private apiKey: string | null;
59
35
  readonly logger: APILogger;
60
36
 
61
37
 
62
38
 
63
- constructor(baseUrl: string, opts: APIOptions = {}) {
64
- this.baseUrl = baseUrl.replace(/\/$/, '');
65
- this.storage = opts.storage ?? new LocalStorageAdapter();
39
+ constructor(_baseUrl?: string, opts: APIOptions = {}) {
66
40
  this.logger = new APILogger(opts.logger);
67
- this.locale = opts.locale ?? null;
68
- this.apiKey = opts.apiKey ?? (typeof process !== 'undefined' ? (process.env?.NEXT_PUBLIC_API_KEY ?? null) : null);
69
-
70
- const credentials: RequestCredentials = (opts.withCredentials ?? true) ? 'include' : 'same-origin';
71
- client.setConfig({ baseUrl: this.baseUrl, credentials });
72
-
73
- client.interceptors.request.use((request) => {
74
- const access = this.getToken();
75
- if (access) request.headers.set('Authorization', `Bearer ${access}`);
76
-
77
- const locale = this.locale ?? detectLocale();
78
- if (locale) request.headers.set('Accept-Language', locale);
79
-
80
- if (this.apiKey) request.headers.set('X-API-Key', this.apiKey);
81
-
82
- return request;
83
- });
84
-
85
-
41
+ if (_baseUrl) auth.setBaseUrl(_baseUrl);
42
+ if (opts.locale !== undefined) auth.setLocale(opts.locale);
43
+ if (opts.apiKey !== undefined) auth.setApiKey(opts.apiKey);
44
+ if (opts.withCredentials !== undefined) auth.setWithCredentials(opts.withCredentials);
86
45
  }
87
46
 
88
47
  // ── Base URL ────────────────────────────────────────────────────────────
89
- getBaseUrl(): string { return this.baseUrl; }
90
- setBaseUrl(url: string): void {
91
- this.baseUrl = url.replace(/\/$/, '');
92
- client.setConfig({ baseUrl: this.baseUrl });
93
- }
48
+ getBaseUrl(): string { return auth.getBaseUrl(); }
49
+ setBaseUrl(url: string): void { auth.setBaseUrl(url); }
94
50
 
95
51
  // ── Tokens ──────────────────────────────────────────────────────────────
96
- getToken(): string | null { return this.storage.getItem(ACCESS_KEY); }
97
- setToken(token: string | null): void {
98
- if (token) this.storage.setItem(ACCESS_KEY, token);
99
- else this.storage.removeItem(ACCESS_KEY);
100
- }
101
- getRefreshToken(): string | null { return this.storage.getItem(REFRESH_KEY); }
102
- setRefreshToken(token: string | null): void {
103
- if (token) this.storage.setItem(REFRESH_KEY, token);
104
- else this.storage.removeItem(REFRESH_KEY);
105
- }
106
- clearToken(): void {
107
- this.storage.removeItem(ACCESS_KEY);
108
- this.storage.removeItem(REFRESH_KEY);
109
- }
110
- isAuthenticated(): boolean { return this.getToken() !== null; }
52
+ getToken(): string | null { return auth.getToken(); }
53
+ setToken(token: string | null): void { auth.setToken(token); }
54
+ getRefreshToken(): string | null { return auth.getRefreshToken(); }
55
+ setRefreshToken(token: string | null): void { auth.setRefreshToken(token); }
56
+ clearToken(): void { auth.clearTokens(); }
57
+ isAuthenticated(): boolean { return auth.isAuthenticated(); }
111
58
 
112
59
  // ── Locale / API key ────────────────────────────────────────────────────
113
- getLocale(): string | null { return this.locale ?? detectLocale(); }
114
- setLocale(locale: string | null): void { this.locale = locale; }
115
- getApiKey(): string | null { return this.apiKey; }
116
- setApiKey(key: string | null): void { this.apiKey = key; }
60
+ getLocale(): string | null { return auth.getLocale(); }
61
+ setLocale(locale: string | null): void { auth.setLocale(locale); }
62
+ getApiKey(): string | null { return auth.getApiKey(); }
63
+ setApiKey(key: string | null): void { auth.setApiKey(key); }
117
64
  }
118
65
 
119
66
  export { };
120
- export { client };
67
+ export { auth };
@@ -1,10 +1,10 @@
1
1
  // AUTO-GENERATED by django_generator / ts_extras.wrapper
2
2
  // Group barrel. DO NOT EDIT — re-run `make gen`.
3
3
 
4
- // Wrapper class + per-group SDK re-exports
5
- export { API, type APIOptions, } from './api';
4
+ // Wrapper class + per-group SDK re-exports + global auth.
5
+ export { API, type APIOptions, auth, } from './api';
6
6
 
7
- // Shared utilities (storage / errors / logger / validation events)
7
+ // Shared utilities.
8
8
  export {
9
9
  type StorageAdapter,
10
10
  LocalStorageAdapter,
@@ -25,5 +25,5 @@ export {
25
25
  type ValidationErrorEvent,
26
26
  } from '../helpers';
27
27
 
28
- // Generated artifacts (Hey API)
28
+ // Generated artifacts (Hey API).
29
29
  export type * from '../types.gen';
@@ -1,36 +1,16 @@
1
1
  // AUTO-GENERATED by django_generator / ts_extras.wrapper
2
- // Self-contained API wrapper for this group. DO NOT EDIT — re-run `make gen`.
2
+ // Thin per-group proxy over the global `auth` store. All actual auth
3
+ // wiring lives in `helpers/auth.ts` (one interceptor, one source of
4
+ // truth). DO NOT EDIT — re-run `make gen`.
3
5
 
4
- import { client } from '../client.gen';
5
- import type { StorageAdapter } from '../helpers/storage';
6
- import { LocalStorageAdapter } from '../helpers/storage';
6
+ import { auth } from '../helpers/auth';
7
7
  import { APILogger, type LoggerConfig } from '../helpers/logger';
8
8
 
9
9
 
10
10
 
11
11
 
12
- const ACCESS_KEY = 'cfg.access_token';
13
- const REFRESH_KEY = 'cfg.refresh_token';
14
-
15
-
16
-
17
- /** Auto-detect locale from cookie NEXT_LOCALE or navigator.language. */
18
- function detectLocale(): string | null {
19
- try {
20
- if (typeof document !== 'undefined') {
21
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
22
- if (m) return decodeURIComponent(m[1]);
23
- }
24
- if (typeof navigator !== 'undefined' && navigator.language) {
25
- return navigator.language;
26
- }
27
- } catch {}
28
- return null;
29
- }
30
12
 
31
13
  export interface APIOptions {
32
- /** Override storage backend (LocalStorage by default; Memory for SSR/tests). */
33
- storage?: StorageAdapter;
34
14
  /** Logger config (defaults to dev-only). */
35
15
  logger?: Partial<LoggerConfig>;
36
16
  /** Locale for `Accept-Language`. If omitted, auto-detected from cookie/navigator. */
@@ -42,79 +22,46 @@ export interface APIOptions {
42
22
  }
43
23
 
44
24
  /**
45
- * Self-contained API wrapper for this group.
25
+ * Per-group ergonomic facade.
46
26
  *
47
- * Each group has its own client + interceptor + token store. The interceptor
48
- * automatically attaches:
49
- * - `Authorization: Bearer <jwt>` from storage
50
- * - `Accept-Language` from `opts.locale` or `NEXT_LOCALE` cookie
51
- * - `X-API-Key` from `opts.apiKey` or `NEXT_PUBLIC_API_KEY`
52
- * - `credentials: 'include'` for Django session/CSRF cookies (toggle via opts)
27
+ * Calling `setToken/setApiKey/setLocale/setBaseUrl` proxies to the
28
+ * global `auth` store — the change applies to **every** group's API
29
+ * instance because they share the same HTTP client and interceptor.
30
+ *
31
+ * Use the global `auth` object directly when you don't need a group
32
+ * facade: `import { auth } from '@your/api'; auth.setToken(jwt);`
53
33
  */
54
34
  export class API {
55
- private baseUrl: string;
56
- private storage: StorageAdapter;
57
- private locale: string | null;
58
- private apiKey: string | null;
59
35
  readonly logger: APILogger;
60
36
 
61
37
 
62
38
 
63
- constructor(baseUrl: string, opts: APIOptions = {}) {
64
- this.baseUrl = baseUrl.replace(/\/$/, '');
65
- this.storage = opts.storage ?? new LocalStorageAdapter();
39
+ constructor(_baseUrl?: string, opts: APIOptions = {}) {
66
40
  this.logger = new APILogger(opts.logger);
67
- this.locale = opts.locale ?? null;
68
- this.apiKey = opts.apiKey ?? (typeof process !== 'undefined' ? (process.env?.NEXT_PUBLIC_API_KEY ?? null) : null);
69
-
70
- const credentials: RequestCredentials = (opts.withCredentials ?? true) ? 'include' : 'same-origin';
71
- client.setConfig({ baseUrl: this.baseUrl, credentials });
72
-
73
- client.interceptors.request.use((request) => {
74
- const access = this.getToken();
75
- if (access) request.headers.set('Authorization', `Bearer ${access}`);
76
-
77
- const locale = this.locale ?? detectLocale();
78
- if (locale) request.headers.set('Accept-Language', locale);
79
-
80
- if (this.apiKey) request.headers.set('X-API-Key', this.apiKey);
81
-
82
- return request;
83
- });
84
-
85
-
41
+ if (_baseUrl) auth.setBaseUrl(_baseUrl);
42
+ if (opts.locale !== undefined) auth.setLocale(opts.locale);
43
+ if (opts.apiKey !== undefined) auth.setApiKey(opts.apiKey);
44
+ if (opts.withCredentials !== undefined) auth.setWithCredentials(opts.withCredentials);
86
45
  }
87
46
 
88
47
  // ── Base URL ────────────────────────────────────────────────────────────
89
- getBaseUrl(): string { return this.baseUrl; }
90
- setBaseUrl(url: string): void {
91
- this.baseUrl = url.replace(/\/$/, '');
92
- client.setConfig({ baseUrl: this.baseUrl });
93
- }
48
+ getBaseUrl(): string { return auth.getBaseUrl(); }
49
+ setBaseUrl(url: string): void { auth.setBaseUrl(url); }
94
50
 
95
51
  // ── Tokens ──────────────────────────────────────────────────────────────
96
- getToken(): string | null { return this.storage.getItem(ACCESS_KEY); }
97
- setToken(token: string | null): void {
98
- if (token) this.storage.setItem(ACCESS_KEY, token);
99
- else this.storage.removeItem(ACCESS_KEY);
100
- }
101
- getRefreshToken(): string | null { return this.storage.getItem(REFRESH_KEY); }
102
- setRefreshToken(token: string | null): void {
103
- if (token) this.storage.setItem(REFRESH_KEY, token);
104
- else this.storage.removeItem(REFRESH_KEY);
105
- }
106
- clearToken(): void {
107
- this.storage.removeItem(ACCESS_KEY);
108
- this.storage.removeItem(REFRESH_KEY);
109
- }
110
- isAuthenticated(): boolean { return this.getToken() !== null; }
52
+ getToken(): string | null { return auth.getToken(); }
53
+ setToken(token: string | null): void { auth.setToken(token); }
54
+ getRefreshToken(): string | null { return auth.getRefreshToken(); }
55
+ setRefreshToken(token: string | null): void { auth.setRefreshToken(token); }
56
+ clearToken(): void { auth.clearTokens(); }
57
+ isAuthenticated(): boolean { return auth.isAuthenticated(); }
111
58
 
112
59
  // ── Locale / API key ────────────────────────────────────────────────────
113
- getLocale(): string | null { return this.locale ?? detectLocale(); }
114
- setLocale(locale: string | null): void { this.locale = locale; }
115
- getApiKey(): string | null { return this.apiKey; }
116
- setApiKey(key: string | null): void { this.apiKey = key; }
60
+ getLocale(): string | null { return auth.getLocale(); }
61
+ setLocale(locale: string | null): void { auth.setLocale(locale); }
62
+ getApiKey(): string | null { return auth.getApiKey(); }
63
+ setApiKey(key: string | null): void { auth.setApiKey(key); }
117
64
  }
118
65
 
119
66
  export { };
120
- export { client };
67
+ export { auth };
@@ -1,10 +1,10 @@
1
1
  // AUTO-GENERATED by django_generator / ts_extras.wrapper
2
2
  // Group barrel. DO NOT EDIT — re-run `make gen`.
3
3
 
4
- // Wrapper class + per-group SDK re-exports
5
- export { API, type APIOptions, } from './api';
4
+ // Wrapper class + per-group SDK re-exports + global auth.
5
+ export { API, type APIOptions, auth, } from './api';
6
6
 
7
- // Shared utilities (storage / errors / logger / validation events)
7
+ // Shared utilities.
8
8
  export {
9
9
  type StorageAdapter,
10
10
  LocalStorageAdapter,
@@ -25,5 +25,5 @@ export {
25
25
  type ValidationErrorEvent,
26
26
  } from '../helpers';
27
27
 
28
- // Generated artifacts (Hey API)
28
+ // Generated artifacts (Hey API).
29
29
  export type * from '../types.gen';
@@ -14,3 +14,6 @@ import type { ClientOptions as ClientOptions2 } from './types.gen';
14
14
  export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
15
15
 
16
16
  export const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'http://localhost:8000' }));
17
+
18
+ // auto-init: load auth interceptor
19
+ import './helpers/auth';