@djangocfg/api 2.1.262 → 2.1.264
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 +9 -0
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +9 -0
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +76 -72
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +76 -72
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +122 -80
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +129 -172
- package/dist/clients.d.ts +129 -172
- package/dist/clients.mjs +122 -80
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +47 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +80 -57
- package/dist/hooks.d.ts +80 -57
- package/dist/hooks.mjs +47 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +56 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -99
- package/dist/index.d.ts +99 -99
- package/dist/index.mjs +56 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +46 -2
- package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +3 -2
- package/src/_api/generated/cfg_accounts/accounts/models.ts +34 -34
- package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +1 -1
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +54 -54
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +14 -14
- package/src/_api/generated/cfg_accounts/client.ts +8 -0
- package/src/_api/generated/cfg_accounts/errors.ts +5 -0
- package/src/_api/generated/cfg_centrifugo/client.ts +8 -0
- package/src/_api/generated/cfg_centrifugo/errors.ts +5 -0
- package/src/_api/generated/cfg_totp/CLAUDE.md +3 -3
- package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +7 -7
- package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +5 -5
- package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -1
- package/src/_api/generated/cfg_totp/client.ts +8 -0
- package/src/_api/generated/cfg_totp/errors.ts +5 -0
- package/src/_api/generated/cfg_totp/schema.json +2 -103
- package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +2 -13
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +9 -34
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +12 -12
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
- package/src/auth/hooks/useTwoFactorStatus.ts +5 -11
- package/src/_api/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts +0 -24
package/dist/hooks.d.cts
CHANGED
|
@@ -48,15 +48,51 @@ interface OAuthProvidersResponse {
|
|
|
48
48
|
providers: Array<Record<string, any>>;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Response with OAuth authorization URL.
|
|
52
|
+
*
|
|
53
|
+
* Response model (includes read-only fields).
|
|
54
|
+
*/
|
|
55
|
+
interface OAuthAuthorizeResponse$1 {
|
|
56
|
+
/** Full URL to redirect user to OAuth provider */
|
|
57
|
+
authorization_url: string;
|
|
58
|
+
/** State token for CSRF protection. Store this and verify on callback. */
|
|
59
|
+
state: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Request to complete OAuth flow (callback handler).
|
|
52
63
|
*
|
|
53
64
|
* Request model (no read-only fields).
|
|
54
65
|
*/
|
|
55
|
-
interface
|
|
56
|
-
/** OAuth provider
|
|
66
|
+
interface OAuthCallbackRequestRequest$1 {
|
|
67
|
+
/** Authorization code from OAuth provider callback */
|
|
68
|
+
code: string;
|
|
69
|
+
/** State token for CSRF verification (from authorize response) */
|
|
70
|
+
state: string;
|
|
71
|
+
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
72
|
+
redirect_uri?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Serializer for OAuth connection info (user-facing).
|
|
76
|
+
*
|
|
77
|
+
* Response model (includes read-only fields).
|
|
78
|
+
*/
|
|
79
|
+
interface OAuthConnection {
|
|
80
|
+
id: number;
|
|
81
|
+
/** OAuth provider name (github, google, etc.)
|
|
57
82
|
|
|
58
83
|
* `github` - GitHub */
|
|
59
84
|
provider: OAuthConnectionProvider;
|
|
85
|
+
provider_display: string;
|
|
86
|
+
/** Username on the OAuth provider platform */
|
|
87
|
+
provider_username: string;
|
|
88
|
+
/** Email from OAuth provider (may differ from user.email) */
|
|
89
|
+
provider_email: string;
|
|
90
|
+
/** Avatar URL from OAuth provider */
|
|
91
|
+
provider_avatar_url: string;
|
|
92
|
+
/** When this OAuth connection was created */
|
|
93
|
+
connected_at: string;
|
|
94
|
+
/** Last time this OAuth connection was used for login */
|
|
95
|
+
last_login_at: string;
|
|
60
96
|
}
|
|
61
97
|
/**
|
|
62
98
|
* Request to start OAuth flow.
|
|
@@ -96,28 +132,15 @@ interface OAuthTokenResponse$1 {
|
|
|
96
132
|
should_prompt_2fa?: boolean;
|
|
97
133
|
}
|
|
98
134
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* Response model (includes read-only fields).
|
|
102
|
-
*/
|
|
103
|
-
interface OAuthAuthorizeResponse$1 {
|
|
104
|
-
/** Full URL to redirect user to OAuth provider */
|
|
105
|
-
authorization_url: string;
|
|
106
|
-
/** State token for CSRF protection. Store this and verify on callback. */
|
|
107
|
-
state: string;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Request to complete OAuth flow (callback handler).
|
|
135
|
+
* Request to disconnect OAuth provider.
|
|
111
136
|
*
|
|
112
137
|
* Request model (no read-only fields).
|
|
113
138
|
*/
|
|
114
|
-
interface
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
120
|
-
redirect_uri?: string;
|
|
139
|
+
interface OAuthDisconnectRequestRequest$1 {
|
|
140
|
+
/** OAuth provider to disconnect
|
|
141
|
+
|
|
142
|
+
* `github` - GitHub */
|
|
143
|
+
provider: OAuthConnectionProvider;
|
|
121
144
|
}
|
|
122
145
|
|
|
123
146
|
/**
|
|
@@ -131,7 +154,7 @@ declare class Oauth {
|
|
|
131
154
|
*
|
|
132
155
|
* Get all OAuth connections for the current user.
|
|
133
156
|
*/
|
|
134
|
-
accountsOauthConnectionsList(): Promise<
|
|
157
|
+
accountsOauthConnectionsList(): Promise<OAuthConnection[]>;
|
|
135
158
|
/**
|
|
136
159
|
* Disconnect OAuth provider
|
|
137
160
|
*
|
|
@@ -160,6 +183,19 @@ declare class Oauth {
|
|
|
160
183
|
accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
|
|
161
184
|
}
|
|
162
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Serializer for updating user profile.
|
|
188
|
+
*
|
|
189
|
+
* Request model (no read-only fields).
|
|
190
|
+
*/
|
|
191
|
+
interface UserProfileUpdateRequest$1 {
|
|
192
|
+
first_name?: string;
|
|
193
|
+
last_name?: string;
|
|
194
|
+
company?: string;
|
|
195
|
+
phone?: string;
|
|
196
|
+
position?: string;
|
|
197
|
+
language?: string;
|
|
198
|
+
}
|
|
163
199
|
/**
|
|
164
200
|
* Serializer for updating user profile.
|
|
165
201
|
*
|
|
@@ -214,19 +250,6 @@ interface AccountDeleteResponse$1 {
|
|
|
214
250
|
/** Human-readable message about the deletion */
|
|
215
251
|
message: string;
|
|
216
252
|
}
|
|
217
|
-
/**
|
|
218
|
-
* Serializer for updating user profile.
|
|
219
|
-
*
|
|
220
|
-
* Request model (no read-only fields).
|
|
221
|
-
*/
|
|
222
|
-
interface UserProfileUpdateRequest$1 {
|
|
223
|
-
first_name?: string;
|
|
224
|
-
last_name?: string;
|
|
225
|
-
company?: string;
|
|
226
|
-
phone?: string;
|
|
227
|
-
position?: string;
|
|
228
|
-
language?: string;
|
|
229
|
-
}
|
|
230
253
|
/**
|
|
231
254
|
*
|
|
232
255
|
* Request model (no read-only fields).
|
|
@@ -320,26 +343,6 @@ interface OTPVerifyRequest$1 {
|
|
|
320
343
|
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
321
344
|
source_url?: string;
|
|
322
345
|
}
|
|
323
|
-
/**
|
|
324
|
-
* OTP request response.
|
|
325
|
-
*
|
|
326
|
-
* Response model (includes read-only fields).
|
|
327
|
-
*/
|
|
328
|
-
interface OTPRequestResponse$1 {
|
|
329
|
-
/** Success message */
|
|
330
|
-
message: string;
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Serializer for OTP request.
|
|
334
|
-
*
|
|
335
|
-
* Request model (no read-only fields).
|
|
336
|
-
*/
|
|
337
|
-
interface OTPRequestRequest$1 {
|
|
338
|
-
/** Email address for OTP delivery */
|
|
339
|
-
identifier: string;
|
|
340
|
-
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
341
|
-
source_url?: string;
|
|
342
|
-
}
|
|
343
346
|
/**
|
|
344
347
|
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
345
348
|
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
@@ -361,6 +364,26 @@ interface OTPVerifyResponse$1 {
|
|
|
361
364
|
/** Whether user should be prompted to enable 2FA */
|
|
362
365
|
should_prompt_2fa?: boolean;
|
|
363
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Serializer for OTP request.
|
|
369
|
+
*
|
|
370
|
+
* Request model (no read-only fields).
|
|
371
|
+
*/
|
|
372
|
+
interface OTPRequestRequest$1 {
|
|
373
|
+
/** Email address for OTP delivery */
|
|
374
|
+
identifier: string;
|
|
375
|
+
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
376
|
+
source_url?: string;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* OTP request response.
|
|
380
|
+
*
|
|
381
|
+
* Response model (includes read-only fields).
|
|
382
|
+
*/
|
|
383
|
+
interface OTPRequestResponse$1 {
|
|
384
|
+
/** Success message */
|
|
385
|
+
message: string;
|
|
386
|
+
}
|
|
364
387
|
/**
|
|
365
388
|
* Serializer for user details.
|
|
366
389
|
*
|
|
@@ -1068,7 +1091,7 @@ declare function useCreateAccountsTokenRefreshCreate(): (data: TokenRefreshReque
|
|
|
1068
1091
|
* @method GET
|
|
1069
1092
|
* @path /cfg/accounts/oauth/connections/
|
|
1070
1093
|
*/
|
|
1071
|
-
declare function useAccountsOauthConnectionsList(client?: API): ReturnType<typeof useSWR<
|
|
1094
|
+
declare function useAccountsOauthConnectionsList(client?: API): ReturnType<typeof useSWR<OAuthConnection[]>>;
|
|
1072
1095
|
/**
|
|
1073
1096
|
* Disconnect OAuth provider
|
|
1074
1097
|
*
|
package/dist/hooks.d.ts
CHANGED
|
@@ -48,15 +48,51 @@ interface OAuthProvidersResponse {
|
|
|
48
48
|
providers: Array<Record<string, any>>;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Response with OAuth authorization URL.
|
|
52
|
+
*
|
|
53
|
+
* Response model (includes read-only fields).
|
|
54
|
+
*/
|
|
55
|
+
interface OAuthAuthorizeResponse$1 {
|
|
56
|
+
/** Full URL to redirect user to OAuth provider */
|
|
57
|
+
authorization_url: string;
|
|
58
|
+
/** State token for CSRF protection. Store this and verify on callback. */
|
|
59
|
+
state: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Request to complete OAuth flow (callback handler).
|
|
52
63
|
*
|
|
53
64
|
* Request model (no read-only fields).
|
|
54
65
|
*/
|
|
55
|
-
interface
|
|
56
|
-
/** OAuth provider
|
|
66
|
+
interface OAuthCallbackRequestRequest$1 {
|
|
67
|
+
/** Authorization code from OAuth provider callback */
|
|
68
|
+
code: string;
|
|
69
|
+
/** State token for CSRF verification (from authorize response) */
|
|
70
|
+
state: string;
|
|
71
|
+
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
72
|
+
redirect_uri?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Serializer for OAuth connection info (user-facing).
|
|
76
|
+
*
|
|
77
|
+
* Response model (includes read-only fields).
|
|
78
|
+
*/
|
|
79
|
+
interface OAuthConnection {
|
|
80
|
+
id: number;
|
|
81
|
+
/** OAuth provider name (github, google, etc.)
|
|
57
82
|
|
|
58
83
|
* `github` - GitHub */
|
|
59
84
|
provider: OAuthConnectionProvider;
|
|
85
|
+
provider_display: string;
|
|
86
|
+
/** Username on the OAuth provider platform */
|
|
87
|
+
provider_username: string;
|
|
88
|
+
/** Email from OAuth provider (may differ from user.email) */
|
|
89
|
+
provider_email: string;
|
|
90
|
+
/** Avatar URL from OAuth provider */
|
|
91
|
+
provider_avatar_url: string;
|
|
92
|
+
/** When this OAuth connection was created */
|
|
93
|
+
connected_at: string;
|
|
94
|
+
/** Last time this OAuth connection was used for login */
|
|
95
|
+
last_login_at: string;
|
|
60
96
|
}
|
|
61
97
|
/**
|
|
62
98
|
* Request to start OAuth flow.
|
|
@@ -96,28 +132,15 @@ interface OAuthTokenResponse$1 {
|
|
|
96
132
|
should_prompt_2fa?: boolean;
|
|
97
133
|
}
|
|
98
134
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* Response model (includes read-only fields).
|
|
102
|
-
*/
|
|
103
|
-
interface OAuthAuthorizeResponse$1 {
|
|
104
|
-
/** Full URL to redirect user to OAuth provider */
|
|
105
|
-
authorization_url: string;
|
|
106
|
-
/** State token for CSRF protection. Store this and verify on callback. */
|
|
107
|
-
state: string;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Request to complete OAuth flow (callback handler).
|
|
135
|
+
* Request to disconnect OAuth provider.
|
|
111
136
|
*
|
|
112
137
|
* Request model (no read-only fields).
|
|
113
138
|
*/
|
|
114
|
-
interface
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
120
|
-
redirect_uri?: string;
|
|
139
|
+
interface OAuthDisconnectRequestRequest$1 {
|
|
140
|
+
/** OAuth provider to disconnect
|
|
141
|
+
|
|
142
|
+
* `github` - GitHub */
|
|
143
|
+
provider: OAuthConnectionProvider;
|
|
121
144
|
}
|
|
122
145
|
|
|
123
146
|
/**
|
|
@@ -131,7 +154,7 @@ declare class Oauth {
|
|
|
131
154
|
*
|
|
132
155
|
* Get all OAuth connections for the current user.
|
|
133
156
|
*/
|
|
134
|
-
accountsOauthConnectionsList(): Promise<
|
|
157
|
+
accountsOauthConnectionsList(): Promise<OAuthConnection[]>;
|
|
135
158
|
/**
|
|
136
159
|
* Disconnect OAuth provider
|
|
137
160
|
*
|
|
@@ -160,6 +183,19 @@ declare class Oauth {
|
|
|
160
183
|
accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
|
|
161
184
|
}
|
|
162
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Serializer for updating user profile.
|
|
188
|
+
*
|
|
189
|
+
* Request model (no read-only fields).
|
|
190
|
+
*/
|
|
191
|
+
interface UserProfileUpdateRequest$1 {
|
|
192
|
+
first_name?: string;
|
|
193
|
+
last_name?: string;
|
|
194
|
+
company?: string;
|
|
195
|
+
phone?: string;
|
|
196
|
+
position?: string;
|
|
197
|
+
language?: string;
|
|
198
|
+
}
|
|
163
199
|
/**
|
|
164
200
|
* Serializer for updating user profile.
|
|
165
201
|
*
|
|
@@ -214,19 +250,6 @@ interface AccountDeleteResponse$1 {
|
|
|
214
250
|
/** Human-readable message about the deletion */
|
|
215
251
|
message: string;
|
|
216
252
|
}
|
|
217
|
-
/**
|
|
218
|
-
* Serializer for updating user profile.
|
|
219
|
-
*
|
|
220
|
-
* Request model (no read-only fields).
|
|
221
|
-
*/
|
|
222
|
-
interface UserProfileUpdateRequest$1 {
|
|
223
|
-
first_name?: string;
|
|
224
|
-
last_name?: string;
|
|
225
|
-
company?: string;
|
|
226
|
-
phone?: string;
|
|
227
|
-
position?: string;
|
|
228
|
-
language?: string;
|
|
229
|
-
}
|
|
230
253
|
/**
|
|
231
254
|
*
|
|
232
255
|
* Request model (no read-only fields).
|
|
@@ -320,26 +343,6 @@ interface OTPVerifyRequest$1 {
|
|
|
320
343
|
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
321
344
|
source_url?: string;
|
|
322
345
|
}
|
|
323
|
-
/**
|
|
324
|
-
* OTP request response.
|
|
325
|
-
*
|
|
326
|
-
* Response model (includes read-only fields).
|
|
327
|
-
*/
|
|
328
|
-
interface OTPRequestResponse$1 {
|
|
329
|
-
/** Success message */
|
|
330
|
-
message: string;
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Serializer for OTP request.
|
|
334
|
-
*
|
|
335
|
-
* Request model (no read-only fields).
|
|
336
|
-
*/
|
|
337
|
-
interface OTPRequestRequest$1 {
|
|
338
|
-
/** Email address for OTP delivery */
|
|
339
|
-
identifier: string;
|
|
340
|
-
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
341
|
-
source_url?: string;
|
|
342
|
-
}
|
|
343
346
|
/**
|
|
344
347
|
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
345
348
|
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
@@ -361,6 +364,26 @@ interface OTPVerifyResponse$1 {
|
|
|
361
364
|
/** Whether user should be prompted to enable 2FA */
|
|
362
365
|
should_prompt_2fa?: boolean;
|
|
363
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Serializer for OTP request.
|
|
369
|
+
*
|
|
370
|
+
* Request model (no read-only fields).
|
|
371
|
+
*/
|
|
372
|
+
interface OTPRequestRequest$1 {
|
|
373
|
+
/** Email address for OTP delivery */
|
|
374
|
+
identifier: string;
|
|
375
|
+
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
376
|
+
source_url?: string;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* OTP request response.
|
|
380
|
+
*
|
|
381
|
+
* Response model (includes read-only fields).
|
|
382
|
+
*/
|
|
383
|
+
interface OTPRequestResponse$1 {
|
|
384
|
+
/** Success message */
|
|
385
|
+
message: string;
|
|
386
|
+
}
|
|
364
387
|
/**
|
|
365
388
|
* Serializer for user details.
|
|
366
389
|
*
|
|
@@ -1068,7 +1091,7 @@ declare function useCreateAccountsTokenRefreshCreate(): (data: TokenRefreshReque
|
|
|
1068
1091
|
* @method GET
|
|
1069
1092
|
* @path /cfg/accounts/oauth/connections/
|
|
1070
1093
|
*/
|
|
1071
|
-
declare function useAccountsOauthConnectionsList(client?: API): ReturnType<typeof useSWR<
|
|
1094
|
+
declare function useAccountsOauthConnectionsList(client?: API): ReturnType<typeof useSWR<OAuthConnection[]>>;
|
|
1072
1095
|
/**
|
|
1073
1096
|
* Disconnect OAuth provider
|
|
1074
1097
|
*
|
package/dist/hooks.mjs
CHANGED
|
@@ -305,6 +305,9 @@ var APIError = class extends Error {
|
|
|
305
305
|
if (details.detail) {
|
|
306
306
|
return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
|
|
307
307
|
}
|
|
308
|
+
if (details.error) {
|
|
309
|
+
return String(details.error);
|
|
310
|
+
}
|
|
308
311
|
if (details.message) {
|
|
309
312
|
return String(details.message);
|
|
310
313
|
}
|
|
@@ -643,6 +646,12 @@ var APIClient = class {
|
|
|
643
646
|
if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
|
|
644
647
|
headers["Content-Type"] = "application/json";
|
|
645
648
|
}
|
|
649
|
+
if (!headers["Authorization"]) {
|
|
650
|
+
const token = this.getToken();
|
|
651
|
+
if (token) {
|
|
652
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
646
655
|
if (this.logger) {
|
|
647
656
|
this.logger.logRequest({
|
|
648
657
|
method,
|
|
@@ -1107,7 +1116,44 @@ import { consola as consola2 } from "consola";
|
|
|
1107
1116
|
async function getAccountsOauthConnectionsList(client) {
|
|
1108
1117
|
const api = client || getAPIInstance();
|
|
1109
1118
|
const response = await api.oauth.accountsOauthConnectionsList();
|
|
1110
|
-
|
|
1119
|
+
try {
|
|
1120
|
+
return OAuthConnectionSchema.array().parse(response);
|
|
1121
|
+
} catch (error) {
|
|
1122
|
+
consola2.error("\u274C Zod Validation Failed");
|
|
1123
|
+
consola2.box(`getAccountsOauthConnectionsList
|
|
1124
|
+
Path: /cfg/accounts/oauth/connections/
|
|
1125
|
+
Method: GET`);
|
|
1126
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1127
|
+
consola2.error("Validation Issues:");
|
|
1128
|
+
error.issues.forEach((issue, index) => {
|
|
1129
|
+
consola2.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1130
|
+
consola2.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1131
|
+
if (issue.expected) consola2.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1132
|
+
if (issue.received) consola2.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
consola2.error("Response data:", response);
|
|
1136
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1137
|
+
try {
|
|
1138
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1139
|
+
detail: {
|
|
1140
|
+
operation: "getAccountsOauthConnectionsList",
|
|
1141
|
+
path: "/cfg/accounts/oauth/connections/",
|
|
1142
|
+
method: "GET",
|
|
1143
|
+
error,
|
|
1144
|
+
response,
|
|
1145
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1146
|
+
},
|
|
1147
|
+
bubbles: true,
|
|
1148
|
+
cancelable: false
|
|
1149
|
+
});
|
|
1150
|
+
window.dispatchEvent(event);
|
|
1151
|
+
} catch (eventError) {
|
|
1152
|
+
consola2.warn("Failed to dispatch validation error event:", eventError);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
throw error;
|
|
1156
|
+
}
|
|
1111
1157
|
}
|
|
1112
1158
|
__name(getAccountsOauthConnectionsList, "getAccountsOauthConnectionsList");
|
|
1113
1159
|
async function createAccountsOauthDisconnectCreate(data, client) {
|