@djangocfg/api 2.1.261 → 2.1.263

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 (43) hide show
  1. package/dist/auth-server.cjs +9 -0
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +9 -0
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +27 -0
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.mjs +27 -0
  8. package/dist/auth.mjs.map +1 -1
  9. package/dist/clients.cjs +65 -1
  10. package/dist/clients.cjs.map +1 -1
  11. package/dist/clients.d.cts +145 -122
  12. package/dist/clients.d.ts +145 -122
  13. package/dist/clients.mjs +65 -1
  14. package/dist/clients.mjs.map +1 -1
  15. package/dist/hooks.cjs +47 -1
  16. package/dist/hooks.cjs.map +1 -1
  17. package/dist/hooks.d.cts +91 -68
  18. package/dist/hooks.d.ts +91 -68
  19. package/dist/hooks.mjs +47 -1
  20. package/dist/hooks.mjs.map +1 -1
  21. package/dist/index.cjs +56 -1
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +89 -89
  24. package/dist/index.d.ts +89 -89
  25. package/dist/index.mjs +56 -1
  26. package/dist/index.mjs.map +1 -1
  27. package/package.json +2 -2
  28. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +46 -2
  29. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +3 -2
  30. package/src/_api/generated/cfg_accounts/accounts/models.ts +12 -12
  31. package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +1 -1
  32. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +55 -55
  33. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +23 -23
  34. package/src/_api/generated/cfg_accounts/client.ts +8 -0
  35. package/src/_api/generated/cfg_accounts/errors.ts +5 -0
  36. package/src/_api/generated/cfg_centrifugo/client.ts +8 -0
  37. package/src/_api/generated/cfg_centrifugo/errors.ts +5 -0
  38. package/src/_api/generated/cfg_totp/client.ts +8 -0
  39. package/src/_api/generated/cfg_totp/errors.ts +5 -0
  40. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
  41. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
  42. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +25 -25
  43. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
package/dist/index.d.cts CHANGED
@@ -48,13 +48,15 @@ declare namespace enums {
48
48
  }
49
49
 
50
50
  /**
51
- * Response with available OAuth providers.
51
+ * Request to start OAuth flow.
52
52
  *
53
- * Response model (includes read-only fields).
53
+ * Request model (no read-only fields).
54
54
  */
