@djangocfg/api 2.1.228 → 2.1.229

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/hooks.d.cts CHANGED
@@ -4,17 +4,17 @@ import useSWR from 'swr';
4
4
 
5
5
  /**
6
6
  *
7
- * Request model (no read-only fields).
7
+ * Response model (includes read-only fields).
8
8
  */
9
- interface TokenRefreshRequest$1 {
9
+ interface TokenRefresh$1 {
10
+ access: string;
10
11
  refresh: string;
11
12
  }
12
13
  /**
13
14
  *
14
- * Response model (includes read-only fields).
15
+ * Request model (no read-only fields).
15
16
  */
16
- interface TokenRefresh$1 {
17
- access: string;
17
+ interface TokenRefreshRequest$1 {
18
18
  refresh: string;
19
19
  }
20
20
 
@@ -39,24 +39,41 @@ declare enum OAuthConnectionProvider {
39
39
  }
40
40
 
41
41
  /**
42
- * Response with available OAuth providers.
42
+ * Response with OAuth authorization URL.
43
43
  *
44
44
  * Response model (includes read-only fields).
45
45
  */
46
- interface OAuthProvidersResponse {
47
- /** List of available OAuth providers */
48
- providers: Array<Record<string, any>>;
46
+ interface OAuthAuthorizeResponse$1 {
47
+ /** Full URL to redirect user to OAuth provider */
48
+ authorization_url: string;
49
+ /** State token for CSRF protection. Store this and verify on callback. */
50
+ state: string;
49
51
  }
50
52
  /**
51
- * Request to disconnect OAuth provider.
53
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
54
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
55
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
56
+ * session_id: null - access/refresh/user: populated
52
57
  *
53
- * Request model (no read-only fields).
58
+ * Response model (includes read-only fields).
54
59
  */
55
- interface OAuthDisconnectRequestRequest$1 {
56
- /** OAuth provider to disconnect
57
-
58
- * `github` - GitHub */
59
- provider: OAuthConnectionProvider;
60
+ interface OAuthTokenResponse$1 {
61
+ /** True if 2FA verification is required */
62
+ requires_2fa?: boolean;
63
+ /** 2FA session ID (only when requires_2fa=True) */
64
+ session_id?: string | null;
65
+ /** JWT access token (null when requires_2fa=True) */
66
+ access?: string | null;
67
+ /** JWT refresh token (null when requires_2fa=True) */
68
+ refresh?: string | null;
69
+ /** Authenticated user info (null when requires_2fa=True) */
70
+ user?: Record<string, any> | null;
71
+ /** True if a new user was created during this OAuth flow */
72
+ is_new_user: boolean;
73
+ /** True if a new OAuth connection was created */
74
+ is_new_connection: boolean;
75
+ /** True if user should be prompted to enable 2FA */
76
+ should_prompt_2fa?: boolean;
60
77
  }
61
78
  /**
62
79
  * Request to start OAuth flow.
@@ -83,41 +100,24 @@ interface OAuthCallbackRequestRequest$1 {
83
100
  redirect_uri?: string;
84
101
  }
85
102
  /**
86
- * Response with OAuth authorization URL.
103
+ * Request to disconnect OAuth provider.
87
104
  *
88
- * Response model (includes read-only fields).
105
+ * Request model (no read-only fields).
89
106
  */
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;
107
+ interface OAuthDisconnectRequestRequest$1 {
108
+ /** OAuth provider to disconnect
109
+
110
+ * `github` - GitHub */
111
+ provider: OAuthConnectionProvider;
95
112
  }
96
113
  /**
97
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
98
- * requires_2fa: True - session_id: UUID of 2FA verification session -
99
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
100
- * session_id: null - access/refresh/user: populated
114
+ * Response with available OAuth providers.
101
115
  *
102
116
  * Response model (includes read-only fields).
103
117
  */
104
- interface OAuthTokenResponse$1 {
105
- /** True if 2FA verification is required */
106
- requires_2fa?: boolean;
107
- /** 2FA session ID (only when requires_2fa=True) */
108
- session_id?: string | null;
109
- /** JWT access token (null when requires_2fa=True) */
110
- access?: string | null;
111
- /** JWT refresh token (null when requires_2fa=True) */
112
- refresh?: string | null;
113
- /** Authenticated user info (null when requires_2fa=True) */
114
- user?: Record<string, any> | null;
115
- /** True if a new user was created during this OAuth flow */
116
- is_new_user: boolean;
117
- /** True if a new OAuth connection was created */
118
- is_new_connection: boolean;
119
- /** True if user should be prompted to enable 2FA */
120
- should_prompt_2fa?: boolean;
118
+ interface OAuthProvidersResponse {
119
+ /** List of available OAuth providers */
120
+ providers: Array<Record<string, any>>;
121
121
  }
122
122
 
123
123
  /**
@@ -160,23 +160,12 @@ declare class Oauth {
160
160
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
161
161
  }
162
162
 
163
- /**
164
- * Response serializer for account deletion.
165
- *
166
- * Response model (includes read-only fields).
167
- */
168
- interface AccountDeleteResponse$1 {
169
- /** Whether the account was successfully deleted */
170
- success: boolean;
171
- /** Human-readable message about the deletion */
172
- message: string;
173
- }
174
163
  /**
175
164
  * Serializer for updating user profile.
176
165
  *
177
166
  * Request model (no read-only fields).
178
167
  */
179
- interface UserProfileUpdateRequest$1 {
168
+ interface PatchedUserProfileUpdateRequest$1 {
180
169
  first_name?: string;
181
170
  last_name?: string;
182
171
  company?: string;
@@ -184,12 +173,20 @@ interface UserProfileUpdateRequest$1 {
184
173
  position?: string;
185
174
  language?: string;
186
175
  }
176
+ /**
177
+ *
178
+ * Request model (no read-only fields).
179
+ */
180
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
181
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
182
+ avatar: File | Blob;
183
+ }
187
184
  /**
188
185
  * Serializer for updating user profile.
189
186
  *
190
187
  * Request model (no read-only fields).
191
188
  */
192
- interface PatchedUserProfileUpdateRequest$1 {
189
+ interface UserProfileUpdateRequest$1 {
193
190
  first_name?: string;
194
191
  last_name?: string;
195
192
  company?: string;
@@ -228,12 +225,15 @@ interface User$2 {
228
225
  centrifugo: CentrifugoToken$1 | null;
229
226
  }
230
227
  /**
228
+ * Response serializer for account deletion.
231
229
  *
232
- * Request model (no read-only fields).
230
+ * Response model (includes read-only fields).
233
231
  */
234
- interface CfgAccountsProfileAvatarCreateRequest$1 {
235
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
236
- avatar: File | Blob;
232
+ interface AccountDeleteResponse$1 {
233
+ /** Whether the account was successfully deleted */
234
+ success: boolean;
235
+ /** Human-readable message about the deletion */
236
+ message: string;
237
237
  }
238
238
  /**
239
239
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -319,6 +319,18 @@ interface OTPRequestRequest$1 {
319
319
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
320
320
  source_url?: string;
321
321
  }
322
+ /**
323
+ * Serializer for OTP verification.
324
+ *
325
+ * Request model (no read-only fields).
326
+ */
327
+ interface OTPVerifyRequest$1 {
328
+ /** Email address used for OTP request */
329
+ identifier: string;
330
+ otp: string;
331
+ /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
332
+ source_url?: string;
333
+ }
322
334
  /**
323
335
  * OTP request response.
324
336
  *
@@ -349,18 +361,6 @@ interface OTPVerifyResponse$1 {
349
361
  /** Whether user should be prompted to enable 2FA */
350
362
  should_prompt_2fa?: boolean;
351
363
  }
352
- /**
353
- * Serializer for OTP verification.
354
- *
355
- * Request model (no read-only fields).
356
- */
357
- interface OTPVerifyRequest$1 {
358
- /** Email address used for OTP request */
359
- identifier: string;
360
- otp: string;
361
- /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
362
- source_url?: string;
363
- }
364
364
  /**
365
365
  * Serializer for user details.
366
366
  *
package/dist/hooks.d.ts CHANGED
@@ -4,17 +4,17 @@ import useSWR from 'swr';
4
4
 
5
5
  /**
6
6
  *
7
- * Request model (no read-only fields).
7
+ * Response model (includes read-only fields).
8
8
  */
9
- interface TokenRefreshRequest$1 {
9
+ interface TokenRefresh$1 {
10
+ access: string;
10
11
  refresh: string;
11
12
  }
12
13
  /**
13
14
  *
14
- * Response model (includes read-only fields).
15
+ * Request model (no read-only fields).
15
16
  */
16
- interface TokenRefresh$1 {
17
- access: string;
17
+ interface TokenRefreshRequest$1 {
18
18
  refresh: string;
19
19
  }
20
20
 
@@ -39,24 +39,41 @@ declare enum OAuthConnectionProvider {
39
39
  }
40
40
 
41
41
  /**
42
- * Response with available OAuth providers.
42
+ * Response with OAuth authorization URL.
43
43
  *
44
44
  * Response model (includes read-only fields).
45
45
  */
46
- interface OAuthProvidersResponse {
47
- /** List of available OAuth providers */
48
- providers: Array<Record<string, any>>;
46
+ interface OAuthAuthorizeResponse$1 {
47
+ /** Full URL to redirect user to OAuth provider */
48
+ authorization_url: string;
49
+ /** State token for CSRF protection. Store this and verify on callback. */
50
+ state: string;
49
51
  }
50
52
  /**
51
- * Request to disconnect OAuth provider.
53
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
54
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
55
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
56
+ * session_id: null - access/refresh/user: populated
52
57
  *
53
- * Request model (no read-only fields).
58
+ * Response model (includes read-only fields).
54
59
  */
55
- interface OAuthDisconnectRequestRequest$1 {
56
- /** OAuth provider to disconnect
57
-
58
- * `github` - GitHub */
59
- provider: OAuthConnectionProvider;
60
+ interface OAuthTokenResponse$1 {
61
+ /** True if 2FA verification is required */
62
+ requires_2fa?: boolean;
63
+ /** 2FA session ID (only when requires_2fa=True) */
64
+ session_id?: string | null;
65
+ /** JWT access token (null when requires_2fa=True) */
66
+ access?: string | null;
67
+ /** JWT refresh token (null when requires_2fa=True) */
68
+ refresh?: string | null;
69
+ /** Authenticated user info (null when requires_2fa=True) */
70
+ user?: Record<string, any> | null;
71
+ /** True if a new user was created during this OAuth flow */
72
+ is_new_user: boolean;
73
+ /** True if a new OAuth connection was created */
74
+ is_new_connection: boolean;
75
+ /** True if user should be prompted to enable 2FA */
76
+ should_prompt_2fa?: boolean;
60
77
  }
61
78
  /**
62
79
  * Request to start OAuth flow.
@@ -83,41 +100,24 @@ interface OAuthCallbackRequestRequest$1 {
83
100
  redirect_uri?: string;
84
101
  }
85
102
  /**
86
- * Response with OAuth authorization URL.
103
+ * Request to disconnect OAuth provider.
87
104
  *
88
- * Response model (includes read-only fields).
105
+ * Request model (no read-only fields).
89
106
  */
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;
107
+ interface OAuthDisconnectRequestRequest$1 {
108
+ /** OAuth provider to disconnect
109
+
110
+ * `github` - GitHub */
111
+ provider: OAuthConnectionProvider;
95
112
  }
96
113
  /**
97
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
98
- * requires_2fa: True - session_id: UUID of 2FA verification session -
99
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
100
- * session_id: null - access/refresh/user: populated
114
+ * Response with available OAuth providers.
101
115
  *
102
116
  * Response model (includes read-only fields).
103
117
  */
104
- interface OAuthTokenResponse$1 {
105
- /** True if 2FA verification is required */
106
- requires_2fa?: boolean;
107
- /** 2FA session ID (only when requires_2fa=True) */
108
- session_id?: string | null;
109
- /** JWT access token (null when requires_2fa=True) */
110
- access?: string | null;
111
- /** JWT refresh token (null when requires_2fa=True) */
112
- refresh?: string | null;
113
- /** Authenticated user info (null when requires_2fa=True) */
114
- user?: Record<string, any> | null;
115
- /** True if a new user was created during this OAuth flow */
116
- is_new_user: boolean;
117
- /** True if a new OAuth connection was created */
118
- is_new_connection: boolean;
119
- /** True if user should be prompted to enable 2FA */
120
- should_prompt_2fa?: boolean;
118
+ interface OAuthProvidersResponse {
119
+ /** List of available OAuth providers */
120
+ providers: Array<Record<string, any>>;
121
121
  }
122
122
 
123
123
  /**
@@ -160,23 +160,12 @@ declare class Oauth {
160
160
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
161
161
  }
162
162
 
163
- /**
164
- * Response serializer for account deletion.
165
- *
166
- * Response model (includes read-only fields).
167
- */
168
- interface AccountDeleteResponse$1 {
169
- /** Whether the account was successfully deleted */
170
- success: boolean;
171
- /** Human-readable message about the deletion */
172
- message: string;
173
- }
174
163
  /**
175
164
  * Serializer for updating user profile.
176
165
  *
177
166
  * Request model (no read-only fields).
178
167
  */
179
- interface UserProfileUpdateRequest$1 {
168
+ interface PatchedUserProfileUpdateRequest$1 {
180
169
  first_name?: string;
181
170
  last_name?: string;
182
171
  company?: string;
@@ -184,12 +173,20 @@ interface UserProfileUpdateRequest$1 {
184
173
  position?: string;
185
174
  language?: string;
186
175
  }
176
+ /**
177
+ *
178
+ * Request model (no read-only fields).
179
+ */
180
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
181
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
182
+ avatar: File | Blob;
183
+ }
187
184
  /**
188
185
  * Serializer for updating user profile.
189
186
  *
190
187
  * Request model (no read-only fields).
191
188
  */
192
- interface PatchedUserProfileUpdateRequest$1 {
189
+ interface UserProfileUpdateRequest$1 {
193
190
  first_name?: string;
194
191
  last_name?: string;
195
192
  company?: string;
@@ -228,12 +225,15 @@ interface User$2 {
228
225
  centrifugo: CentrifugoToken$1 | null;
229
226
  }
230
227
  /**
228
+ * Response serializer for account deletion.
231
229
  *
232
- * Request model (no read-only fields).
230
+ * Response model (includes read-only fields).
233
231
  */
234
- interface CfgAccountsProfileAvatarCreateRequest$1 {
235
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
236
- avatar: File | Blob;
232
+ interface AccountDeleteResponse$1 {
233
+ /** Whether the account was successfully deleted */
234
+ success: boolean;
235
+ /** Human-readable message about the deletion */
236
+ message: string;
237
237
  }
238
238
  /**
239
239
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -319,6 +319,18 @@ interface OTPRequestRequest$1 {
319
319
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
320
320
  source_url?: string;
321
321
  }
322
+ /**
323
+ * Serializer for OTP verification.
324
+ *
325
+ * Request model (no read-only fields).
326
+ */
327
+ interface OTPVerifyRequest$1 {
328
+ /** Email address used for OTP request */
329
+ identifier: string;
330
+ otp: string;
331
+ /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
332
+ source_url?: string;
333
+ }
322
334
  /**
323
335
  * OTP request response.
324
336
  *
@@ -349,18 +361,6 @@ interface OTPVerifyResponse$1 {
349
361
  /** Whether user should be prompted to enable 2FA */
350
362
  should_prompt_2fa?: boolean;
351
363
  }
352
- /**
353
- * Serializer for OTP verification.
354
- *
355
- * Request model (no read-only fields).
356
- */
357
- interface OTPVerifyRequest$1 {
358
- /** Email address used for OTP request */
359
- identifier: string;
360
- otp: string;
361
- /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
362
- source_url?: string;
363
- }
364
364
  /**
365
365
  * Serializer for user details.
366
366
  *