@djangocfg/api 2.1.226 → 2.1.228
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/README.md +8 -9
- package/dist/auth-server.cjs +4 -9
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +4 -9
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +120 -158
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +120 -177
- package/dist/auth.d.ts +120 -177
- package/dist/auth.mjs +149 -191
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +5 -11
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +218 -219
- package/dist/clients.d.ts +218 -219
- package/dist/clients.mjs +5 -11
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +4 -9
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +70 -91
- package/dist/hooks.d.ts +70 -91
- package/dist/hooks.mjs +4 -9
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +5 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +116 -106
- package/dist/index.d.ts +116 -106
- package/dist/index.mjs +5 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts +24 -2
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +0 -2
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +0 -2
- package/src/_api/generated/cfg_accounts/accounts/client.ts +1 -1
- package/src/_api/generated/cfg_accounts/accounts/models.ts +25 -26
- package/src/_api/generated/cfg_accounts/accounts__auth/models.ts +5 -5
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +42 -42
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +23 -23
- package/src/_api/generated/cfg_accounts/enums.ts +0 -10
- package/src/_api/generated/cfg_accounts/schema.json +31 -25
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +57 -57
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +24 -24
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +14 -14
- package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
- package/src/auth/context/AccountsContext.tsx +6 -2
- package/src/auth/context/AuthContext.tsx +32 -39
- package/src/auth/context/types.ts +5 -9
- package/src/auth/hooks/index.ts +1 -1
- package/src/auth/hooks/useAuthForm.ts +42 -75
- package/src/auth/hooks/useAuthFormState.ts +35 -6
- package/src/auth/hooks/useAuthValidation.ts +5 -65
- package/src/auth/hooks/useTwoFactor.ts +17 -2
- package/src/auth/types/form.ts +25 -70
- package/src/auth/types/index.ts +2 -6
package/dist/clients.d.cts
CHANGED
|
@@ -4,17 +4,17 @@ import useSWR from 'swr';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Request model (no read-only fields).
|
|
8
8
|
*/
|
|
9
|
-
interface
|
|
10
|
-
access: string;
|
|
9
|
+
interface TokenRefreshRequest$1 {
|
|
11
10
|
refresh: string;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* Response model (includes read-only fields).
|
|
16
15
|
*/
|
|
17
|
-
interface
|
|
16
|
+
interface TokenRefresh$1 {
|
|
17
|
+
access: string;
|
|
18
18
|
refresh: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -37,24 +37,22 @@ declare class Auth {
|
|
|
37
37
|
declare enum OAuthConnectionProvider {
|
|
38
38
|
GITHUB = "github"
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
|
|
42
|
-
* * `email` - Email
|
|
43
|
-
* * `phone` - Phone
|
|
44
|
-
*/
|
|
45
|
-
declare enum OTPRequestRequestChannel {
|
|
46
|
-
EMAIL = "email",
|
|
47
|
-
PHONE = "phone"
|
|
48
|
-
}
|
|
49
40
|
|
|
50
41
|
type enums_OAuthConnectionProvider = OAuthConnectionProvider;
|
|
51
42
|
declare const enums_OAuthConnectionProvider: typeof OAuthConnectionProvider;
|
|
52
|
-
type enums_OTPRequestRequestChannel = OTPRequestRequestChannel;
|
|
53
|
-
declare const enums_OTPRequestRequestChannel: typeof OTPRequestRequestChannel;
|
|
54
43
|
declare namespace enums {
|
|
55
|
-
export { enums_OAuthConnectionProvider as OAuthConnectionProvider
|
|
44
|
+
export { enums_OAuthConnectionProvider as OAuthConnectionProvider };
|
|
56
45
|
}
|
|
57
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Response with available OAuth providers.
|
|
49
|
+
*
|
|
50
|
+
* Response model (includes read-only fields).
|
|
51
|
+
*/
|
|
52
|
+
interface OAuthProvidersResponse$1 {
|
|
53
|
+
/** List of available OAuth providers */
|
|
54
|
+
providers: Array<Record<string, any>>;
|
|
55
|
+
}
|
|
58
56
|
/**
|
|
59
57
|
* Request to disconnect OAuth provider.
|
|
60
58
|
*
|
|
@@ -66,17 +64,6 @@ interface OAuthDisconnectRequestRequest$1 {
|
|
|
66
64
|
* `github` - GitHub */
|
|
67
65
|
provider: OAuthConnectionProvider;
|
|
68
66
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Response with OAuth authorization URL.
|
|
71
|
-
*
|
|
72
|
-
* Response model (includes read-only fields).
|
|
73
|
-
*/
|
|
74
|
-
interface OAuthAuthorizeResponse$1 {
|
|
75
|
-
/** Full URL to redirect user to OAuth provider */
|
|
76
|
-
authorization_url: string;
|
|
77
|
-
/** State token for CSRF protection. Store this and verify on callback. */
|
|
78
|
-
state: string;
|
|
79
|
-
}
|
|
80
67
|
/**
|
|
81
68
|
* Request to start OAuth flow.
|
|
82
69
|
*
|
|
@@ -88,6 +75,30 @@ interface OAuthAuthorizeRequestRequest$1 {
|
|
|
88
75
|
/** Optional source URL for registration tracking */
|
|
89
76
|
source_url?: string;
|
|
90
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Request to complete OAuth flow (callback handler).
|
|
80
|
+
*
|
|
81
|
+
* Request model (no read-only fields).
|
|
82
|
+
*/
|
|
83
|
+
interface OAuthCallbackRequestRequest$1 {
|
|
84
|
+
/** Authorization code from OAuth provider callback */
|
|
85
|
+
code: string;
|
|
86
|
+
/** State token for CSRF verification (from authorize response) */
|
|
87
|
+
state: string;
|
|
88
|
+
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
89
|
+
redirect_uri?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Response with OAuth authorization URL.
|
|
93
|
+
*
|
|
94
|
+
* Response model (includes read-only fields).
|
|
95
|
+
*/
|
|
96
|
+
interface OAuthAuthorizeResponse$1 {
|
|
97
|
+
/** Full URL to redirect user to OAuth provider */
|
|
98
|
+
authorization_url: string;
|
|
99
|
+
/** State token for CSRF protection. Store this and verify on callback. */
|
|
100
|
+
state: string;
|
|
101
|
+
}
|
|
91
102
|
/**
|
|
92
103
|
* Response with JWT tokens after OAuth authentication. When 2FA is required: -
|
|
93
104
|
* requires_2fa: True - session_id: UUID of 2FA verification session -
|
|
@@ -114,28 +125,6 @@ interface OAuthTokenResponse$1 {
|
|
|
114
125
|
/** True if user should be prompted to enable 2FA */
|
|
115
126
|
should_prompt_2fa?: boolean;
|
|
116
127
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Response with available OAuth providers.
|
|
119
|
-
*
|
|
120
|
-
* Response model (includes read-only fields).
|
|
121
|
-
*/
|
|
122
|
-
interface OAuthProvidersResponse$1 {
|
|
123
|
-
/** List of available OAuth providers */
|
|
124
|
-
providers: Array<Record<string, any>>;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Request to complete OAuth flow (callback handler).
|
|
128
|
-
*
|
|
129
|
-
* Request model (no read-only fields).
|
|
130
|
-
*/
|
|
131
|
-
interface OAuthCallbackRequestRequest$1 {
|
|
132
|
-
/** Authorization code from OAuth provider callback */
|
|
133
|
-
code: string;
|
|
134
|
-
/** State token for CSRF verification (from authorize response) */
|
|
135
|
-
state: string;
|
|
136
|
-
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
137
|
-
redirect_uri?: string;
|
|
138
|
-
}
|
|
139
128
|
|
|
140
129
|
/**
|
|
141
130
|
* API endpoints for Oauth.
|
|
@@ -177,6 +166,17 @@ declare class Oauth {
|
|
|
177
166
|
accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse$1>;
|
|
178
167
|
}
|
|
179
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Response serializer for account deletion.
|
|
171
|
+
*
|
|
172
|
+
* Response model (includes read-only fields).
|
|
173
|
+
*/
|
|
174
|
+
interface AccountDeleteResponse$1 {
|
|
175
|
+
/** Whether the account was successfully deleted */
|
|
176
|
+
success: boolean;
|
|
177
|
+
/** Human-readable message about the deletion */
|
|
178
|
+
message: string;
|
|
179
|
+
}
|
|
180
180
|
/**
|
|
181
181
|
* Serializer for updating user profile.
|
|
182
182
|
*
|
|
@@ -191,12 +191,17 @@ interface UserProfileUpdateRequest$1 {
|
|
|
191
191
|
language?: string;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
+
* Serializer for updating user profile.
|
|
194
195
|
*
|
|
195
196
|
* Request model (no read-only fields).
|
|
196
197
|
*/
|
|
197
|
-
interface
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
interface PatchedUserProfileUpdateRequest$1 {
|
|
199
|
+
first_name?: string;
|
|
200
|
+
last_name?: string;
|
|
201
|
+
company?: string;
|
|
202
|
+
phone?: string;
|
|
203
|
+
position?: string;
|
|
204
|
+
language?: string;
|
|
200
205
|
}
|
|
201
206
|
/**
|
|
202
207
|
* Serializer for user details.
|
|
@@ -229,28 +234,12 @@ interface User$2 {
|
|
|
229
234
|
centrifugo: CentrifugoToken$2 | null;
|
|
230
235
|
}
|
|
231
236
|
/**
|
|
232
|
-
* Serializer for updating user profile.
|
|
233
237
|
*
|
|
234
238
|
* Request model (no read-only fields).
|
|
235
239
|
*/
|
|
236
|
-
interface
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
company?: string;
|
|
240
|
-
phone?: string;
|
|
241
|
-
position?: string;
|
|
242
|
-
language?: string;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Response serializer for account deletion.
|
|
246
|
-
*
|
|
247
|
-
* Response model (includes read-only fields).
|
|
248
|
-
*/
|
|
249
|
-
interface AccountDeleteResponse$1 {
|
|
250
|
-
/** Whether the account was successfully deleted */
|
|
251
|
-
success: boolean;
|
|
252
|
-
/** Human-readable message about the deletion */
|
|
253
|
-
message: string;
|
|
240
|
+
interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
241
|
+
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
242
|
+
avatar: File | Blob;
|
|
254
243
|
}
|
|
255
244
|
/**
|
|
256
245
|
* Nested serializer for Centrifugo WebSocket connection token.
|
|
@@ -331,16 +320,20 @@ declare class UserProfile {
|
|
|
331
320
|
* Request model (no read-only fields).
|
|
332
321
|
*/
|
|
333
322
|
interface OTPRequestRequest$1 {
|
|
334
|
-
/** Email address
|
|
323
|
+
/** Email address for OTP delivery */
|
|
335
324
|
identifier: string;
|
|
336
|
-
/** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
|
|
337
|
-
|
|
338
|
-
* `email` - Email
|
|
339
|
-
* `phone` - Phone */
|
|
340
|
-
channel?: OTPRequestRequestChannel;
|
|
341
325
|
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
342
326
|
source_url?: string;
|
|
343
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* OTP request response.
|
|
330
|
+
*
|
|
331
|
+
* Response model (includes read-only fields).
|
|
332
|
+
*/
|
|
333
|
+
interface OTPRequestResponse$1 {
|
|
334
|
+
/** Success message */
|
|
335
|
+
message: string;
|
|
336
|
+
}
|
|
344
337
|
/**
|
|
345
338
|
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
346
339
|
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
@@ -362,29 +355,15 @@ interface OTPVerifyResponse$1 {
|
|
|
362
355
|
/** Whether user should be prompted to enable 2FA */
|
|
363
356
|
should_prompt_2fa?: boolean;
|
|
364
357
|
}
|
|
365
|
-
/**
|
|
366
|
-
* OTP request response.
|
|
367
|
-
*
|
|
368
|
-
* Response model (includes read-only fields).
|
|
369
|
-
*/
|
|
370
|
-
interface OTPRequestResponse$1 {
|
|
371
|
-
/** Success message */
|
|
372
|
-
message: string;
|
|
373
|
-
}
|
|
374
358
|
/**
|
|
375
359
|
* Serializer for OTP verification.
|
|
376
360
|
*
|
|
377
361
|
* Request model (no read-only fields).
|
|
378
362
|
*/
|
|
379
363
|
interface OTPVerifyRequest$1 {
|
|
380
|
-
/** Email address
|
|
364
|
+
/** Email address used for OTP request */
|
|
381
365
|
identifier: string;
|
|
382
366
|
otp: string;
|
|
383
|
-
/** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
|
|
384
|
-
|
|
385
|
-
* `email` - Email
|
|
386
|
-
* `phone` - Phone */
|
|
387
|
-
channel?: OTPRequestRequestChannel;
|
|
388
367
|
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
389
368
|
source_url?: string;
|
|
390
369
|
}
|
|
@@ -441,7 +420,7 @@ declare class Accounts {
|
|
|
441
420
|
private client;
|
|
442
421
|
constructor(client: any);
|
|
443
422
|
/**
|
|
444
|
-
* Request OTP code to email
|
|
423
|
+
* Request OTP code to email.
|
|
445
424
|
*/
|
|
446
425
|
otpRequestCreate(data: OTPRequestRequest$1): Promise<OTPRequestResponse$1>;
|
|
447
426
|
/**
|
|
@@ -795,14 +774,36 @@ type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>;
|
|
|
795
774
|
* Zod schema for OTPErrorResponse
|
|
796
775
|
*
|
|
797
776
|
* This schema provides runtime validation and type inference.
|
|
798
|
-
* *
|
|
777
|
+
* * Typed error response for OTP operations.
|
|
778
|
+
|
|
779
|
+
error_code values:
|
|
780
|
+
- invalid_identifier — malformed email
|
|
781
|
+
- cooldown — too soon after last request (retry_after = seconds)
|
|
782
|
+
- hourly_limit — hourly quota exceeded (retry_after = seconds until reset)
|
|
783
|
+
- daily_limit — daily quota exceeded (retry_after = seconds until reset)
|
|
784
|
+
- rate_limited — IP-level rate limit hit (no retry_after)
|
|
785
|
+
- user_creation_failed — internal error creating account
|
|
786
|
+
- send_failed — transport error (email / SMS)
|
|
787
|
+
- internal_error — unexpected server error
|
|
799
788
|
* */
|
|
800
789
|
|
|
801
790
|
/**
|
|
802
|
-
*
|
|
791
|
+
* Typed error response for OTP operations.
|
|
792
|
+
|
|
793
|
+
error_code values:
|
|
794
|
+
- invalid_identifier — malformed email
|
|
795
|
+
- cooldown — too soon after last request (retry_after = seconds)
|
|
796
|
+
- hourly_limit — hourly quota exceeded (retry_after = seconds until reset)
|
|
797
|
+
- daily_limit — daily quota exceeded (retry_after = seconds until reset)
|
|
798
|
+
- rate_limited — IP-level rate limit hit (no retry_after)
|
|
799
|
+
- user_creation_failed — internal error creating account
|
|
800
|
+
- send_failed — transport error (email / SMS)
|
|
801
|
+
- internal_error — unexpected server error
|
|
803
802
|
*/
|
|
804
803
|
declare const OTPErrorResponseSchema: z.ZodObject<{
|
|
805
804
|
error: z.ZodString;
|
|
805
|
+
error_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
806
|
+
retry_after: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
806
807
|
}, z.core.$strip>;
|
|
807
808
|
/**
|
|
808
809
|
* Infer TypeScript type from Zod schema
|
|
@@ -821,7 +822,6 @@ type OTPErrorResponse = z.infer<typeof OTPErrorResponseSchema>;
|
|
|
821
822
|
*/
|
|
822
823
|
declare const OTPRequestRequestSchema: z.ZodObject<{
|
|
823
824
|
identifier: z.ZodString;
|
|
824
|
-
channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
|
|
825
825
|
source_url: z.ZodOptional<z.ZodString>;
|
|
826
826
|
}, z.core.$strip>;
|
|
827
827
|
/**
|
|
@@ -860,7 +860,6 @@ type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;
|
|
|
860
860
|
declare const OTPVerifyRequestSchema: z.ZodObject<{
|
|
861
861
|
identifier: z.ZodString;
|
|
862
862
|
otp: z.ZodString;
|
|
863
|
-
channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
|
|
864
863
|
source_url: z.ZodOptional<z.ZodString>;
|
|
865
864
|
}, z.core.$strip>;
|
|
866
865
|
/**
|
|
@@ -1276,15 +1275,6 @@ declare class API$2 {
|
|
|
1276
1275
|
getSchemaPath(): string;
|
|
1277
1276
|
}
|
|
1278
1277
|
|
|
1279
|
-
/**
|
|
1280
|
-
* Channel history response.
|
|
1281
|
-
*
|
|
1282
|
-
* Response model (includes read-only fields).
|
|
1283
|
-
*/
|
|
1284
|
-
interface CentrifugoHistoryResponse$1 {
|
|
1285
|
-
error?: CentrifugoError$1 | null;
|
|
1286
|
-
result?: CentrifugoHistoryResult$1 | null;
|
|
1287
|
-
}
|
|
1288
1278
|
/**
|
|
1289
1279
|
* Channel presence response.
|
|
1290
1280
|
*
|
|
@@ -1294,15 +1284,6 @@ interface CentrifugoPresenceResponse$1 {
|
|
|
1294
1284
|
error?: CentrifugoError$1 | null;
|
|
1295
1285
|
result?: CentrifugoPresenceResult$1 | null;
|
|
1296
1286
|
}
|
|
1297
|
-
/**
|
|
1298
|
-
* Server info response.
|
|
1299
|
-
*
|
|
1300
|
-
* Response model (includes read-only fields).
|
|
1301
|
-
*/
|
|
1302
|
-
interface CentrifugoInfoResponse$1 {
|
|
1303
|
-
error?: CentrifugoError$1 | null;
|
|
1304
|
-
result?: CentrifugoInfoResult$1 | null;
|
|
1305
|
-
}
|
|
1306
1287
|
/**
|
|
1307
1288
|
* Request to get channel presence.
|
|
1308
1289
|
*
|
|
@@ -1313,13 +1294,22 @@ interface CentrifugoPresenceRequestRequest$1 {
|
|
|
1313
1294
|
channel: string;
|
|
1314
1295
|
}
|
|
1315
1296
|
/**
|
|
1316
|
-
*
|
|
1297
|
+
* Channel history response.
|
|
1317
1298
|
*
|
|
1318
1299
|
* Response model (includes read-only fields).
|
|
1319
1300
|
*/
|
|
1320
|
-
interface
|
|
1301
|
+
interface CentrifugoHistoryResponse$1 {
|
|
1321
1302
|
error?: CentrifugoError$1 | null;
|
|
1322
|
-
result?:
|
|
1303
|
+
result?: CentrifugoHistoryResult$1 | null;
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Server info response.
|
|
1307
|
+
*
|
|
1308
|
+
* Response model (includes read-only fields).
|
|
1309
|
+
*/
|
|
1310
|
+
interface CentrifugoInfoResponse$1 {
|
|
1311
|
+
error?: CentrifugoError$1 | null;
|
|
1312
|
+
result?: CentrifugoInfoResult$1 | null;
|
|
1323
1313
|
}
|
|
1324
1314
|
/**
|
|
1325
1315
|
* Request to get channel presence statistics.
|
|
@@ -1354,26 +1344,22 @@ interface CentrifugoChannelsRequestRequest$1 {
|
|
|
1354
1344
|
pattern?: string | null;
|
|
1355
1345
|
}
|
|
1356
1346
|
/**
|
|
1357
|
-
*
|
|
1347
|
+
* List of active channels response.
|
|
1358
1348
|
*
|
|
1359
1349
|
* Response model (includes read-only fields).
|
|
1360
1350
|
*/
|
|
1361
|
-
interface
|
|
1351
|
+
interface CentrifugoChannelsResponse$1 {
|
|
1362
1352
|
error?: CentrifugoError$1 | null;
|
|
1363
|
-
result?:
|
|
1353
|
+
result?: CentrifugoChannelsResult$1 | null;
|
|
1364
1354
|
}
|
|
1365
1355
|
/**
|
|
1366
|
-
*
|
|
1356
|
+
* Channel presence stats response.
|
|
1367
1357
|
*
|
|
1368
1358
|
* Response model (includes read-only fields).
|
|
1369
1359
|
*/
|
|
1370
|
-
interface
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
/** Current stream epoch */
|
|
1374
|
-
epoch: string;
|
|
1375
|
-
/** Latest stream offset */
|
|
1376
|
-
offset: number;
|
|
1360
|
+
interface CentrifugoPresenceStatsResponse$1 {
|
|
1361
|
+
error?: CentrifugoError$1 | null;
|
|
1362
|
+
result?: CentrifugoPresenceStatsResult$1 | null;
|
|
1377
1363
|
}
|
|
1378
1364
|
/**
|
|
1379
1365
|
* Centrifugo API error structure.
|
|
@@ -1396,22 +1382,26 @@ interface CentrifugoPresenceResult$1 {
|
|
|
1396
1382
|
presence: Record<string, CentrifugoClientInfo$1>;
|
|
1397
1383
|
}
|
|
1398
1384
|
/**
|
|
1399
|
-
*
|
|
1385
|
+
* History result wrapper.
|
|
1400
1386
|
*
|
|
1401
1387
|
* Response model (includes read-only fields).
|
|
1402
1388
|
*/
|
|
1403
|
-
interface
|
|
1404
|
-
/** List of
|
|
1405
|
-
|
|
1389
|
+
interface CentrifugoHistoryResult$1 {
|
|
1390
|
+
/** List of publications */
|
|
1391
|
+
publications: Array<CentrifugoPublication$1>;
|
|
1392
|
+
/** Current stream epoch */
|
|
1393
|
+
epoch: string;
|
|
1394
|
+
/** Latest stream offset */
|
|
1395
|
+
offset: number;
|
|
1406
1396
|
}
|
|
1407
1397
|
/**
|
|
1408
|
-
*
|
|
1398
|
+
* Info result wrapper.
|
|
1409
1399
|
*
|
|
1410
1400
|
* Response model (includes read-only fields).
|
|
1411
1401
|
*/
|
|
1412
|
-
interface
|
|
1413
|
-
/**
|
|
1414
|
-
|
|
1402
|
+
interface CentrifugoInfoResult$1 {
|
|
1403
|
+
/** List of Centrifugo nodes */
|
|
1404
|
+
nodes: Array<CentrifugoNodeInfo$1>;
|
|
1415
1405
|
}
|
|
1416
1406
|
/**
|
|
1417
1407
|
* Stream position for pagination.
|
|
@@ -1424,6 +1414,15 @@ interface CentrifugoStreamPosition$1 {
|
|
|
1424
1414
|
/** Stream epoch */
|
|
1425
1415
|
epoch: string;
|
|
1426
1416
|
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Channels result wrapper.
|
|
1419
|
+
*
|
|
1420
|
+
* Response model (includes read-only fields).
|
|
1421
|
+
*/
|
|
1422
|
+
interface CentrifugoChannelsResult$1 {
|
|
1423
|
+
/** Map of channel names to channel info */
|
|
1424
|
+
channels: Record<string, CentrifugoChannelInfo$1>;
|
|
1425
|
+
}
|
|
1427
1426
|
/**
|
|
1428
1427
|
* Presence stats result.
|
|
1429
1428
|
*
|
|
@@ -1435,20 +1434,6 @@ interface CentrifugoPresenceStatsResult$1 {
|
|
|
1435
1434
|
/** Number of unique users */
|
|
1436
1435
|
num_users: number;
|
|
1437
1436
|
}
|
|
1438
|
-
/**
|
|
1439
|
-
* Single publication (message) in channel history.
|
|
1440
|
-
*
|
|
1441
|
-
* Response model (includes read-only fields).
|
|
1442
|
-
*/
|
|
1443
|
-
interface CentrifugoPublication$1 {
|
|
1444
|
-
/** Message payload */
|
|
1445
|
-
data: Record<string, any>;
|
|
1446
|
-
info?: CentrifugoClientInfo$1 | null;
|
|
1447
|
-
/** Message offset in channel stream */
|
|
1448
|
-
offset: number;
|
|
1449
|
-
/** Optional message tags */
|
|
1450
|
-
tags?: Record<string, any> | null;
|
|
1451
|
-
}
|
|
1452
1437
|
/**
|
|
1453
1438
|
* Information about connected client.
|
|
1454
1439
|
*
|
|
@@ -1464,6 +1449,20 @@ interface CentrifugoClientInfo$1 {
|
|
|
1464
1449
|
/** Channel-specific metadata */
|
|
1465
1450
|
chan_info?: Record<string, any> | null;
|
|
1466
1451
|
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Single publication (message) in channel history.
|
|
1454
|
+
*
|
|
1455
|
+
* Response model (includes read-only fields).
|
|
1456
|
+
*/
|
|
1457
|
+
interface CentrifugoPublication$1 {
|
|
1458
|
+
/** Message payload */
|
|
1459
|
+
data: Record<string, any>;
|
|
1460
|
+
info?: CentrifugoClientInfo$1 | null;
|
|
1461
|
+
/** Message offset in channel stream */
|
|
1462
|
+
offset: number;
|
|
1463
|
+
/** Optional message tags */
|
|
1464
|
+
tags?: Record<string, any> | null;
|
|
1465
|
+
}
|
|
1467
1466
|
/**
|
|
1468
1467
|
* Information about a single Centrifugo node.
|
|
1469
1468
|
*
|
|
@@ -1633,15 +1632,27 @@ interface PaginatedPublishList$1 {
|
|
|
1633
1632
|
results: Array<Publish$1>;
|
|
1634
1633
|
}
|
|
1635
1634
|
/**
|
|
1636
|
-
*
|
|
1635
|
+
* Overview statistics for Centrifugo publishes.
|
|
1637
1636
|
*
|
|
1638
1637
|
* Response model (includes read-only fields).
|
|
1639
1638
|
*/
|
|
1640
|
-
interface
|
|
1641
|
-
/**
|
|
1642
|
-
|
|
1643
|
-
/**
|
|
1644
|
-
|
|
1639
|
+
interface CentrifugoOverviewStats$1 {
|
|
1640
|
+
/** Total publishes in period */
|
|
1641
|
+
total: number;
|
|
1642
|
+
/** Successful publishes */
|
|
1643
|
+
successful: number;
|
|
1644
|
+
/** Failed publishes */
|
|
1645
|
+
failed: number;
|
|
1646
|
+
/** Timeout publishes */
|
|
1647
|
+
timeout: number;
|
|
1648
|
+
/** Success rate percentage */
|
|
1649
|
+
success_rate: number;
|
|
1650
|
+
/** Average duration in milliseconds */
|
|
1651
|
+
avg_duration_ms: number;
|
|
1652
|
+
/** Average ACKs received */
|
|
1653
|
+
avg_acks_received: number;
|
|
1654
|
+
/** Statistics period in hours */
|
|
1655
|
+
period_hours: number;
|
|
1645
1656
|
}
|
|
1646
1657
|
/**
|
|
1647
1658
|
* Health check response.
|
|
@@ -1659,27 +1670,15 @@ interface CentrifugoHealthCheck$1 {
|
|
|
1659
1670
|
timestamp: string;
|
|
1660
1671
|
}
|
|
1661
1672
|
/**
|
|
1662
|
-
*
|
|
1673
|
+
* List of channel statistics.
|
|
1663
1674
|
*
|
|
1664
1675
|
* Response model (includes read-only fields).
|
|
1665
1676
|
*/
|
|
1666
|
-
interface
|
|
1667
|
-
/**
|
|
1668
|
-
|
|
1669
|
-
/**
|
|
1670
|
-
|
|
1671
|
-
/** Failed publishes */
|
|
1672
|
-
failed: number;
|
|
1673
|
-
/** Timeout publishes */
|
|
1674
|
-
timeout: number;
|
|
1675
|
-
/** Success rate percentage */
|
|
1676
|
-
success_rate: number;
|
|
1677
|
-
/** Average duration in milliseconds */
|
|
1678
|
-
avg_duration_ms: number;
|
|
1679
|
-
/** Average ACKs received */
|
|
1680
|
-
avg_acks_received: number;
|
|
1681
|
-
/** Statistics period in hours */
|
|
1682
|
-
period_hours: number;
|
|
1677
|
+
interface ChannelList$1 {
|
|
1678
|
+
/** Channel statistics */
|
|
1679
|
+
channels: Array<ChannelStats$1>;
|
|
1680
|
+
/** Total number of channels */
|
|
1681
|
+
total_channels: number;
|
|
1683
1682
|
}
|
|
1684
1683
|
/**
|
|
1685
1684
|
* Single timeline data point for DRF.
|
|
@@ -1769,19 +1768,6 @@ declare class CentrifugoMonitoring {
|
|
|
1769
1768
|
}): Promise<TimelineResponse$1>;
|
|
1770
1769
|
}
|
|
1771
1770
|
|
|
1772
|
-
/**
|
|
1773
|
-
* Response model for manual ACK.
|
|
1774
|
-
*
|
|
1775
|
-
* Response model (includes read-only fields).
|
|
1776
|
-
*/
|
|
1777
|
-
interface ManualAckResponse$1 {
|
|
1778
|
-
/** Whether ACK was sent successfully */
|
|
1779
|
-
success: boolean;
|
|
1780
|
-
/** Message ID that was acknowledged */
|
|
1781
|
-
message_id: string;
|
|
1782
|
-
/** Error message if failed */
|
|
1783
|
-
error?: string | null;
|
|
1784
|
-
}
|
|
1785
1771
|
/**
|
|
1786
1772
|
* Request model for test message publishing.
|
|
1787
1773
|
*
|
|
@@ -1816,6 +1802,19 @@ interface PublishTestResponse$1 {
|
|
|
1816
1802
|
/** Error message if failed */
|
|
1817
1803
|
error?: string | null;
|
|
1818
1804
|
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Response model for manual ACK.
|
|
1807
|
+
*
|
|
1808
|
+
* Response model (includes read-only fields).
|
|
1809
|
+
*/
|
|
1810
|
+
interface ManualAckResponse$1 {
|
|
1811
|
+
/** Whether ACK was sent successfully */
|
|
1812
|
+
success: boolean;
|
|
1813
|
+
/** Message ID that was acknowledged */
|
|
1814
|
+
message_id: string;
|
|
1815
|
+
/** Error message if failed */
|
|
1816
|
+
error?: string | null;
|
|
1817
|
+
}
|
|
1819
1818
|
/**
|
|
1820
1819
|
* Request model for manual ACK sending.
|
|
1821
1820
|
*
|
|
@@ -3183,19 +3182,6 @@ declare class API$1 {
|
|
|
3183
3182
|
getSchemaPath(): string;
|
|
3184
3183
|
}
|
|
3185
3184
|
|
|
3186
|
-
/**
|
|
3187
|
-
* Serializer for backup codes status.
|
|
3188
|
-
*
|
|
3189
|
-
* Response model (includes read-only fields).
|
|
3190
|
-
*/
|
|
3191
|
-
interface BackupCodesStatus$1 {
|
|
3192
|
-
/** Number of unused backup codes */
|
|
3193
|
-
remaining_count: number;
|
|
3194
|
-
/** Total number of codes generated */
|
|
3195
|
-
total_generated: number;
|
|
3196
|
-
/** Warning if running low on codes */
|
|
3197
|
-
warning?: string | null;
|
|
3198
|
-
}
|
|
3199
3185
|
/**
|
|
3200
3186
|
* Serializer for regenerating backup codes.
|
|
3201
3187
|
*
|
|
@@ -3216,6 +3202,19 @@ interface BackupCodesRegenerateResponse$1 {
|
|
|
3216
3202
|
/** Warning about previous codes being invalidated */
|
|
3217
3203
|
warning: string;
|
|
3218
3204
|
}
|
|
3205
|
+
/**
|
|
3206
|
+
* Serializer for backup codes status.
|
|
3207
|
+
*
|
|
3208
|
+
* Response model (includes read-only fields).
|
|
3209
|
+
*/
|
|
3210
|
+
interface BackupCodesStatus$1 {
|
|
3211
|
+
/** Number of unused backup codes */
|
|
3212
|
+
remaining_count: number;
|
|
3213
|
+
/** Total number of codes generated */
|
|
3214
|
+
total_generated: number;
|
|
3215
|
+
/** Warning if running low on codes */
|
|
3216
|
+
warning?: string | null;
|
|
3217
|
+
}
|
|
3219
3218
|
|
|
3220
3219
|
/**
|
|
3221
3220
|
* API endpoints for Backup Codes.
|
|
@@ -3357,6 +3356,15 @@ interface SetupResponse$1 {
|
|
|
3357
3356
|
/** Seconds until setup expires (typically 600 = 10 minutes) */
|
|
3358
3357
|
expires_in: number;
|
|
3359
3358
|
}
|
|
3359
|
+
/**
|
|
3360
|
+
* Serializer for starting 2FA setup.
|
|
3361
|
+
*
|
|
3362
|
+
* Request model (no read-only fields).
|
|
3363
|
+
*/
|
|
3364
|
+
interface SetupRequest$1 {
|
|
3365
|
+
/** Device name for identification (e.g., 'My iPhone') */
|
|
3366
|
+
device_name?: string;
|
|
3367
|
+
}
|
|
3360
3368
|
/**
|
|
3361
3369
|
* Serializer for confirming 2FA setup with first code.
|
|
3362
3370
|
*
|
|
@@ -3368,15 +3376,6 @@ interface ConfirmSetupRequest$1 {
|
|
|
3368
3376
|
/** 6-digit TOTP code from authenticator app */
|
|
3369
3377
|
code: string;
|
|
3370
3378
|
}
|
|
3371
|
-
/**
|
|
3372
|
-
* Serializer for starting 2FA setup.
|
|
3373
|
-
*
|
|
3374
|
-
* Request model (no read-only fields).
|
|
3375
|
-
*/
|
|
3376
|
-
interface SetupRequest$1 {
|
|
3377
|
-
/** Device name for identification (e.g., 'My iPhone') */
|
|
3378
|
-
device_name?: string;
|
|
3379
|
-
}
|
|
3380
3379
|
|
|
3381
3380
|
/**
|
|
3382
3381
|
* API endpoints for TOTP Setup.
|
|
@@ -3397,15 +3396,15 @@ declare class TotpSetup {
|
|
|
3397
3396
|
}
|
|
3398
3397
|
|
|
3399
3398
|
/**
|
|
3400
|
-
* Serializer for
|
|
3399
|
+
* Serializer for backup code verification during login.
|
|
3401
3400
|
*
|
|
3402
3401
|
* Request model (no read-only fields).
|
|
3403
3402
|
*/
|
|
3404
|
-
interface
|
|
3403
|
+
interface VerifyBackupRequest$1 {
|
|
3405
3404
|
/** 2FA session ID from login response */
|
|
3406
3405
|
session_id: string;
|
|
3407
|
-
/**
|
|
3408
|
-
|
|
3406
|
+
/** 8-character backup recovery code */
|
|
3407
|
+
backup_code: string;
|
|
3409
3408
|
}
|
|
3410
3409
|
/**
|
|
3411
3410
|
* Response serializer for successful 2FA verification.
|
|
@@ -3425,15 +3424,15 @@ interface VerifyResponse$1 {
|
|
|
3425
3424
|
warning?: string;
|
|
3426
3425
|
}
|
|
3427
3426
|
/**
|
|
3428
|
-
* Serializer for
|
|
3427
|
+
* Serializer for TOTP code verification during login.
|
|
3429
3428
|
*
|
|
3430
3429
|
* Request model (no read-only fields).
|
|
3431
3430
|
*/
|
|
3432
|
-
interface
|
|
3431
|
+
interface VerifyRequest$1 {
|
|
3433
3432
|
/** 2FA session ID from login response */
|
|
3434
3433
|
session_id: string;
|
|
3435
|
-
/**
|
|
3436
|
-
|
|
3434
|
+
/** 6-digit TOTP code from authenticator app */
|
|
3435
|
+
code: string;
|
|
3437
3436
|
}
|
|
3438
3437
|
/**
|
|
3439
3438
|
* User data returned after 2FA verification.
|