@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
package/dist/auth.d.cts
CHANGED
|
@@ -1,232 +1,172 @@
|
|
|
1
1
|
import React$1, { MutableRefObject, ReactNode } from 'react';
|
|
2
|
-
import { z } from 'zod';
|
|
3
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
3
|
import * as consola from 'consola';
|
|
4
|
+
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* This schema provides runtime validation and type inference.
|
|
10
|
-
* * Serializer for OTP request.
|
|
11
|
-
* */
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Serializer for OTP request.
|
|
7
|
+
* Nested serializer for Centrifugo WebSocket connection token.
|
|
15
8
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
type CentrifugoToken = {
|
|
10
|
+
/**
|
|
11
|
+
* Centrifugo WebSocket URL
|
|
12
|
+
*/
|
|
13
|
+
centrifugo_url: string;
|
|
14
|
+
/**
|
|
15
|
+
* List of allowed channels for this user
|
|
16
|
+
*/
|
|
17
|
+
channels: Array<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Token expiration time (ISO 8601)
|
|
20
|
+
*/
|
|
21
|
+
expires_at: string;
|
|
22
|
+
/**
|
|
23
|
+
* JWT token for Centrifugo WebSocket connection
|
|
24
|
+
*/
|
|
25
|
+
token: string;
|
|
26
|
+
};
|
|
20
27
|
/**
|
|
21
|
-
*
|
|
28
|
+
* Serializer for updating user profile.
|
|
22
29
|
*/
|
|
23
|
-
type
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
type CfgUserUpdateRequest = {
|
|
31
|
+
company?: string;
|
|
32
|
+
first_name?: string;
|
|
33
|
+
language?: string;
|
|
34
|
+
last_name?: string;
|
|
35
|
+
phone?: string;
|
|
36
|
+
position?: string;
|
|
37
|
+
};
|
|
32
38
|
/**
|
|
33
|
-
* OTP request
|
|
39
|
+
* Serializer for OTP request.
|
|
34
40
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
type OtpRequestRequest = {
|
|
42
|
+
/**
|
|
43
|
+
* Email address for OTP delivery
|
|
44
|
+
*/
|
|
45
|
+
identifier: string;
|
|
46
|
+
/**
|
|
47
|
+
* Source URL for tracking registration (e.g., https://my.djangocfg.com)
|
|
48
|
+
*/
|
|
49
|
+
source_url?: string;
|
|
50
|
+
};
|
|
38
51
|
/**
|
|
39
|
-
*
|
|
52
|
+
* OTP request response.
|
|
40
53
|
*/
|
|
41
|
-
type
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* * Serializer for OTP verification.
|
|
48
|
-
* */
|
|
49
|
-
|
|
54
|
+
type OtpRequestResponse = {
|
|
55
|
+
/**
|
|
56
|
+
* Success message
|
|
57
|
+
*/
|
|
58
|
+
message: string;
|
|
59
|
+
};
|
|
50
60
|
/**
|
|
51
61
|
* Serializer for OTP verification.
|
|
52
62
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* Zod schema for OTPVerifyResponse
|
|
65
|
-
*
|
|
66
|
-
* This schema provides runtime validation and type inference.
|
|
67
|
-
* * OTP verification response.
|
|
68
|
-
|
|
69
|
-
When 2FA is required:
|
|
70
|
-
- requires_2fa: True
|
|
71
|
-
- session_id: UUID of 2FA verification session
|
|
72
|
-
- refresh/access/user: null
|
|
73
|
-
|
|
74
|
-
When 2FA is not required:
|
|
75
|
-
- requires_2fa: False
|
|
76
|
-
- session_id: null
|
|
77
|
-
- refresh/access/user: populated
|
|
78
|
-
* */
|
|
79
|
-
|
|
63
|
+
type OtpVerifyRequest = {
|
|
64
|
+
/**
|
|
65
|
+
* Email address used for OTP request
|
|
66
|
+
*/
|
|
67
|
+
identifier: string;
|
|
68
|
+
otp: string;
|
|
69
|
+
/**
|
|
70
|
+
* Source URL for tracking login (e.g., https://my.djangocfg.com)
|
|
71
|
+
*/
|
|
72
|
+
source_url?: string;
|
|
73
|
+
};
|
|
80
74
|
/**
|
|
81
75
|
* OTP verification response.
|
|
82
|
-
|
|
83
|
-
When 2FA is required:
|
|
84
|
-
- requires_2fa: True
|
|
85
|
-
- session_id: UUID of 2FA verification session
|
|
86
|
-
- refresh/access/user: null
|
|
87
|
-
|
|
88
|
-
When 2FA is not required:
|
|
89
|
-
- requires_2fa: False
|
|
90
|
-
- session_id: null
|
|
91
|
-
- refresh/access/user: populated
|
|
92
|
-
*/
|
|
93
|
-
declare const OTPVerifyResponseSchema: z.ZodObject<{
|
|
94
|
-
requires_2fa: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
-
session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
-
refresh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
97
|
-
access: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
-
user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
99
|
-
id: z.ZodNumber;
|
|
100
|
-
email: z.ZodEmail;
|
|
101
|
-
first_name: z.ZodOptional<z.ZodString>;
|
|
102
|
-
last_name: z.ZodOptional<z.ZodString>;
|
|
103
|
-
full_name: z.ZodString;
|
|
104
|
-
initials: z.ZodString;
|
|
105
|
-
display_username: z.ZodString;
|
|
106
|
-
company: z.ZodOptional<z.ZodString>;
|
|
107
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
108
|
-
position: z.ZodOptional<z.ZodString>;
|
|
109
|
-
language: z.ZodOptional<z.ZodString>;
|
|
110
|
-
avatar: z.ZodNullable<z.ZodString>;
|
|
111
|
-
is_staff: z.ZodBoolean;
|
|
112
|
-
is_superuser: z.ZodBoolean;
|
|
113
|
-
date_joined: z.ZodString;
|
|
114
|
-
last_login: z.ZodNullable<z.ZodString>;
|
|
115
|
-
unanswered_messages_count: z.ZodNumber;
|
|
116
|
-
centrifugo: z.ZodNullable<z.ZodObject<{
|
|
117
|
-
token: z.ZodString;
|
|
118
|
-
centrifugo_url: z.ZodString;
|
|
119
|
-
expires_at: z.ZodString;
|
|
120
|
-
channels: z.ZodArray<z.ZodString>;
|
|
121
|
-
}, z.core.$strip>>;
|
|
122
|
-
}, z.core.$strip>>>;
|
|
123
|
-
should_prompt_2fa: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
-
}, z.core.$strip>;
|
|
125
|
-
/**
|
|
126
|
-
* Infer TypeScript type from Zod schema
|
|
127
|
-
*/
|
|
128
|
-
type OTPVerifyResponse = z.infer<typeof OTPVerifyResponseSchema>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Zod schema for PatchedUserProfileUpdateRequest
|
|
132
76
|
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Serializer for updating user profile.
|
|
139
|
-
*/
|
|
140
|
-
declare const PatchedUserProfileUpdateRequestSchema: z.ZodObject<{
|
|
141
|
-
first_name: z.ZodOptional<z.ZodString>;
|
|
142
|
-
last_name: z.ZodOptional<z.ZodString>;
|
|
143
|
-
company: z.ZodOptional<z.ZodString>;
|
|
144
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
145
|
-
position: z.ZodOptional<z.ZodString>;
|
|
146
|
-
language: z.ZodOptional<z.ZodString>;
|
|
147
|
-
}, z.core.$strip>;
|
|
148
|
-
/**
|
|
149
|
-
* Infer TypeScript type from Zod schema
|
|
150
|
-
*/
|
|
151
|
-
type PatchedUserProfileUpdateRequest = z.infer<typeof PatchedUserProfileUpdateRequestSchema>;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Zod schema for TokenRefresh
|
|
155
|
-
*
|
|
156
|
-
* This schema provides runtime validation and type inference.
|
|
157
|
-
* */
|
|
158
|
-
|
|
159
|
-
declare const TokenRefreshSchema: z.ZodObject<{
|
|
160
|
-
access: z.ZodString;
|
|
161
|
-
refresh: z.ZodString;
|
|
162
|
-
}, z.core.$strip>;
|
|
163
|
-
/**
|
|
164
|
-
* Infer TypeScript type from Zod schema
|
|
165
|
-
*/
|
|
166
|
-
type TokenRefresh = z.infer<typeof TokenRefreshSchema>;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Zod schema for User
|
|
77
|
+
* When 2FA is required:
|
|
78
|
+
* - requires_2fa: True
|
|
79
|
+
* - session_id: UUID of 2FA verification session
|
|
80
|
+
* - refresh/access/user: null
|
|
170
81
|
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Serializer for user details.
|
|
177
|
-
*/
|
|
178
|
-
declare const UserSchema: z.ZodObject<{
|
|
179
|
-
id: z.ZodNumber;
|
|
180
|
-
email: z.ZodEmail;
|
|
181
|
-
first_name: z.ZodOptional<z.ZodString>;
|
|
182
|
-
last_name: z.ZodOptional<z.ZodString>;
|
|
183
|
-
full_name: z.ZodString;
|
|
184
|
-
initials: z.ZodString;
|
|
185
|
-
display_username: z.ZodString;
|
|
186
|
-
company: z.ZodOptional<z.ZodString>;
|
|
187
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
188
|
-
position: z.ZodOptional<z.ZodString>;
|
|
189
|
-
language: z.ZodOptional<z.ZodString>;
|
|
190
|
-
avatar: z.ZodNullable<z.ZodString>;
|
|
191
|
-
is_staff: z.ZodBoolean;
|
|
192
|
-
is_superuser: z.ZodBoolean;
|
|
193
|
-
date_joined: z.ZodString;
|
|
194
|
-
last_login: z.ZodNullable<z.ZodString>;
|
|
195
|
-
unanswered_messages_count: z.ZodNumber;
|
|
196
|
-
centrifugo: z.ZodNullable<z.ZodObject<{
|
|
197
|
-
token: z.ZodString;
|
|
198
|
-
centrifugo_url: z.ZodString;
|
|
199
|
-
expires_at: z.ZodString;
|
|
200
|
-
channels: z.ZodArray<z.ZodString>;
|
|
201
|
-
}, z.core.$strip>>;
|
|
202
|
-
}, z.core.$strip>;
|
|
203
|
-
/**
|
|
204
|
-
* Infer TypeScript type from Zod schema
|
|
82
|
+
* When 2FA is not required:
|
|
83
|
+
* - requires_2fa: False
|
|
84
|
+
* - session_id: null
|
|
85
|
+
* - refresh/access/user: populated
|
|
205
86
|
*/
|
|
206
|
-
type
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
87
|
+
type OtpVerifyResponse = {
|
|
88
|
+
/**
|
|
89
|
+
* JWT access token (if requires_2fa is False)
|
|
90
|
+
*/
|
|
91
|
+
access?: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* JWT refresh token (if requires_2fa is False)
|
|
94
|
+
*/
|
|
95
|
+
refresh?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Whether 2FA verification is required
|
|
98
|
+
*/
|
|
99
|
+
requires_2fa?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 2FA session ID (if requires_2fa is True)
|
|
102
|
+
*/
|
|
103
|
+
session_id?: string | null;
|
|
104
|
+
/**
|
|
105
|
+
* Whether user should be prompted to enable 2FA
|
|
106
|
+
*/
|
|
107
|
+
should_prompt_2fa?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* User information (if requires_2fa is False)
|
|
110
|
+
*/
|
|
111
|
+
user?: User | null;
|
|
112
|
+
};
|
|
215
113
|
/**
|
|
216
114
|
* Serializer for updating user profile.
|
|
217
115
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
116
|
+
type PatchedCfgUserUpdateRequest = {
|
|
117
|
+
company?: string;
|
|
118
|
+
first_name?: string;
|
|
119
|
+
language?: string;
|
|
120
|
+
last_name?: string;
|
|
121
|
+
phone?: string;
|
|
122
|
+
position?: string;
|
|
123
|
+
};
|
|
124
|
+
type TokenRefresh = {
|
|
125
|
+
readonly access: string;
|
|
126
|
+
refresh: string;
|
|
127
|
+
};
|
|
226
128
|
/**
|
|
227
|
-
*
|
|
129
|
+
* Serializer for user details.
|
|
228
130
|
*/
|
|
229
|
-
type
|
|
131
|
+
type User = {
|
|
132
|
+
readonly avatar: string | null;
|
|
133
|
+
readonly centrifugo: CentrifugoToken | null;
|
|
134
|
+
company?: string;
|
|
135
|
+
readonly date_joined: string;
|
|
136
|
+
/**
|
|
137
|
+
* Get formatted username for display.
|
|
138
|
+
*/
|
|
139
|
+
readonly display_username: string;
|
|
140
|
+
readonly email: string;
|
|
141
|
+
first_name?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Get user's full name.
|
|
144
|
+
*/
|
|
145
|
+
readonly full_name: string;
|
|
146
|
+
readonly id: number;
|
|
147
|
+
/**
|
|
148
|
+
* Get user's initials for avatar fallback.
|
|
149
|
+
*/
|
|
150
|
+
readonly initials: string;
|
|
151
|
+
/**
|
|
152
|
+
* Staff status
|
|
153
|
+
*
|
|
154
|
+
* Designates whether the user can log into this admin site.
|
|
155
|
+
*/
|
|
156
|
+
readonly is_staff: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Superuser status
|
|
159
|
+
*
|
|
160
|
+
* Designates that this user has all permissions without explicitly assigning them.
|
|
161
|
+
*/
|
|
162
|
+
readonly is_superuser: boolean;
|
|
163
|
+
language?: string;
|
|
164
|
+
readonly last_login: string | null;
|
|
165
|
+
last_name?: string;
|
|
166
|
+
phone?: string;
|
|
167
|
+
position?: string;
|
|
168
|
+
readonly unanswered_messages_count: number;
|
|
169
|
+
};
|
|
230
170
|
|
|
231
171
|
/**
|
|
232
172
|
* Auth Form Types
|
|
@@ -401,19 +341,28 @@ declare const AuthProvider: React$1.FC<AuthProviderProps>;
|
|
|
401
341
|
*/
|
|
402
342
|
declare const useAuth: () => AuthContextType;
|
|
403
343
|
|
|
344
|
+
declare const PatchedCfgUserUpdateRequestSchema: z.ZodObject<{
|
|
345
|
+
company: z.ZodOptional<z.ZodString>;
|
|
346
|
+
first_name: z.ZodOptional<z.ZodString>;
|
|
347
|
+
language: z.ZodOptional<z.ZodString>;
|
|
348
|
+
last_name: z.ZodOptional<z.ZodString>;
|
|
349
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
350
|
+
position: z.ZodOptional<z.ZodString>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
|
|
404
353
|
interface AccountsContextValue {
|
|
405
354
|
profile?: User;
|
|
406
355
|
isLoadingProfile: boolean;
|
|
407
356
|
profileError: Error | null;
|
|
408
|
-
updateProfile: (data:
|
|
409
|
-
partialUpdateProfile: (data:
|
|
357
|
+
updateProfile: (data: CfgUserUpdateRequest) => Promise<User>;
|
|
358
|
+
partialUpdateProfile: (data: PatchedCfgUserUpdateRequest) => Promise<User>;
|
|
410
359
|
uploadAvatar: (avatar: File | Blob) => Promise<User>;
|
|
411
360
|
refreshProfile: (options?: {
|
|
412
361
|
callerId?: string;
|
|
413
362
|
force?: boolean;
|
|
414
363
|
}) => Promise<User | undefined>;
|
|
415
|
-
requestOTP: (data:
|
|
416
|
-
verifyOTP: (data:
|
|
364
|
+
requestOTP: (data: OtpRequestRequest) => Promise<OtpRequestResponse>;
|
|
365
|
+
verifyOTP: (data: OtpVerifyRequest) => Promise<OtpVerifyResponse>;
|
|
417
366
|
refreshToken: (refresh: string) => Promise<TokenRefresh>;
|
|
418
367
|
logout: () => void;
|
|
419
368
|
}
|
|
@@ -941,4 +890,4 @@ declare const Analytics: {
|
|
|
941
890
|
setUser(userId: string): void;
|
|
942
891
|
};
|
|
943
892
|
|
|
944
|
-
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, AuthProvider, type AuthProviderProps, type AuthStep, type DeleteAccountResult, type OTPRequestResult, type
|
|
893
|
+
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, AuthProvider, type AuthProviderProps, type AuthStep, type DeleteAccountResult, type OTPRequestResult, type PatchedCfgUserUpdateRequest, PatchedCfgUserUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseDeleteAccountReturn, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useCfgRouter, useDeleteAccount, useGithubAuth, useLocalStorage, useQueryParams, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|