@djangocfg/api 2.1.327 → 2.1.332
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/auth-server.cjs +328 -3553
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +328 -3553
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +744 -3036
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +35 -35
- package/dist/auth.d.ts +35 -35
- package/dist/auth.mjs +744 -3036
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +303 -3548
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +28 -2557
- package/dist/clients.d.ts +28 -2557
- package/dist/clients.mjs +303 -3548
- package/dist/clients.mjs.map +1 -1
- package/dist/index.cjs +1130 -3099
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1807 -2165
- package/dist/index.d.ts +1807 -2165
- package/dist/index.mjs +1130 -3099
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/_cfg_accounts/api.ts +67 -0
- package/src/_api/generated/{cfg_totp → _cfg_accounts}/events.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthConnectionsList.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthDisconnectCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthProvidersRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpRequestCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpVerifyCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileAvatarCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileDeleteCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdateUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsTokenRefreshCreate.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_accounts}/index.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/AccountDeleteResponse.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CentrifugoToken.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CfgUserUpdateRequest.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthCallbackRequestRequest.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthConnection.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthDisconnectRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthError.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthProvidersResponse.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthTokenResponse.ts +7 -7
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPErrorResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyResponse.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/PatchedCfgUserUpdateRequest.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/ProviderEnum.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefresh.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefreshRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/User.ts +13 -13
- package/src/_api/generated/_cfg_accounts/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_accounts/types.gen.ts +5 -0
- package/src/_api/generated/_cfg_centrifugo/api.ts +67 -0
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/events.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_centrifugo}/index.ts +6 -6
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/ConnectionTokenResponse.ts +4 -4
- package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_centrifugo/types.gen.ts +5 -0
- package/src/_api/generated/_cfg_totp/api.ts +67 -0
- package/src/_api/generated/{cfg_accounts → _cfg_totp}/events.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesDestroy.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDisableCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupConfirmCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyBackupCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/index.ts +6 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateRequest.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateResponse.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesStatus.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupResponse.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceList.ts +6 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListResponse.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListStatusEnum.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DisableRequest.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/SetupRequest.ts +11 -0
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/SetupResponse.ts +4 -4
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/TotpVerifyUser.ts +12 -12
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyBackupRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyResponse.ts +4 -4
- package/src/_api/generated/_cfg_totp/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_totp/types.gen.ts +5 -0
- package/src/_api/generated/{cfg_centrifugo/client.gen.ts → client.gen.ts} +3 -0
- package/src/_api/generated/helpers/auth.ts +223 -0
- package/src/_api/generated/{_shared → helpers}/index.ts +1 -0
- package/src/_api/generated/index.ts +22 -20
- package/src/_api/generated/{cfg_accounts/sdk.gen.ts → sdk.gen.ts} +455 -1
- package/src/_api/generated/{cfg_accounts/types.gen.ts → types.gen.ts} +607 -77
- package/src/auth/context/AccountsContext.tsx +10 -10
- package/src/auth/context/AuthContext.tsx +1 -1
- package/src/auth/hooks/useDeleteAccount.ts +2 -1
- package/src/auth/hooks/useGithubAuth.ts +3 -2
- package/src/auth/hooks/useTokenRefresh.ts +2 -1
- package/src/auth/hooks/useTwoFactor.ts +4 -3
- package/src/auth/hooks/useTwoFactorSetup.ts +3 -2
- package/src/auth/hooks/useTwoFactorStatus.ts +4 -3
- package/src/auth/middlewares/tokenRefresh.ts +2 -1
- package/src/clients.ts +3 -3
- package/src/index.ts +22 -5
- package/src/server.ts +9 -9
- package/src/_api/generated/cfg_accounts/api.ts +0 -187
- package/src/_api/generated/cfg_accounts/client.gen.ts +0 -16
- package/src/_api/generated/cfg_centrifugo/api.ts +0 -164
- package/src/_api/generated/cfg_centrifugo/client/client.gen.ts +0 -280
- package/src/_api/generated/cfg_centrifugo/client/index.ts +0 -25
- package/src/_api/generated/cfg_centrifugo/client/types.gen.ts +0 -217
- package/src/_api/generated/cfg_centrifugo/client/utils.gen.ts +0 -318
- package/src/_api/generated/cfg_centrifugo/core/auth.gen.ts +0 -41
- package/src/_api/generated/cfg_centrifugo/core/bodySerializer.gen.ts +0 -82
- package/src/_api/generated/cfg_centrifugo/core/params.gen.ts +0 -169
- package/src/_api/generated/cfg_centrifugo/core/pathSerializer.gen.ts +0 -171
- package/src/_api/generated/cfg_centrifugo/core/queryKeySerializer.gen.ts +0 -117
- package/src/_api/generated/cfg_centrifugo/core/serverSentEvents.gen.ts +0 -242
- package/src/_api/generated/cfg_centrifugo/core/types.gen.ts +0 -104
- package/src/_api/generated/cfg_centrifugo/core/utils.gen.ts +0 -140
- package/src/_api/generated/cfg_centrifugo/sdk.gen.ts +0 -64
- package/src/_api/generated/cfg_centrifugo/types.gen.ts +0 -61
- package/src/_api/generated/cfg_totp/api.ts +0 -181
- package/src/_api/generated/cfg_totp/client/client.gen.ts +0 -280
- package/src/_api/generated/cfg_totp/client/index.ts +0 -25
- package/src/_api/generated/cfg_totp/client/types.gen.ts +0 -217
- package/src/_api/generated/cfg_totp/client/utils.gen.ts +0 -318
- package/src/_api/generated/cfg_totp/client.gen.ts +0 -16
- package/src/_api/generated/cfg_totp/core/auth.gen.ts +0 -41
- package/src/_api/generated/cfg_totp/core/bodySerializer.gen.ts +0 -82
- package/src/_api/generated/cfg_totp/core/params.gen.ts +0 -169
- package/src/_api/generated/cfg_totp/core/pathSerializer.gen.ts +0 -171
- package/src/_api/generated/cfg_totp/core/queryKeySerializer.gen.ts +0 -117
- package/src/_api/generated/cfg_totp/core/serverSentEvents.gen.ts +0 -242
- package/src/_api/generated/cfg_totp/core/types.gen.ts +0 -104
- package/src/_api/generated/cfg_totp/core/utils.gen.ts +0 -140
- package/src/_api/generated/cfg_totp/schemas/SetupRequest.ts +0 -11
- package/src/_api/generated/cfg_totp/sdk.gen.ts +0 -432
- package/src/_api/generated/cfg_totp/types.gen.ts +0 -479
- /package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/client.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/index.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/types.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/utils.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/auth.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/bodySerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/params.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/pathSerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/queryKeySerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/serverSentEvents.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/types.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/utils.gen.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/errors.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/logger.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/storage.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/validation-events.ts +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
|
|
4
4
|
import { client } from './client.gen';
|
|
5
|
-
import type { CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses } from './types.gen';
|
|
5
|
+
import type { CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses, CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveErrors, CfgCentrifugoAuthTokenRetrieveResponses, CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateErrors, CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses, CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses, CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses, CfgTotpDisableCreateData, CfgTotpDisableCreateErrors, CfgTotpDisableCreateResponses, CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateErrors, CfgTotpSetupConfirmCreateResponses, CfgTotpSetupCreateData, CfgTotpSetupCreateErrors, CfgTotpSetupCreateResponses, CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateErrors, CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyCreateData, CfgTotpVerifyCreateErrors, CfgTotpVerifyCreateResponses } from './types.gen';
|
|
6
6
|
|
|
7
7
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
8
8
|
/**
|
|
@@ -286,6 +286,157 @@ export class Cfg {
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Get Centrifugo connection token
|
|
292
|
+
*
|
|
293
|
+
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
294
|
+
*/
|
|
295
|
+
public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>) {
|
|
296
|
+
return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
|
|
297
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
298
|
+
url: '/cfg/centrifugo/auth/token/',
|
|
299
|
+
...options
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Get backup codes status for user.
|
|
305
|
+
*/
|
|
306
|
+
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
307
|
+
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
308
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
309
|
+
url: '/cfg/totp/backup-codes/',
|
|
310
|
+
...options
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Regenerate backup codes.
|
|
316
|
+
*
|
|
317
|
+
* Requires TOTP code for verification.
|
|
318
|
+
* Invalidates all existing codes.
|
|
319
|
+
*/
|
|
320
|
+
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
321
|
+
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
322
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
323
|
+
url: '/cfg/totp/backup-codes/regenerate/',
|
|
324
|
+
...options,
|
|
325
|
+
headers: {
|
|
326
|
+
'Content-Type': 'application/json',
|
|
327
|
+
...options.headers
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* List all TOTP devices for user.
|
|
334
|
+
*/
|
|
335
|
+
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
336
|
+
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
337
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
338
|
+
url: '/cfg/totp/devices/',
|
|
339
|
+
...options
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Delete a TOTP device.
|
|
345
|
+
*
|
|
346
|
+
* Requires verification code if removing the last/primary device.
|
|
347
|
+
*/
|
|
348
|
+
public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>) {
|
|
349
|
+
return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
|
|
350
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
351
|
+
url: '/cfg/totp/devices/{id}/',
|
|
352
|
+
...options
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Completely disable 2FA for account.
|
|
358
|
+
*
|
|
359
|
+
* Requires verification code.
|
|
360
|
+
*/
|
|
361
|
+
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
362
|
+
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
363
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
364
|
+
url: '/cfg/totp/disable/',
|
|
365
|
+
...options,
|
|
366
|
+
headers: {
|
|
367
|
+
'Content-Type': 'application/json',
|
|
368
|
+
...options.headers
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Start 2FA setup process.
|
|
375
|
+
*
|
|
376
|
+
* Creates a new TOTP device and returns QR code for scanning.
|
|
377
|
+
*/
|
|
378
|
+
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
379
|
+
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
380
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
381
|
+
url: '/cfg/totp/setup/',
|
|
382
|
+
...options,
|
|
383
|
+
headers: {
|
|
384
|
+
'Content-Type': 'application/json',
|
|
385
|
+
...options?.headers
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Confirm 2FA setup with first valid code.
|
|
392
|
+
*
|
|
393
|
+
* Activates the device and generates backup codes.
|
|
394
|
+
*/
|
|
395
|
+
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
396
|
+
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
397
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
398
|
+
url: '/cfg/totp/setup/confirm/',
|
|
399
|
+
...options,
|
|
400
|
+
headers: {
|
|
401
|
+
'Content-Type': 'application/json',
|
|
402
|
+
...options.headers
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Verify TOTP code for 2FA session.
|
|
409
|
+
*
|
|
410
|
+
* Completes authentication and returns JWT tokens on success.
|
|
411
|
+
*/
|
|
412
|
+
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
413
|
+
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
414
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
415
|
+
url: '/cfg/totp/verify/',
|
|
416
|
+
...options,
|
|
417
|
+
headers: {
|
|
418
|
+
'Content-Type': 'application/json',
|
|
419
|
+
...options.headers
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Verify backup recovery code for 2FA session.
|
|
426
|
+
*
|
|
427
|
+
* Alternative verification method when TOTP device unavailable.
|
|
428
|
+
*/
|
|
429
|
+
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
430
|
+
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
431
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
432
|
+
url: '/cfg/totp/verify/backup/',
|
|
433
|
+
...options,
|
|
434
|
+
headers: {
|
|
435
|
+
'Content-Type': 'application/json',
|
|
436
|
+
...options.headers
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
289
440
|
}
|
|
290
441
|
|
|
291
442
|
export class Accounts {
|
|
@@ -794,3 +945,306 @@ export class Auth {
|
|
|
794
945
|
});
|
|
795
946
|
}
|
|
796
947
|
}
|
|
948
|
+
|
|
949
|
+
export class Centrifugo {
|
|
950
|
+
/**
|
|
951
|
+
* Get Centrifugo connection token
|
|
952
|
+
*
|
|
953
|
+
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
954
|
+
*/
|
|
955
|
+
public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>) {
|
|
956
|
+
return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
|
|
957
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
958
|
+
url: '/cfg/centrifugo/auth/token/',
|
|
959
|
+
...options
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
export class CentrifugoAuth {
|
|
965
|
+
/**
|
|
966
|
+
* Get Centrifugo connection token
|
|
967
|
+
*
|
|
968
|
+
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
969
|
+
*/
|
|
970
|
+
public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>) {
|
|
971
|
+
return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
|
|
972
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
973
|
+
url: '/cfg/centrifugo/auth/token/',
|
|
974
|
+
...options
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export class Totp {
|
|
980
|
+
/**
|
|
981
|
+
* Get backup codes status for user.
|
|
982
|
+
*/
|
|
983
|
+
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
984
|
+
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
985
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
986
|
+
url: '/cfg/totp/backup-codes/',
|
|
987
|
+
...options
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Regenerate backup codes.
|
|
993
|
+
*
|
|
994
|
+
* Requires TOTP code for verification.
|
|
995
|
+
* Invalidates all existing codes.
|
|
996
|
+
*/
|
|
997
|
+
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
998
|
+
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
999
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1000
|
+
url: '/cfg/totp/backup-codes/regenerate/',
|
|
1001
|
+
...options,
|
|
1002
|
+
headers: {
|
|
1003
|
+
'Content-Type': 'application/json',
|
|
1004
|
+
...options.headers
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* List all TOTP devices for user.
|
|
1011
|
+
*/
|
|
1012
|
+
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
1013
|
+
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
1014
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1015
|
+
url: '/cfg/totp/devices/',
|
|
1016
|
+
...options
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* Delete a TOTP device.
|
|
1022
|
+
*
|
|
1023
|
+
* Requires verification code if removing the last/primary device.
|
|
1024
|
+
*/
|
|
1025
|
+
public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>) {
|
|
1026
|
+
return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
|
|
1027
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1028
|
+
url: '/cfg/totp/devices/{id}/',
|
|
1029
|
+
...options
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Completely disable 2FA for account.
|
|
1035
|
+
*
|
|
1036
|
+
* Requires verification code.
|
|
1037
|
+
*/
|
|
1038
|
+
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
1039
|
+
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
1040
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1041
|
+
url: '/cfg/totp/disable/',
|
|
1042
|
+
...options,
|
|
1043
|
+
headers: {
|
|
1044
|
+
'Content-Type': 'application/json',
|
|
1045
|
+
...options.headers
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Start 2FA setup process.
|
|
1052
|
+
*
|
|
1053
|
+
* Creates a new TOTP device and returns QR code for scanning.
|
|
1054
|
+
*/
|
|
1055
|
+
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
1056
|
+
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
1057
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1058
|
+
url: '/cfg/totp/setup/',
|
|
1059
|
+
...options,
|
|
1060
|
+
headers: {
|
|
1061
|
+
'Content-Type': 'application/json',
|
|
1062
|
+
...options?.headers
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* Confirm 2FA setup with first valid code.
|
|
1069
|
+
*
|
|
1070
|
+
* Activates the device and generates backup codes.
|
|
1071
|
+
*/
|
|
1072
|
+
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
1073
|
+
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
1074
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1075
|
+
url: '/cfg/totp/setup/confirm/',
|
|
1076
|
+
...options,
|
|
1077
|
+
headers: {
|
|
1078
|
+
'Content-Type': 'application/json',
|
|
1079
|
+
...options.headers
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Verify TOTP code for 2FA session.
|
|
1086
|
+
*
|
|
1087
|
+
* Completes authentication and returns JWT tokens on success.
|
|
1088
|
+
*/
|
|
1089
|
+
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
1090
|
+
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
1091
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1092
|
+
url: '/cfg/totp/verify/',
|
|
1093
|
+
...options,
|
|
1094
|
+
headers: {
|
|
1095
|
+
'Content-Type': 'application/json',
|
|
1096
|
+
...options.headers
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Verify backup recovery code for 2FA session.
|
|
1103
|
+
*
|
|
1104
|
+
* Alternative verification method when TOTP device unavailable.
|
|
1105
|
+
*/
|
|
1106
|
+
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
1107
|
+
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
1108
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1109
|
+
url: '/cfg/totp/verify/backup/',
|
|
1110
|
+
...options,
|
|
1111
|
+
headers: {
|
|
1112
|
+
'Content-Type': 'application/json',
|
|
1113
|
+
...options.headers
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
export class BackupCodes {
|
|
1120
|
+
/**
|
|
1121
|
+
* Get backup codes status for user.
|
|
1122
|
+
*/
|
|
1123
|
+
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
1124
|
+
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
1125
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1126
|
+
url: '/cfg/totp/backup-codes/',
|
|
1127
|
+
...options
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Regenerate backup codes.
|
|
1133
|
+
*
|
|
1134
|
+
* Requires TOTP code for verification.
|
|
1135
|
+
* Invalidates all existing codes.
|
|
1136
|
+
*/
|
|
1137
|
+
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
1138
|
+
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
1139
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1140
|
+
url: '/cfg/totp/backup-codes/regenerate/',
|
|
1141
|
+
...options,
|
|
1142
|
+
headers: {
|
|
1143
|
+
'Content-Type': 'application/json',
|
|
1144
|
+
...options.headers
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
export class TotpManagement {
|
|
1151
|
+
/**
|
|
1152
|
+
* List all TOTP devices for user.
|
|
1153
|
+
*/
|
|
1154
|
+
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
1155
|
+
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
1156
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1157
|
+
url: '/cfg/totp/devices/',
|
|
1158
|
+
...options
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Completely disable 2FA for account.
|
|
1164
|
+
*
|
|
1165
|
+
* Requires verification code.
|
|
1166
|
+
*/
|
|
1167
|
+
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
1168
|
+
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
1169
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1170
|
+
url: '/cfg/totp/disable/',
|
|
1171
|
+
...options,
|
|
1172
|
+
headers: {
|
|
1173
|
+
'Content-Type': 'application/json',
|
|
1174
|
+
...options.headers
|
|
1175
|
+
}
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
export class TotpSetup {
|
|
1181
|
+
/**
|
|
1182
|
+
* Start 2FA setup process.
|
|
1183
|
+
*
|
|
1184
|
+
* Creates a new TOTP device and returns QR code for scanning.
|
|
1185
|
+
*/
|
|
1186
|
+
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
1187
|
+
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
1188
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1189
|
+
url: '/cfg/totp/setup/',
|
|
1190
|
+
...options,
|
|
1191
|
+
headers: {
|
|
1192
|
+
'Content-Type': 'application/json',
|
|
1193
|
+
...options?.headers
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Confirm 2FA setup with first valid code.
|
|
1200
|
+
*
|
|
1201
|
+
* Activates the device and generates backup codes.
|
|
1202
|
+
*/
|
|
1203
|
+
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
1204
|
+
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
1205
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1206
|
+
url: '/cfg/totp/setup/confirm/',
|
|
1207
|
+
...options,
|
|
1208
|
+
headers: {
|
|
1209
|
+
'Content-Type': 'application/json',
|
|
1210
|
+
...options.headers
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
export class TotpVerification {
|
|
1217
|
+
/**
|
|
1218
|
+
* Verify TOTP code for 2FA session.
|
|
1219
|
+
*
|
|
1220
|
+
* Completes authentication and returns JWT tokens on success.
|
|
1221
|
+
*/
|
|
1222
|
+
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
1223
|
+
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
1224
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1225
|
+
url: '/cfg/totp/verify/',
|
|
1226
|
+
...options,
|
|
1227
|
+
headers: {
|
|
1228
|
+
'Content-Type': 'application/json',
|
|
1229
|
+
...options.headers
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* Verify backup recovery code for 2FA session.
|
|
1236
|
+
*
|
|
1237
|
+
* Alternative verification method when TOTP device unavailable.
|
|
1238
|
+
*/
|
|
1239
|
+
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
1240
|
+
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
1241
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1242
|
+
url: '/cfg/totp/verify/backup/',
|
|
1243
|
+
...options,
|
|
1244
|
+
headers: {
|
|
1245
|
+
'Content-Type': 'application/json',
|
|
1246
|
+
...options.headers
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
}
|