@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/index.d.cts
CHANGED
|
@@ -47,6 +47,17 @@ declare namespace enums {
|
|
|
47
47
|
export { enums_OAuthConnectionProvider as OAuthConnectionProvider };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Error response for OAuth endpoints.
|
|
52
|
+
*
|
|
53
|
+
* Response model (includes read-only fields).
|
|
54
|
+
*/
|
|
55
|
+
interface OAuthError$1 {
|
|
56
|
+
/** Error code */
|
|
57
|
+
error: string;
|
|
58
|
+
/** Human-readable error description */
|
|
59
|
+
error_description?: string;
|
|
60
|
+
}
|
|
50
61
|
/**
|
|
51
62
|
* Response with available OAuth providers.
|
|
52
63
|
*
|
|
@@ -57,26 +68,51 @@ interface OAuthProvidersResponse$1 {
|
|
|
57
68
|
providers: Array<Record<string, any>>;
|
|
58
69
|
}
|
|
59
70
|
/**
|
|
60
|
-
*
|
|
71
|
+
* Response with OAuth authorization URL.
|
|
72
|
+
*
|
|
73
|
+
* Response model (includes read-only fields).
|
|
74
|
+
*/
|
|
75
|
+
interface OAuthAuthorizeResponse$1 {
|
|
76
|
+
/** Full URL to redirect user to OAuth provider */
|
|
77
|
+
authorization_url: string;
|
|
78
|
+
/** State token for CSRF protection. Store this and verify on callback. */
|
|
79
|
+
state: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Request to complete OAuth flow (callback handler).
|
|
61
83
|
*
|
|
62
84
|
* Request model (no read-only fields).
|
|
63
85
|
*/
|
|
64
|
-
interface
|
|
65
|
-
/** OAuth provider
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
interface OAuthCallbackRequestRequest$1 {
|
|
87
|
+
/** Authorization code from OAuth provider callback */
|
|
88
|
+
code: string;
|
|
89
|
+
/** State token for CSRF verification (from authorize response) */
|
|
90
|
+
state: string;
|
|
91
|
+
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
92
|
+
redirect_uri?: string;
|
|
69
93
|
}
|
|
70
94
|
/**
|
|
71
|
-
*
|
|
95
|
+
* Serializer for OAuth connection info (user-facing).
|
|
72
96
|
*
|
|
73
97
|
* Response model (includes read-only fields).
|
|
74
98
|
*/
|
|
75
|
-
interface
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
99
|
+
interface OAuthConnection$1 {
|
|
100
|
+
id: number;
|
|
101
|
+
/** OAuth provider name (github, google, etc.)
|
|
102
|
+
|
|
103
|
+
* `github` - GitHub */
|
|
104
|
+
provider: OAuthConnectionProvider;
|
|
105
|
+
provider_display: string;
|
|
106
|
+
/** Username on the OAuth provider platform */
|
|
107
|
+
provider_username: string;
|
|
108
|
+
/** Email from OAuth provider (may differ from user.email) */
|
|
109
|
+
provider_email: string;
|
|
110
|
+
/** Avatar URL from OAuth provider */
|
|
111
|
+
provider_avatar_url: string;
|
|
112
|
+
/** When this OAuth connection was created */
|
|
113
|
+
connected_at: string;
|
|
114
|
+
/** Last time this OAuth connection was used for login */
|
|
115
|
+
last_login_at: string;
|
|
80
116
|
}
|
|
81
117
|
/**
|
|
82
118
|
* Request to start OAuth flow.
|
|
@@ -116,51 +152,15 @@ interface OAuthTokenResponse$1 {
|
|
|
116
152
|
should_prompt_2fa?: boolean;
|
|
117
153
|
}
|
|
118
154
|
/**
|
|
119
|
-
*
|
|
155
|
+
* Request to disconnect OAuth provider.
|
|
120
156
|
*
|
|
121
|
-
*
|
|
157
|
+
* Request model (no read-only fields).
|
|
122
158
|
*/
|
|
123
|
-
interface
|
|
124
|
-
|
|
125
|
-
/** OAuth provider name (github, google, etc.)
|
|
159
|
+
interface OAuthDisconnectRequestRequest$1 {
|
|
160
|
+
/** OAuth provider to disconnect
|
|
126
161
|
|
|
127
162
|
* `github` - GitHub */
|
|
128
163
|
provider: OAuthConnectionProvider;
|
|
129
|
-
provider_display: string;
|
|
130
|
-
/** Username on the OAuth provider platform */
|
|
131
|
-
provider_username: string;
|
|
132
|
-
/** Email from OAuth provider (may differ from user.email) */
|
|
133
|
-
provider_email: string;
|
|
134
|
-
/** Avatar URL from OAuth provider */
|
|
135
|
-
provider_avatar_url: string;
|
|
136
|
-
/** When this OAuth connection was created */
|
|
137
|
-
connected_at: string;
|
|
138
|
-
/** Last time this OAuth connection was used for login */
|
|
139
|
-
last_login_at: string;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Response with OAuth authorization URL.
|
|
143
|
-
*
|
|
144
|
-
* Response model (includes read-only fields).
|
|
145
|
-
*/
|
|
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;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Request to complete OAuth flow (callback handler).
|
|
154
|
-
*
|
|
155
|
-
* Request model (no read-only fields).
|
|
156
|
-
*/
|
|
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;
|
|
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,6 +207,19 @@ 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 UserProfileUpdateRequest$1 {
|
|
216
|
+
first_name?: string;
|
|
217
|
+
last_name?: string;
|
|
218
|
+
company?: string;
|
|
219
|
+
phone?: string;
|
|
220
|
+
position?: string;
|
|
221
|
+
language?: string;
|
|
222
|
+
}
|
|
210
223
|
/**
|
|
211
224
|
* Serializer for updating user profile.
|
|
212
225
|
*
|
|
@@ -261,19 +274,6 @@ interface AccountDeleteResponse$1 {
|
|
|
261
274
|
/** Human-readable message about the deletion */
|
|
262
275
|
message: string;
|
|
263
276
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Serializer for updating user profile.
|
|
266
|
-
*
|
|
267
|
-
* Request model (no read-only fields).
|
|
268
|
-
*/
|
|
269
|
-
interface UserProfileUpdateRequest$1 {
|
|
270
|
-
first_name?: string;
|
|
271
|
-
last_name?: string;
|
|
272
|
-
company?: string;
|
|
273
|
-
phone?: string;
|
|
274
|
-
position?: string;
|
|
275
|
-
language?: string;
|
|
276
|
-
}
|
|
277
277
|
/**
|
|
278
278
|
*
|
|
279
279
|
* Request model (no read-only fields).
|
|
@@ -371,6 +371,38 @@ interface OTPVerifyRequest$1 {
|
|
|
371
371
|
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
372
372
|
source_url?: string;
|
|
373
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
376
|
+
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
377
|
+
* When 2FA is not required: - requires_2fa: False - session_id: null -
|
|
378
|
+
* refresh/access/user: populated
|
|
379
|
+
*
|
|
380
|
+
* Response model (includes read-only fields).
|
|
381
|
+
*/
|
|
382
|
+
interface OTPVerifyResponse$1 {
|
|
383
|
+
/** Whether 2FA verification is required */
|
|
384
|
+
requires_2fa?: boolean;
|
|
385
|
+
/** 2FA session ID (if requires_2fa is True) */
|
|
386
|
+
session_id?: string | null;
|
|
387
|
+
/** JWT refresh token (if requires_2fa is False) */
|
|
388
|
+
refresh?: string | null;
|
|
389
|
+
/** JWT access token (if requires_2fa is False) */
|
|
390
|
+
access?: string | null;
|
|
391
|
+
user?: User$1 | null;
|
|
392
|
+
/** Whether user should be prompted to enable 2FA */
|
|
393
|
+
should_prompt_2fa?: boolean;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Serializer for OTP request.
|
|
397
|
+
*
|
|
398
|
+
* Request model (no read-only fields).
|
|
399
|
+
*/
|
|
400
|
+
interface OTPRequestRequest$1 {
|
|
401
|
+
/** Email address for OTP delivery */
|
|
402
|
+
identifier: string;
|
|
403
|
+
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
404
|
+
source_url?: string;
|
|
405
|
+
}
|
|
374
406
|
/**
|
|
375
407
|
* OTP request response.
|
|
376
408
|
*
|
|
@@ -400,38 +432,6 @@ interface OTPErrorResponse$1 {
|
|
|
400
432
|
/** Seconds until the client may retry (present only for rate-limit errors) */
|
|
401
433
|
retry_after?: number | null;
|
|
402
434
|
}
|
|
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
|
-
/**
|
|
415
|
-
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
416
|
-
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
417
|
-
* When 2FA is not required: - requires_2fa: False - session_id: null -
|
|
418
|
-
* refresh/access/user: populated
|
|
419
|
-
*
|
|
420
|
-
* Response model (includes read-only fields).
|
|
421
|
-
*/
|
|
422
|
-
interface OTPVerifyResponse$1 {
|
|
423
|
-
/** Whether 2FA verification is required */
|
|
424
|
-
requires_2fa?: boolean;
|
|
425
|
-
/** 2FA session ID (if requires_2fa is True) */
|
|
426
|
-
session_id?: string | null;
|
|
427
|
-
/** JWT refresh token (if requires_2fa is False) */
|
|
428
|
-
refresh?: string | null;
|
|
429
|
-
/** JWT access token (if requires_2fa is False) */
|
|
430
|
-
access?: string | null;
|
|
431
|
-
user?: User$1 | null;
|
|
432
|
-
/** Whether user should be prompted to enable 2FA */
|
|
433
|
-
should_prompt_2fa?: boolean;
|
|
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
|
@@ -47,6 +47,17 @@ declare namespace enums {
|
|
|
47
47
|
export { enums_OAuthConnectionProvider as OAuthConnectionProvider };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Error response for OAuth endpoints.
|
|
52
|
+
*
|
|
53
|
+
* Response model (includes read-only fields).
|
|
54
|
+
*/
|
|
55
|
+
interface OAuthError$1 {
|
|
56
|
+
/** Error code */
|
|
57
|
+
error: string;
|
|
58
|
+
/** Human-readable error description */
|
|
59
|
+
error_description?: string;
|
|
60
|
+
}
|
|
50
61
|
/**
|
|
51
62
|
* Response with available OAuth providers.
|
|
52
63
|
*
|
|
@@ -57,26 +68,51 @@ interface OAuthProvidersResponse$1 {
|
|
|
57
68
|
providers: Array<Record<string, any>>;
|
|
58
69
|
}
|
|
59
70
|
/**
|
|
60
|
-
*
|
|
71
|
+
* Response with OAuth authorization URL.
|
|
72
|
+
*
|
|
73
|
+
* Response model (includes read-only fields).
|
|
74
|
+
*/
|
|
75
|
+
interface OAuthAuthorizeResponse$1 {
|
|
76
|
+
/** Full URL to redirect user to OAuth provider */
|
|
77
|
+
authorization_url: string;
|
|
78
|
+
/** State token for CSRF protection. Store this and verify on callback. */
|
|
79
|
+
state: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Request to complete OAuth flow (callback handler).
|
|
61
83
|
*
|
|
62
84
|
* Request model (no read-only fields).
|
|
63
85
|
*/
|
|
64
|
-
interface
|
|
65
|
-
/** OAuth provider
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
interface OAuthCallbackRequestRequest$1 {
|
|
87
|
+
/** Authorization code from OAuth provider callback */
|
|
88
|
+
code: string;
|
|
89
|
+
/** State token for CSRF verification (from authorize response) */
|
|
90
|
+
state: string;
|
|
91
|
+
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
92
|
+
redirect_uri?: string;
|
|
69
93
|
}
|
|
70
94
|
/**
|
|
71
|
-
*
|
|
95
|
+
* Serializer for OAuth connection info (user-facing).
|
|
72
96
|
*
|
|
73
97
|
* Response model (includes read-only fields).
|
|
74
98
|
*/
|
|
75
|
-
interface
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
99
|
+
interface OAuthConnection$1 {
|
|
100
|
+
id: number;
|
|
101
|
+
/** OAuth provider name (github, google, etc.)
|
|
102
|
+
|
|
103
|
+
* `github` - GitHub */
|
|
104
|
+
provider: OAuthConnectionProvider;
|
|
105
|
+
provider_display: string;
|
|
106
|
+
/** Username on the OAuth provider platform */
|
|
107
|
+
provider_username: string;
|
|
108
|
+
/** Email from OAuth provider (may differ from user.email) */
|
|
109
|
+
provider_email: string;
|
|
110
|
+
/** Avatar URL from OAuth provider */
|
|
111
|
+
provider_avatar_url: string;
|
|
112
|
+
/** When this OAuth connection was created */
|
|
113
|
+
connected_at: string;
|
|
114
|
+
/** Last time this OAuth connection was used for login */
|
|
115
|
+
last_login_at: string;
|
|
80
116
|
}
|
|
81
117
|
/**
|
|
82
118
|
* Request to start OAuth flow.
|
|
@@ -116,51 +152,15 @@ interface OAuthTokenResponse$1 {
|
|
|
116
152
|
should_prompt_2fa?: boolean;
|
|
117
153
|
}
|
|
118
154
|
/**
|
|
119
|
-
*
|
|
155
|
+
* Request to disconnect OAuth provider.
|
|
120
156
|
*
|
|
121
|
-
*
|
|
157
|
+
* Request model (no read-only fields).
|
|
122
158
|
*/
|
|
123
|
-
interface
|
|
124
|
-
|
|
125
|
-
/** OAuth provider name (github, google, etc.)
|
|
159
|
+
interface OAuthDisconnectRequestRequest$1 {
|
|
160
|
+
/** OAuth provider to disconnect
|
|
126
161
|
|
|
127
162
|
* `github` - GitHub */
|
|
128
163
|
provider: OAuthConnectionProvider;
|
|
129
|
-
provider_display: string;
|
|
130
|
-
/** Username on the OAuth provider platform */
|
|
131
|
-
provider_username: string;
|
|
132
|
-
/** Email from OAuth provider (may differ from user.email) */
|
|
133
|
-
provider_email: string;
|
|
134
|
-
/** Avatar URL from OAuth provider */
|
|
135
|
-
provider_avatar_url: string;
|
|
136
|
-
/** When this OAuth connection was created */
|
|
137
|
-
connected_at: string;
|
|
138
|
-
/** Last time this OAuth connection was used for login */
|
|
139
|
-
last_login_at: string;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Response with OAuth authorization URL.
|
|
143
|
-
*
|
|
144
|
-
* Response model (includes read-only fields).
|
|
145
|
-
*/
|
|
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;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Request to complete OAuth flow (callback handler).
|
|
154
|
-
*
|
|
155
|
-
* Request model (no read-only fields).
|
|
156
|
-
*/
|
|
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;
|
|
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,6 +207,19 @@ 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 UserProfileUpdateRequest$1 {
|
|
216
|
+
first_name?: string;
|
|
217
|
+
last_name?: string;
|
|
218
|
+
company?: string;
|
|
219
|
+
phone?: string;
|
|
220
|
+
position?: string;
|
|
221
|
+
language?: string;
|
|
222
|
+
}
|
|
210
223
|
/**
|
|
211
224
|
* Serializer for updating user profile.
|
|
212
225
|
*
|
|
@@ -261,19 +274,6 @@ interface AccountDeleteResponse$1 {
|
|
|
261
274
|
/** Human-readable message about the deletion */
|
|
262
275
|
message: string;
|
|
263
276
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Serializer for updating user profile.
|
|
266
|
-
*
|
|
267
|
-
* Request model (no read-only fields).
|
|
268
|
-
*/
|
|
269
|
-
interface UserProfileUpdateRequest$1 {
|
|
270
|
-
first_name?: string;
|
|
271
|
-
last_name?: string;
|
|
272
|
-
company?: string;
|
|
273
|
-
phone?: string;
|
|
274
|
-
position?: string;
|
|
275
|
-
language?: string;
|
|
276
|
-
}
|
|
277
277
|
/**
|
|
278
278
|
*
|
|
279
279
|
* Request model (no read-only fields).
|
|
@@ -371,6 +371,38 @@ interface OTPVerifyRequest$1 {
|
|
|
371
371
|
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
372
372
|
source_url?: string;
|
|
373
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
376
|
+
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
377
|
+
* When 2FA is not required: - requires_2fa: False - session_id: null -
|
|
378
|
+
* refresh/access/user: populated
|
|
379
|
+
*
|
|
380
|
+
* Response model (includes read-only fields).
|
|
381
|
+
*/
|
|
382
|
+
interface OTPVerifyResponse$1 {
|
|
383
|
+
/** Whether 2FA verification is required */
|
|
384
|
+
requires_2fa?: boolean;
|
|
385
|
+
/** 2FA session ID (if requires_2fa is True) */
|
|
386
|
+
session_id?: string | null;
|
|
387
|
+
/** JWT refresh token (if requires_2fa is False) */
|
|
388
|
+
refresh?: string | null;
|
|
389
|
+
/** JWT access token (if requires_2fa is False) */
|
|
390
|
+
access?: string | null;
|
|
391
|
+
user?: User$1 | null;
|
|
392
|
+
/** Whether user should be prompted to enable 2FA */
|
|
393
|
+
should_prompt_2fa?: boolean;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Serializer for OTP request.
|
|
397
|
+
*
|
|
398
|
+
* Request model (no read-only fields).
|
|
399
|
+
*/
|
|
400
|
+
interface OTPRequestRequest$1 {
|
|
401
|
+
/** Email address for OTP delivery */
|
|
402
|
+
identifier: string;
|
|
403
|
+
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
404
|
+
source_url?: string;
|
|
405
|
+
}
|
|
374
406
|
/**
|
|
375
407
|
* OTP request response.
|
|
376
408
|
*
|
|
@@ -400,38 +432,6 @@ interface OTPErrorResponse$1 {
|
|
|
400
432
|
/** Seconds until the client may retry (present only for rate-limit errors) */
|
|
401
433
|
retry_after?: number | null;
|
|
402
434
|
}
|
|
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
|
-
/**
|
|
415
|
-
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
416
|
-
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
417
|
-
* When 2FA is not required: - requires_2fa: False - session_id: null -
|
|
418
|
-
* refresh/access/user: populated
|
|
419
|
-
*
|
|
420
|
-
* Response model (includes read-only fields).
|
|
421
|
-
*/
|
|
422
|
-
interface OTPVerifyResponse$1 {
|
|
423
|
-
/** Whether 2FA verification is required */
|
|
424
|
-
requires_2fa?: boolean;
|
|
425
|
-
/** 2FA session ID (if requires_2fa is True) */
|
|
426
|
-
session_id?: string | null;
|
|
427
|
-
/** JWT refresh token (if requires_2fa is False) */
|
|
428
|
-
refresh?: string | null;
|
|
429
|
-
/** JWT access token (if requires_2fa is False) */
|
|
430
|
-
access?: string | null;
|
|
431
|
-
user?: User$1 | null;
|
|
432
|
-
/** Whether user should be prompted to enable 2FA */
|
|
433
|
-
should_prompt_2fa?: boolean;
|
|
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,
|