@djangocfg/api 1.2.5 → 1.2.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.
Files changed (74) hide show
  1. package/dist/index.cjs +3407 -1386
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +2418 -409
  4. package/dist/index.d.ts +2418 -409
  5. package/dist/index.mjs +3309 -1304
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/contexts/TasksContext.tsx +242 -0
  9. package/src/cfg/contexts/index.ts +3 -0
  10. package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +2 -2
  11. package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -1
  12. package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -6
  13. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +62 -0
  14. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +12 -12
  15. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +25 -25
  16. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +8 -8
  17. package/src/cfg/generated/_utils/fetchers/cfg__dashboard.ts +150 -0
  18. package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +30 -1
  19. package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -2
  20. package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +57 -57
  21. package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -6
  22. package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -1
  23. package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -3
  24. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -1
  25. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -6
  26. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -1
  27. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -2
  28. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -3
  29. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -1
  30. package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +8 -8
  31. package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -12
  32. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -10
  33. package/src/cfg/generated/_utils/fetchers/index.ts +2 -0
  34. package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +49 -0
  35. package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +20 -20
  36. package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +137 -0
  37. package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +29 -0
  38. package/src/cfg/generated/_utils/hooks/index.ts +2 -0
  39. package/src/cfg/generated/_utils/schemas/ActivityEntry.schema.ts +25 -0
  40. package/src/cfg/generated/_utils/schemas/AppStatistics.schema.ts +20 -0
  41. package/src/cfg/generated/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +1 -1
  42. package/src/cfg/generated/_utils/schemas/CentrifugoClientInfo.schema.ts +2 -2
  43. package/src/cfg/generated/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +2 -2
  44. package/src/cfg/generated/_utils/schemas/CentrifugoPublication.schema.ts +1 -1
  45. package/src/cfg/generated/_utils/schemas/ChannelStatsSerializer.schema.ts +1 -0
  46. package/src/cfg/generated/_utils/schemas/DashboardOverview.schema.ts +27 -0
  47. package/src/cfg/generated/_utils/schemas/ManualAckResponse.schema.ts +1 -1
  48. package/src/cfg/generated/_utils/schemas/PublishTestResponse.schema.ts +1 -1
  49. package/src/cfg/generated/_utils/schemas/QuickAction.schema.ts +29 -0
  50. package/src/cfg/generated/_utils/schemas/RecentPublishes.schema.ts +2 -0
  51. package/src/cfg/generated/_utils/schemas/StatCard.schema.ts +30 -0
  52. package/src/cfg/generated/_utils/schemas/SystemHealth.schema.ts +24 -0
  53. package/src/cfg/generated/_utils/schemas/SystemHealthItem.schema.ts +28 -0
  54. package/src/cfg/generated/_utils/schemas/SystemMetrics.schema.ts +25 -0
  55. package/src/cfg/generated/_utils/schemas/URLPattern.schema.ts +26 -0
  56. package/src/cfg/generated/_utils/schemas/URLsList.schema.ts +25 -0
  57. package/src/cfg/generated/_utils/schemas/UserStatistics.schema.ts +22 -0
  58. package/src/cfg/generated/_utils/schemas/index.ts +11 -0
  59. package/src/cfg/generated/cfg__centrifugo/client.ts +30 -0
  60. package/src/cfg/generated/cfg__centrifugo/index.ts +2 -0
  61. package/src/cfg/generated/cfg__centrifugo/models.ts +0 -0
  62. package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +6 -6
  63. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +32 -32
  64. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +18 -12
  65. package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +2 -2
  66. package/src/cfg/generated/cfg__dashboard/client.ts +106 -0
  67. package/src/cfg/generated/cfg__dashboard/index.ts +2 -0
  68. package/src/cfg/generated/cfg__dashboard/models.ts +108 -0
  69. package/src/cfg/generated/cfg__endpoints/client.ts +16 -0
  70. package/src/cfg/generated/cfg__endpoints/models.ts +44 -0
  71. package/src/cfg/generated/client.ts +6 -0
  72. package/src/cfg/generated/enums.ts +56 -0
  73. package/src/cfg/generated/index.ts +17 -10
  74. package/src/cfg/generated/schema.ts +1546 -127
