@djangocfg/api 2.1.229 → 2.1.230

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
 
@@ -48,15 +48,15 @@ declare namespace enums {
48
48
  }
49
49
 
50
50
  /**
51
- * Response with OAuth authorization URL.
51
+ * Request to start OAuth flow.
52
52
  *
53
- * Response model (includes read-only fields).
53
+ * Request model (no read-only fields).
54
54
  */
55
- interface 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;
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;
60
60
  }
61
61
  /**
62
62
  * Error response for OAuth endpoints.
@@ -70,41 +70,24 @@ interface OAuthError$1 {
70
70
  error_description?: string;
71
71
  }
72
72
  /**
73
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
74
- * requires_2fa: True - session_id: UUID of 2FA verification session -
75
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
76
- * session_id: null - access/refresh/user: populated
73
+ * Request to disconnect OAuth provider.
77
74
  *
78
- * Response model (includes read-only fields).
75
+ * Request model (no read-only fields).
79
76
  */
80
- interface OAuthTokenResponse$1 {
81
- /** True if 2FA verification is required */
82
- requires_2fa?: boolean;
83
- /** 2FA session ID (only when requires_2fa=True) */
84
- session_id?: string | null;
85
- /** JWT access token (null when requires_2fa=True) */
86
- access?: string | null;
87
- /** JWT refresh token (null when requires_2fa=True) */
88
- refresh?: string | null;
89
- /** Authenticated user info (null when requires_2fa=True) */
90
- user?: Record<string, any> | null;
91
- /** True if a new user was created during this OAuth flow */
92
- is_new_user: boolean;
93
- /** True if a new OAuth connection was created */
94
- is_new_connection: boolean;
95
- /** True if user should be prompted to enable 2FA */
96
- should_prompt_2fa?: boolean;
77
+ interface OAuthDisconnectRequestRequest$1 {
78
+ /** OAuth provider to disconnect
79
+
80
+ * `github` - GitHub */
81
+ provider: OAuthConnectionProvider;
97
82
  }
98
83
  /**
99
- * Request to start OAuth flow.
84
+ * Response with available OAuth providers.
100
85
  *
101
- * Request model (no read-only fields).
86
+ * Response model (includes read-only fields).
102
87
  */
103
- interface OAuthAuthorizeRequestRequest$1 {
104
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
105
- redirect_uri?: string;
106
- /** Optional source URL for registration tracking */
107
- source_url?: string;
88
+ interface OAuthProvidersResponse$1 {
89
+ /** List of available OAuth providers */
90
+ providers: Array<Record<string, any>>;
108
91
  }
109
92
  /**
110
93
  * Request to complete OAuth flow (callback handler).
@@ -120,24 +103,41 @@ interface OAuthCallbackRequestRequest$1 {
120
103
  redirect_uri?: string;
121
104
  }
122
105
  /**
123
- * Request to disconnect OAuth provider.
106
+ * Response with OAuth authorization URL.
124
107
  *
125
- * Request model (no read-only fields).
108
+ * Response model (includes read-only fields).
126
109
  */
127
- interface OAuthDisconnectRequestRequest$1 {
128
- /** OAuth provider to disconnect
129
-
130
- * `github` - GitHub */
131
- provider: OAuthConnectionProvider;
110
+ interface OAuthAuthorizeResponse$1 {
111
+ /** Full URL to redirect user to OAuth provider */
112
+ authorization_url: string;
113
+ /** State token for CSRF protection. Store this and verify on callback. */
114
+ state: string;
132
115
  }
133
116
  /**
134
- * Response with available OAuth providers.
117
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
118
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
119
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
120
+ * session_id: null - access/refresh/user: populated
135
121
  *
136
122
  * Response model (includes read-only fields).
137
123
  */
138
- interface OAuthProvidersResponse$1 {
139
- /** List of available OAuth providers */
140
- providers: Array<Record<string, any>>;
124
+ interface OAuthTokenResponse$1 {
125
+ /** True if 2FA verification is required */
126
+ requires_2fa?: boolean;
127
+ /** 2FA session ID (only when requires_2fa=True) */
128
+ session_id?: string | null;
129
+ /** JWT access token (null when requires_2fa=True) */
130
+ access?: string | null;
131
+ /** JWT refresh token (null when requires_2fa=True) */
132
+ refresh?: string | null;
133
+ /** Authenticated user info (null when requires_2fa=True) */
134
+ user?: Record<string, any> | null;
135
+ /** True if a new user was created during this OAuth flow */
136
+ is_new_user: boolean;
137
+ /** True if a new OAuth connection was created */
138
+ is_new_connection: boolean;
139
+ /** True if user should be prompted to enable 2FA */
140
+ should_prompt_2fa?: boolean;
141
141
  }
142
142
  /**
143
143
  * Serializer for OAuth connection info (user-facing).
@@ -212,7 +212,7 @@ declare class Oauth {
212
212
  *
213
213
  * Request model (no read-only fields).
214
214
  */
215
- interface PatchedUserProfileUpdateRequest$1 {
215
+ interface UserProfileUpdateRequest$1 {
216
216
  first_name?: string;
217
217
  last_name?: string;
218
218
  company?: string;
@@ -228,19 +228,6 @@ interface CfgAccountsProfileAvatarCreateRequest$1 {
228
228
  /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
229
229
  avatar: File | Blob;
230
230
  }
231
- /**
232
- * Serializer for updating user profile.
233
- *
234
- * Request model (no read-only fields).
235
- */
236
- interface UserProfileUpdateRequest$1 {
237
- first_name?: string;
238
- last_name?: string;
239
- company?: string;
240
- phone?: string;
241
- position?: string;
242
- language?: string;
243
- }
244
231
  /**
245
232
  * Serializer for user details.
246
233
  *
@@ -271,6 +258,19 @@ interface User$2 {
271
258
  unanswered_messages_count: number;
272
259
  centrifugo: CentrifugoToken$2 | null;
273
260
  }
261
+ /**
262
+ * Serializer for updating user profile.
263
+ *
264
+ * Request model (no read-only fields).
265
+ */
266
+ interface PatchedUserProfileUpdateRequest$1 {
267
+ first_name?: string;
268
+ last_name?: string;
269
+ company?: string;
270
+ phone?: string;
271
+ position?: string;
272
+ language?: string;
273
+ }
274
274
  /**
275
275
  * Response serializer for account deletion.
276
276
  *
@@ -360,15 +360,25 @@ declare class UserProfile {
360
360
  }
361
361
 
362
362
  /**
363
- * Serializer for OTP request.
363
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
364
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
365
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
366
+ * refresh/access/user: populated
364
367
  *
365
- * Request model (no read-only fields).
368
+ * Response model (includes read-only fields).
366
369
  */
367
- interface OTPRequestRequest$1 {
368
- /** Email address for OTP delivery */
369
- identifier: string;
370
- /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
371
- source_url?: string;
370
+ interface OTPVerifyResponse$1 {
371
+ /** Whether 2FA verification is required */
372
+ requires_2fa?: boolean;
373
+ /** 2FA session ID (if requires_2fa is True) */
374
+ session_id?: string | null;
375
+ /** JWT refresh token (if requires_2fa is False) */
376
+ refresh?: string | null;
377
+ /** JWT access token (if requires_2fa is False) */
378
+ access?: string | null;
379
+ user?: User$1 | null;
380
+ /** Whether user should be prompted to enable 2FA */
381
+ should_prompt_2fa?: boolean;
372
382
  }
373
383
  /**
374
384
  * Serializer for OTP verification.
@@ -382,6 +392,17 @@ interface OTPVerifyRequest$1 {
382
392
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
383
393
  source_url?: string;
384
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
+ }
385
406
  /**
386
407
  * OTP request response.
387
408
  *
@@ -411,27 +432,6 @@ interface OTPErrorResponse$1 {
411
432
  /** Seconds until the client may retry (present only for rate-limit errors) */
412
433
  retry_after?: number | null;
413
434
  }
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
  *
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
 
@@ -48,15 +48,15 @@ declare namespace enums {
48
48
  }
49
49
 
50
50
  /**
51
- * Response with OAuth authorization URL.
51
+ * Request to start OAuth flow.
52
52
  *
53
- * Response model (includes read-only fields).
53
+ * Request model (no read-only fields).
54
54
  */
55
- interface 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;
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;
60
60
  }
61
61
  /**
62
62
  * Error response for OAuth endpoints.
@@ -70,41 +70,24 @@ interface OAuthError$1 {
70
70
  error_description?: string;
71
71
  }
72
72
  /**
73
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
74
- * requires_2fa: True - session_id: UUID of 2FA verification session -
75
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
76
- * session_id: null - access/refresh/user: populated
73
+ * Request to disconnect OAuth provider.
77
74
  *
78
- * Response model (includes read-only fields).
75
+ * Request model (no read-only fields).
79
76
  */
80
- interface OAuthTokenResponse$1 {
81
- /** True if 2FA verification is required */
82
- requires_2fa?: boolean;
83
- /** 2FA session ID (only when requires_2fa=True) */
84
- session_id?: string | null;
85
- /** JWT access token (null when requires_2fa=True) */
86
- access?: string | null;
87
- /** JWT refresh token (null when requires_2fa=True) */
88
- refresh?: string | null;
89
- /** Authenticated user info (null when requires_2fa=True) */
90
- user?: Record<string, any> | null;
91
- /** True if a new user was created during this OAuth flow */
92
- is_new_user: boolean;
93
- /** True if a new OAuth connection was created */
94
- is_new_connection: boolean;
95
- /** True if user should be prompted to enable 2FA */
96
- should_prompt_2fa?: boolean;
77
+ interface OAuthDisconnectRequestRequest$1 {
78
+ /** OAuth provider to disconnect
79
+
80
+ * `github` - GitHub */
81
+ provider: OAuthConnectionProvider;
97
82
  }
98
83
  /**
99
- * Request to start OAuth flow.
84
+ * Response with available OAuth providers.
100
85
  *
101
- * Request model (no read-only fields).
86
+ * Response model (includes read-only fields).
102
87
  */
103
- interface OAuthAuthorizeRequestRequest$1 {
104
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
105
- redirect_uri?: string;
106
- /** Optional source URL for registration tracking */
107
- source_url?: string;
88
+ interface OAuthProvidersResponse$1 {
89
+ /** List of available OAuth providers */
90
+ providers: Array<Record<string, any>>;
108
91
  }
109
92
  /**
110
93
  * Request to complete OAuth flow (callback handler).
@@ -120,24 +103,41 @@ interface OAuthCallbackRequestRequest$1 {
120
103
  redirect_uri?: string;
121
104
  }
122
105
  /**
123
- * Request to disconnect OAuth provider.
106
+ * Response with OAuth authorization URL.
124
107
  *
125
- * Request model (no read-only fields).
108
+ * Response model (includes read-only fields).
126
109
  */
127
- interface OAuthDisconnectRequestRequest$1 {
128
- /** OAuth provider to disconnect
129
-
130
- * `github` - GitHub */
131
- provider: OAuthConnectionProvider;
110
+ interface OAuthAuthorizeResponse$1 {
111
+ /** Full URL to redirect user to OAuth provider */
112
+ authorization_url: string;
113
+ /** State token for CSRF protection. Store this and verify on callback. */
114
+ state: string;
132
115
  }
133
116
  /**
134
- * Response with available OAuth providers.
117
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
118
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
119
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
120
+ * session_id: null - access/refresh/user: populated
135
121
  *
136
122
  * Response model (includes read-only fields).
137
123
  */
138
- interface OAuthProvidersResponse$1 {
139
- /** List of available OAuth providers */
140
- providers: Array<Record<string, any>>;
124
+ interface OAuthTokenResponse$1 {
125
+ /** True if 2FA verification is required */
126
+ requires_2fa?: boolean;
127
+ /** 2FA session ID (only when requires_2fa=True) */
128
+ session_id?: string | null;
129
+ /** JWT access token (null when requires_2fa=True) */
130
+ access?: string | null;
131
+ /** JWT refresh token (null when requires_2fa=True) */
132
+ refresh?: string | null;
133
+ /** Authenticated user info (null when requires_2fa=True) */
134
+ user?: Record<string, any> | null;
135
+ /** True if a new user was created during this OAuth flow */
136
+ is_new_user: boolean;
137
+ /** True if a new OAuth connection was created */
138
+ is_new_connection: boolean;
139
+ /** True if user should be prompted to enable 2FA */
140
+ should_prompt_2fa?: boolean;
141
141
  }
142
142
  /**
143
143
  * Serializer for OAuth connection info (user-facing).
@@ -212,7 +212,7 @@ declare class Oauth {
212
212
  *
213
213
  * Request model (no read-only fields).
214
214
  */
215
- interface PatchedUserProfileUpdateRequest$1 {
215
+ interface UserProfileUpdateRequest$1 {
216
216
  first_name?: string;
217
217
  last_name?: string;
218
218
  company?: string;
@@ -228,19 +228,6 @@ interface CfgAccountsProfileAvatarCreateRequest$1 {
228
228
  /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
229
229
  avatar: File | Blob;
230
230
  }
231
- /**
232
- * Serializer for updating user profile.
233
- *
234
- * Request model (no read-only fields).
235
- */
236
- interface UserProfileUpdateRequest$1 {
237
- first_name?: string;
238
- last_name?: string;
239
- company?: string;
240
- phone?: string;
241
- position?: string;
242
- language?: string;
243
- }
244
231
  /**
245
232
  * Serializer for user details.
246
233
  *
@@ -271,6 +258,19 @@ interface User$2 {
271
258
  unanswered_messages_count: number;
272
259
  centrifugo: CentrifugoToken$2 | null;
273
260
  }
261
+ /**
262
+ * Serializer for updating user profile.
263
+ *
264
+ * Request model (no read-only fields).
265
+ */
266
+ interface PatchedUserProfileUpdateRequest$1 {
267
+ first_name?: string;
268
+ last_name?: string;
269
+ company?: string;
270
+ phone?: string;
271
+ position?: string;
272
+ language?: string;
273
+ }
274
274
  /**
275
275
  * Response serializer for account deletion.
276
276
  *
@@ -360,15 +360,25 @@ declare class UserProfile {
360
360
  }
361
361
 
362
362
  /**
363
- * Serializer for OTP request.
363
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
364
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
365
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
366
+ * refresh/access/user: populated
364
367
  *
365
- * Request model (no read-only fields).
368
+ * Response model (includes read-only fields).
366
369
  */
367
- interface OTPRequestRequest$1 {
368
- /** Email address for OTP delivery */
369
- identifier: string;
370
- /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
371
- source_url?: string;
370
+ interface OTPVerifyResponse$1 {
371
+ /** Whether 2FA verification is required */
372
+ requires_2fa?: boolean;
373
+ /** 2FA session ID (if requires_2fa is True) */
374
+ session_id?: string | null;
375
+ /** JWT refresh token (if requires_2fa is False) */
376
+ refresh?: string | null;
377
+ /** JWT access token (if requires_2fa is False) */
378
+ access?: string | null;
379
+ user?: User$1 | null;
380
+ /** Whether user should be prompted to enable 2FA */
381
+ should_prompt_2fa?: boolean;
372
382
  }
373
383
  /**
374
384
  * Serializer for OTP verification.
@@ -382,6 +392,17 @@ interface OTPVerifyRequest$1 {
382
392
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
383
393
  source_url?: string;
384
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
+ }
385
406
  /**
386
407
  * OTP request response.
387
408
  *
@@ -411,27 +432,6 @@ interface OTPErrorResponse$1 {
411
432
  /** Seconds until the client may retry (present only for rate-limit errors) */
412
433
  retry_after?: number | null;
413
434
  }
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
  *