@djangocfg/api 2.1.224 → 2.1.225

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/index.d.cts CHANGED
@@ -3,17 +3,17 @@ import { z, ZodError } from 'zod';
3
3
 
4
4
  /**
5
5
  *
6
- * Response model (includes read-only fields).
6
+ * Request model (no read-only fields).
7
7
  */
8
- interface TokenRefresh$1 {
9
- access: string;
8
+ interface TokenRefreshRequest$1 {
10
9
  refresh: string;
11
10
  }
12
11
  /**
13
12
  *
14
- * Request model (no read-only fields).
13
+ * Response model (includes read-only fields).
15
14
  */
16
- interface TokenRefreshRequest$1 {
15
+ interface TokenRefresh$1 {
16
+ access: string;
17
17
  refresh: string;
18
18
  }
19
19
 
@@ -58,6 +58,26 @@ declare namespace enums {
58
58
  export { enums_OAuthConnectionProvider as OAuthConnectionProvider, enums_OTPRequestRequestChannel as OTPRequestRequestChannel };
59
59
  }
60
60
 
61
+ /**
62
+ * Request to start OAuth flow.
63
+ *
64
+ * Request model (no read-only fields).
65
+ */
66
+ interface OAuthAuthorizeRequestRequest$1 {
67
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
68
+ redirect_uri?: string;
69
+ /** Optional source URL for registration tracking */
70
+ source_url?: string;
71
+ }
72
+ /**
73
+ * Response with available OAuth providers.
74
+ *
75
+ * Response model (includes read-only fields).
76
+ */
77
+ interface OAuthProvidersResponse$1 {
78
+ /** List of available OAuth providers */
79
+ providers: Array<Record<string, any>>;
80
+ }
61
81
  /**
62
82
  * Error response for OAuth endpoints.
63
83
  *
@@ -83,35 +103,38 @@ interface OAuthCallbackRequestRequest$1 {
83
103
  redirect_uri?: string;
84
104
  }
85
105
  /**
86
- * Request to start OAuth flow.
87
- *
88
- * Request model (no read-only fields).
89
- */
90
- interface OAuthAuthorizeRequestRequest$1 {
91
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
92
- redirect_uri?: string;
93
- /** Optional source URL for registration tracking */
94
- source_url?: string;
95
- }
96
- /**
97
- * Response with OAuth authorization URL.
106
+ * Serializer for OAuth connection info (user-facing).
98
107
  *
99
108
  * Response model (includes read-only fields).
100
109
  */
101
- interface OAuthAuthorizeResponse$1 {
102
- /** Full URL to redirect user to OAuth provider */
103
- authorization_url: string;
104
- /** State token for CSRF protection. Store this and verify on callback. */
105
- state: string;
110
+ interface OAuthConnection$1 {
111
+ id: number;
112
+ /** OAuth provider name (github, google, etc.)
113
+
114
+ * `github` - GitHub */
115
+ provider: OAuthConnectionProvider;
116
+ provider_display: string;
117
+ /** Username on the OAuth provider platform */
118
+ provider_username: string;
119
+ /** Email from OAuth provider (may differ from user.email) */
120
+ provider_email: string;
121
+ /** Avatar URL from OAuth provider */
122
+ provider_avatar_url: string;
123
+ /** When this OAuth connection was created */
124
+ connected_at: string;
125
+ /** Last time this OAuth connection was used for login */
126
+ last_login_at: string;
106
127
  }
107
128
  /**
108
- * Response with available OAuth providers.
129
+ * Request to disconnect OAuth provider.
109
130
  *
110
- * Response model (includes read-only fields).
131
+ * Request model (no read-only fields).
111
132
  */
112
- interface OAuthProvidersResponse$1 {
113
- /** List of available OAuth providers */
114
- providers: Array<Record<string, any>>;
133
+ interface OAuthDisconnectRequestRequest$1 {
134
+ /** OAuth provider to disconnect
135
+
136
+ * `github` - GitHub */
137
+ provider: OAuthConnectionProvider;
115
138
  }
116
139
  /**
117
140
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
@@ -140,38 +163,15 @@ interface OAuthTokenResponse$1 {
140
163
  should_prompt_2fa?: boolean;
141
164
  }
142
165
  /**
143
- * Request to disconnect OAuth provider.
144
- *
145
- * Request model (no read-only fields).
146
- */
147
- interface OAuthDisconnectRequestRequest$1 {
148
- /** OAuth provider to disconnect
149
-
150
- * `github` - GitHub */
151
- provider: OAuthConnectionProvider;
152
- }
153
- /**
154
- * Serializer for OAuth connection info (user-facing).
166
+ * Response with OAuth authorization URL.
155
167
  *
156
168
  * Response model (includes read-only fields).
157
169
  */
158
- interface OAuthConnection$1 {
159
- id: number;
160
- /** OAuth provider name (github, google, etc.)
161
-
162
- * `github` - GitHub */
163
- provider: OAuthConnectionProvider;
164
- provider_display: string;
165
- /** Username on the OAuth provider platform */
166
- provider_username: string;
167
- /** Email from OAuth provider (may differ from user.email) */
168
- provider_email: string;
169
- /** Avatar URL from OAuth provider */
170
- provider_avatar_url: string;
171
- /** When this OAuth connection was created */
172
- connected_at: string;
173
- /** Last time this OAuth connection was used for login */
174
- last_login_at: string;
170
+ interface OAuthAuthorizeResponse$1 {
171
+ /** Full URL to redirect user to OAuth provider */
172
+ authorization_url: string;
173
+ /** State token for CSRF protection. Store this and verify on callback. */
174
+ state: string;
175
175
  }
176
176
 
177
177
  declare namespace models$2 {
@@ -261,6 +261,14 @@ interface UserProfileUpdateRequest$1 {
261
261
  position?: string;
262
262
  language?: string;
263
263
  }
264
+ /**
265
+ *
266
+ * Request model (no read-only fields).
267
+ */
268
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
269
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
270
+ avatar: File | Blob;
271
+ }
264
272
  /**
265
273
  * Response serializer for account deletion.
266
274
  *
@@ -285,14 +293,6 @@ interface PatchedUserProfileUpdateRequest$1 {
285
293
  position?: string;
286
294
  language?: string;
287
295
  }
288
- /**
289
- *
290
- * Request model (no read-only fields).
291
- */
292
- interface CfgAccountsProfileAvatarCreateRequest$1 {
293
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
294
- avatar: File | Blob;
295
- }
296
296
  /**
297
297
  * Nested serializer for Centrifugo WebSocket connection token.
298
298
  *
@@ -370,6 +370,27 @@ declare class UserProfile {
370
370
  accountsProfileUpdatePartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
371
371
  }
372
372
 
373
+ /**
374
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
375
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
376
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
377
+ * refresh/access/user: populated
378
+ *
379
+ * Response model (includes read-only fields).
380
+ */
381
+ interface OTPVerifyResponse$1 {
382
+ /** Whether 2FA verification is required */
383
+ requires_2fa?: boolean;
384
+ /** 2FA session ID (if requires_2fa is True) */
385
+ session_id?: string | null;
386
+ /** JWT refresh token (if requires_2fa is False) */
387
+ refresh?: string | null;
388
+ /** JWT access token (if requires_2fa is False) */
389
+ access?: string | null;
390
+ user?: User$1 | null;
391
+ /** Whether user should be prompted to enable 2FA */
392
+ should_prompt_2fa?: boolean;
393
+ }
373
394
  /**
374
395
  * Serializer for OTP request.
375
396
  *
@@ -396,25 +417,13 @@ interface OTPRequestResponse$1 {
396
417
  message: string;
397
418
  }
398
419
  /**
399
- * OTP verification response. When 2FA is required: - requires_2fa: True -
400
- * session_id: UUID of 2FA verification session - refresh/access/user: null
401
- * When 2FA is not required: - requires_2fa: False - session_id: null -
402
- * refresh/access/user: populated
420
+ * Error response for OTP operations.
403
421
  *
404
422
  * Response model (includes read-only fields).
405
423
  */
406
- interface OTPVerifyResponse$1 {
407
- /** Whether 2FA verification is required */
408
- requires_2fa?: boolean;
409
- /** 2FA session ID (if requires_2fa is True) */
410
- session_id?: string | null;
411
- /** JWT refresh token (if requires_2fa is False) */
412
- refresh?: string | null;
413
- /** JWT access token (if requires_2fa is False) */
414
- access?: string | null;
415
- user?: User$1 | null;
416
- /** Whether user should be prompted to enable 2FA */
417
- should_prompt_2fa?: boolean;
424
+ interface OTPErrorResponse$1 {
425
+ /** Error message */
426
+ error: string;
418
427
  }
419
428
  /**
420
429
  * Serializer for OTP verification.
@@ -433,15 +442,6 @@ interface OTPVerifyRequest$1 {
433
442
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
434
443
  source_url?: string;
435
444
  }
436
- /**
437
- * Error response for OTP operations.
438
- *
439
- * Response model (includes read-only fields).
440
- */
441
- interface OTPErrorResponse$1 {
442
- /** Error message */
443
- error: string;
444
- }
445
445
  /**
446
446
  * Serializer for user details.
447
447
  *
package/dist/index.d.ts CHANGED
@@ -3,17 +3,17 @@ import { z, ZodError } from 'zod';
3
3
 
4
4
  /**
5
5
  *
6
- * Response model (includes read-only fields).
6
+ * Request model (no read-only fields).
7
7
  */
8
- interface TokenRefresh$1 {
9
- access: string;
8
+ interface TokenRefreshRequest$1 {
10
9
  refresh: string;
11
10
  }
12
11
  /**
13
12
  *
14
- * Request model (no read-only fields).
13
+ * Response model (includes read-only fields).
15
14
  */
16
- interface TokenRefreshRequest$1 {
15
+ interface TokenRefresh$1 {
16
+ access: string;
17
17
  refresh: string;
18
18
  }
19
19
 
@@ -58,6 +58,26 @@ declare namespace enums {
58
58
  export { enums_OAuthConnectionProvider as OAuthConnectionProvider, enums_OTPRequestRequestChannel as OTPRequestRequestChannel };
59
59
  }
60
60
 
61
+ /**
62
+ * Request to start OAuth flow.
63
+ *
64
+ * Request model (no read-only fields).
65
+ */
66
+ interface OAuthAuthorizeRequestRequest$1 {
67
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
68
+ redirect_uri?: string;
69
+ /** Optional source URL for registration tracking */
70
+ source_url?: string;
71
+ }
72
+ /**
73
+ * Response with available OAuth providers.
74
+ *
75
+ * Response model (includes read-only fields).
76
+ */
77
+ interface OAuthProvidersResponse$1 {
78
+ /** List of available OAuth providers */
79
+ providers: Array<Record<string, any>>;
80
+ }
61
81
  /**
62
82
  * Error response for OAuth endpoints.
63
83
  *
@@ -83,35 +103,38 @@ interface OAuthCallbackRequestRequest$1 {
83
103
  redirect_uri?: string;
84
104
  }
85
105
  /**
86
- * Request to start OAuth flow.
87
- *
88
- * Request model (no read-only fields).
89
- */
90
- interface OAuthAuthorizeRequestRequest$1 {
91
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
92
- redirect_uri?: string;
93
- /** Optional source URL for registration tracking */
94
- source_url?: string;
95
- }
96
- /**
97
- * Response with OAuth authorization URL.
106
+ * Serializer for OAuth connection info (user-facing).
98
107
  *
99
108
  * Response model (includes read-only fields).
100
109
  */
101
- interface OAuthAuthorizeResponse$1 {
102
- /** Full URL to redirect user to OAuth provider */
103
- authorization_url: string;
104
- /** State token for CSRF protection. Store this and verify on callback. */
105
- state: string;
110
+ interface OAuthConnection$1 {
111
+ id: number;
112
+ /** OAuth provider name (github, google, etc.)
113
+
114
+ * `github` - GitHub */
115
+ provider: OAuthConnectionProvider;
116
+ provider_display: string;
117
+ /** Username on the OAuth provider platform */
118
+ provider_username: string;
119
+ /** Email from OAuth provider (may differ from user.email) */
120
+ provider_email: string;
121
+ /** Avatar URL from OAuth provider */
122
+ provider_avatar_url: string;
123
+ /** When this OAuth connection was created */
124
+ connected_at: string;
125
+ /** Last time this OAuth connection was used for login */
126
+ last_login_at: string;
106
127
  }
107
128
  /**
108
- * Response with available OAuth providers.
129
+ * Request to disconnect OAuth provider.
109
130
  *
110
- * Response model (includes read-only fields).
131
+ * Request model (no read-only fields).
111
132
  */
112
- interface OAuthProvidersResponse$1 {
113
- /** List of available OAuth providers */
114
- providers: Array<Record<string, any>>;
133
+ interface OAuthDisconnectRequestRequest$1 {
134
+ /** OAuth provider to disconnect
135
+
136
+ * `github` - GitHub */
137
+ provider: OAuthConnectionProvider;
115
138
  }
116
139
  /**
117
140
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
@@ -140,38 +163,15 @@ interface OAuthTokenResponse$1 {
140
163
  should_prompt_2fa?: boolean;
141
164
  }
142
165
  /**
143
- * Request to disconnect OAuth provider.
144
- *
145
- * Request model (no read-only fields).
146
- */
147
- interface OAuthDisconnectRequestRequest$1 {
148
- /** OAuth provider to disconnect
149
-
150
- * `github` - GitHub */
151
- provider: OAuthConnectionProvider;
152
- }
153
- /**
154
- * Serializer for OAuth connection info (user-facing).
166
+ * Response with OAuth authorization URL.
155
167
  *
156
168
  * Response model (includes read-only fields).
157
169
  */
158
- interface OAuthConnection$1 {
159
- id: number;
160
- /** OAuth provider name (github, google, etc.)
161
-
162
- * `github` - GitHub */
163
- provider: OAuthConnectionProvider;
164
- provider_display: string;
165
- /** Username on the OAuth provider platform */
166
- provider_username: string;
167
- /** Email from OAuth provider (may differ from user.email) */
168
- provider_email: string;
169
- /** Avatar URL from OAuth provider */
170
- provider_avatar_url: string;
171
- /** When this OAuth connection was created */
172
- connected_at: string;
173
- /** Last time this OAuth connection was used for login */
174
- last_login_at: string;
170
+ interface OAuthAuthorizeResponse$1 {
171
+ /** Full URL to redirect user to OAuth provider */
172
+ authorization_url: string;
173
+ /** State token for CSRF protection. Store this and verify on callback. */
174
+ state: string;
175
175
  }
176
176
 
177
177
  declare namespace models$2 {
@@ -261,6 +261,14 @@ interface UserProfileUpdateRequest$1 {
261
261
  position?: string;
262
262
  language?: string;
263
263
  }
264
+ /**
265
+ *
266
+ * Request model (no read-only fields).
267
+ */
268
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
269
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
270
+ avatar: File | Blob;
271
+ }
264
272
  /**
265
273
  * Response serializer for account deletion.
266
274
  *
@@ -285,14 +293,6 @@ interface PatchedUserProfileUpdateRequest$1 {
285
293
  position?: string;
286
294
  language?: string;
287
295
  }
288
- /**
289
- *
290
- * Request model (no read-only fields).
291
- */
292
- interface CfgAccountsProfileAvatarCreateRequest$1 {
293
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
294
- avatar: File | Blob;
295
- }
296
296
  /**
297
297
  * Nested serializer for Centrifugo WebSocket connection token.
298
298
  *
@@ -370,6 +370,27 @@ declare class UserProfile {
370
370
  accountsProfileUpdatePartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
371
371
  }
372
372
 
373
+ /**
374
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
375
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
376
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
377
+ * refresh/access/user: populated
378
+ *
379
+ * Response model (includes read-only fields).
380
+ */
381
+ interface OTPVerifyResponse$1 {
382
+ /** Whether 2FA verification is required */
383
+ requires_2fa?: boolean;
384
+ /** 2FA session ID (if requires_2fa is True) */
385
+ session_id?: string | null;
386
+ /** JWT refresh token (if requires_2fa is False) */
387
+ refresh?: string | null;
388
+ /** JWT access token (if requires_2fa is False) */
389
+ access?: string | null;
390
+ user?: User$1 | null;
391
+ /** Whether user should be prompted to enable 2FA */
392
+ should_prompt_2fa?: boolean;
393
+ }
373
394
  /**
374
395
  * Serializer for OTP request.
375
396
  *
@@ -396,25 +417,13 @@ interface OTPRequestResponse$1 {
396
417
  message: string;
397
418
  }
398
419
  /**
399
- * OTP verification response. When 2FA is required: - requires_2fa: True -
400
- * session_id: UUID of 2FA verification session - refresh/access/user: null
401
- * When 2FA is not required: - requires_2fa: False - session_id: null -
402
- * refresh/access/user: populated
420
+ * Error response for OTP operations.
403
421
  *
404
422
  * Response model (includes read-only fields).
405
423
  */
406
- interface OTPVerifyResponse$1 {
407
- /** Whether 2FA verification is required */
408
- requires_2fa?: boolean;
409
- /** 2FA session ID (if requires_2fa is True) */
410
- session_id?: string | null;
411
- /** JWT refresh token (if requires_2fa is False) */
412
- refresh?: string | null;
413
- /** JWT access token (if requires_2fa is False) */
414
- access?: string | null;
415
- user?: User$1 | null;
416
- /** Whether user should be prompted to enable 2FA */
417
- should_prompt_2fa?: boolean;
424
+ interface OTPErrorResponse$1 {
425
+ /** Error message */
426
+ error: string;
418
427
  }
419
428
  /**
420
429
  * Serializer for OTP verification.
@@ -433,15 +442,6 @@ interface OTPVerifyRequest$1 {
433
442
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
434
443
  source_url?: string;
435
444
  }
436
- /**
437
- * Error response for OTP operations.
438
- *
439
- * Response model (includes read-only fields).
440
- */
441
- interface OTPErrorResponse$1 {
442
- /** Error message */
443
- error: string;
444
- }
445
445
  /**
446
446
  * Serializer for user details.
447
447
  *