@@ -57,7 +57,7 @@ export interface PublishTestResponse {
57
57
  /** Whether message was delivered */
58
58
  delivered?: boolean;
59
59
  /** Error message if failed */
60
- error?: string;
60
+ error?: string | null;
61
61
  }
62
62
 
63
63
  /**
@@ -83,6 +83,6 @@ export interface ManualAckResponse {
83
83
  /** Message ID that was acknowledged */
84
84
  message_id: string;
85
85
  /** Error message if failed */
86
- error?: string;
86
+ error?: string | null;
87
87
  }
88
88
 
@@ -0,0 +1,106 @@
1
+ import * as Models from "./models";
2
+
3
+
4
+ /**
5
+ * API endpoints for Dashboard.
6
+ */
7
+ export class CfgDashboard {
8
+ private client: any;
9
+
10
+ constructor(client: any) {
11
+ this.client = client;
12
+ }
13
+
14
+ /**
15
+ * Get quick actions
16
+ *
17
+ * Retrieve quick action buttons for dashboard
18
+ */
19
+ async apiActivityActionsList(): Promise<any> {
20
+ const response = await this.client.request('GET', "/cfg/dashboard/api/activity/actions/");
21
+ return response;
22
+ }
23
+
24
+ async apiActivityRecentList(limit?: number): Promise<any>;
25
+ async apiActivityRecentList(params?: { limit?: number }): Promise<any>;
26
+
27
+ /**
28
+ * Get recent activity
29
+ *
30
+ * Retrieve recent system activity entries
31
+ */
32
+ async apiActivityRecentList(...args: any[]): Promise<any> {
33
+ const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
34
+
35
+ let params;
36
+ if (isParamsObject) {
37
+ params = args[0];
38
+ } else {
39
+ params = { limit: args[0] };
40
+ }
41
+ const response = await this.client.request('GET', "/cfg/dashboard/api/activity/recent/", { params });
42
+ return response;
43
+ }
44
+
45
+ /**
46
+ * Get dashboard overview
47
+ *
48
+ * Retrieve complete dashboard data including stats, health, actions, and
49
+ * metrics
50
+ */
51
+ async apiOverviewOverviewRetrieve(): Promise<Models.DashboardOverview> {
52
+ const response = await this.client.request('GET', "/cfg/dashboard/api/overview/overview/");
53
+ return response;
54
+ }
55
+
56
+ /**
57
+ * Get application statistics
58
+ *
59
+ * Retrieve statistics for all enabled django-cfg applications
60
+ */
61
+ async apiStatisticsAppsList(): Promise<any> {
62
+ const response = await this.client.request('GET', "/cfg/dashboard/api/statistics/apps/");
63
+ return response;
64
+ }
65
+
66
+ /**
67
+ * Get statistics cards
68
+ *
69
+ * Retrieve dashboard statistics cards with key metrics
70
+ */
71
+ async apiStatisticsCardsList(): Promise<any> {
72
+ const response = await this.client.request('GET', "/cfg/dashboard/api/statistics/cards/");
73
+ return response;
74
+ }
75
+
76
+ /**
77
+ * Get user statistics
78
+ *
79
+ * Retrieve user-related statistics
80
+ */
81
+ async apiStatisticsUsersRetrieve(): Promise<Models.UserStatistics> {
82
+ const response = await this.client.request('GET', "/cfg/dashboard/api/statistics/users/");
83
+ return response;
84
+ }
85
+
86
+ /**
87
+ * Get system health status
88
+ *
89
+ * Retrieve overall system health including all component checks
90
+ */
91
+ async apiSystemHealthRetrieve(): Promise<Models.SystemHealth> {
92
+ const response = await this.client.request('GET', "/cfg/dashboard/api/system/health/");
93
+ return response;
94
+ }
95
+
96
+ /**
97
+ * Get system metrics
98
+ *
99
+ * Retrieve system performance metrics (CPU, memory, disk, etc.)
100
+ */
101
+ async apiSystemMetricsRetrieve(): Promise<Models.SystemMetrics> {
102
+ const response = await this.client.request('GET', "/cfg/dashboard/api/system/metrics/");
103
+ return response;
104
+ }
105
+
106
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./client";
2
+ export * as Models from "./models";
@@ -0,0 +1,108 @@
1
+ import * as Enums from "../enums";
2
+
3
+ /**
4
+ * Main serializer for dashboard overview endpoint. Uses DictField to avoid
5
+ * allOf generation in OpenAPI.
6
+ *
7
+ * Response model (includes read-only fields).
8
+ */
9
+ export interface DashboardOverview {
10
+ /** Dashboard statistics cards */
11
+ stat_cards: Array<Record<string, any>>;
12
+ /** System health status */
13
+ system_health: Array<Record<string, any>>;
14
+ /** Quick action buttons */
15
+ quick_actions: Array<Record<string, any>>;
16
+ /** Recent activity entries */
17
+ recent_activity: Array<Record<string, any>>;
18
+ /** System performance metrics */
19
+ system_metrics: Record<string, any>;
20
+ /** User statistics */
21
+ user_statistics: Record<string, any>;
22
+ /** Data timestamp (ISO format) */
23
+ timestamp: string;
24
+ }
25
+
26
+ /**
27
+ * Serializer for user statistics.
28
+ *
29
+ * Response model (includes read-only fields).
30
+ */
31
+ export interface UserStatistics {
32
+ /** Total number of users */
33
+ total_users: number;
34
+ /** Active users (last 30 days) */
35
+ active_users: number;
36
+ /** New users (last 7 days) */
37
+ new_users: number;
38
+ /** Number of superusers */
39
+ superusers: number;
40
+ }
41
+
42
+ /**
43
+ * Serializer for overall system health status.
44
+ *
45
+ * Response model (includes read-only fields).
46
+ */
47
+ export interface SystemHealth {
48
+ /** Overall system health status
49
+
50
+ * `healthy` - healthy
51
+ * `warning` - warning
52
+ * `error` - error
53
+ * `unknown` - unknown */
54
+ overall_status: Enums.SystemHealthOverallStatus;
55
+ /** Overall health percentage */
56
+ overall_health_percentage: number;
57
+ /** Health status of individual components */
58
+ components: Array<SystemHealthItem>;
59
+ /** Check timestamp (ISO format) */
60
+ timestamp: string;
61
+ }
62
+
63
+ /**
64
+ * Serializer for system performance metrics.
65
+ *
66
+ * Response model (includes read-only fields).
67
+ */
68
+ export interface SystemMetrics {
69
+ /** CPU usage percentage */
70
+ cpu_usage: number;
71
+ /** Memory usage percentage */
72
+ memory_usage: number;
73
+ /** Disk usage percentage */
74
+ disk_usage: number;
75
+ /** Network incoming bandwidth */
76
+ network_in: string;
77
+ /** Network outgoing bandwidth */
78
+ network_out: string;
79
+ /** Average response time */
80
+ response_time: string;
81
+ /** System uptime */
82
+ uptime: string;
83
+ }
84
+
85
+ /**
86
+ * Serializer for system health status items. Maps to SystemHealthItem Pydantic
87
+ * model.
88
+ *
89
+ * Response model (includes read-only fields).
90
+ */
91
+ export interface SystemHealthItem {
92
+ /** Component name */
93
+ component: string;
94
+ /** Health status
95
+
96
+ * `healthy` - healthy
97
+ * `warning` - warning
98
+ * `error` - error
99
+ * `unknown` - unknown */
100
+ status: Enums.SystemHealthItemStatus;
101
+ /** Status description */
102
+ description: string;
103
+ /** Last check time (ISO format) */
104
+ last_check: string;
105
+ /** Health percentage (0-100) */
106
+ health_percentage?: number | null;
107
+ }
108
+
@@ -19,4 +19,20 @@ export class CfgEndpoints {
19
19
  return response;
20
20
  }
21
21
 
22
+ /**
23
+ * Return all registered URLs.
24
+ */
25
+ async urlsRetrieve(): Promise<Models.URLsList[]> {
26
+ const response = await this.client.request('GET', "/cfg/endpoints/urls/");
27
+ return (response as any).results || [];
28
+ }
29
+
30
+ /**
31
+ * Return compact URL list.
32
+ */
33
+ async urlsCompactRetrieve(): Promise<any> {
34
+ const response = await this.client.request('GET', "/cfg/endpoints/urls/compact/");
35
+ return response;
36
+ }
37
+
22
38
  }
