@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "2.1.229",
3
+ "version": "2.1.230",
4
4
  "description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
5
5
  "keywords": [
6
6
  "django",
@@ -84,7 +84,7 @@
84
84
  "devDependencies": {
85
85
  "@types/node": "^24.7.2",
86
86
  "@types/react": "^19.1.0",
87
- "@djangocfg/typescript-config": "^2.1.229",
87
+ "@djangocfg/typescript-config": "^2.1.230",
88
88
  "next": "^16.0.10",
89
89
  "react": "^19.1.0",
90
90
  "tsup": "^8.5.0",
@@ -1,15 +1,25 @@
1
1
  // @ts-nocheck
2
2
  // Auto-generated by DjangoCFG - see CLAUDE.md
3
3
  /**
4
- * Serializer for OTP request.
4
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
5
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
6
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
7
+ * refresh/access/user: populated
5
8
  *
6
- * Request model (no read-only fields).
9
+ * Response model (includes read-only fields).
7
10
  */
8
- export interface OTPRequestRequest {
9
- /** Email address for OTP delivery */
10
- identifier: string;
11
- /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
12
- source_url?: string;
11
+ export interface OTPVerifyResponse {
12
+ /** Whether 2FA verification is required */
13
+ requires_2fa?: boolean;
14
+ /** 2FA session ID (if requires_2fa is True) */
15
+ session_id?: string | null;
16
+ /** JWT refresh token (if requires_2fa is False) */
17
+ refresh?: string | null;
18
+ /** JWT access token (if requires_2fa is False) */
19
+ access?: string | null;
20
+ user?: User | null;
21
+ /** Whether user should be prompted to enable 2FA */
22
+ should_prompt_2fa?: boolean;
13
23
  }
14
24
 
15
25
  /**
@@ -25,6 +35,18 @@ export interface OTPVerifyRequest {
25
35
  source_url?: string;
26
36
  }
27
37
 
38
+ /**
39
+ * Serializer for OTP request.
40
+ *
41
+ * Request model (no read-only fields).
42
+ */
43
+ export interface OTPRequestRequest {
44
+ /** Email address for OTP delivery */
45
+ identifier: string;
46
+ /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
47
+ source_url?: string;
48
+ }
49
+
28
50
  /**
29
51
  * OTP request response.
30
52
  *
@@ -56,28 +78,6 @@ export interface OTPErrorResponse {
56
78
  retry_after?: number | null;
57
79
  }
58
80
 
59
- /**
60
- * OTP verification response. When 2FA is required: - requires_2fa: True -
61
- * session_id: UUID of 2FA verification session - refresh/access/user: null
62
- * When 2FA is not required: - requires_2fa: False - session_id: null -
63
- * refresh/access/user: populated
64
- *
65
- * Response model (includes read-only fields).
66
- */
67
- export interface OTPVerifyResponse {
68
- /** Whether 2FA verification is required */
69
- requires_2fa?: boolean;
70
- /** 2FA session ID (if requires_2fa is True) */
71
- session_id?: string | null;
72
- /** JWT refresh token (if requires_2fa is False) */
73
- refresh?: string | null;
74
- /** JWT access token (if requires_2fa is False) */
75
- access?: string | null;
76
- user?: User | null;
77
- /** Whether user should be prompted to enable 2FA */
78
- should_prompt_2fa?: boolean;
79
- }
80
-
81
81
  /**
82
82
  * Serializer for user details.
83
83
  *
@@ -2,18 +2,18 @@
2
2
  // Auto-generated by DjangoCFG - see CLAUDE.md
3
3
  /**
4
4
  *
5
- * Response model (includes read-only fields).
5
+ * Request model (no read-only fields).
6
6
  */
7
- export interface TokenRefresh {
8
- access: string;
7
+ export interface TokenRefreshRequest {
9
8
  refresh: string;
10
9
  }
11
10
 
12
11
  /**
13
12
  *
14
- * Request model (no read-only fields).
13
+ * Response model (includes read-only fields).
15
14
  */
16
- export interface TokenRefreshRequest {
15
+ export interface TokenRefresh {
16
+ access: string;
17
17
  refresh: string;
18
18
  }
19
19
 
@@ -3,15 +3,15 @@
3
3
  import * as Enums from "../enums";
4
4
 
5
5
  /**
6
- * Response with OAuth authorization URL.
6
+ * Request to start OAuth flow.
7
7
  *
8
- * Response model (includes read-only fields).
8
+ * Request model (no read-only fields).
9
9
  */
10
- export interface OAuthAuthorizeResponse {
11
- /** Full URL to redirect user to OAuth provider */
12
- authorization_url: string;
13
- /** State token for CSRF protection. Store this and verify on callback. */
14
- state: string;
10
+ export interface OAuthAuthorizeRequestRequest {
11
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
12
+ redirect_uri?: string;
13
+ /** Optional source URL for registration tracking */
14
+ source_url?: string;
15
15
  }
16
16
 
17
17
  /**
@@ -27,42 +27,25 @@ export interface OAuthError {
27
27
  }
28
28
 
29
29
  /**
30
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
31
- * requires_2fa: True - session_id: UUID of 2FA verification session -
32
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
33
- * session_id: null - access/refresh/user: populated
30
+ * Request to disconnect OAuth provider.
34
31
  *
35
- * Response model (includes read-only fields).
32
+ * Request model (no read-only fields).
36
33
  */
37
- export interface OAuthTokenResponse {
38
- /** True if 2FA verification is required */
39
- requires_2fa?: boolean;
40
- /** 2FA session ID (only when requires_2fa=True) */
41
- session_id?: string | null;
42
- /** JWT access token (null when requires_2fa=True) */
43
- access?: string | null;
44
- /** JWT refresh token (null when requires_2fa=True) */
45
- refresh?: string | null;
46
- /** Authenticated user info (null when requires_2fa=True) */
47
- user?: Record<string, any> | null;
48
- /** True if a new user was created during this OAuth flow */
49
- is_new_user: boolean;
50
- /** True if a new OAuth connection was created */
51
- is_new_connection: boolean;
52
- /** True if user should be prompted to enable 2FA */
53
- should_prompt_2fa?: boolean;
34
+ export interface OAuthDisconnectRequestRequest {
35
+ /** OAuth provider to disconnect
36
+
37
+ * `github` - GitHub */
38
+ provider: Enums.OAuthConnectionProvider;
54
39
  }
55
40
 
56
41
  /**
57
- * Request to start OAuth flow.
42
+ * Response with available OAuth providers.
58
43
  *
59
- * Request model (no read-only fields).
44
+ * Response model (includes read-only fields).
60
45
  */
61
- export interface OAuthAuthorizeRequestRequest {
62
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
63
- redirect_uri?: string;
64
- /** Optional source URL for registration tracking */
65
- source_url?: string;
46
+ export interface OAuthProvidersResponse {
47
+ /** List of available OAuth providers */
48
+ providers: Array<Record<string, any>>;
66
49
  }
67
50
 
68
51
  /**
@@ -80,25 +63,42 @@ export interface OAuthCallbackRequestRequest {
80
63
  }
81
64
 
82
65
  /**
83
- * Request to disconnect OAuth provider.
66
+ * Response with OAuth authorization URL.
84
67
  *
85
- * Request model (no read-only fields).
68
+ * Response model (includes read-only fields).
86
69
  */
87
- export interface OAuthDisconnectRequestRequest {
88
- /** OAuth provider to disconnect
89
-
90
- * `github` - GitHub */
91
- provider: Enums.OAuthConnectionProvider;
70
+ export interface OAuthAuthorizeResponse {
71
+ /** Full URL to redirect user to OAuth provider */
72
+ authorization_url: string;
73
+ /** State token for CSRF protection. Store this and verify on callback. */
74
+ state: string;
92
75
  }
93
76
 
94
77
  /**
95
- * Response with available OAuth providers.
78
+ * Response with JWT tokens after OAuth authentication. When 2FA is required: -
79
+ * requires_2fa: True - session_id: UUID of 2FA verification session -
80
+ * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
81
+ * session_id: null - access/refresh/user: populated
96
82
  *
97
83
  * Response model (includes read-only fields).
98
84
  */
99
- export interface OAuthProvidersResponse {
100
- /** List of available OAuth providers */
101
- providers: Array<Record<string, any>>;
85
+ export interface OAuthTokenResponse {
86
+ /** True if 2FA verification is required */
87
+ requires_2fa?: boolean;
88
+ /** 2FA session ID (only when requires_2fa=True) */
89
+ session_id?: string | null;
90
+ /** JWT access token (null when requires_2fa=True) */
91
+ access?: string | null;
92
+ /** JWT refresh token (null when requires_2fa=True) */
93
+ refresh?: string | null;
94
+ /** Authenticated user info (null when requires_2fa=True) */
95
+ user?: Record<string, any> | null;
96
+ /** True if a new user was created during this OAuth flow */
97
+ is_new_user: boolean;
98
+ /** True if a new OAuth connection was created */
99
+ is_new_connection: boolean;
100
+ /** True if user should be prompted to enable 2FA */
101
+ should_prompt_2fa?: boolean;
102
102
  }
103
103
 
104
104
  /**
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Request model (no read-only fields).
7
7
  */
8
- export interface PatchedUserProfileUpdateRequest {
8
+ export interface UserProfileUpdateRequest {
9
9
  first_name?: string;
10
10
  last_name?: string;
11
11
  company?: string;
@@ -23,20 +23,6 @@ export interface CfgAccountsProfileAvatarCreateRequest {
23
23
  avatar: File | Blob;
24
24
  }
25
25
 
26
- /**
27
- * Serializer for updating user profile.
28
- *
29
- * Request model (no read-only fields).
30
- */
31
- export interface UserProfileUpdateRequest {
32
- first_name?: string;
33
- last_name?: string;
34
- company?: string;
35
- phone?: string;
36
- position?: string;
37
- language?: string;
38
- }
39
-
40
26
  /**
41
27
  * Serializer for user details.
42
28
  *
@@ -68,6 +54,20 @@ export interface User {
68
54
  centrifugo: CentrifugoToken | null;
69
55
  }
70
56
 
57
+ /**
58
+ * Serializer for updating user profile.
59
+ *
60
+ * Request model (no read-only fields).
61
+ */
62
+ export interface PatchedUserProfileUpdateRequest {
63
+ first_name?: string;
64
+ last_name?: string;
65
+ company?: string;
66
+ phone?: string;
67
+ position?: string;
68
+ language?: string;
69
+ }
70
+
71
71
  /**
72
72
  * Response serializer for account deletion.
73
73
  *
@@ -1,33 +1,28 @@
1
1
  // @ts-nocheck
2
2
  // Auto-generated by DjangoCFG - see CLAUDE.md
3
3
  /**
4
- * Channel history response.
5
- *
6
- * Response model (includes read-only fields).
7
- */
8
- export interface CentrifugoHistoryResponse {
9
- error?: CentrifugoError | null;
10
- result?: CentrifugoHistoryResult | null;
11
- }
12
-
13
- /**
14
- * Request to get channel presence statistics.
4
+ * Request to get channel history.
15
5
  *
16
6
  * Request model (no read-only fields).
17
7
  */
18
- export interface CentrifugoPresenceStatsRequestRequest {
8
+ export interface CentrifugoHistoryRequestRequest {
19
9
  /** Channel name */
20
10
  channel: string;
11
+ /** Maximum number of messages to return */
12
+ limit?: number | null;
13
+ since?: CentrifugoStreamPosition | null;
14
+ /** Reverse message order (newest first) */
15
+ reverse?: boolean | null;
21
16
  }
22
17
 
23
18
  /**
24
- * Server info response.
19
+ * Request to list active channels.
25
20
  *
26
- * Response model (includes read-only fields).
21
+ * Request model (no read-only fields).
27
22
  */
28
- export interface CentrifugoInfoResponse {
29
- error?: CentrifugoError | null;
30
- result?: CentrifugoInfoResult | null;
23
+ export interface CentrifugoChannelsRequestRequest {
24
+ /** Pattern to filter channels (e.g., 'user:*') */
25
+ pattern?: string | null;
31
26
  }
32
27
 
33
28
  /**
@@ -40,6 +35,16 @@ export interface CentrifugoPresenceResponse {
40
35
  result?: CentrifugoPresenceResult | null;
41
36
  }
42
37
 
38
+ /**
39
+ * Request to get channel presence statistics.
40
+ *
41
+ * Request model (no read-only fields).
42
+ */
43
+ export interface CentrifugoPresenceStatsRequestRequest {
44
+ /** Channel name */
45
+ channel: string;
46
+ }
47
+
43
48
  /**
44
49
  * Channel presence stats response.
45
50
  *
@@ -61,84 +66,67 @@ export interface CentrifugoChannelsResponse {
61
66
  }
62
67
 
63
68
  /**
64
- * Request to get channel presence.
69
+ * Server info response.
65
70
  *
66
- * Request model (no read-only fields).
71
+ * Response model (includes read-only fields).
67
72
  */
68
- export interface CentrifugoPresenceRequestRequest {
69
- /** Channel name */
70
- channel: string;
73
+ export interface CentrifugoInfoResponse {
74
+ error?: CentrifugoError | null;
75
+ result?: CentrifugoInfoResult | null;
71
76
  }
72
77
 
73
78
  /**
74
- * Request to list active channels.
79
+ * Channel history response.
75
80
  *
76
- * Request model (no read-only fields).
81
+ * Response model (includes read-only fields).
77
82
  */
78
- export interface CentrifugoChannelsRequestRequest {
79
- /** Pattern to filter channels (e.g., 'user:*') */
80
- pattern?: string | null;
83
+ export interface CentrifugoHistoryResponse {
84
+ error?: CentrifugoError | null;
85
+ result?: CentrifugoHistoryResult | null;
81
86
  }
82
87
 
83
88
  /**
84
- * Request to get channel history.
89
+ * Request to get channel presence.
85
90
  *
86
91
  * Request model (no read-only fields).
87
92
  */
88
- export interface CentrifugoHistoryRequestRequest {
93
+ export interface CentrifugoPresenceRequestRequest {
89
94
  /** Channel name */
90
95
  channel: string;
91
- /** Maximum number of messages to return */
92
- limit?: number | null;
93
- since?: CentrifugoStreamPosition | null;
94
- /** Reverse message order (newest first) */
95
- reverse?: boolean | null;
96
96
  }
97
97
 
98
98
  /**
99
- * Centrifugo API error structure.
100
- *
101
- * Response model (includes read-only fields).
102
- */
103
- export interface CentrifugoError {
104
- /** Error code (0 = no error) */
105
- code?: number;
106
- /** Error message */
107
- message?: string;
108
- }
109
-
110
- /**
111
- * History result wrapper.
99
+ * Stream position for pagination.
112
100
  *
113
101
  * Response model (includes read-only fields).
114
102
  */
115
- export interface CentrifugoHistoryResult {
116
- /** List of publications */
117
- publications: Array<CentrifugoPublication>;
118
- /** Current stream epoch */
119
- epoch: string;
120
- /** Latest stream offset */
103
+ export interface CentrifugoStreamPosition {
104
+ /** Stream offset */
121
105
  offset: number;
106
+ /** Stream epoch */
107
+ epoch: string;
122
108
  }
123
109
 
124
110
  /**
125
- * Info result wrapper.
111
+ * Presence result wrapper.
126
112
  *
127
113
  * Response model (includes read-only fields).
128
114
  */
129
- export interface CentrifugoInfoResult {
130
- /** List of Centrifugo nodes */
131
- nodes: Array<CentrifugoNodeInfo>;
115
+ export interface CentrifugoPresenceResult {
116
+ /** Map of client IDs to client info */
117
+ presence: Record<string, CentrifugoClientInfo>;
132
118
  }
133
119
 
134
120
  /**
135
- * Presence result wrapper.
121
+ * Centrifugo API error structure.
136
122
  *
137
123
  * Response model (includes read-only fields).
138
124
  */
139
- export interface CentrifugoPresenceResult {
140
- /** Map of client IDs to client info */
141
- presence: Record<string, CentrifugoClientInfo>;
125
+ export interface CentrifugoError {
126
+ /** Error code (0 = no error) */
127
+ code?: number;
128
+ /** Error message */
129
+ message?: string;
142
130
  }
143
131
 
144
132
  /**
@@ -164,30 +152,53 @@ export interface CentrifugoChannelsResult {
164
152
  }
165
153
 
166
154
  /**
167
- * Stream position for pagination.
155
+ * Info result wrapper.
168
156
  *
169
157
  * Response model (includes read-only fields).
170
158
  */
171
- export interface CentrifugoStreamPosition {
172
- /** Stream offset */
173
- offset: number;
174
- /** Stream epoch */
175
- epoch: string;
159
+ export interface CentrifugoInfoResult {
160
+ /** List of Centrifugo nodes */
161
+ nodes: Array<CentrifugoNodeInfo>;
176
162
  }
177
163
 
178
164
  /**
179
- * Single publication (message) in channel history.
165
+ * History result wrapper.
180
166
  *
181
167
  * Response model (includes read-only fields).
182
168
  */
183
- export interface CentrifugoPublication {
184
- /** Message payload */
185
- data: Record<string, any>;
186
- info?: CentrifugoClientInfo | null;
187
- /** Message offset in channel stream */
169
+ export interface CentrifugoHistoryResult {
170
+ /** List of publications */
171
+ publications: Array<CentrifugoPublication>;
172
+ /** Current stream epoch */
173
+ epoch: string;
174
+ /** Latest stream offset */
188
175
  offset: number;
189
- /** Optional message tags */
190
- tags?: Record<string, any> | null;
176
+ }
177
+
178
+ /**
179
+ * Information about connected client.
180
+ *
181
+ * Response model (includes read-only fields).
182
+ */
183
+ export interface CentrifugoClientInfo {
184
+ /** User ID */
185
+ user: string;
186
+ /** Client UUID */
187
+ client: string;
188
+ /** Connection metadata */
189
+ conn_info?: Record<string, any> | null;
190
+ /** Channel-specific metadata */
191
+ chan_info?: Record<string, any> | null;
192
+ }
193
+
194
+ /**
195
+ * Information about a single channel.
196
+ *
197
+ * Response model (includes read-only fields).
198
+ */
199
+ export interface CentrifugoChannelInfo {
200
+ /** Number of connected clients in channel */
201
+ num_clients: number;
191
202
  }
192
203
 
193
204
  /**
@@ -217,29 +228,18 @@ export interface CentrifugoNodeInfo {
217
228
  }
218
229
 
219
230
  /**
220
- * Information about connected client.
221
- *
222
- * Response model (includes read-only fields).
223
- */
224
- export interface CentrifugoClientInfo {
225
- /** User ID */
226
- user: string;
227
- /** Client UUID */
228
- client: string;
229
- /** Connection metadata */
230
- conn_info?: Record<string, any> | null;
231
- /** Channel-specific metadata */
232
- chan_info?: Record<string, any> | null;
233
- }
234
-
235
- /**
236
- * Information about a single channel.
231
+ * Single publication (message) in channel history.
237
232
  *
238
233
  * Response model (includes read-only fields).
239
234
  */
240
- export interface CentrifugoChannelInfo {
241
- /** Number of connected clients in channel */
242
- num_clients: number;
235
+ export interface CentrifugoPublication {
236
+ /** Message payload */
237
+ data: Record<string, any>;
238
+ info?: CentrifugoClientInfo | null;
239
+ /** Message offset in channel stream */
240
+ offset: number;
241
+ /** Optional message tags */
242
+ tags?: Record<string, any> | null;
243
243
  }
244
244
 
245
245
  /**