@djangocfg/api 2.1.227 → 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/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 +253 -254
- package/dist/clients.d.ts +253 -254
- 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 +64 -85
- package/dist/hooks.d.ts +64 -85
- 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 +109 -99
- package/dist/index.d.ts +109 -99
- 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 +37 -38
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +36 -36
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +15 -15
- 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 +74 -74
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +36 -36
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +22 -22
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +22 -22
- 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.ts
CHANGED
|
@@ -37,35 +37,13 @@ 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
|
|
|
58
|
-
/**
|
|
59
|
-
* Request to disconnect OAuth provider.
|
|
60
|
-
*
|
|
61
|
-
* Request model (no read-only fields).
|
|
62
|
-
*/
|
|
63
|
-
interface OAuthDisconnectRequestRequest$1 {
|
|
64
|
-
/** OAuth provider to disconnect
|
|
65
|
-
|
|
66
|
-
* `github` - GitHub */
|
|
67
|
-
provider: OAuthConnectionProvider;
|
|
68
|
-
}
|
|
69
47
|
/**
|
|
70
48
|
* Response with OAuth authorization URL.
|
|
71
49
|
*
|
|
@@ -77,17 +55,6 @@ interface OAuthAuthorizeResponse$1 {
|
|
|
77
55
|
/** State token for CSRF protection. Store this and verify on callback. */
|
|
78
56
|
state: string;
|
|
79
57
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Request to start OAuth flow.
|
|
82
|
-
*
|
|
83
|
-
* Request model (no read-only fields).
|
|
84
|
-
*/
|
|
85
|
-
interface OAuthAuthorizeRequestRequest$1 {
|
|
86
|
-
/** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
|
|
87
|
-
redirect_uri?: string;
|
|
88
|
-
/** Optional source URL for registration tracking */
|
|
89
|
-
source_url?: string;
|
|
90
|
-
}
|
|
91
58
|
/**
|
|
92
59
|
* Response with JWT tokens after OAuth authentication. When 2FA is required: -
|
|
93
60
|
* requires_2fa: True - session_id: UUID of 2FA verification session -
|
|
@@ -115,13 +82,15 @@ interface OAuthTokenResponse$1 {
|
|
|
115
82
|
should_prompt_2fa?: boolean;
|
|
116
83
|
}
|
|
117
84
|
/**
|
|
118
|
-
*
|
|
85
|
+
* Request to start OAuth flow.
|
|
119
86
|
*
|
|
120
|
-
*
|
|
87
|
+
* Request model (no read-only fields).
|
|
121
88
|
*/
|
|
122
|
-
interface
|
|
123
|
-
/**
|
|
124
|
-
|
|
89
|
+
interface OAuthAuthorizeRequestRequest$1 {
|
|
90
|
+
/** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
|
|
91
|
+
redirect_uri?: string;
|
|
92
|
+
/** Optional source URL for registration tracking */
|
|
93
|
+
source_url?: string;
|
|
125
94
|
}
|
|
126
95
|
/**
|
|
127
96
|
* Request to complete OAuth flow (callback handler).
|
|
@@ -136,6 +105,26 @@ interface OAuthCallbackRequestRequest$1 {
|
|
|
136
105
|
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
137
106
|
redirect_uri?: string;
|
|
138
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Request to disconnect OAuth provider.
|
|
110
|
+
*
|
|
111
|
+
* Request model (no read-only fields).
|
|
112
|
+
*/
|
|
113
|
+
interface OAuthDisconnectRequestRequest$1 {
|
|
114
|
+
/** OAuth provider to disconnect
|
|
115
|
+
|
|
116
|
+
* `github` - GitHub */
|
|
117
|
+
provider: OAuthConnectionProvider;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Response with available OAuth providers.
|
|
121
|
+
*
|
|
122
|
+
* Response model (includes read-only fields).
|
|
123
|
+
*/
|
|
124
|
+
interface OAuthProvidersResponse$1 {
|
|
125
|
+
/** List of available OAuth providers */
|
|
126
|
+
providers: Array<Record<string, any>>;
|
|
127
|
+
}
|
|
139
128
|
|
|
140
129
|
/**
|
|
141
130
|
* API endpoints for Oauth.
|
|
@@ -182,7 +171,7 @@ declare class Oauth {
|
|
|
182
171
|
*
|
|
183
172
|
* Request model (no read-only fields).
|
|
184
173
|
*/
|
|
185
|
-
interface
|
|
174
|
+
interface PatchedUserProfileUpdateRequest$1 {
|
|
186
175
|
first_name?: string;
|
|
187
176
|
last_name?: string;
|
|
188
177
|
company?: string;
|
|
@@ -198,6 +187,19 @@ interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
|
198
187
|
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
199
188
|
avatar: File | Blob;
|
|
200
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Serializer for updating user profile.
|
|
192
|
+
*
|
|
193
|
+
* Request model (no read-only fields).
|
|
194
|
+
*/
|
|
195
|
+
interface UserProfileUpdateRequest$1 {
|
|
196
|
+
first_name?: string;
|
|
197
|
+
last_name?: string;
|
|
198
|
+
company?: string;
|
|
199
|
+
phone?: string;
|
|
200
|
+
position?: string;
|
|
201
|
+
language?: string;
|
|
202
|
+
}
|
|
201
203
|
/**
|
|
202
204
|
* Serializer for user details.
|
|
203
205
|
*
|
|
@@ -228,19 +230,6 @@ interface User$2 {
|
|
|
228
230
|
unanswered_messages_count: number;
|
|
229
231
|
centrifugo: CentrifugoToken$2 | null;
|
|
230
232
|
}
|
|
231
|
-
/**
|
|
232
|
-
* Serializer for updating user profile.
|
|
233
|
-
*
|
|
234
|
-
* Request model (no read-only fields).
|
|
235
|
-
*/
|
|
236
|
-
interface PatchedUserProfileUpdateRequest$1 {
|
|
237
|
-
first_name?: string;
|
|
238
|
-
last_name?: string;
|
|
239
|
-
company?: string;
|
|
240
|
-
phone?: string;
|
|
241
|
-
position?: string;
|
|
242
|
-
language?: string;
|
|
243
|
-
}
|
|
244
233
|
/**
|
|
245
234
|
* Response serializer for account deletion.
|
|
246
235
|
*
|
|
@@ -331,16 +320,32 @@ 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
|
+
* Serializer for OTP verification.
|
|
330
|
+
*
|
|
331
|
+
* Request model (no read-only fields).
|
|
332
|
+
*/
|
|
333
|
+
interface OTPVerifyRequest$1 {
|
|
334
|
+
/** Email address used for OTP request */
|
|
335
|
+
identifier: string;
|
|
336
|
+
otp: string;
|
|
337
|
+
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
338
|
+
source_url?: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* OTP request response.
|
|
342
|
+
*
|
|
343
|
+
* Response model (includes read-only fields).
|
|
344
|
+
*/
|
|
345
|
+
interface OTPRequestResponse$1 {
|
|
346
|
+
/** Success message */
|
|
347
|
+
message: string;
|
|
348
|
+
}
|
|
344
349
|
/**
|
|
345
350
|
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
346
351
|
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
@@ -362,32 +367,6 @@ interface OTPVerifyResponse$1 {
|
|
|
362
367
|
/** Whether user should be prompted to enable 2FA */
|
|
363
368
|
should_prompt_2fa?: boolean;
|
|
364
369
|
}
|
|
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
|
-
/**
|
|
375
|
-
* Serializer for OTP verification.
|
|
376
|
-
*
|
|
377
|
-
* Request model (no read-only fields).
|
|
378
|
-
*/
|
|
379
|
-
interface OTPVerifyRequest$1 {
|
|
380
|
-
/** Email address or phone number used for OTP request */
|
|
381
|
-
identifier: string;
|
|
382
|
-
otp: string;
|
|
383
|
-
/** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
|
|
384
|
-
|
|
385
|
-
* `email` - Email
|
|
386
|
-
* `phone` - Phone */
|
|
387
|
-
channel?: OTPRequestRequestChannel;
|
|
388
|
-
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
389
|
-
source_url?: string;
|
|
390
|
-
}
|
|
391
370
|
/**
|
|
392
371
|
* Serializer for user details.
|
|
393
372
|
*
|
|
@@ -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
|
/**
|
|
@@ -1286,13 +1285,13 @@ interface CentrifugoHistoryResponse$1 {
|
|
|
1286
1285
|
result?: CentrifugoHistoryResult$1 | null;
|
|
1287
1286
|
}
|
|
1288
1287
|
/**
|
|
1289
|
-
*
|
|
1288
|
+
* Request to get channel presence statistics.
|
|
1290
1289
|
*
|
|
1291
|
-
*
|
|
1290
|
+
* Request model (no read-only fields).
|
|
1292
1291
|
*/
|
|
1293
|
-
interface
|
|
1294
|
-
|
|
1295
|
-
|
|
1292
|
+
interface CentrifugoPresenceStatsRequestRequest$1 {
|
|
1293
|
+
/** Channel name */
|
|
1294
|
+
channel: string;
|
|
1296
1295
|
}
|
|
1297
1296
|
/**
|
|
1298
1297
|
* Server info response.
|
|
@@ -1304,13 +1303,22 @@ interface CentrifugoInfoResponse$1 {
|
|
|
1304
1303
|
result?: CentrifugoInfoResult$1 | null;
|
|
1305
1304
|
}
|
|
1306
1305
|
/**
|
|
1307
|
-
*
|
|
1306
|
+
* Channel presence response.
|
|
1308
1307
|
*
|
|
1309
|
-
*
|
|
1308
|
+
* Response model (includes read-only fields).
|
|
1310
1309
|
*/
|
|
1311
|
-
interface
|
|
1312
|
-
|
|
1313
|
-
|
|
1310
|
+
interface CentrifugoPresenceResponse$1 {
|
|
1311
|
+
error?: CentrifugoError$1 | null;
|
|
1312
|
+
result?: CentrifugoPresenceResult$1 | null;
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Channel presence stats response.
|
|
1316
|
+
*
|
|
1317
|
+
* Response model (includes read-only fields).
|
|
1318
|
+
*/
|
|
1319
|
+
interface CentrifugoPresenceStatsResponse$1 {
|
|
1320
|
+
error?: CentrifugoError$1 | null;
|
|
1321
|
+
result?: CentrifugoPresenceStatsResult$1 | null;
|
|
1314
1322
|
}
|
|
1315
1323
|
/**
|
|
1316
1324
|
* List of active channels response.
|
|
@@ -1322,14 +1330,23 @@ interface CentrifugoChannelsResponse$1 {
|
|
|
1322
1330
|
result?: CentrifugoChannelsResult$1 | null;
|
|
1323
1331
|
}
|
|
1324
1332
|
/**
|
|
1325
|
-
* Request to get channel presence
|
|
1333
|
+
* Request to get channel presence.
|
|
1326
1334
|
*
|
|
1327
1335
|
* Request model (no read-only fields).
|
|
1328
1336
|
*/
|
|
1329
|
-
interface
|
|
1337
|
+
interface CentrifugoPresenceRequestRequest$1 {
|
|
1330
1338
|
/** Channel name */
|
|
1331
1339
|
channel: string;
|
|
1332
1340
|
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Request to list active channels.
|
|
1343
|
+
*
|
|
1344
|
+
* Request model (no read-only fields).
|
|
1345
|
+
*/
|
|
1346
|
+
interface CentrifugoChannelsRequestRequest$1 {
|
|
1347
|
+
/** Pattern to filter channels (e.g., 'user:*') */
|
|
1348
|
+
pattern?: string | null;
|
|
1349
|
+
}
|
|
1333
1350
|
/**
|
|
1334
1351
|
* Request to get channel history.
|
|
1335
1352
|
*
|
|
@@ -1345,22 +1362,15 @@ interface CentrifugoHistoryRequestRequest$1 {
|
|
|
1345
1362
|
reverse?: boolean | null;
|
|
1346
1363
|
}
|
|
1347
1364
|
/**
|
|
1348
|
-
*
|
|
1349
|
-
*
|
|
1350
|
-
* Request model (no read-only fields).
|
|
1351
|
-
*/
|
|
1352
|
-
interface CentrifugoChannelsRequestRequest$1 {
|
|
1353
|
-
/** Pattern to filter channels (e.g., 'user:*') */
|
|
1354
|
-
pattern?: string | null;
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* Channel presence stats response.
|
|
1365
|
+
* Centrifugo API error structure.
|
|
1358
1366
|
*
|
|
1359
1367
|
* Response model (includes read-only fields).
|
|
1360
1368
|
*/
|
|
1361
|
-
interface
|
|
1362
|
-
|
|
1363
|
-
|
|
1369
|
+
interface CentrifugoError$1 {
|
|
1370
|
+
/** Error code (0 = no error) */
|
|
1371
|
+
code?: number;
|
|
1372
|
+
/** Error message */
|
|
1373
|
+
message?: string;
|
|
1364
1374
|
}
|
|
1365
1375
|
/**
|
|
1366
1376
|
* History result wrapper.
|
|
@@ -1376,15 +1386,13 @@ interface CentrifugoHistoryResult$1 {
|
|
|
1376
1386
|
offset: number;
|
|
1377
1387
|
}
|
|
1378
1388
|
/**
|
|
1379
|
-
*
|
|
1389
|
+
* Info result wrapper.
|
|
1380
1390
|
*
|
|
1381
1391
|
* Response model (includes read-only fields).
|
|
1382
1392
|
*/
|
|
1383
|
-
interface
|
|
1384
|
-
/**
|
|
1385
|
-
|
|
1386
|
-
/** Error message */
|
|
1387
|
-
message?: string;
|
|
1393
|
+
interface CentrifugoInfoResult$1 {
|
|
1394
|
+
/** List of Centrifugo nodes */
|
|
1395
|
+
nodes: Array<CentrifugoNodeInfo$1>;
|
|
1388
1396
|
}
|
|
1389
1397
|
/**
|
|
1390
1398
|
* Presence result wrapper.
|
|
@@ -1396,13 +1404,15 @@ interface CentrifugoPresenceResult$1 {
|
|
|
1396
1404
|
presence: Record<string, CentrifugoClientInfo$1>;
|
|
1397
1405
|
}
|
|
1398
1406
|
/**
|
|
1399
|
-
*
|
|
1407
|
+
* Presence stats result.
|
|
1400
1408
|
*
|
|
1401
1409
|
* Response model (includes read-only fields).
|
|
1402
1410
|
*/
|
|
1403
|
-
interface
|
|
1404
|
-
/**
|
|
1405
|
-
|
|
1411
|
+
interface CentrifugoPresenceStatsResult$1 {
|
|
1412
|
+
/** Number of connected clients */
|
|
1413
|
+
num_clients: number;
|
|
1414
|
+
/** Number of unique users */
|
|
1415
|
+
num_users: number;
|
|
1406
1416
|
}
|
|
1407
1417
|
/**
|
|
1408
1418
|
* Channels result wrapper.
|
|
@@ -1424,17 +1434,6 @@ interface CentrifugoStreamPosition$1 {
|
|
|
1424
1434
|
/** Stream epoch */
|
|
1425
1435
|
epoch: string;
|
|
1426
1436
|
}
|
|
1427
|
-
/**
|
|
1428
|
-
* Presence stats result.
|
|
1429
|
-
*
|
|
1430
|
-
* Response model (includes read-only fields).
|
|
1431
|
-
*/
|
|
1432
|
-
interface CentrifugoPresenceStatsResult$1 {
|
|
1433
|
-
/** Number of connected clients */
|
|
1434
|
-
num_clients: number;
|
|
1435
|
-
/** Number of unique users */
|
|
1436
|
-
num_users: number;
|
|
1437
|
-
}
|
|
1438
1437
|
/**
|
|
1439
1438
|
* Single publication (message) in channel history.
|
|
1440
1439
|
*
|
|
@@ -1449,21 +1448,6 @@ interface CentrifugoPublication$1 {
|
|
|
1449
1448
|
/** Optional message tags */
|
|
1450
1449
|
tags?: Record<string, any> | null;
|
|
1451
1450
|
}
|
|
1452
|
-
/**
|
|
1453
|
-
* Information about connected client.
|
|
1454
|
-
*
|
|
1455
|
-
* Response model (includes read-only fields).
|
|
1456
|
-
*/
|
|
1457
|
-
interface CentrifugoClientInfo$1 {
|
|
1458
|
-
/** User ID */
|
|
1459
|
-
user: string;
|
|
1460
|
-
/** Client UUID */
|
|
1461
|
-
client: string;
|
|
1462
|
-
/** Connection metadata */
|
|
1463
|
-
conn_info?: Record<string, any> | null;
|
|
1464
|
-
/** Channel-specific metadata */
|
|
1465
|
-
chan_info?: Record<string, any> | null;
|
|
1466
|
-
}
|
|
1467
1451
|
/**
|
|
1468
1452
|
* Information about a single Centrifugo node.
|
|
1469
1453
|
*
|
|
@@ -1490,24 +1474,28 @@ interface CentrifugoNodeInfo$1 {
|
|
|
1490
1474
|
process?: CentrifugoProcess$1 | null;
|
|
1491
1475
|
}
|
|
1492
1476
|
/**
|
|
1493
|
-
* Information about
|
|
1477
|
+
* Information about connected client.
|
|
1494
1478
|
*
|
|
1495
1479
|
* Response model (includes read-only fields).
|
|
1496
1480
|
*/
|
|
1497
|
-
interface
|
|
1498
|
-
/**
|
|
1499
|
-
|
|
1481
|
+
interface CentrifugoClientInfo$1 {
|
|
1482
|
+
/** User ID */
|
|
1483
|
+
user: string;
|
|
1484
|
+
/** Client UUID */
|
|
1485
|
+
client: string;
|
|
1486
|
+
/** Connection metadata */
|
|
1487
|
+
conn_info?: Record<string, any> | null;
|
|
1488
|
+
/** Channel-specific metadata */
|
|
1489
|
+
chan_info?: Record<string, any> | null;
|
|
1500
1490
|
}
|
|
1501
1491
|
/**
|
|
1502
|
-
*
|
|
1492
|
+
* Information about a single channel.
|
|
1503
1493
|
*
|
|
1504
1494
|
* Response model (includes read-only fields).
|
|
1505
1495
|
*/
|
|
1506
|
-
interface
|
|
1507
|
-
/**
|
|
1508
|
-
|
|
1509
|
-
/** Metric name to value mapping */
|
|
1510
|
-
items: Record<string, any>;
|
|
1496
|
+
interface CentrifugoChannelInfo$1 {
|
|
1497
|
+
/** Number of connected clients in channel */
|
|
1498
|
+
num_clients: number;
|
|
1511
1499
|
}
|
|
1512
1500
|
/**
|
|
1513
1501
|
* Process information.
|
|
@@ -1520,6 +1508,17 @@ interface CentrifugoProcess$1 {
|
|
|
1520
1508
|
/** Resident set size in bytes */
|
|
1521
1509
|
rss: number;
|
|
1522
1510
|
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Server metrics.
|
|
1513
|
+
*
|
|
1514
|
+
* Response model (includes read-only fields).
|
|
1515
|
+
*/
|
|
1516
|
+
interface CentrifugoMetrics$1 {
|
|
1517
|
+
/** Metrics collection interval */
|
|
1518
|
+
interval: number;
|
|
1519
|
+
/** Metric name to value mapping */
|
|
1520
|
+
items: Record<string, any>;
|
|
1521
|
+
}
|
|
1523
1522
|
|
|
1524
1523
|
/**
|
|
1525
1524
|
* API endpoints for Centrifugo Admin API.
|
|
@@ -1599,14 +1598,15 @@ declare class CentrifugoAuth {
|
|
|
1599
1598
|
}
|
|
1600
1599
|
|
|
1601
1600
|
/**
|
|
1602
|
-
*
|
|
1601
|
+
* List of channel statistics.
|
|
1603
1602
|
*
|
|
1604
1603
|
* Response model (includes read-only fields).
|
|
1605
1604
|
*/
|
|
1606
|
-
interface
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1605
|
+
interface ChannelList$1 {
|
|
1606
|
+
/** Channel statistics */
|
|
1607
|
+
channels: Array<ChannelStats$1>;
|
|
1608
|
+
/** Total number of channels */
|
|
1609
|
+
total_channels: number;
|
|
1610
1610
|
}
|
|
1611
1611
|
/**
|
|
1612
1612
|
*
|
|
@@ -1632,17 +1632,6 @@ interface PaginatedPublishList$1 {
|
|
|
1632
1632
|
/** Array of items for current page */
|
|
1633
1633
|
results: Array<Publish$1>;
|
|
1634
1634
|
}
|
|
1635
|
-
/**
|
|
1636
|
-
* List of channel statistics.
|
|
1637
|
-
*
|
|
1638
|
-
* Response model (includes read-only fields).
|
|
1639
|
-
*/
|
|
1640
|
-
interface ChannelList$1 {
|
|
1641
|
-
/** Channel statistics */
|
|
1642
|
-
channels: Array<ChannelStats$1>;
|
|
1643
|
-
/** Total number of channels */
|
|
1644
|
-
total_channels: number;
|
|
1645
|
-
}
|
|
1646
1635
|
/**
|
|
1647
1636
|
* Health check response.
|
|
1648
1637
|
*
|
|
@@ -1682,16 +1671,35 @@ interface CentrifugoOverviewStats$1 {
|
|
|
1682
1671
|
period_hours: number;
|
|
1683
1672
|
}
|
|
1684
1673
|
/**
|
|
1685
|
-
*
|
|
1674
|
+
* Timeline response with hourly/daily breakdown for DRF.
|
|
1686
1675
|
*
|
|
1687
1676
|
* Response model (includes read-only fields).
|
|
1688
1677
|
*/
|
|
1689
|
-
interface
|
|
1690
|
-
|
|
1691
|
-
|
|
1678
|
+
interface TimelineResponse$1 {
|
|
1679
|
+
timeline: Array<TimelineItem$1>;
|
|
1680
|
+
period_hours: number;
|
|
1681
|
+
interval: string;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Statistics per channel.
|
|
1685
|
+
*
|
|
1686
|
+
* Response model (includes read-only fields).
|
|
1687
|
+
*/
|
|
1688
|
+
interface ChannelStats$1 {
|
|
1689
|
+
/** Channel name */
|
|
1690
|
+
channel: string;
|
|
1691
|
+
/** Total publishes to this channel */
|
|
1692
|
+
total: number;
|
|
1693
|
+
/** Successful publishes */
|
|
1692
1694
|
successful: number;
|
|
1695
|
+
/** Failed publishes */
|
|
1693
1696
|
failed: number;
|
|
1694
|
-
|
|
1697
|
+
/** Average duration */
|
|
1698
|
+
avg_duration_ms: number;
|
|
1699
|
+
/** Average ACKs received */
|
|
1700
|
+
avg_acks: number;
|
|
1701
|
+
/** Last activity timestamp (ISO format) */
|
|
1702
|
+
last_activity_at: string | null;
|
|
1695
1703
|
}
|
|
1696
1704
|
/**
|
|
1697
1705
|
* Single publish item for DRF pagination.
|
|
@@ -1712,25 +1720,16 @@ interface Publish$1 {
|
|
|
1712
1720
|
error_message: string | null;
|
|
1713
1721
|
}
|
|
1714
1722
|
/**
|
|
1715
|
-
*
|
|
1723
|
+
* Single timeline data point for DRF.
|
|
1716
1724
|
*
|
|
1717
1725
|
* Response model (includes read-only fields).
|
|
1718
1726
|
*/
|
|
1719
|
-
interface
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
/** Total publishes to this channel */
|
|
1723
|
-
total: number;
|
|
1724
|
-
/** Successful publishes */
|
|
1727
|
+
interface TimelineItem$1 {
|
|
1728
|
+
timestamp: string;
|
|
1729
|
+
count: number;
|
|
1725
1730
|
successful: number;
|
|
1726
|
-
/** Failed publishes */
|
|
1727
1731
|
failed: number;
|
|
1728
|
-
|
|
1729
|
-
avg_duration_ms: number;
|
|
1730
|
-
/** Average ACKs received */
|
|
1731
|
-
avg_acks: number;
|
|
1732
|
-
/** Last activity timestamp (ISO format) */
|
|
1733
|
-
last_activity_at: string | null;
|
|
1732
|
+
timeout: number;
|
|
1734
1733
|
}
|
|
1735
1734
|
|
|
1736
1735
|
/**
|
|
@@ -1769,6 +1768,21 @@ declare class CentrifugoMonitoring {
|
|
|
1769
1768
|
}): Promise<TimelineResponse$1>;
|
|
1770
1769
|
}
|
|
1771
1770
|
|
|
1771
|
+
/**
|
|
1772
|
+
* Request model for test message publishing.
|
|
1773
|
+
*
|
|
1774
|
+
* Request model (no read-only fields).
|
|
1775
|
+
*/
|
|
1776
|
+
interface PublishTestRequestRequest$1 {
|
|
1777
|
+
/** Target channel name */
|
|
1778
|
+
channel: string;
|
|
1779
|
+
/** Message data (any JSON object) */
|
|
1780
|
+
data: Record<string, any>;
|
|
1781
|
+
/** Wait for client acknowledgment */
|
|
1782
|
+
wait_for_ack?: boolean;
|
|
1783
|
+
/** ACK timeout in seconds */
|
|
1784
|
+
ack_timeout?: number;
|
|
1785
|
+
}
|
|
1772
1786
|
/**
|
|
1773
1787
|
* Response model for manual ACK.
|
|
1774
1788
|
*
|
|
@@ -1783,19 +1797,15 @@ interface ManualAckResponse$1 {
|
|
|
1783
1797
|
error?: string | null;
|
|
1784
1798
|
}
|
|
1785
1799
|
/**
|
|
1786
|
-
* Request model for
|
|
1800
|
+
* Request model for manual ACK sending.
|
|
1787
1801
|
*
|
|
1788
1802
|
* Request model (no read-only fields).
|
|
1789
1803
|
*/
|
|
1790
|
-
interface
|
|
1791
|
-
/**
|
|
1792
|
-
|
|
1793
|
-
/**
|
|
1794
|
-
|
|
1795
|
-
/** Wait for client acknowledgment */
|
|
1796
|
-
wait_for_ack?: boolean;
|
|
1797
|
-
/** ACK timeout in seconds */
|
|
1798
|
-
ack_timeout?: number;
|
|
1804
|
+
interface ManualAckRequestRequest$1 {
|
|
1805
|
+
/** Message ID to acknowledge */
|
|
1806
|
+
message_id: string;
|
|
1807
|
+
/** Client ID sending the ACK */
|
|
1808
|
+
client_id: string;
|
|
1799
1809
|
}
|
|
1800
1810
|
/**
|
|
1801
1811
|
* Response model for test message publishing.
|
|
@@ -1816,17 +1826,6 @@ interface PublishTestResponse$1 {
|
|
|
1816
1826
|
/** Error message if failed */
|
|
1817
1827
|
error?: string | null;
|
|
1818
1828
|
}
|
|
1819
|
-
/**
|
|
1820
|
-
* Request model for manual ACK sending.
|
|
1821
|
-
*
|
|
1822
|
-
* Request model (no read-only fields).
|
|
1823
|
-
*/
|
|
1824
|
-
interface ManualAckRequestRequest$1 {
|
|
1825
|
-
/** Message ID to acknowledge */
|
|
1826
|
-
message_id: string;
|
|
1827
|
-
/** Client ID sending the ACK */
|
|
1828
|
-
client_id: string;
|
|
1829
|
-
}
|
|
1830
1829
|
|
|
1831
1830
|
/**
|
|
1832
1831
|
* API endpoints for Centrifugo Testing.
|
|
@@ -3245,15 +3244,6 @@ declare enum DeviceListStatus {
|
|
|
3245
3244
|
DISABLED = "disabled"
|
|
3246
3245
|
}
|
|
3247
3246
|
|
|
3248
|
-
/**
|
|
3249
|
-
* Serializer for completely disabling 2FA.
|
|
3250
|
-
*
|
|
3251
|
-
* Request model (no read-only fields).
|
|
3252
|
-
*/
|
|
3253
|
-
interface DisableRequest$1 {
|
|
3254
|
-
/** TOTP code for verification */
|
|
3255
|
-
code: string;
|
|
3256
|
-
}
|
|
3257
3247
|
/**
|
|
3258
3248
|
*
|
|
3259
3249
|
* Response model (includes read-only fields).
|
|
@@ -3278,6 +3268,15 @@ interface PaginatedDeviceListResponseList$1 {
|
|
|
3278
3268
|
/** Array of items for current page */
|
|
3279
3269
|
results: Array<DeviceListResponse$1>;
|
|
3280
3270
|
}
|
|
3271
|
+
/**
|
|
3272
|
+
* Serializer for completely disabling 2FA.
|
|
3273
|
+
*
|
|
3274
|
+
* Request model (no read-only fields).
|
|
3275
|
+
*/
|
|
3276
|
+
interface DisableRequest$1 {
|
|
3277
|
+
/** TOTP code for verification */
|
|
3278
|
+
code: string;
|
|
3279
|
+
}
|
|
3281
3280
|
/**
|
|
3282
3281
|
* Response serializer for device list endpoint.
|
|
3283
3282
|
*
|
|
@@ -3328,6 +3327,15 @@ declare class TotpManagement {
|
|
|
3328
3327
|
totpDisableCreate(data: DisableRequest$1): Promise<any>;
|
|
3329
3328
|
}
|
|
3330
3329
|
|
|
3330
|
+
/**
|
|
3331
|
+
* Serializer for starting 2FA setup.
|
|
3332
|
+
*
|
|
3333
|
+
* Request model (no read-only fields).
|
|
3334
|
+
*/
|
|
3335
|
+
interface SetupRequest$1 {
|
|
3336
|
+
/** Device name for identification (e.g., 'My iPhone') */
|
|
3337
|
+
device_name?: string;
|
|
3338
|
+
}
|
|
3331
3339
|
/**
|
|
3332
3340
|
* Response serializer for setup confirmation.
|
|
3333
3341
|
*
|
|
@@ -3340,6 +3348,17 @@ interface ConfirmSetupResponse$1 {
|
|
|
3340
3348
|
/** Warning message about backup codes */
|
|
3341
3349
|
backup_codes_warning: string;
|
|
3342
3350
|
}
|
|
3351
|
+
/**
|
|
3352
|
+
* Serializer for confirming 2FA setup with first code.
|
|
3353
|
+
*
|
|
3354
|
+
* Request model (no read-only fields).
|
|
3355
|
+
*/
|
|
3356
|
+
interface ConfirmSetupRequest$1 {
|
|
3357
|
+
/** Device ID from setup response */
|
|
3358
|
+
device_id: string;
|
|
3359
|
+
/** 6-digit TOTP code from authenticator app */
|
|
3360
|
+
code: string;
|
|
3361
|
+
}
|
|
3343
3362
|
/**
|
|
3344
3363
|
* Response serializer for setup initiation.
|
|
3345
3364
|
*
|
|
@@ -3357,26 +3376,6 @@ interface SetupResponse$1 {
|
|
|
3357
3376
|
/** Seconds until setup expires (typically 600 = 10 minutes) */
|
|
3358
3377
|
expires_in: number;
|
|
3359
3378
|
}
|
|
3360
|
-
/**
|
|
3361
|
-
* Serializer for confirming 2FA setup with first code.
|
|
3362
|
-
*
|
|
3363
|
-
* Request model (no read-only fields).
|
|
3364
|
-
*/
|
|
3365
|
-
interface ConfirmSetupRequest$1 {
|
|
3366
|
-
/** Device ID from setup response */
|
|
3367
|
-
device_id: string;
|
|
3368
|
-
/** 6-digit TOTP code from authenticator app */
|
|
3369
|
-
code: string;
|
|
3370
|
-
}
|
|
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.
|