@@ -24,6 +24,26 @@ export interface EndpointsStatus {
24
24
  endpoints: Array<Endpoint>;
25
25
  }
26
26
 
27
+ /**
28
+ * Serializer for URLs list response.
29
+ *
30
+ * Response model (includes read-only fields).
31
+ */
32
+ export interface URLsList {
33
+ /** Status: success or error */
34
+ status: string;
35
+ /** Service name */
36
+ service: string;
37
+ /** Django-CFG version */
38
+ version: string;
39
+ /** Base URL of the service */
40
+ base_url: string;
41
+ /** Total number of registered URLs */
42
+ total_urls: number;
43
+ /** List of all registered URL patterns */
44
+ urls: Array<URLPattern>;
45
+ }
46
+
27
47
  /**
28
48
  * Serializer for single endpoint status.
29
49
  *
@@ -66,3 +86,27 @@ export interface Endpoint {
66
86
  rate_limited?: boolean;
67
87
  }
68
88
 
89
+ /**
90
+ * Serializer for single URL pattern.
91
+ *
92
+ * Response model (includes read-only fields).
93
+ */
94
+ export interface URLPattern {
95
+ /** URL pattern (e.g., ^api/users/(?P<pk>[^/.]+)/$) */
96
+ pattern: string;
97
+ /** URL name (if defined) */
98
+ name?: string | null;
99
+ /** Full URL name with namespace (e.g., admin:index) */
100
+ full_name?: string | null;
101
+ /** URL namespace */
102
+ namespace?: string | null;
103
+ /** View function/class name */
104
+ view?: string | null;
105
+ /** View class name (for CBV/ViewSets) */
106
+ view_class?: string | null;
107
+ /** Allowed HTTP methods */
108
+ methods?: Array<string>;
109
+ /** View module path */
110
+ module?: string | null;
111
+ }
112
+
@@ -11,6 +11,8 @@ import { CfgSubscriptions } from "./cfg__newsletter__subscriptions";
11
11
  import { CfgTesting } from "./cfg__newsletter__testing";
