@djangocfg/api 2.1.321 → 2.1.327
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 +4265 -1169
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +4265 -1159
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +4150 -3053
- 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 +4139 -3042
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +3932 -4031
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +2408 -2671
- package/dist/clients.d.ts +2408 -2671
- package/dist/clients.mjs +3945 -4038
- package/dist/clients.mjs.map +1 -1
- package/dist/index.cjs +4214 -2713
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2758 -1828
- package/dist/index.d.ts +2758 -1828
- package/dist/index.mjs +4183 -2676
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -7
- package/src/_api/generated/_shared/errors.ts +70 -0
- package/src/_api/generated/_shared/index.ts +25 -0
- package/src/_api/generated/_shared/logger.ts +123 -0
- package/src/_api/generated/_shared/storage.ts +83 -0
- package/src/_api/generated/_shared/validation-events.ts +52 -0
- package/src/_api/generated/cfg_accounts/api.ts +187 -0
- package/src/_api/generated/cfg_accounts/client/client.gen.ts +280 -0
- package/src/_api/generated/cfg_accounts/client/index.ts +25 -0
- package/src/_api/generated/cfg_accounts/client/types.gen.ts +217 -0
- package/src/_api/generated/cfg_accounts/client/utils.gen.ts +318 -0
- package/src/_api/generated/cfg_accounts/client.gen.ts +16 -0
- package/src/_api/generated/cfg_accounts/core/auth.gen.ts +41 -0
- package/src/_api/generated/cfg_accounts/core/bodySerializer.gen.ts +82 -0
- package/src/_api/generated/cfg_accounts/core/params.gen.ts +169 -0
- package/src/_api/generated/cfg_accounts/core/pathSerializer.gen.ts +171 -0
- package/src/_api/generated/cfg_accounts/core/queryKeySerializer.gen.ts +117 -0
- package/src/_api/generated/cfg_accounts/core/serverSentEvents.gen.ts +242 -0
- package/src/_api/generated/cfg_accounts/core/types.gen.ts +104 -0
- package/src/_api/generated/cfg_accounts/core/utils.gen.ts +140 -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 +26 -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 +26 -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 +26 -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 +26 -335
- 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 → schemas/User.ts} +8 -16
- package/src/_api/generated/cfg_accounts/schemas/index.ts +24 -0
- package/src/_api/generated/cfg_accounts/sdk.gen.ts +796 -0
- package/src/_api/generated/cfg_accounts/types.gen.ts +764 -0
- package/src/_api/generated/cfg_centrifugo/api.ts +164 -0
- package/src/_api/generated/cfg_centrifugo/client/client.gen.ts +280 -0
- package/src/_api/generated/cfg_centrifugo/client/index.ts +25 -0
- package/src/_api/generated/cfg_centrifugo/client/types.gen.ts +217 -0
- package/src/_api/generated/cfg_centrifugo/client/utils.gen.ts +318 -0
- package/src/_api/generated/cfg_centrifugo/client.gen.ts +16 -0
- package/src/_api/generated/cfg_centrifugo/core/auth.gen.ts +41 -0
- package/src/_api/generated/cfg_centrifugo/core/bodySerializer.gen.ts +82 -0
- package/src/_api/generated/cfg_centrifugo/core/params.gen.ts +169 -0
- package/src/_api/generated/cfg_centrifugo/core/pathSerializer.gen.ts +171 -0
- package/src/_api/generated/cfg_centrifugo/core/queryKeySerializer.gen.ts +117 -0
- package/src/_api/generated/cfg_centrifugo/core/serverSentEvents.gen.ts +242 -0
- package/src/_api/generated/cfg_centrifugo/core/types.gen.ts +104 -0
- package/src/_api/generated/cfg_centrifugo/core/utils.gen.ts +140 -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 +26 -0
- package/src/_api/generated/cfg_centrifugo/index.ts +26 -313
- 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 +64 -0
- package/src/_api/generated/cfg_centrifugo/types.gen.ts +61 -0
- package/src/_api/generated/cfg_totp/api.ts +181 -0
- package/src/_api/generated/cfg_totp/client/client.gen.ts +280 -0
- package/src/_api/generated/cfg_totp/client/index.ts +25 -0
- package/src/_api/generated/cfg_totp/client/types.gen.ts +217 -0
- package/src/_api/generated/cfg_totp/client/utils.gen.ts +318 -0
- package/src/_api/generated/cfg_totp/client.gen.ts +16 -0
- package/src/_api/generated/cfg_totp/core/auth.gen.ts +41 -0
- package/src/_api/generated/cfg_totp/core/bodySerializer.gen.ts +82 -0
- package/src/_api/generated/cfg_totp/core/params.gen.ts +169 -0
- package/src/_api/generated/cfg_totp/core/pathSerializer.gen.ts +171 -0
- package/src/_api/generated/cfg_totp/core/queryKeySerializer.gen.ts +117 -0
- package/src/_api/generated/cfg_totp/core/serverSentEvents.gen.ts +242 -0
- package/src/_api/generated/cfg_totp/core/types.gen.ts +104 -0
- package/src/_api/generated/cfg_totp/core/utils.gen.ts +140 -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 +26 -0
- package/src/_api/generated/cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +24 -0
- package/src/_api/generated/cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +26 -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 +26 -342
- 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 → schemas/TotpVerifyUser.ts} +7 -15
- 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 +432 -0
- package/src/_api/generated/cfg_totp/types.gen.ts +479 -0
- package/src/_api/generated/index.ts +30 -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 +2 -1
- package/src/auth/hooks/useGithubAuth.ts +12 -11
- package/src/auth/hooks/useTokenRefresh.ts +6 -4
- package/src/auth/hooks/useTwoFactor.ts +14 -8
- package/src/auth/hooks/useTwoFactorSetup.ts +8 -5
- package/src/auth/hooks/useTwoFactorStatus.ts +3 -2
- package/src/auth/middlewares/tokenRefresh.ts +6 -4
- package/src/clients.ts +14 -51
- package/src/index.ts +15 -57
- 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/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/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/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,140 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
|
|
4
|
+
import {
|
|
5
|
+
type ArraySeparatorStyle,
|
|
6
|
+
serializeArrayParam,
|
|
7
|
+
serializeObjectParam,
|
|
8
|
+
serializePrimitiveParam,
|
|
9
|
+
} from './pathSerializer.gen';
|
|
10
|
+
|
|
11
|
+
export interface PathSerializer {
|
|
12
|
+
path: Record<string, unknown>;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
17
|
+
|
|
18
|
+
export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
|
19
|
+
let url = _url;
|
|
20
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
21
|
+
if (matches) {
|
|
22
|
+
for (const match of matches) {
|
|
23
|
+
let explode = false;
|
|
24
|
+
let name = match.substring(1, match.length - 1);
|
|
25
|
+
let style: ArraySeparatorStyle = 'simple';
|
|
26
|
+
|
|
27
|
+
if (name.endsWith('*')) {
|
|
28
|
+
explode = true;
|
|
29
|
+
name = name.substring(0, name.length - 1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (name.startsWith('.')) {
|
|
33
|
+
name = name.substring(1);
|
|
34
|
+
style = 'label';
|
|
35
|
+
} else if (name.startsWith(';')) {
|
|
36
|
+
name = name.substring(1);
|
|
37
|
+
style = 'matrix';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const value = path[name];
|
|
41
|
+
|
|
42
|
+
if (value === undefined || value === null) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (typeof value === 'object') {
|
|
52
|
+
url = url.replace(
|
|
53
|
+
match,
|
|
54
|
+
serializeObjectParam({
|
|
55
|
+
explode,
|
|
56
|
+
name,
|
|
57
|
+
style,
|
|
58
|
+
value: value as Record<string, unknown>,
|
|
59
|
+
valueOnly: true,
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (style === 'matrix') {
|
|
66
|
+
url = url.replace(
|
|
67
|
+
match,
|
|
68
|
+
`;${serializePrimitiveParam({
|
|
69
|
+
name,
|
|
70
|
+
value: value as string,
|
|
71
|
+
})}`,
|
|
72
|
+
);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const replaceValue = encodeURIComponent(
|
|
77
|
+
style === 'label' ? `.${value as string}` : (value as string),
|
|
78
|
+
);
|
|
79
|
+
url = url.replace(match, replaceValue);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return url;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const getUrl = ({
|
|
86
|
+
baseUrl,
|
|
87
|
+
path,
|
|
88
|
+
query,
|
|
89
|
+
querySerializer,
|
|
90
|
+
url: _url,
|
|
91
|
+
}: {
|
|
92
|
+
baseUrl?: string;
|
|
93
|
+
path?: Record<string, unknown>;
|
|
94
|
+
query?: Record<string, unknown>;
|
|
95
|
+
querySerializer: QuerySerializer;
|
|
96
|
+
url: string;
|
|
97
|
+
}) => {
|
|
98
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
99
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
100
|
+
if (path) {
|
|
101
|
+
url = defaultPathSerializer({ path, url });
|
|
102
|
+
}
|
|
103
|
+
let search = query ? querySerializer(query) : '';
|
|
104
|
+
if (search.startsWith('?')) {
|
|
105
|
+
search = search.substring(1);
|
|
106
|
+
}
|
|
107
|
+
if (search) {
|
|
108
|
+
url += `?${search}`;
|
|
109
|
+
}
|
|
110
|
+
return url;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export function getValidRequestBody(options: {
|
|
114
|
+
body?: unknown;
|
|
115
|
+
bodySerializer?: BodySerializer | null;
|
|
116
|
+
serializedBody?: unknown;
|
|
117
|
+
}) {
|
|
118
|
+
const hasBody = options.body !== undefined;
|
|
119
|
+
const isSerializedBody = hasBody && options.bodySerializer;
|
|
120
|
+
|
|
121
|
+
if (isSerializedBody) {
|
|
122
|
+
if ('serializedBody' in options) {
|
|
123
|
+
const hasSerializedBody =
|
|
124
|
+
options.serializedBody !== undefined && options.serializedBody !== '';
|
|
125
|
+
|
|
126
|
+
return hasSerializedBody ? options.serializedBody : null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
130
|
+
return options.body !== '' ? options.body : null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// plain/text body
|
|
134
|
+
if (hasBody) {
|
|
135
|
+
return options.body;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// no body was provided
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras.events
|
|
2
|
+
// Hooks Hey API client interceptors → typed CustomEvents on `window`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
//
|
|
5
|
+
// Usage:
|
|
6
|
+
// import "./generated/events" // side-effect: registers interceptors
|
|
7
|
+
//
|
|
8
|
+
// window.addEventListener("cmdop:network-error", (e) => {
|
|
9
|
+
// console.log(e.detail.status, e.detail.method, e.detail.url);
|
|
10
|
+
// });
|
|
11
|
+
|
|
12
|
+
import { client } from "./client.gen";
|
|
13
|
+
|
|
14
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
15
|
+
// Event names + detail types
|
|
16
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
export const NETWORK_ERROR_EVENT = "cmdop:network-error" as const;
|
|
19
|
+
export const VALIDATION_ERROR_EVENT = "cmdop:validation-error" as const;
|
|
20
|
+
export const RUNTIME_ERROR_EVENT = "cmdop:runtime-error" as const;
|
|
21
|
+
|
|
22
|
+
export interface NetworkErrorDetail {
|
|
23
|
+
/** HTTP method (GET/POST/...). */
|
|
24
|
+
method: string;
|
|
25
|
+
/** Request URL. */
|
|
26
|
+
url: string;
|
|
27
|
+
/** HTTP status if response arrived; null on transport failure. */
|
|
28
|
+
status: number | null;
|
|
29
|
+
/** Response body parsed as text (best-effort, may be empty). */
|
|
30
|
+
body?: string;
|
|
31
|
+
/** Underlying error message (network failures, abort, etc.). */
|
|
32
|
+
error?: string;
|
|
33
|
+
/** Heuristic: did the request likely fail due to CORS? */
|
|
34
|
+
possiblyCors: boolean;
|
|
35
|
+
timestamp: Date;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ValidationErrorDetail {
|
|
39
|
+
/** Operation ID this validation applies to (from the OpenAPI spec). */
|
|
40
|
+
operation: string;
|
|
41
|
+
/** Schema name that failed (if known). */
|
|
42
|
+
schema?: string;
|
|
43
|
+
/** Issues array — shape mirrors zod's ZodIssue but kept opaque here to
|
|
44
|
+
* avoid forcing a hard zod dep on consumers that don't use schemas. */
|
|
45
|
+
issues: unknown;
|
|
46
|
+
/** Raw response data that failed validation. */
|
|
47
|
+
data: unknown;
|
|
48
|
+
timestamp: Date;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface RuntimeErrorDetail {
|
|
52
|
+
/** Free-form source identifier — component name, hook name, etc. */
|
|
53
|
+
source: string;
|
|
54
|
+
message: string;
|
|
55
|
+
/** Original Error object (may be undefined when caller lacks one). */
|
|
56
|
+
error?: Error;
|
|
57
|
+
/** Arbitrary context payload from the caller. */
|
|
58
|
+
context?: Record<string, unknown>;
|
|
59
|
+
timestamp: Date;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Augment the global WindowEventMap so addEventListener gets typed details.
|
|
63
|
+
declare global {
|
|
64
|
+
interface WindowEventMap {
|
|
65
|
+
"cmdop:network-error": CustomEvent<NetworkErrorDetail>;
|
|
66
|
+
"cmdop:validation-error": CustomEvent<ValidationErrorDetail>;
|
|
67
|
+
"cmdop:runtime-error": CustomEvent<RuntimeErrorDetail>;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
72
|
+
// Dispatch helpers
|
|
73
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
function _dispatch<T>(name: string, detail: T): void {
|
|
76
|
+
if (typeof window === "undefined") return;
|
|
77
|
+
try {
|
|
78
|
+
window.dispatchEvent(new CustomEvent(name, { detail, bubbles: true }));
|
|
79
|
+
} catch {
|
|
80
|
+
// Event dispatch must never crash the app.
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Emit a runtime error from anywhere in app code. */
|
|
85
|
+
export function emitRuntimeError(
|
|
86
|
+
source: string,
|
|
87
|
+
message: string,
|
|
88
|
+
error?: Error,
|
|
89
|
+
context?: Record<string, unknown>,
|
|
90
|
+
): void {
|
|
91
|
+
_dispatch<RuntimeErrorDetail>(RUNTIME_ERROR_EVENT, {
|
|
92
|
+
source,
|
|
93
|
+
message,
|
|
94
|
+
error,
|
|
95
|
+
context,
|
|
96
|
+
timestamp: new Date(),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Emit a zod validation failure. Called by hooks when `validate` is provided. */
|
|
101
|
+
export function dispatchValidationError(
|
|
102
|
+
operation: string,
|
|
103
|
+
data: unknown,
|
|
104
|
+
issues: unknown,
|
|
105
|
+
schema?: string,
|
|
106
|
+
): void {
|
|
107
|
+
_dispatch<ValidationErrorDetail>(VALIDATION_ERROR_EVENT, {
|
|
108
|
+
operation,
|
|
109
|
+
schema,
|
|
110
|
+
issues,
|
|
111
|
+
data,
|
|
112
|
+
timestamp: new Date(),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
117
|
+
// Listen helpers — typed wrappers over addEventListener, return cleanup fn.
|
|
118
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
119
|
+
|
|
120
|
+
export function onNetworkError(
|
|
121
|
+
cb: (detail: NetworkErrorDetail) => void,
|
|
122
|
+
): () => void {
|
|
123
|
+
if (typeof window === "undefined") return () => {};
|
|
124
|
+
const handler = (e: CustomEvent<NetworkErrorDetail>) => cb(e.detail);
|
|
125
|
+
window.addEventListener(NETWORK_ERROR_EVENT, handler);
|
|
126
|
+
return () => window.removeEventListener(NETWORK_ERROR_EVENT, handler);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function onValidationError(
|
|
130
|
+
cb: (detail: ValidationErrorDetail) => void,
|
|
131
|
+
): () => void {
|
|
132
|
+
if (typeof window === "undefined") return () => {};
|
|
133
|
+
const handler = (e: CustomEvent<ValidationErrorDetail>) => cb(e.detail);
|
|
134
|
+
window.addEventListener(VALIDATION_ERROR_EVENT, handler);
|
|
135
|
+
return () => window.removeEventListener(VALIDATION_ERROR_EVENT, handler);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function onRuntimeError(
|
|
139
|
+
cb: (detail: RuntimeErrorDetail) => void,
|
|
140
|
+
): () => void {
|
|
141
|
+
if (typeof window === "undefined") return () => {};
|
|
142
|
+
const handler = (e: CustomEvent<RuntimeErrorDetail>) => cb(e.detail);
|
|
143
|
+
window.addEventListener(RUNTIME_ERROR_EVENT, handler);
|
|
144
|
+
return () => window.removeEventListener(RUNTIME_ERROR_EVENT, handler);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
148
|
+
// Hey API interceptors — wire once, emit on response/error.
|
|
149
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
150
|
+
|
|
151
|
+
let _wired = false;
|
|
152
|
+
|
|
153
|
+
function _wire(): void {
|
|
154
|
+
if (_wired) return;
|
|
155
|
+
_wired = true;
|
|
156
|
+
|
|
157
|
+
// response interceptor: every response, OK or not, lets us see status.
|
|
158
|
+
// We only emit for non-2xx — successful requests are silent.
|
|
159
|
+
client.interceptors.response.use(async (response, request) => {
|
|
160
|
+
if (!response.ok) {
|
|
161
|
+
let body: string | undefined;
|
|
162
|
+
try {
|
|
163
|
+
body = await response.clone().text();
|
|
164
|
+
if (body.length > 4000) body = body.slice(0, 4000) + "…";
|
|
165
|
+
} catch {
|
|
166
|
+
// ignore — body inaccessible
|
|
167
|
+
}
|
|
168
|
+
_dispatch<NetworkErrorDetail>(NETWORK_ERROR_EVENT, {
|
|
169
|
+
method: request.method,
|
|
170
|
+
url: request.url,
|
|
171
|
+
status: response.status,
|
|
172
|
+
body,
|
|
173
|
+
possiblyCors: false,
|
|
174
|
+
timestamp: new Date(),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return response;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// error interceptor: transport-level failures (abort, DNS, CORS, offline).
|
|
181
|
+
client.interceptors.error.use((error, _response, request) => {
|
|
182
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
183
|
+
// Heuristic: CORS-blocked fetches usually surface as "Failed to fetch"
|
|
184
|
+
// without a status. Not perfect, but catches the common case.
|
|
185
|
+
const possiblyCors = /failed to fetch|network error|cors/i.test(msg);
|
|
186
|
+
_dispatch<NetworkErrorDetail>(NETWORK_ERROR_EVENT, {
|
|
187
|
+
method: request?.method ?? "UNKNOWN",
|
|
188
|
+
url: request?.url ?? "",
|
|
189
|
+
status: null,
|
|
190
|
+
error: msg,
|
|
191
|
+
possiblyCors,
|
|
192
|
+
timestamp: new Date(),
|
|
193
|
+
});
|
|
194
|
+
return error;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
_wire();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED — barrel for hooks.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
export { useCfgTotpBackupCodesRegenerateCreate } from "./useCfgTotpBackupCodesRegenerateCreate";
|
|
5
|
+
export { useCfgTotpBackupCodesRetrieve } from "./useCfgTotpBackupCodesRetrieve";
|
|
6
|
+
export { useCfgTotpDevicesDestroy } from "./useCfgTotpDevicesDestroy";
|
|
7
|
+
export { useCfgTotpDevicesRetrieve } from "./useCfgTotpDevicesRetrieve";
|
|
8
|
+
export { useCfgTotpDisableCreate } from "./useCfgTotpDisableCreate";
|
|
9
|
+
export { useCfgTotpSetupConfirmCreate } from "./useCfgTotpSetupConfirmCreate";
|
|
10
|
+
export { useCfgTotpSetupCreate } from "./useCfgTotpSetupCreate";
|
|
11
|
+
export { useCfgTotpVerifyBackupCreate } from "./useCfgTotpVerifyBackupCreate";
|
|
12
|
+
export { useCfgTotpVerifyCreate } from "./useCfgTotpVerifyCreate";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// POST /cfg/totp/backup-codes/regenerate/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpBackupCodesRegenerateCreateData, "url">;
|
|
11
|
+
type Result = CfgTotpBackupCodesRegenerateCreateResponses[keyof CfgTotpBackupCodesRegenerateCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpBackupCodesRegenerateCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_backup_codes_regenerate_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_backup_codes_regenerate_create"], Args>(
|
|
17
|
+
["cfg_totp_backup_codes_regenerate_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpBackupCodesRegenerateCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// GET /cfg/totp/backup-codes/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWR from "swr";
|
|
6
|
+
import type { SWRConfiguration } from "swr";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpBackupCodesRetrieveData, "url"> | undefined;
|
|
11
|
+
type Result = CfgTotpBackupCodesRetrieveResponses[keyof CfgTotpBackupCodesRetrieveResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpBackupCodesRetrieve(
|
|
14
|
+
args: Args,
|
|
15
|
+
config?: SWRConfiguration<Result>,
|
|
16
|
+
) {
|
|
17
|
+
const key = args ? ["cfg_totp_backup_codes_retrieve", args] as const : null;
|
|
18
|
+
return useSWR<Result>(
|
|
19
|
+
key,
|
|
20
|
+
async () => {
|
|
21
|
+
const res = await Cfg.cfgTotpBackupCodesRetrieve({ ...(args ?? {}), throwOnError: true } as never);
|
|
22
|
+
return res.data as Result;
|
|
23
|
+
},
|
|
24
|
+
config,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// DELETE /cfg/totp/devices/{id}/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpDevicesDestroyData, "url">;
|
|
11
|
+
type Result = CfgTotpDevicesDestroyResponses[keyof CfgTotpDevicesDestroyResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpDevicesDestroy(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_devices_destroy"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_devices_destroy"], Args>(
|
|
17
|
+
["cfg_totp_devices_destroy"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpDevicesDestroy({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// GET /cfg/totp/devices/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWR from "swr";
|
|
6
|
+
import type { SWRConfiguration } from "swr";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpDevicesRetrieveData, "url"> | undefined;
|
|
11
|
+
type Result = CfgTotpDevicesRetrieveResponses[keyof CfgTotpDevicesRetrieveResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpDevicesRetrieve(
|
|
14
|
+
args: Args,
|
|
15
|
+
config?: SWRConfiguration<Result>,
|
|
16
|
+
) {
|
|
17
|
+
const key = args ? ["cfg_totp_devices_retrieve", args] as const : null;
|
|
18
|
+
return useSWR<Result>(
|
|
19
|
+
key,
|
|
20
|
+
async () => {
|
|
21
|
+
const res = await Cfg.cfgTotpDevicesRetrieve({ ...(args ?? {}), throwOnError: true } as never);
|
|
22
|
+
return res.data as Result;
|
|
23
|
+
},
|
|
24
|
+
config,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// POST /cfg/totp/disable/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpDisableCreateData, CfgTotpDisableCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpDisableCreateData, "url">;
|
|
11
|
+
type Result = CfgTotpDisableCreateResponses[keyof CfgTotpDisableCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpDisableCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_disable_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_disable_create"], Args>(
|
|
17
|
+
["cfg_totp_disable_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpDisableCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// POST /cfg/totp/setup/confirm/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpSetupConfirmCreateData, "url">;
|
|
11
|
+
type Result = CfgTotpSetupConfirmCreateResponses[keyof CfgTotpSetupConfirmCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpSetupConfirmCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_setup_confirm_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_setup_confirm_create"], Args>(
|
|
17
|
+
["cfg_totp_setup_confirm_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpSetupConfirmCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// POST /cfg/totp/setup/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpSetupCreateData, CfgTotpSetupCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpSetupCreateData, "url">;
|
|
11
|
+
type Result = CfgTotpSetupCreateResponses[keyof CfgTotpSetupCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpSetupCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_setup_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_setup_create"], Args>(
|
|
17
|
+
["cfg_totp_setup_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpSetupCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// POST /cfg/totp/verify/backup/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpVerifyBackupCreateData, "url">;
|
|
11
|
+
type Result = CfgTotpVerifyBackupCreateResponses[keyof CfgTotpVerifyBackupCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpVerifyBackupCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_verify_backup_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_verify_backup_create"], Args>(
|
|
17
|
+
["cfg_totp_verify_backup_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpVerifyBackupCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// POST /cfg/totp/verify/
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import useSWRMutation from "swr/mutation";
|
|
6
|
+
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
+
import { Cfg } from "../sdk.gen";
|
|
8
|
+
import type { CfgTotpVerifyCreateData, CfgTotpVerifyCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgTotpVerifyCreateData, "url">;
|
|
11
|
+
type Result = CfgTotpVerifyCreateResponses[keyof CfgTotpVerifyCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgTotpVerifyCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_totp_verify_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_totp_verify_create"], Args>(
|
|
17
|
+
["cfg_totp_verify_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgTotpVerifyCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|