@djangocfg/api 2.1.322 → 2.1.331
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 +1037 -1227
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +1037 -1217
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +2142 -3398
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +158 -209
- package/dist/auth.d.ts +158 -209
- package/dist/auth.mjs +2136 -3392
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +1018 -4423
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +151 -2918
- package/dist/clients.d.ts +151 -2918
- package/dist/clients.mjs +1018 -4417
- package/dist/clients.mjs.map +1 -1
- package/dist/index.cjs +2253 -2819
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2408 -1872
- package/dist/index.d.ts +2408 -1872
- package/dist/index.mjs +2235 -2795
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -7
- package/src/_api/generated/_cfg_accounts/api.ts +120 -0
- package/src/_api/generated/_cfg_accounts/events.ts +198 -0
- package/src/_api/generated/_cfg_accounts/hooks/index.ts +18 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +25 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +25 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +25 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +24 -0
- package/src/_api/generated/_cfg_accounts/index.ts +29 -0
- package/src/_api/generated/_cfg_accounts/schemas/AccountDeleteResponse.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +14 -0
- package/src/_api/generated/_cfg_accounts/schemas/CfgUserUpdateRequest.ts +16 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeRequestRequest.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeResponse.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +13 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthConnection.ts +19 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthDisconnectRequestRequest.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthError.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthProvidersResponse.ts +11 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthTokenResponse.ts +18 -0
- package/src/_api/generated/_cfg_accounts/schemas/OTPErrorResponse.ts +13 -0
- package/src/_api/generated/_cfg_accounts/schemas/OTPRequestRequest.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/OTPRequestResponse.ts +11 -0
- package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyRequest.ts +13 -0
- package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyResponse.ts +17 -0
- package/src/_api/generated/_cfg_accounts/schemas/PatchedCfgUserUpdateRequest.ts +16 -0
- package/src/_api/generated/_cfg_accounts/schemas/ProviderEnum.ts +9 -0
- package/src/_api/generated/_cfg_accounts/schemas/TokenRefresh.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/TokenRefreshRequest.ts +11 -0
- package/src/_api/generated/{cfg_accounts/_utils/schemas/User.schema.ts → _cfg_accounts/schemas/User.ts} +19 -27
- package/src/_api/generated/_cfg_accounts/schemas/index.ts +24 -0
- 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 +120 -0
- package/src/_api/generated/_cfg_centrifugo/events.ts +198 -0
- package/src/_api/generated/_cfg_centrifugo/hooks/index.ts +4 -0
- package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +25 -0
- package/src/_api/generated/_cfg_centrifugo/index.ts +29 -0
- package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +14 -0
- package/src/_api/generated/_cfg_centrifugo/schemas/index.ts +4 -0
- 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 +120 -0
- package/src/_api/generated/_cfg_totp/events.ts +198 -0
- package/src/_api/generated/_cfg_totp/hooks/index.ts +12 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +24 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +25 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +24 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +25 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDisableCreate.ts +24 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +24 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupCreate.ts +24 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +24 -0
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyCreate.ts +24 -0
- package/src/_api/generated/_cfg_totp/index.ts +29 -0
- package/src/_api/generated/_cfg_totp/schemas/BackupCodesRegenerateRequest.ts +11 -0
- package/src/_api/generated/_cfg_totp/schemas/BackupCodesRegenerateResponse.ts +12 -0
- package/src/_api/generated/_cfg_totp/schemas/BackupCodesStatus.ts +13 -0
- package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupRequest.ts +12 -0
- package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupResponse.ts +13 -0
- package/src/_api/generated/_cfg_totp/schemas/DeviceList.ts +18 -0
- package/src/_api/generated/_cfg_totp/schemas/DeviceListResponse.ts +13 -0
- package/src/_api/generated/_cfg_totp/schemas/DeviceListStatusEnum.ts +9 -0
- package/src/_api/generated/_cfg_totp/schemas/DisableRequest.ts +11 -0
- package/src/_api/generated/_cfg_totp/schemas/SetupRequest.ts +11 -0
- package/src/_api/generated/_cfg_totp/schemas/SetupResponse.ts +15 -0
- package/src/_api/generated/{cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts → _cfg_totp/schemas/TotpVerifyUser.ts} +17 -25
- package/src/_api/generated/_cfg_totp/schemas/VerifyBackupRequest.ts +12 -0
- package/src/_api/generated/_cfg_totp/schemas/VerifyRequest.ts +12 -0
- package/src/_api/generated/_cfg_totp/schemas/VerifyResponse.ts +17 -0
- package/src/_api/generated/_cfg_totp/schemas/index.ts +18 -0
- 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/client/client.gen.ts +280 -0
- package/src/_api/generated/client/index.ts +25 -0
- package/src/_api/generated/client/types.gen.ts +217 -0
- package/src/_api/generated/client/utils.gen.ts +318 -0
- package/src/_api/generated/client.gen.ts +16 -0
- package/src/_api/generated/core/auth.gen.ts +41 -0
- package/src/_api/generated/core/bodySerializer.gen.ts +82 -0
- package/src/_api/generated/core/params.gen.ts +169 -0
- package/src/_api/generated/core/pathSerializer.gen.ts +171 -0
- package/src/_api/generated/core/queryKeySerializer.gen.ts +117 -0
- package/src/_api/generated/core/serverSentEvents.gen.ts +242 -0
- package/src/_api/generated/core/types.gen.ts +104 -0
- package/src/_api/generated/core/utils.gen.ts +140 -0
- package/src/_api/generated/helpers/errors.ts +70 -0
- package/src/_api/generated/helpers/index.ts +25 -0
- package/src/_api/generated/helpers/logger.ts +123 -0
- package/src/_api/generated/helpers/storage.ts +83 -0
- package/src/_api/generated/helpers/validation-events.ts +52 -0
- package/src/_api/generated/index.ts +28 -0
- package/src/_api/generated/sdk.gen.ts +1250 -0
- package/src/_api/generated/types.gen.ts +1294 -0
- package/src/_api/index.ts +5 -23
- package/src/auth/context/AccountsContext.tsx +58 -89
- package/src/auth/context/AuthContext.tsx +3 -3
- package/src/auth/context/index.ts +2 -2
- package/src/auth/hooks/useDeleteAccount.ts +3 -1
- package/src/auth/hooks/useGithubAuth.ts +13 -11
- package/src/auth/hooks/useTokenRefresh.ts +7 -4
- package/src/auth/hooks/useTwoFactor.ts +15 -8
- package/src/auth/hooks/useTwoFactorSetup.ts +9 -5
- package/src/auth/hooks/useTwoFactorStatus.ts +5 -3
- package/src/auth/middlewares/tokenRefresh.ts +7 -4
- package/src/clients.ts +14 -51
- package/src/index.ts +35 -60
- package/src/server.ts +25 -23
- package/src/_api/BaseClient.ts +0 -22
- package/src/_api/generated/cfg_accounts/CLAUDE.md +0 -86
- package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts.ts +0 -154
- package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts +0 -95
- package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +0 -285
- package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +0 -440
- package/src/_api/generated/cfg_accounts/_utils/fetchers/index.ts +0 -33
- package/src/_api/generated/cfg_accounts/_utils/hooks/accounts.ts +0 -64
- package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__auth.ts +0 -44
- package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +0 -114
- package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +0 -152
- package/src/_api/generated/cfg_accounts/_utils/hooks/index.ts +0 -33
- package/src/_api/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts +0 -20
- package/src/_api/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts +0 -22
- package/src/_api/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +0 -15
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts +0 -20
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts +0 -21
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts +0 -27
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts +0 -20
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts +0 -19
- package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts +0 -46
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts +0 -41
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts +0 -19
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +0 -21
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts +0 -45
- package/src/_api/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts +0 -24
- package/src/_api/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts +0 -16
- package/src/_api/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts +0 -15
- package/src/_api/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts +0 -24
- package/src/_api/generated/cfg_accounts/_utils/schemas/index.ts +0 -41
- package/src/_api/generated/cfg_accounts/accounts/client.ts +0 -34
- package/src/_api/generated/cfg_accounts/accounts/index.ts +0 -4
- package/src/_api/generated/cfg_accounts/accounts/models.ts +0 -127
- package/src/_api/generated/cfg_accounts/accounts__auth/client.ts +0 -23
- package/src/_api/generated/cfg_accounts/accounts__auth/index.ts +0 -4
- package/src/_api/generated/cfg_accounts/accounts__auth/models.ts +0 -19
- package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +0 -67
- package/src/_api/generated/cfg_accounts/accounts__oauth/index.ts +0 -4
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +0 -127
- package/src/_api/generated/cfg_accounts/accounts__user_profile/client.ts +0 -94
- package/src/_api/generated/cfg_accounts/accounts__user_profile/index.ts +0 -4
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +0 -98
- package/src/_api/generated/cfg_accounts/api-instance.ts +0 -181
- package/src/_api/generated/cfg_accounts/client.ts +0 -339
- package/src/_api/generated/cfg_accounts/enums.ts +0 -10
- package/src/_api/generated/cfg_accounts/errors.ts +0 -123
- package/src/_api/generated/cfg_accounts/http.ts +0 -160
- package/src/_api/generated/cfg_accounts/index.ts +0 -338
- package/src/_api/generated/cfg_accounts/logger.ts +0 -261
- package/src/_api/generated/cfg_accounts/retry.ts +0 -177
- package/src/_api/generated/cfg_accounts/schema.json +0 -1576
- package/src/_api/generated/cfg_accounts/storage.ts +0 -163
- package/src/_api/generated/cfg_accounts/validation-events.ts +0 -135
- package/src/_api/generated/cfg_centrifugo/CLAUDE.md +0 -60
- package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts +0 -94
- package/src/_api/generated/cfg_centrifugo/_utils/fetchers/index.ts +0 -30
- package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts +0 -39
- package/src/_api/generated/cfg_centrifugo/_utils/hooks/index.ts +0 -30
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/index.ts +0 -21
- package/src/_api/generated/cfg_centrifugo/api-instance.ts +0 -181
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts +0 -27
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +0 -4
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/models.ts +0 -18
- package/src/_api/generated/cfg_centrifugo/client.ts +0 -330
- package/src/_api/generated/cfg_centrifugo/errors.ts +0 -123
- package/src/_api/generated/cfg_centrifugo/http.ts +0 -160
- package/src/_api/generated/cfg_centrifugo/index.ts +0 -316
- package/src/_api/generated/cfg_centrifugo/logger.ts +0 -261
- package/src/_api/generated/cfg_centrifugo/retry.ts +0 -177
- package/src/_api/generated/cfg_centrifugo/schema.json +0 -118
- package/src/_api/generated/cfg_centrifugo/storage.ts +0 -163
- package/src/_api/generated/cfg_centrifugo/validation-events.ts +0 -135
- package/src/_api/generated/cfg_totp/CLAUDE.md +0 -83
- package/src/_api/generated/cfg_totp/_utils/fetchers/index.ts +0 -34
- package/src/_api/generated/cfg_totp/_utils/fetchers/totp.ts +0 -50
- package/src/_api/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts +0 -153
- package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +0 -109
- package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_setup.ts +0 -154
- package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_verification.ts +0 -153
- package/src/_api/generated/cfg_totp/_utils/hooks/index.ts +0 -34
- package/src/_api/generated/cfg_totp/_utils/hooks/totp.ts +0 -43
- package/src/_api/generated/cfg_totp/_utils/hooks/totp__backup_codes.ts +0 -60
- package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +0 -59
- package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_setup.ts +0 -64
- package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_verification.ts +0 -63
- package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts +0 -19
- package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts +0 -20
- package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts +0 -21
- package/src/_api/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts +0 -21
- package/src/_api/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts +0 -26
- package/src/_api/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts +0 -21
- package/src/_api/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts +0 -19
- package/src/_api/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts +0 -19
- package/src/_api/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts +0 -23
- package/src/_api/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +0 -25
- package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -34
- package/src/_api/generated/cfg_totp/api-instance.ts +0 -181
- package/src/_api/generated/cfg_totp/client.ts +0 -342
- package/src/_api/generated/cfg_totp/enums.ts +0 -13
- package/src/_api/generated/cfg_totp/errors.ts +0 -123
- package/src/_api/generated/cfg_totp/http.ts +0 -160
- package/src/_api/generated/cfg_totp/index.ts +0 -345
- package/src/_api/generated/cfg_totp/logger.ts +0 -261
- package/src/_api/generated/cfg_totp/retry.ts +0 -177
- package/src/_api/generated/cfg_totp/schema.json +0 -910
- package/src/_api/generated/cfg_totp/storage.ts +0 -163
- package/src/_api/generated/cfg_totp/totp/client.ts +0 -24
- package/src/_api/generated/cfg_totp/totp/index.ts +0 -4
- package/src/_api/generated/cfg_totp/totp/models.ts +0 -4
- package/src/_api/generated/cfg_totp/totp__backup_codes/client.ts +0 -32
- package/src/_api/generated/cfg_totp/totp__backup_codes/index.ts +0 -4
- package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +0 -38
- package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +0 -31
- package/src/_api/generated/cfg_totp/totp__totp_management/index.ts +0 -4
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +0 -46
- package/src/_api/generated/cfg_totp/totp__totp_setup/client.ts +0 -33
- package/src/_api/generated/cfg_totp/totp__totp_setup/index.ts +0 -4
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +0 -55
- package/src/_api/generated/cfg_totp/totp__totp_verification/client.ts +0 -33
- package/src/_api/generated/cfg_totp/totp__totp_verification/index.ts +0 -4
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +0 -74
- package/src/_api/generated/cfg_totp/validation-events.ts +0 -135
- package/src/hooks/accounts.ts +0 -8
- package/src/hooks/index.ts +0 -10
|
@@ -0,0 +1,1250 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
|
|
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, 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
|
+
|
|
7
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
8
|
+
/**
|
|
9
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
10
|
+
* individual options. This might be also useful if you want to implement a
|
|
11
|
+
* custom client.
|
|
12
|
+
*/
|
|
13
|
+
client?: Client;
|
|
14
|
+
/**
|
|
15
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
16
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
17
|
+
*/
|
|
18
|
+
meta?: Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class Cfg {
|
|
22
|
+
/**
|
|
23
|
+
* List OAuth connections
|
|
24
|
+
*
|
|
25
|
+
* Get all OAuth connections for the current user.
|
|
26
|
+
*/
|
|
27
|
+
public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>) {
|
|
28
|
+
return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
|
|
29
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
30
|
+
url: '/cfg/accounts/oauth/connections/',
|
|
31
|
+
...options
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Disconnect OAuth provider
|
|
37
|
+
*
|
|
38
|
+
* Remove OAuth connection for the specified provider.
|
|
39
|
+
*/
|
|
40
|
+
public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>) {
|
|
41
|
+
return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
|
|
42
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
43
|
+
url: '/cfg/accounts/oauth/disconnect/',
|
|
44
|
+
...options,
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/json',
|
|
47
|
+
...options.headers
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Start GitHub OAuth
|
|
54
|
+
*
|
|
55
|
+
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
56
|
+
*/
|
|
57
|
+
public static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>) {
|
|
58
|
+
return (options?.client ?? client).post<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError>({
|
|
59
|
+
url: '/cfg/accounts/oauth/github/authorize/',
|
|
60
|
+
...options,
|
|
61
|
+
headers: {
|
|
62
|
+
'Content-Type': 'application/json',
|
|
63
|
+
...options?.headers
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Complete GitHub OAuth
|
|
70
|
+
*
|
|
71
|
+
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
72
|
+
*/
|
|
73
|
+
public static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>) {
|
|
74
|
+
return (options.client ?? client).post<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError>({
|
|
75
|
+
url: '/cfg/accounts/oauth/github/callback/',
|
|
76
|
+
...options,
|
|
77
|
+
headers: {
|
|
78
|
+
'Content-Type': 'application/json',
|
|
79
|
+
...options.headers
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* List OAuth providers
|
|
86
|
+
*
|
|
87
|
+
* Get list of available OAuth providers for authentication.
|
|
88
|
+
*/
|
|
89
|
+
public static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>) {
|
|
90
|
+
return (options?.client ?? client).get<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>({ url: '/cfg/accounts/oauth/providers/', ...options });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Request OTP code to email.
|
|
95
|
+
*/
|
|
96
|
+
public static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>) {
|
|
97
|
+
return (options.client ?? client).post<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError>({
|
|
98
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
99
|
+
url: '/cfg/accounts/otp/request/',
|
|
100
|
+
...options,
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
...options.headers
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Verify OTP code and return JWT tokens or 2FA session.
|
|
110
|
+
*
|
|
111
|
+
* If user has 2FA enabled:
|
|
112
|
+
* - Returns requires_2fa=True with session_id
|
|
113
|
+
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
114
|
+
*
|
|
115
|
+
* If user has no 2FA:
|
|
116
|
+
* - Returns JWT tokens and user data directly
|
|
117
|
+
*/
|
|
118
|
+
public static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>) {
|
|
119
|
+
return (options.client ?? client).post<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError>({
|
|
120
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
121
|
+
url: '/cfg/accounts/otp/verify/',
|
|
122
|
+
...options,
|
|
123
|
+
headers: {
|
|
124
|
+
'Content-Type': 'application/json',
|
|
125
|
+
...options.headers
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Get current user profile
|
|
132
|
+
*
|
|
133
|
+
* Retrieve the current authenticated user's profile information.
|
|
134
|
+
*/
|
|
135
|
+
public static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>) {
|
|
136
|
+
return (options?.client ?? client).get<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError>({
|
|
137
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
138
|
+
in: 'cookie',
|
|
139
|
+
name: 'sessionid',
|
|
140
|
+
type: 'apiKey'
|
|
141
|
+
}],
|
|
142
|
+
url: '/cfg/accounts/profile/',
|
|
143
|
+
...options
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Upload user avatar
|
|
149
|
+
*
|
|
150
|
+
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
151
|
+
*/
|
|
152
|
+
public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>) {
|
|
153
|
+
return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
|
|
154
|
+
...formDataBodySerializer,
|
|
155
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
156
|
+
url: '/cfg/accounts/profile/avatar/',
|
|
157
|
+
...options,
|
|
158
|
+
headers: {
|
|
159
|
+
'Content-Type': null,
|
|
160
|
+
...options?.headers
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Delete user account
|
|
167
|
+
*
|
|
168
|
+
*
|
|
169
|
+
* Permanently delete the current user's account.
|
|
170
|
+
*
|
|
171
|
+
* This operation:
|
|
172
|
+
* - Deactivates the account (user cannot log in)
|
|
173
|
+
* - Anonymizes personal data (GDPR compliance)
|
|
174
|
+
* - Frees up the email address for re-registration
|
|
175
|
+
* - Preserves audit trail
|
|
176
|
+
*
|
|
177
|
+
* The account can be restored by an administrator if needed.
|
|
178
|
+
*
|
|
179
|
+
*/
|
|
180
|
+
public static cfgAccountsProfileDeleteCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileDeleteCreateData, ThrowOnError>) {
|
|
181
|
+
return (options?.client ?? client).post<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError>({
|
|
182
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
183
|
+
in: 'cookie',
|
|
184
|
+
name: 'sessionid',
|
|
185
|
+
type: 'apiKey'
|
|
186
|
+
}],
|
|
187
|
+
url: '/cfg/accounts/profile/delete/',
|
|
188
|
+
...options
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Partial update user profile
|
|
194
|
+
*
|
|
195
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
196
|
+
*/
|
|
197
|
+
public static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>) {
|
|
198
|
+
return (options?.client ?? client).patch<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError>({
|
|
199
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
200
|
+
in: 'cookie',
|
|
201
|
+
name: 'sessionid',
|
|
202
|
+
type: 'apiKey'
|
|
203
|
+
}],
|
|
204
|
+
url: '/cfg/accounts/profile/partial/',
|
|
205
|
+
...options,
|
|
206
|
+
headers: {
|
|
207
|
+
'Content-Type': 'application/json',
|
|
208
|
+
...options?.headers
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Partial update user profile
|
|
215
|
+
*
|
|
216
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
217
|
+
*/
|
|
218
|
+
public static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>) {
|
|
219
|
+
return (options?.client ?? client).put<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError>({
|
|
220
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
221
|
+
in: 'cookie',
|
|
222
|
+
name: 'sessionid',
|
|
223
|
+
type: 'apiKey'
|
|
224
|
+
}],
|
|
225
|
+
url: '/cfg/accounts/profile/partial/',
|
|
226
|
+
...options,
|
|
227
|
+
headers: {
|
|
228
|
+
'Content-Type': 'application/json',
|
|
229
|
+
...options?.headers
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Update user profile
|
|
236
|
+
*
|
|
237
|
+
* Update the current authenticated user's profile information.
|
|
238
|
+
*/
|
|
239
|
+
public static cfgAccountsProfileUpdatePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdatePartialUpdateData, ThrowOnError>) {
|
|
240
|
+
return (options?.client ?? client).patch<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError>({
|
|
241
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
242
|
+
in: 'cookie',
|
|
243
|
+
name: 'sessionid',
|
|
244
|
+
type: 'apiKey'
|
|
245
|
+
}],
|
|
246
|
+
url: '/cfg/accounts/profile/update/',
|
|
247
|
+
...options,
|
|
248
|
+
headers: {
|
|
249
|
+
'Content-Type': 'application/json',
|
|
250
|
+
...options?.headers
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Update user profile
|
|
257
|
+
*
|
|
258
|
+
* Update the current authenticated user's profile information.
|
|
259
|
+
*/
|
|
260
|
+
public static cfgAccountsProfileUpdateUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdateUpdateData, ThrowOnError>) {
|
|
261
|
+
return (options?.client ?? client).put<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError>({
|
|
262
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
263
|
+
in: 'cookie',
|
|
264
|
+
name: 'sessionid',
|
|
265
|
+
type: 'apiKey'
|
|
266
|
+
}],
|
|
267
|
+
url: '/cfg/accounts/profile/update/',
|
|
268
|
+
...options,
|
|
269
|
+
headers: {
|
|
270
|
+
'Content-Type': 'application/json',
|
|
271
|
+
...options?.headers
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Refresh JWT token.
|
|
278
|
+
*/
|
|
279
|
+
public static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>) {
|
|
280
|
+
return (options.client ?? client).post<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError>({
|
|
281
|
+
url: '/cfg/accounts/token/refresh/',
|
|
282
|
+
...options,
|
|
283
|
+
headers: {
|
|
284
|
+
'Content-Type': 'application/json',
|
|
285
|
+
...options.headers
|
|
286
|
+
}
|
|
287
|
+
});
|
|
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
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export class Accounts {
|
|
443
|
+
/**
|
|
444
|
+
* List OAuth connections
|
|
445
|
+
*
|
|
446
|
+
* Get all OAuth connections for the current user.
|
|
447
|
+
*/
|
|
448
|
+
public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>) {
|
|
449
|
+
return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
|
|
450
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
451
|
+
url: '/cfg/accounts/oauth/connections/',
|
|
452
|
+
...options
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Disconnect OAuth provider
|
|
458
|
+
*
|
|
459
|
+
* Remove OAuth connection for the specified provider.
|
|
460
|
+
*/
|
|
461
|
+
public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>) {
|
|
462
|
+
return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
|
|
463
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
464
|
+
url: '/cfg/accounts/oauth/disconnect/',
|
|
465
|
+
...options,
|
|
466
|
+
headers: {
|
|
467
|
+
'Content-Type': 'application/json',
|
|
468
|
+
...options.headers
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Start GitHub OAuth
|
|
475
|
+
*
|
|
476
|
+
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
477
|
+
*/
|
|
478
|
+
public static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>) {
|
|
479
|
+
return (options?.client ?? client).post<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError>({
|
|
480
|
+
url: '/cfg/accounts/oauth/github/authorize/',
|
|
481
|
+
...options,
|
|
482
|
+
headers: {
|
|
483
|
+
'Content-Type': 'application/json',
|
|
484
|
+
...options?.headers
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Complete GitHub OAuth
|
|
491
|
+
*
|
|
492
|
+
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
493
|
+
*/
|
|
494
|
+
public static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>) {
|
|
495
|
+
return (options.client ?? client).post<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError>({
|
|
496
|
+
url: '/cfg/accounts/oauth/github/callback/',
|
|
497
|
+
...options,
|
|
498
|
+
headers: {
|
|
499
|
+
'Content-Type': 'application/json',
|
|
500
|
+
...options.headers
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* List OAuth providers
|
|
507
|
+
*
|
|
508
|
+
* Get list of available OAuth providers for authentication.
|
|
509
|
+
*/
|
|
510
|
+
public static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>) {
|
|
511
|
+
return (options?.client ?? client).get<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>({ url: '/cfg/accounts/oauth/providers/', ...options });
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Request OTP code to email.
|
|
516
|
+
*/
|
|
517
|
+
public static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>) {
|
|
518
|
+
return (options.client ?? client).post<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError>({
|
|
519
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
520
|
+
url: '/cfg/accounts/otp/request/',
|
|
521
|
+
...options,
|
|
522
|
+
headers: {
|
|
523
|
+
'Content-Type': 'application/json',
|
|
524
|
+
...options.headers
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Verify OTP code and return JWT tokens or 2FA session.
|
|
531
|
+
*
|
|
532
|
+
* If user has 2FA enabled:
|
|
533
|
+
* - Returns requires_2fa=True with session_id
|
|
534
|
+
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
535
|
+
*
|
|
536
|
+
* If user has no 2FA:
|
|
537
|
+
* - Returns JWT tokens and user data directly
|
|
538
|
+
*/
|
|
539
|
+
public static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>) {
|
|
540
|
+
return (options.client ?? client).post<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError>({
|
|
541
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
542
|
+
url: '/cfg/accounts/otp/verify/',
|
|
543
|
+
...options,
|
|
544
|
+
headers: {
|
|
545
|
+
'Content-Type': 'application/json',
|
|
546
|
+
...options.headers
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Get current user profile
|
|
553
|
+
*
|
|
554
|
+
* Retrieve the current authenticated user's profile information.
|
|
555
|
+
*/
|
|
556
|
+
public static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>) {
|
|
557
|
+
return (options?.client ?? client).get<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError>({
|
|
558
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
559
|
+
in: 'cookie',
|
|
560
|
+
name: 'sessionid',
|
|
561
|
+
type: 'apiKey'
|
|
562
|
+
}],
|
|
563
|
+
url: '/cfg/accounts/profile/',
|
|
564
|
+
...options
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Upload user avatar
|
|
570
|
+
*
|
|
571
|
+
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
572
|
+
*/
|
|
573
|
+
public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>) {
|
|
574
|
+
return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
|
|
575
|
+
...formDataBodySerializer,
|
|
576
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
577
|
+
url: '/cfg/accounts/profile/avatar/',
|
|
578
|
+
...options,
|
|
579
|
+
headers: {
|
|
580
|
+
'Content-Type': null,
|
|
581
|
+
...options?.headers
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Delete user account
|
|
588
|
+
*
|
|
589
|
+
*
|
|
590
|
+
* Permanently delete the current user's account.
|
|
591
|
+
*
|
|
592
|
+
* This operation:
|
|
593
|
+
* - Deactivates the account (user cannot log in)
|
|
594
|
+
* - Anonymizes personal data (GDPR compliance)
|
|
595
|
+
* - Frees up the email address for re-registration
|
|
596
|
+
* - Preserves audit trail
|
|
597
|
+
*
|
|
598
|
+
* The account can be restored by an administrator if needed.
|
|
599
|
+
*
|
|
600
|
+
*/
|
|
601
|
+
public static cfgAccountsProfileDeleteCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileDeleteCreateData, ThrowOnError>) {
|
|
602
|
+
return (options?.client ?? client).post<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError>({
|
|
603
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
604
|
+
in: 'cookie',
|
|
605
|
+
name: 'sessionid',
|
|
606
|
+
type: 'apiKey'
|
|
607
|
+
}],
|
|
608
|
+
url: '/cfg/accounts/profile/delete/',
|
|
609
|
+
...options
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Partial update user profile
|
|
615
|
+
*
|
|
616
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
617
|
+
*/
|
|
618
|
+
public static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>) {
|
|
619
|
+
return (options?.client ?? client).patch<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError>({
|
|
620
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
621
|
+
in: 'cookie',
|
|
622
|
+
name: 'sessionid',
|
|
623
|
+
type: 'apiKey'
|
|
624
|
+
}],
|
|
625
|
+
url: '/cfg/accounts/profile/partial/',
|
|
626
|
+
...options,
|
|
627
|
+
headers: {
|
|
628
|
+
'Content-Type': 'application/json',
|
|
629
|
+
...options?.headers
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Partial update user profile
|
|
636
|
+
*
|
|
637
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
638
|
+
*/
|
|
639
|
+
public static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>) {
|
|
640
|
+
return (options?.client ?? client).put<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError>({
|
|
641
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
642
|
+
in: 'cookie',
|
|
643
|
+
name: 'sessionid',
|
|
644
|
+
type: 'apiKey'
|
|
645
|
+
}],
|
|
646
|
+
url: '/cfg/accounts/profile/partial/',
|
|
647
|
+
...options,
|
|
648
|
+
headers: {
|
|
649
|
+
'Content-Type': 'application/json',
|
|
650
|
+
...options?.headers
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Update user profile
|
|
657
|
+
*
|
|
658
|
+
* Update the current authenticated user's profile information.
|
|
659
|
+
*/
|
|
660
|
+
public static cfgAccountsProfileUpdatePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdatePartialUpdateData, ThrowOnError>) {
|
|
661
|
+
return (options?.client ?? client).patch<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError>({
|
|
662
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
663
|
+
in: 'cookie',
|
|
664
|
+
name: 'sessionid',
|
|
665
|
+
type: 'apiKey'
|
|
666
|
+
}],
|
|
667
|
+
url: '/cfg/accounts/profile/update/',
|
|
668
|
+
...options,
|
|
669
|
+
headers: {
|
|
670
|
+
'Content-Type': 'application/json',
|
|
671
|
+
...options?.headers
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Update user profile
|
|
678
|
+
*
|
|
679
|
+
* Update the current authenticated user's profile information.
|
|
680
|
+
*/
|
|
681
|
+
public static cfgAccountsProfileUpdateUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdateUpdateData, ThrowOnError>) {
|
|
682
|
+
return (options?.client ?? client).put<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError>({
|
|
683
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
684
|
+
in: 'cookie',
|
|
685
|
+
name: 'sessionid',
|
|
686
|
+
type: 'apiKey'
|
|
687
|
+
}],
|
|
688
|
+
url: '/cfg/accounts/profile/update/',
|
|
689
|
+
...options,
|
|
690
|
+
headers: {
|
|
691
|
+
'Content-Type': 'application/json',
|
|
692
|
+
...options?.headers
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Refresh JWT token.
|
|
699
|
+
*/
|
|
700
|
+
public static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>) {
|
|
701
|
+
return (options.client ?? client).post<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError>({
|
|
702
|
+
url: '/cfg/accounts/token/refresh/',
|
|
703
|
+
...options,
|
|
704
|
+
headers: {
|
|
705
|
+
'Content-Type': 'application/json',
|
|
706
|
+
...options.headers
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export class OAuth {
|
|
713
|
+
/**
|
|
714
|
+
* List OAuth connections
|
|
715
|
+
*
|
|
716
|
+
* Get all OAuth connections for the current user.
|
|
717
|
+
*/
|
|
718
|
+
public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>) {
|
|
719
|
+
return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
|
|
720
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
721
|
+
url: '/cfg/accounts/oauth/connections/',
|
|
722
|
+
...options
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Disconnect OAuth provider
|
|
728
|
+
*
|
|
729
|
+
* Remove OAuth connection for the specified provider.
|
|
730
|
+
*/
|
|
731
|
+
public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>) {
|
|
732
|
+
return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
|
|
733
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
734
|
+
url: '/cfg/accounts/oauth/disconnect/',
|
|
735
|
+
...options,
|
|
736
|
+
headers: {
|
|
737
|
+
'Content-Type': 'application/json',
|
|
738
|
+
...options.headers
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Start GitHub OAuth
|
|
745
|
+
*
|
|
746
|
+
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
747
|
+
*/
|
|
748
|
+
public static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>) {
|
|
749
|
+
return (options?.client ?? client).post<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError>({
|
|
750
|
+
url: '/cfg/accounts/oauth/github/authorize/',
|
|
751
|
+
...options,
|
|
752
|
+
headers: {
|
|
753
|
+
'Content-Type': 'application/json',
|
|
754
|
+
...options?.headers
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Complete GitHub OAuth
|
|
761
|
+
*
|
|
762
|
+
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
763
|
+
*/
|
|
764
|
+
public static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>) {
|
|
765
|
+
return (options.client ?? client).post<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError>({
|
|
766
|
+
url: '/cfg/accounts/oauth/github/callback/',
|
|
767
|
+
...options,
|
|
768
|
+
headers: {
|
|
769
|
+
'Content-Type': 'application/json',
|
|
770
|
+
...options.headers
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* List OAuth providers
|
|
777
|
+
*
|
|
778
|
+
* Get list of available OAuth providers for authentication.
|
|
779
|
+
*/
|
|
780
|
+
public static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>) {
|
|
781
|
+
return (options?.client ?? client).get<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>({ url: '/cfg/accounts/oauth/providers/', ...options });
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export class UserProfile {
|
|
786
|
+
/**
|
|
787
|
+
* Get current user profile
|
|
788
|
+
*
|
|
789
|
+
* Retrieve the current authenticated user's profile information.
|
|
790
|
+
*/
|
|
791
|
+
public static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>) {
|
|
792
|
+
return (options?.client ?? client).get<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError>({
|
|
793
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
794
|
+
in: 'cookie',
|
|
795
|
+
name: 'sessionid',
|
|
796
|
+
type: 'apiKey'
|
|
797
|
+
}],
|
|
798
|
+
url: '/cfg/accounts/profile/',
|
|
799
|
+
...options
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Upload user avatar
|
|
805
|
+
*
|
|
806
|
+
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
807
|
+
*/
|
|
808
|
+
public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>) {
|
|
809
|
+
return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
|
|
810
|
+
...formDataBodySerializer,
|
|
811
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
812
|
+
url: '/cfg/accounts/profile/avatar/',
|
|
813
|
+
...options,
|
|
814
|
+
headers: {
|
|
815
|
+
'Content-Type': null,
|
|
816
|
+
...options?.headers
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Delete user account
|
|
823
|
+
*
|
|
824
|
+
*
|
|
825
|
+
* Permanently delete the current user's account.
|
|
826
|
+
*
|
|
827
|
+
* This operation:
|
|
828
|
+
* - Deactivates the account (user cannot log in)
|
|
829
|
+
* - Anonymizes personal data (GDPR compliance)
|
|
830
|
+
* - Frees up the email address for re-registration
|
|
831
|
+
* - Preserves audit trail
|
|
832
|
+
*
|
|
833
|
+
* The account can be restored by an administrator if needed.
|
|
834
|
+
*
|
|
835
|
+
*/
|
|
836
|
+
public static cfgAccountsProfileDeleteCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileDeleteCreateData, ThrowOnError>) {
|
|
837
|
+
return (options?.client ?? client).post<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError>({
|
|
838
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
839
|
+
in: 'cookie',
|
|
840
|
+
name: 'sessionid',
|
|
841
|
+
type: 'apiKey'
|
|
842
|
+
}],
|
|
843
|
+
url: '/cfg/accounts/profile/delete/',
|
|
844
|
+
...options
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Partial update user profile
|
|
850
|
+
*
|
|
851
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
852
|
+
*/
|
|
853
|
+
public static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>) {
|
|
854
|
+
return (options?.client ?? client).patch<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError>({
|
|
855
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
856
|
+
in: 'cookie',
|
|
857
|
+
name: 'sessionid',
|
|
858
|
+
type: 'apiKey'
|
|
859
|
+
}],
|
|
860
|
+
url: '/cfg/accounts/profile/partial/',
|
|
861
|
+
...options,
|
|
862
|
+
headers: {
|
|
863
|
+
'Content-Type': 'application/json',
|
|
864
|
+
...options?.headers
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Partial update user profile
|
|
871
|
+
*
|
|
872
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
873
|
+
*/
|
|
874
|
+
public static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>) {
|
|
875
|
+
return (options?.client ?? client).put<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError>({
|
|
876
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
877
|
+
in: 'cookie',
|
|
878
|
+
name: 'sessionid',
|
|
879
|
+
type: 'apiKey'
|
|
880
|
+
}],
|
|
881
|
+
url: '/cfg/accounts/profile/partial/',
|
|
882
|
+
...options,
|
|
883
|
+
headers: {
|
|
884
|
+
'Content-Type': 'application/json',
|
|
885
|
+
...options?.headers
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* Update user profile
|
|
892
|
+
*
|
|
893
|
+
* Update the current authenticated user's profile information.
|
|
894
|
+
*/
|
|
895
|
+
public static cfgAccountsProfileUpdatePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdatePartialUpdateData, ThrowOnError>) {
|
|
896
|
+
return (options?.client ?? client).patch<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError>({
|
|
897
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
898
|
+
in: 'cookie',
|
|
899
|
+
name: 'sessionid',
|
|
900
|
+
type: 'apiKey'
|
|
901
|
+
}],
|
|
902
|
+
url: '/cfg/accounts/profile/update/',
|
|
903
|
+
...options,
|
|
904
|
+
headers: {
|
|
905
|
+
'Content-Type': 'application/json',
|
|
906
|
+
...options?.headers
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Update user profile
|
|
913
|
+
*
|
|
914
|
+
* Update the current authenticated user's profile information.
|
|
915
|
+
*/
|
|
916
|
+
public static cfgAccountsProfileUpdateUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdateUpdateData, ThrowOnError>) {
|
|
917
|
+
return (options?.client ?? client).put<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError>({
|
|
918
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
919
|
+
in: 'cookie',
|
|
920
|
+
name: 'sessionid',
|
|
921
|
+
type: 'apiKey'
|
|
922
|
+
}],
|
|
923
|
+
url: '/cfg/accounts/profile/update/',
|
|
924
|
+
...options,
|
|
925
|
+
headers: {
|
|
926
|
+
'Content-Type': 'application/json',
|
|
927
|
+
...options?.headers
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
export class Auth {
|
|
934
|
+
/**
|
|
935
|
+
* Refresh JWT token.
|
|
936
|
+
*/
|
|
937
|
+
public static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>) {
|
|
938
|
+
return (options.client ?? client).post<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError>({
|
|
939
|
+
url: '/cfg/accounts/token/refresh/',
|
|
940
|
+
...options,
|
|
941
|
+
headers: {
|
|
942
|
+
'Content-Type': 'application/json',
|
|
943
|
+
...options.headers
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
}
|
|
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
|
+
}
|