55
- interface OAuthProvidersResponse$1 {
56
- /** List of available OAuth providers */
57
- providers: Array<Record<string, any>>;
55
+ interface OAuthAuthorizeRequestRequest$1 {
56
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
57
+ redirect_uri?: string;
58
+ /** Optional source URL for registration tracking */
59
+ source_url?: string;
58
60
  }
59
61
  /**
60
62
  * Request to disconnect OAuth provider.
@@ -68,52 +70,37 @@ interface OAuthDisconnectRequestRequest$1 {
68
70
  provider: OAuthConnectionProvider;
69
71
  }
70
72
  /**
71
- * Error response for OAuth endpoints.
73
+ * Request to complete OAuth flow (callback handler).
72
74
  *
73
- * Response model (includes read-only fields).
75
+ * Request model (no read-only fields).
74
76
  */
75
- interface OAuthError$1 {
76
- /** Error code */
77
- error: string;
78
- /** Human-readable error description */
79
- error_description?: string;
77
+ interface OAuthCallbackRequestRequest$1 {
78
+ /** Authorization code from OAuth provider callback */
79
+ code: string;
80
+ /** State token for CSRF verification (from authorize response) */
81
+ state: string;
82
+ /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
83
+ redirect_uri?: string;
80
84
  }
81
85
  /**
82
- * Request to start OAuth flow.
86
+ * Response with OAuth authorization URL.
83
87
  *
84
- * Request model (no read-only fields).
88
+ * Response model (includes read-only fields).
85
89
  */
86
- interface OAuthAuthorizeRequestRequest$1 {
87
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
88
- redirect_uri?: string;
89
- /** Optional source URL for registration tracking */
90
- source_url?: string;
90
+ interface OAuthAuthorizeResponse$1 {
91
+ /** Full URL to redirect user to OAuth provider */
92
+ authorization_url: string;
93
+ /** State token for CSRF protection. Store this and verify on callback. */
94
+ state: string;
91
95
  }
92
96
  /**
93
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
94
- * requires_2fa: True - session_id: UUID of 2FA verification session -
95
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
96
- * session_id: null - access/refresh/user: populated
97
+ * Response with available OAuth providers.
97
98
  *
98
99
  * Response model (includes read-only fields).
99
100
  */
100
- interface OAuthTokenResponse$1 {
101
- /** True if 2FA verification is required */
102
- requires_2fa?: boolean;
103
- /** 2FA session ID (only when requires_2fa=True) */
104
- session_id?: string | null;
105
- /** JWT access token (null when requires_2fa=True) */
106
- access?: string | null;
107
- /** JWT refresh token (null when requires_2fa=True) */
108
- refresh?: string | null;
109
- /** Authenticated user info (null when requires_2fa=True) */
110
- user?: Record<string, any> | null;
111
- /** True if a new user was created during this OAuth flow */
112
- is_new_user: boolean;
113
- /** True if a new OAuth connection was created */
114
- is_new_connection: boolean;
115
- /** True if user should be prompted to enable 2FA */
116
- should_prompt_2fa?: boolean;
101
+ interface OAuthProvidersResponse$1 {
102
+ /** List of available OAuth providers */
103
+ providers: Array<Record<string, any>>;
117
104
  }
118
105
  /**
119
106
  * Serializer for OAuth connection info (user-facing).
@@ -139,28 +126,41 @@ interface OAuthConnection$1 {
139
126
  last_login_at: string;
140
127
  }
141
128
  /**
142
- * Response with OAuth authorization URL.
129
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
130
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
131
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
132
+ * session_id: null - access/refresh/user: populated
143
133
  *
144
134
  * Response model (includes read-only fields).
145
135
  */
146
- interface OAuthAuthorizeResponse$1 {
147
- /** Full URL to redirect user to OAuth provider */
148
- authorization_url: string;
149
- /** State token for CSRF protection. Store this and verify on callback. */
150
- state: string;
136
+ interface OAuthTokenResponse$1 {
137
+ /** True if 2FA verification is required */
138
+ requires_2fa?: boolean;
139
+ /** 2FA session ID (only when requires_2fa=True) */
140
+ session_id?: string | null;
141
+ /** JWT access token (null when requires_2fa=True) */
142
+ access?: string | null;
143
+ /** JWT refresh token (null when requires_2fa=True) */
144
+ refresh?: string | null;
145
+ /** Authenticated user info (null when requires_2fa=True) */
146
+ user?: Record<string, any> | null;
147
+ /** True if a new user was created during this OAuth flow */
148
+ is_new_user: boolean;
149
+ /** True if a new OAuth connection was created */
150
+ is_new_connection: boolean;
151
+ /** True if user should be prompted to enable 2FA */
152
+ should_prompt_2fa?: boolean;
151
153
  }
152
154
  /**
153
- * Request to complete OAuth flow (callback handler).
155
+ * Error response for OAuth endpoints.
154
156
  *
155
- * Request model (no read-only fields).
157
+ * Response model (includes read-only fields).
156
158
  */
157
- interface OAuthCallbackRequestRequest$1 {
158
- /** Authorization code from OAuth provider callback */
159
- code: string;
160
- /** State token for CSRF verification (from authorize response) */
161
- state: string;
162
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
163
- redirect_uri?: string;
159
+ interface OAuthError$1 {
160
+ /** Error code */
161
+ error: string;
162
+ /** Human-readable error description */
163
+ error_description?: string;
164
164
  }
165
165
 
166
166
  declare namespace models$2 {
@@ -178,7 +178,7 @@ declare class Oauth {
178
178
  *
179
179
  * Get all OAuth connections for the current user.
180
180
  */
181
- accountsOauthConnectionsList(): Promise<any>;
181
+ accountsOauthConnectionsList(): Promise<OAuthConnection$1[]>;
182
182
  /**
183
183
  * Disconnect OAuth provider
184
184
  *
@@ -207,19 +207,6 @@ declare class Oauth {
207
207
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse$1>;
208
208
  }
209
209
 
210
- /**
211
- * Serializer for updating user profile.
212
- *
213
- * Request model (no read-only fields).
214
- */
215
- interface PatchedUserProfileUpdateRequest$1 {
216
- first_name?: string;
217
- last_name?: string;
218
- company?: string;
219
- phone?: string;
220
- position?: string;
221
- language?: string;
222
- }
223
210
  /**
224
211
  * Serializer for user details.
225
212
  *
@@ -250,6 +237,27 @@ interface User$2 {
250
237
  unanswered_messages_count: number;
251
238
  centrifugo: CentrifugoToken$2 | null;
252
239
  }
240
+ /**
241
+ * Serializer for updating user profile.
242
+ *
243
+ * Request model (no read-only fields).
244
+ */
245
+ interface PatchedUserProfileUpdateRequest$1 {
246
+ first_name?: string;
247
+ last_name?: string;
248
+ company?: string;
249
+ phone?: string;
250
+ position?: string;
251
+ language?: string;
252
+ }
253
+ /**
254
+ *
255
+ * Request model (no read-only fields).
256
+ */
257
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
258
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
259
+ avatar: File | Blob;
260
+ }
253
261
  /**
254
262
  * Response serializer for account deletion.
255
263
  *
@@ -274,14 +282,6 @@ interface UserProfileUpdateRequest$1 {
274
282
  position?: string;
275
283
  language?: string;
276
284
  }
277
- /**
278
- *
279
- * Request model (no read-only fields).
280
- */
281
- interface CfgAccountsProfileAvatarCreateRequest$1 {
282
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
283
- avatar: File | Blob;
284
- }
285
285
  /**
286
286
  * Nested serializer for Centrifugo WebSocket connection token.
287
287
  *
@@ -400,17 +400,6 @@ interface OTPErrorResponse$1 {
400
400
  /** Seconds until the client may retry (present only for rate-limit errors) */
401
401
  retry_after?: number | null;
402
402
  }
403
- /**
404
- * Serializer for OTP request.
405
- *
406
- * Request model (no read-only fields).
407
- */
408
- interface OTPRequestRequest$1 {
409
- /** Email address for OTP delivery */
410
- identifier: string;
411
- /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
412
- source_url?: string;
413
- }
414
403
  /**
415
404
  * OTP verification response. When 2FA is required: - requires_2fa: True -
416
405
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -432,6 +421,17 @@ interface OTPVerifyResponse$1 {
432
421
  /** Whether user should be prompted to enable 2FA */
433
422
  should_prompt_2fa?: boolean;
434
423
  }
424
+ /**
425
+ * Serializer for OTP request.
426
+ *
427
+ * Request model (no read-only fields).
428
+ */
429
+ interface OTPRequestRequest$1 {
430
+ /** Email address for OTP delivery */
431
+ identifier: string;
432
+ /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
433
+ source_url?: string;
434
+ }
435
435
  /**
436
436
  * Serializer for user details.
437
437
  *
@@ -1566,7 +1566,7 @@ declare function createAccountsTokenRefreshCreate(data: TokenRefreshRequest, cli
1566
1566
  * @method GET
1567
1567
  * @path /cfg/accounts/oauth/connections/
1568
1568
  */
1569
- declare function getAccountsOauthConnectionsList(client?: any): Promise<any>;
1569
+ declare function getAccountsOauthConnectionsList(client?: any): Promise<OAuthConnection[]>;
1570
1570
  /**
1571
1571
  * Disconnect OAuth provider
1572
1572
  *
package/dist/index.d.ts CHANGED
@@ -48,13 +48,15 @@ declare namespace enums {
48
48
  }
49
49
 
50
50
  /**
51
- * Response with available OAuth providers.
51
+ * Request to start OAuth flow.
52
52
  *
53
- * Response model (includes read-only fields).
53
+ * Request model (no read-only fields).
54
54
  */
55
- interface OAuthProvidersResponse$1 {
56
- /** List of available OAuth providers */
57
- providers: Array<Record<string, any>>;
55
+ interface OAuthAuthorizeRequestRequest$1 {
56
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
57
+ redirect_uri?: string;
58
+ /** Optional source URL for registration tracking */
59
+ source_url?: string;
58
60
  }
59
61
  /**
60
62
  * Request to disconnect OAuth provider.
@@ -68,52 +70,37 @@ interface OAuthDisconnectRequestRequest$1 {
68
70
  provider: OAuthConnectionProvider;
69
71
  }
70
72
  /**
71
- * Error response for OAuth endpoints.
73
+ * Request to complete OAuth flow (callback handler).
72
74
  *
73
- * Response model (includes read-only fields).
75
+ * Request model (no read-only fields).
74
76
  */
75
- interface OAuthError$1 {
76
- /** Error code */
77
- error: string;
78
- /** Human-readable error description */
79
- error_description?: string;
77
+ interface OAuthCallbackRequestRequest$1 {
78
+ /** Authorization code from OAuth provider callback */
79
+ code: string;
80
+ /** State token for CSRF verification (from authorize response) */
81
+ state: string;
82
+ /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
83
+ redirect_uri?: string;
80
84
  }
81
85
  /**
82
- * Request to start OAuth flow.
86
+ * Response with OAuth authorization URL.
83
87
  *
84
- * Request model (no read-only fields).
88
+ * Response model (includes read-only fields).
85
89
  */
86
- interface OAuthAuthorizeRequestRequest$1 {
87
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
88
- redirect_uri?: string;
89
- /** Optional source URL for registration tracking */
90
- source_url?: string;
90
+ interface OAuthAuthorizeResponse$1 {
91
+ /** Full URL to redirect user to OAuth provider */
92
+ authorization_url: string;
93
+ /** State token for CSRF protection. Store this and verify on callback. */
94
+ state: string;
91
95
  }
92
96
  /**
93
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
94
- * requires_2fa: True - session_id: UUID of 2FA verification session -
95
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
96
- * session_id: null - access/refresh/user: populated
97
+ * Response with available OAuth providers.
97
98
  *
98
99
  * Response model (includes read-only fields).
99
100
  */
100
- interface OAuthTokenResponse$1 {
101
- /** True if 2FA verification is required */
102
- requires_2fa?: boolean;
103
- /** 2FA session ID (only when requires_2fa=True) */
104
- session_id?: string | null;
105
- /** JWT access token (null when requires_2fa=True) */
106
- access?: string | null;
107
- /** JWT refresh token (null when requires_2fa=True) */
108
- refresh?: string | null;
109
- /** Authenticated user info (null when requires_2fa=True) */
110
- user?: Record<string, any> | null;
111
- /** True if a new user was created during this OAuth flow */
112
- is_new_user: boolean;
113
- /** True if a new OAuth connection was created */
114
- is_new_connection: boolean;
115
- /** True if user should be prompted to enable 2FA */
116
- should_prompt_2fa?: boolean;
101
+ interface OAuthProvidersResponse$1 {
102
+ /** List of available OAuth providers */
103
+ providers: Array<Record<string, any>>;
117
104
  }
118
105
  /**
119
106
  * Serializer for OAuth connection info (user-facing).
@@ -139,28 +126,41 @@ interface OAuthConnection$1 {
139
126
  last_login_at: string;
140
127
  }
141
128
  /**
142
- * Response with OAuth authorization URL.
129
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
130
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
131
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
132
+ * session_id: null - access/refresh/user: populated
143
133
  *
144
134
  * Response model (includes read-only fields).
145
135
  */
146
- interface OAuthAuthorizeResponse$1 {
147
- /** Full URL to redirect user to OAuth provider */
148
- authorization_url: string;
149
- /** State token for CSRF protection. Store this and verify on callback. */
150
- state: string;
136
+ interface OAuthTokenResponse$1 {
137
+ /** True if 2FA verification is required */
138
+ requires_2fa?: boolean;
139
+ /** 2FA session ID (only when requires_2fa=True) */
140
+ session_id?: string | null;
141
+ /** JWT access token (null when requires_2fa=True) */
142
+ access?: string | null;
143
+ /** JWT refresh token (null when requires_2fa=True) */
144
+ refresh?: string | null;
145
+ /** Authenticated user info (null when requires_2fa=True) */
146
+ user?: Record<string, any> | null;
147
+ /** True if a new user was created during this OAuth flow */
148
+ is_new_user: boolean;
149
+ /** True if a new OAuth connection was created */
150
+ is_new_connection: boolean;
151
+ /** True if user should be prompted to enable 2FA */
152
+ should_prompt_2fa?: boolean;
151
153
  }
152
154
  /**
153
- * Request to complete OAuth flow (callback handler).
155
+ * Error response for OAuth endpoints.
154
156
  *
155
- * Request model (no read-only fields).
157
+ * Response model (includes read-only fields).
156
158
  */
157
- interface OAuthCallbackRequestRequest$1 {
158
- /** Authorization code from OAuth provider callback */
159
- code: string;
160
- /** State token for CSRF verification (from authorize response) */
161
- state: string;
162
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
163
- redirect_uri?: string;
159
+ interface OAuthError$1 {
160
+ /** Error code */
161
+ error: string;
162
+ /** Human-readable error description */
163
+ error_description?: string;
164
164
  }
165
165
 
166
166
  declare namespace models$2 {
@@ -178,7 +178,7 @@ declare class Oauth {
178
178
  *
179
179
  * Get all OAuth connections for the current user.
180
180
  */
181
- accountsOauthConnectionsList(): Promise<any>;
181
+ accountsOauthConnectionsList(): Promise<OAuthConnection$1[]>;
182
182
  /**
183
183
  * Disconnect OAuth provider
184
184
  *
@@ -207,19 +207,6 @@ declare class Oauth {
207
207
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse$1>;
208
208
  }
209
209
 
210
- /**
211
- * Serializer for updating user profile.
212
- *
213
- * Request model (no read-only fields).
214
- */
215
- interface PatchedUserProfileUpdateRequest$1 {
216
- first_name?: string;
217
- last_name?: string;
218
- company?: string;
219
- phone?: string;
220
- position?: string;
221
- language?: string;
222
- }
223
210
  /**
224
211
  * Serializer for user details.
225
212
  *
@@ -250,6 +237,27 @@ interface User$2 {
250
237
  unanswered_messages_count: number;
251
238
  centrifugo: CentrifugoToken$2 | null;
252
239
  }
240
+ /**
241
+ * Serializer for updating user profile.
242
+ *
243
+ * Request model (no read-only fields).
244
+ */
245
+ interface PatchedUserProfileUpdateRequest$1 {
246
+ first_name?: string;
247
+ last_name?: string;
248
+ company?: string;
249
+ phone?: string;
250
+ position?: string;
251
+ language?: string;
252
+ }
253
+ /**
254
+ *
255
+ * Request model (no read-only fields).
256
+ */
257
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
258
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
259
+ avatar: File | Blob;
260
+ }
253
261
  /**
254
262
  * Response serializer for account deletion.
255
263
  *
@@ -274,14 +282,6 @@ interface UserProfileUpdateRequest$1 {
274
282
  position?: string;
275
283
  language?: string;
276
284
  }
277
- /**
278
- *
279
- * Request model (no read-only fields).
280
- */
281
- interface CfgAccountsProfileAvatarCreateRequest$1 {
282
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
283
- avatar: File | Blob;
284
- }
285
285
  /**
286
286
  * Nested serializer for Centrifugo WebSocket connection token.
287
287
  *
@@ -400,17 +400,6 @@ interface OTPErrorResponse$1 {
400
400
  /** Seconds until the client may retry (present only for rate-limit errors) */
401
401
  retry_after?: number | null;
402
402
  }
403
- /**
404
- * Serializer for OTP request.
405
- *
406
- * Request model (no read-only fields).
407
- */
408
- interface OTPRequestRequest$1 {
409
- /** Email address for OTP delivery */
410
- identifier: string;
411
- /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
412
- source_url?: string;
413
- }
414
403
  /**
415
404
  * OTP verification response. When 2FA is required: - requires_2fa: True -
416
405
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -432,6 +421,17 @@ interface OTPVerifyResponse$1 {
432
421
  /** Whether user should be prompted to enable 2FA */
433
422
  should_prompt_2fa?: boolean;
434
423
  }
424
+ /**
425
+ * Serializer for OTP request.
426
+ *
427
+ * Request model (no read-only fields).
428
+ */
429
+ interface OTPRequestRequest$1 {
430
+ /** Email address for OTP delivery */
431
+ identifier: string;
432
+ /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
433
+ source_url?: string;
434
+ }
435
435
  /**
436
436
  * Serializer for user details.
437
437
  *
@@ -1566,7 +1566,7 @@ declare function createAccountsTokenRefreshCreate(data: TokenRefreshRequest, cli
1566
1566
  * @method GET
1567
1567
  * @path /cfg/accounts/oauth/connections/
1568
1568
  */
1569
- declare function getAccountsOauthConnectionsList(client?: any): Promise<any>;
1569
+ declare function getAccountsOauthConnectionsList(client?: any): Promise<OAuthConnection[]>;
1570
1570
  /**
1571
1571
  * Disconnect OAuth provider
1572
1572
  *
package/dist/index.mjs CHANGED
@@ -393,6 +393,9 @@ var APIError = class extends Error {
393
393
  if (details.detail) {
394
394
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
395
395
  }
396
+ if (details.error) {
397
+ return String(details.error);
398
+ }
396
399
  if (details.message) {
397
400
  return String(details.message);
398
401
  }
@@ -731,6 +734,12 @@ var APIClient = class {
731
734
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
732
735
  headers["Content-Type"] = "application/json";
733
736
  }
737
+ if (!headers["Authorization"]) {
738
+ const token = this.getToken();
739
+ if (token) {
740
+ headers["Authorization"] = `Bearer ${token}`;
741
+ }
742
+ }
734
743
  if (this.logger) {
735
744
  this.logger.logRequest({
736
745
  method,
@@ -1483,7 +1492,44 @@ import { consola as consola3 } from "consola";
1483
1492
  async function getAccountsOauthConnectionsList(client) {
1484
1493
  const api2 = client || getAPIInstance();
1485
1494
  const response = await api2.oauth.accountsOauthConnectionsList();
1486
- return response;
1495
+ try {
1496
+ return OAuthConnectionSchema.array().parse(response);
1497
+ } catch (error) {
1498
+ consola3.error("\u274C Zod Validation Failed");
1499
+ consola3.box(`getAccountsOauthConnectionsList
1500
+ Path: /cfg/accounts/oauth/connections/
1501
+ Method: GET`);
1502
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1503
+ consola3.error("Validation Issues:");
1504
+ error.issues.forEach((issue, index) => {
1505
+ consola3.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1506
+ consola3.error(` \u251C\u2500 Message: ${issue.message}`);
1507
+ if (issue.expected) consola3.error(` \u251C\u2500 Expected: ${issue.expected}`);
1508
+ if (issue.received) consola3.error(` \u2514\u2500 Received: ${issue.received}`);
1509
+ });
1510
+ }
1511
+ consola3.error("Response data:", response);
1512
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1513
+ try {
1514
+ const event = new CustomEvent("zod-validation-error", {
1515
+ detail: {
1516
+ operation: "getAccountsOauthConnectionsList",
1517
+ path: "/cfg/accounts/oauth/connections/",
1518
+ method: "GET",
1519
+ error,
1520
+ response,
1521
+ timestamp: /* @__PURE__ */ new Date()
1522
+ },
1523
+ bubbles: true,
1524
+ cancelable: false
1525
+ });
1526
+ window.dispatchEvent(event);
1527
+ } catch (eventError) {
1528
+ consola3.warn("Failed to dispatch validation error event:", eventError);
1529
+ }
1530
+ }
1531
+ throw error;
1532
+ }
1487
1533
  }
1488
1534
  __name(getAccountsOauthConnectionsList, "getAccountsOauthConnectionsList");
1489
1535
  async function createAccountsOauthDisconnectCreate(data, client) {
@@ -2216,6 +2262,9 @@ var APIError2 = class extends Error {
2216
2262
  if (details.detail) {
2217
2263
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
2218
2264
  }
2265
+ if (details.error) {
2266
+ return String(details.error);
2267
+ }
2219
2268
  if (details.message) {
2220
2269
  return String(details.message);
2221
2270
  }
@@ -2551,6 +2600,12 @@ var APIClient2 = class {
2551
2600
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
2552
2601
  headers["Content-Type"] = "application/json";
2553
2602
  }
2603
+ if (!headers["Authorization"]) {
2604
+ const token = this.getToken();
2605
+ if (token) {
2606
+ headers["Authorization"] = `Bearer ${token}`;
2607
+ }
2608
+ }
2554
2609
  if (this.logger) {
2555
2610
  this.logger.logRequest({
2556
2611
  method,