12
12
  import { CfgUserProfile } from "./cfg__accounts__user_profile";
13
13
  import { CfgAccounts } from "./cfg__accounts";
14
+ import { CfgCentrifugo } from "./cfg__centrifugo";
15
+ import { CfgDashboard } from "./cfg__dashboard";
14
16
  import { CfgEndpoints } from "./cfg__endpoints";
15
17
  import { CfgHealth } from "./cfg__health";
16
18
  import { CfgKnowbase } from "./cfg__knowbase";
@@ -60,6 +62,8 @@ export class APIClient {
60
62
  public cfg_testing: CfgTesting;
61
63
  public cfg_user_profile: CfgUserProfile;
62
64
  public cfg_accounts: CfgAccounts;
65
+ public cfg_centrifugo: CfgCentrifugo;
66
+ public cfg_dashboard: CfgDashboard;
63
67
  public cfg_endpoints: CfgEndpoints;
64
68
  public cfg_health: CfgHealth;
65
69
  public cfg_knowbase: CfgKnowbase;
@@ -104,6 +108,8 @@ export class APIClient {
104
108
  this.cfg_testing = new CfgTesting(this);
105
109
  this.cfg_user_profile = new CfgUserProfile(this);
106
110
  this.cfg_accounts = new CfgAccounts(this);
111
+ this.cfg_centrifugo = new CfgCentrifugo(this);
112
+ this.cfg_dashboard = new CfgDashboard(this);
107
113
  this.cfg_endpoints = new CfgEndpoints(this);
108
114
  this.cfg_health = new CfgHealth(this);
109
115
  this.cfg_knowbase = new CfgKnowbase(this);
@@ -419,6 +419,62 @@ export enum QueueActionRequestAction {
419
419
  FLUSH = "flush",
420
420
  }
421
421
 
422
+ /**
423
+ * Button color theme
424
+ * * `primary` - primary
425
+ * * `success` - success
426
+ * * `warning` - warning
427
+ * * `danger` - danger
428
+ * * `secondary` - secondary
429
+ */
430
+ export enum QuickActionColor {
431
+ PRIMARY = "primary",
432
+ SUCCESS = "success",
433
+ WARNING = "warning",
434
+ DANGER = "danger",
435
+ SECONDARY = "secondary",
436
+ }
437
+
438
+ /**
439
+ * Change type
440
+ * * `positive` - positive
441
+ * * `negative` - negative
442
+ * * `neutral` - neutral
443
+ */
444
+ export enum StatCardChangeType {
445
+ POSITIVE = "positive",
446
+ NEGATIVE = "negative",
447
+ NEUTRAL = "neutral",
448
+ }
449
+
450
+ /**
451
+ * Overall system health status
452
+ * * `healthy` - healthy
453
+ * * `warning` - warning
454
+ * * `error` - error
455
+ * * `unknown` - unknown
456
+ */
457
+ export enum SystemHealthOverallStatus {
458
+ HEALTHY = "healthy",
459
+ WARNING = "warning",
460
+ ERROR = "error",
461
+ UNKNOWN = "unknown",
462
+ }
463
+
464
+ /**
465
+ * Health status
466
+ * * `healthy` - healthy
467
+ * * `warning` - warning
468
+ * * `error` - error
469
+ * * `unknown` - unknown
470
+ */
471
+ export enum SystemHealthItemStatus {
472
+ HEALTHY = "healthy",
473
+ WARNING = "warning",
474
+ ERROR = "error",
475
+ UNKNOWN = "unknown",
476
+ }
477
+
422
478
  /**
423
479
  * * `open` - Open
424
480
  * * `waiting_for_user` - Waiting for User
@@ -56,6 +56,8 @@ import { CfgSubscriptions } from "./cfg__newsletter__subscriptions/client";
56
56
  import { CfgTesting } from "./cfg__newsletter__testing/client";
57
57
  import { CfgUserProfile } from "./cfg__accounts__user_profile/client";
58
58
  import { CfgAccounts } from "./cfg__accounts/client";
59
+ import { CfgCentrifugo } from "./cfg__centrifugo/client";
60
+ import { CfgDashboard } from "./cfg__dashboard/client";
59
61
  import { CfgEndpoints } from "./cfg__endpoints/client";
60
62
  import { CfgHealth } from "./cfg__health/client";
61
63
  import { CfgKnowbase } from "./cfg__knowbase/client";
@@ -77,6 +79,8 @@ export * as CfgSubscriptionsTypes from "./cfg__newsletter__subscriptions/models"
77
79
  export * as CfgTestingTypes from "./cfg__newsletter__testing/models";
78
80
  export * as CfgUserProfileTypes from "./cfg__accounts__user_profile/models";
79
81
  export * as CfgAccountsTypes from "./cfg__accounts/models";
82
+ export * as CfgCentrifugoTypes from "./cfg__centrifugo/models";
83
+ export * as CfgDashboardTypes from "./cfg__dashboard/models";
80
84
  export * as CfgEndpointsTypes from "./cfg__endpoints/models";
81
85
  export * as CfgHealthTypes from "./cfg__health/models";
82
86
  export * as CfgKnowbaseTypes from "./cfg__knowbase/models";
@@ -166,6 +170,8 @@ export class API {
166
170
  public cfg_testing!: CfgTesting;
167
171
  public cfg_user_profile!: CfgUserProfile;
168
172
  public cfg_accounts!: CfgAccounts;
173
+ public cfg_centrifugo!: CfgCentrifugo;
174
+ public cfg_dashboard!: CfgDashboard;
169
175
  public cfg_endpoints!: CfgEndpoints;
170
176
  public cfg_health!: CfgHealth;
171
177
  public cfg_knowbase!: CfgKnowbase;
@@ -193,10 +199,8 @@ export class API {
193
199
  loggerConfig: this.options?.loggerConfig,
194
200
  });
195
201
 
196
- // Inject Authorization header if token exists
197
- if (this._token) {
198
- this._injectAuthHeader();
199
- }
202
+ // Always inject auth header wrapper (reads token dynamically from storage)
203
+ this._injectAuthHeader();
200
204
 
201
205
  // Initialize sub-clients from APIClient
202
206
  this.cfg_auth = this._client.cfg_auth;
@@ -212,6 +216,8 @@ export class API {
212
216
  this.cfg_testing = this._client.cfg_testing;
213
217
  this.cfg_user_profile = this._client.cfg_user_profile;
214
218
  this.cfg_accounts = this._client.cfg_accounts;
219
+ this.cfg_centrifugo = this._client.cfg_centrifugo;
220
+ this.cfg_dashboard = this._client.cfg_dashboard;
215
221
  this.cfg_endpoints = this._client.cfg_endpoints;
216
222
  this.cfg_health = this._client.cfg_health;
217
223
  this.cfg_knowbase = this._client.cfg_knowbase;
@@ -233,10 +239,8 @@ export class API {
233
239
  loggerConfig: this.options?.loggerConfig,
234
240
  });
235
241
 
236
- // Inject Authorization header if token exists
237
- if (this._token) {
238
- this._injectAuthHeader();
239
- }
242
+ // Always inject auth header wrapper (reads token dynamically from storage)
243
+ this._injectAuthHeader();
240
244
 
241
245
  // Reinitialize sub-clients
242
246
  this.cfg_auth = this._client.cfg_auth;
@@ -252,6 +256,8 @@ export class API {
252
256
  this.cfg_testing = this._client.cfg_testing;
253
257
  this.cfg_user_profile = this._client.cfg_user_profile;
254
258
  this.cfg_accounts = this._client.cfg_accounts;
259
+ this.cfg_centrifugo = this._client.cfg_centrifugo;
260
+ this.cfg_dashboard = this._client.cfg_dashboard;
255
261
  this.cfg_endpoints = this._client.cfg_endpoints;
256
262
  this.cfg_health = this._client.cfg_health;
257
263
  this.cfg_knowbase = this._client.cfg_knowbase;
@@ -270,12 +276,13 @@ export class API {
270
276
  path: string,
271
277
  options?: { params?: Record<string, any>; body?: any; formData?: FormData; headers?: Record<string, string> }
272
278
  ): Promise<T> => {
273
- // Merge Authorization header with existing headers
279
+ // Read token from storage dynamically (supports JWT injection after instantiation)
280
+ const token = this.getToken();
274
281
  const mergedOptions = {
275
282
  ...options,
276
283
  headers: {
277
284
  ...(options?.headers || {}),
278
- ...(this._token ? { 'Authorization': `Bearer ${this._token}` } : {}),
285
+ ...(token ? { 'Authorization': `Bearer ${token}` } : {}),
279
286
  },
280
287
  };
281
288