@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.
- 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 +27 -0
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +27 -0
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +65 -1
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +145 -122
- package/dist/clients.d.ts +145 -122
- package/dist/clients.mjs +65 -1
- 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 +91 -68
- package/dist/hooks.d.ts +91 -68
- 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 +89 -89
- package/dist/index.d.ts +89 -89
- 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 +12 -12
- package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +1 -1
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +55 -55
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +23 -23
- 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/client.ts +8 -0
- package/src/_api/generated/cfg_totp/errors.ts +5 -0
- package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +25 -25
- 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
|
-
*
|
|
51
|
+
* Request to start OAuth flow.
|
|
52
52
|
*
|
|
53
|
-
*
|
|
53
|
+
* Request model (no read-only fields).
|
|
54
54
|
*/
|
|
55
|
-
interface
|
|
56
|
-
/**
|
|
57
|
-
|
|
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
|
-
*
|
|
73
|
+
* Request to complete OAuth flow (callback handler).
|
|
72
74
|
*
|
|
73
|
-
*
|
|
75
|
+
* Request model (no read-only fields).
|
|
74
76
|
*/
|
|
75
|
-
interface
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
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
|
-
*
|
|
86
|
+
* Response with OAuth authorization URL.
|
|
83
87
|
*
|
|
84
|
-
*
|
|
88
|
+
* Response model (includes read-only fields).
|
|
85
89
|
*/
|
|
86
|
-
interface
|
|
87
|
-
/** URL to redirect
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
|
|
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
|
|
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
|
|
101
|
-
/**
|
|
102
|
-
|
|
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
|
|
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
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
|
|
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
|
-
*
|
|
155
|
+
* Error response for OAuth endpoints.
|
|
154
156
|
*
|
|
155
|
-
*
|
|
157
|
+
* Response model (includes read-only fields).
|
|
156
158
|
*/
|
|
157
|
-
interface
|
|
158
|
-
/**
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
|
|
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<
|
|
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<
|
|
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
|
-
*
|
|
51
|
+
* Request to start OAuth flow.
|
|
52
52
|
*
|
|
53
|
-
*
|
|
53
|
+
* Request model (no read-only fields).
|
|
54
54
|
*/
|
|
55
|
-
interface
|
|
56
|
-
/**
|
|
57
|
-
|
|
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
|
-
*
|
|
73
|
+
* Request to complete OAuth flow (callback handler).
|
|
72
74
|
*
|
|
73
|
-
*
|
|
75
|
+
* Request model (no read-only fields).
|
|
74
76
|
*/
|
|
75
|
-
interface
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
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
|
-
*
|
|
86
|
+
* Response with OAuth authorization URL.
|
|
83
87
|
*
|
|
84
|
-
*
|
|
88
|
+
* Response model (includes read-only fields).
|
|
85
89
|
*/
|
|
86
|
-
interface
|
|
87
|
-
/** URL to redirect
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
|
|
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
|
|
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
|
|
101
|
-
/**
|
|
102
|
-
|
|
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
|
|
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
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
|
|
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
|
-
*
|
|
155
|
+
* Error response for OAuth endpoints.
|
|
154
156
|
*
|
|
155
|
-
*
|
|
157
|
+
* Response model (includes read-only fields).
|
|
156
158
|
*/
|
|
157
|
-
interface
|
|
158
|
-
/**
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
|
|
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<
|
|
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<
|
|
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
|
-
|
|
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,
|