@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
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* SWR Hooks for User Profile
|
|
7
|
-
*
|
|
8
|
-
* React hooks powered by SWR for data fetching with automatic caching,
|
|
9
|
-
* revalidation, and optimistic updates.
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* ```typescript
|
|
13
|
-
* // Query hooks (GET)
|
|
14
|
-
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
15
|
-
*
|
|
16
|
-
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
17
|
-
* const createUser = useCreateUser()
|
|
18
|
-
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
import useSWR from 'swr'
|
|
22
|
-
import { useSWRConfig } from 'swr'
|
|
23
|
-
import * as Fetchers from '../fetchers/accounts__user_profile'
|
|
24
|
-
import type { API } from '../../index'
|
|
25
|
-
import type { AccountDeleteResponse } from '../schemas/AccountDeleteResponse.schema'
|
|
26
|
-
import type { CfgAccountsProfileAvatarCreateRequest } from '../schemas/CfgAccountsProfileAvatarCreateRequest.schema'
|
|
27
|
-
import type { PatchedUserProfileUpdateRequest } from '../schemas/PatchedUserProfileUpdateRequest.schema'
|
|
28
|
-
import type { User } from '../schemas/User.schema'
|
|
29
|
-
import type { UserProfileUpdateRequest } from '../schemas/UserProfileUpdateRequest.schema'
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get current user profile
|
|
33
|
-
*
|
|
34
|
-
* @method GET
|
|
35
|
-
* @path /cfg/accounts/profile/
|
|
36
|
-
*/
|
|
37
|
-
export function useAccountsProfileRetrieve(client?: API): ReturnType<typeof useSWR<User>> {
|
|
38
|
-
return useSWR<User>(
|
|
39
|
-
'cfg-accounts-profile',
|
|
40
|
-
() => Fetchers.getAccountsProfileRetrieve(client)
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Upload user avatar
|
|
47
|
-
*
|
|
48
|
-
* @method POST
|
|
49
|
-
* @path /cfg/accounts/profile/avatar/
|
|
50
|
-
*/
|
|
51
|
-
export function useCreateAccountsProfileAvatarCreate() {
|
|
52
|
-
const { mutate } = useSWRConfig()
|
|
53
|
-
|
|
54
|
-
return async (data: CfgAccountsProfileAvatarCreateRequest, client?: API): Promise<User> => {
|
|
55
|
-
const result = await Fetchers.createAccountsProfileAvatarCreate(data, client)
|
|
56
|
-
// Revalidate related queries
|
|
57
|
-
mutate('cfg-accounts-profile-avatar')
|
|
58
|
-
return result
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Delete user account
|
|
65
|
-
*
|
|
66
|
-
* @method POST
|
|
67
|
-
* @path /cfg/accounts/profile/delete/
|
|
68
|
-
*/
|
|
69
|
-
export function useCreateAccountsProfileDeleteCreate() {
|
|
70
|
-
const { mutate } = useSWRConfig()
|
|
71
|
-
|
|
72
|
-
return async (client?: API): Promise<AccountDeleteResponse> => {
|
|
73
|
-
const result = await Fetchers.createAccountsProfileDeleteCreate(client)
|
|
74
|
-
// Revalidate related queries
|
|
75
|
-
mutate('cfg-accounts-profile-delete')
|
|
76
|
-
return result
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Partial update user profile
|
|
83
|
-
*
|
|
84
|
-
* @method PUT
|
|
85
|
-
* @path /cfg/accounts/profile/partial/
|
|
86
|
-
*/
|
|
87
|
-
export function usePartialUpdateAccountsProfilePartialUpdate() {
|
|
88
|
-
const { mutate } = useSWRConfig()
|
|
89
|
-
|
|
90
|
-
return async (data: UserProfileUpdateRequest, client?: API): Promise<User> => {
|
|
91
|
-
const result = await Fetchers.partialUpdateAccountsProfilePartialUpdate(data, client)
|
|
92
|
-
// Revalidate related queries
|
|
93
|
-
mutate('cfg-accounts-profile')
|
|
94
|
-
return result
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Partial update user profile
|
|
101
|
-
*
|
|
102
|
-
* @method PATCH
|
|
103
|
-
* @path /cfg/accounts/profile/partial/
|
|
104
|
-
*/
|
|
105
|
-
export function usePartialUpdateAccountsProfilePartialPartialUpdate() {
|
|
106
|
-
const { mutate } = useSWRConfig()
|
|
107
|
-
|
|
108
|
-
return async (data?: PatchedUserProfileUpdateRequest, client?: API): Promise<User> => {
|
|
109
|
-
const result = await Fetchers.partialUpdateAccountsProfilePartialPartialUpdate(data, client)
|
|
110
|
-
// Revalidate related queries
|
|
111
|
-
mutate('cfg-accounts-profile-partial')
|
|
112
|
-
return result
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Update user profile
|
|
119
|
-
*
|
|
120
|
-
* @method PUT
|
|
121
|
-
* @path /cfg/accounts/profile/update/
|
|
122
|
-
*/
|
|
123
|
-
export function useUpdateAccountsProfileUpdateUpdate() {
|
|
124
|
-
const { mutate } = useSWRConfig()
|
|
125
|
-
|
|
126
|
-
return async (data: UserProfileUpdateRequest, client?: API): Promise<User> => {
|
|
127
|
-
const result = await Fetchers.updateAccountsProfileUpdateUpdate(data, client)
|
|
128
|
-
// Revalidate related queries
|
|
129
|
-
mutate('cfg-accounts-profile')
|
|
130
|
-
return result
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Update user profile
|
|
137
|
-
*
|
|
138
|
-
* @method PATCH
|
|
139
|
-
* @path /cfg/accounts/profile/update/
|
|
140
|
-
*/
|
|
141
|
-
export function usePartialUpdateAccountsProfileUpdatePartialUpdate() {
|
|
142
|
-
const { mutate } = useSWRConfig()
|
|
143
|
-
|
|
144
|
-
return async (data?: PatchedUserProfileUpdateRequest, client?: API): Promise<User> => {
|
|
145
|
-
const result = await Fetchers.partialUpdateAccountsProfileUpdatePartialUpdate(data, client)
|
|
146
|
-
// Revalidate related queries
|
|
147
|
-
mutate('cfg-accounts-profile')
|
|
148
|
-
return result
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* SWR Hooks - React data fetching hooks
|
|
7
|
-
*
|
|
8
|
-
* Auto-generated from OpenAPI specification.
|
|
9
|
-
* Powered by SWR for automatic caching and revalidation.
|
|
10
|
-
*
|
|
11
|
-
* Features:
|
|
12
|
-
* - Automatic caching and deduplication
|
|
13
|
-
* - Revalidation on focus/reconnect
|
|
14
|
-
* - Optimistic updates
|
|
15
|
-
* - Type-safe parameters and responses
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import * as hooks from './hooks'
|
|
20
|
-
*
|
|
21
|
-
* // Query hooks (GET)
|
|
22
|
-
* const { data, error, isLoading } = hooks.useUsers({ page: 1 })
|
|
23
|
-
*
|
|
24
|
-
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
25
|
-
* const createUser = hooks.useCreateUser()
|
|
26
|
-
* await createUser({ name: 'John' })
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
export * from './accounts__auth'
|
|
31
|
-
export * from './accounts__oauth'
|
|
32
|
-
export * from './accounts__user_profile'
|
|
33
|
-
export * from './accounts'
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AccountDeleteResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Response serializer for account deletion.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Response serializer for account deletion.
|
|
11
|
-
*/
|
|
12
|
-
export const AccountDeleteResponseSchema = z.object({
|
|
13
|
-
success: z.boolean(),
|
|
14
|
-
message: z.string(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type AccountDeleteResponse = z.infer<typeof AccountDeleteResponseSchema>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for CentrifugoToken
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Nested serializer for Centrifugo WebSocket connection token.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Nested serializer for Centrifugo WebSocket connection token.
|
|
11
|
-
*/
|
|
12
|
-
export const CentrifugoTokenSchema = z.object({
|
|
13
|
-
token: z.string(),
|
|
14
|
-
centrifugo_url: z.string(),
|
|
15
|
-
expires_at: z.string().datetime({ offset: true }),
|
|
16
|
-
channels: z.array(z.string()),
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Infer TypeScript type from Zod schema
|
|
21
|
-
*/
|
|
22
|
-
export type CentrifugoToken = z.infer<typeof CentrifugoTokenSchema>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for CfgAccountsProfileAvatarCreateRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* */
|
|
6
|
-
import { z } from 'zod'
|
|
7
|
-
|
|
8
|
-
export const CfgAccountsProfileAvatarCreateRequestSchema = z.object({
|
|
9
|
-
avatar: z.union([z.instanceof(File), z.instanceof(Blob)]),
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Infer TypeScript type from Zod schema
|
|
14
|
-
*/
|
|
15
|
-
export type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>
|
package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthAuthorizeRequestRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Request to start OAuth flow.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Request to start OAuth flow.
|
|
11
|
-
*/
|
|
12
|
-
export const OAuthAuthorizeRequestRequestSchema = z.object({
|
|
13
|
-
redirect_uri: z.string().optional(),
|
|
14
|
-
source_url: z.string().optional(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type OAuthAuthorizeRequestRequest = z.infer<typeof OAuthAuthorizeRequestRequestSchema>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthAuthorizeResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Response with OAuth authorization URL.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Response with OAuth authorization URL.
|
|
11
|
-
*/
|
|
12
|
-
export const OAuthAuthorizeResponseSchema = z.object({
|
|
13
|
-
authorization_url: z.string(),
|
|
14
|
-
state: z.string(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type OAuthAuthorizeResponse = z.infer<typeof OAuthAuthorizeResponseSchema>
|
package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthCallbackRequestRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Request to complete OAuth flow (callback handler).
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Request to complete OAuth flow (callback handler).
|
|
11
|
-
*/
|
|
12
|
-
export const OAuthCallbackRequestRequestSchema = z.object({
|
|
13
|
-
code: z.string().min(10).max(500),
|
|
14
|
-
state: z.string().min(20).max(100),
|
|
15
|
-
redirect_uri: z.string().optional(),
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Infer TypeScript type from Zod schema
|
|
20
|
-
*/
|
|
21
|
-
export type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSchema>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthConnection
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for OAuth connection info (user-facing).
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import * as Enums from '../../enums'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for OAuth connection info (user-facing).
|
|
12
|
-
*/
|
|
13
|
-
export const OAuthConnectionSchema = z.object({
|
|
14
|
-
id: z.number().int(),
|
|
15
|
-
provider: z.nativeEnum(Enums.OAuthConnectionProvider),
|
|
16
|
-
provider_display: z.string(),
|
|
17
|
-
provider_username: z.string(),
|
|
18
|
-
provider_email: z.email(),
|
|
19
|
-
provider_avatar_url: z.string(),
|
|
20
|
-
connected_at: z.string().datetime({ offset: true }),
|
|
21
|
-
last_login_at: z.string().datetime({ offset: true }),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Infer TypeScript type from Zod schema
|
|
26
|
-
*/
|
|
27
|
-
export type OAuthConnection = z.infer<typeof OAuthConnectionSchema>
|
package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthDisconnectRequestRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Request to disconnect OAuth provider.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import * as Enums from '../../enums'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Request to disconnect OAuth provider.
|
|
12
|
-
*/
|
|
13
|
-
export const OAuthDisconnectRequestRequestSchema = z.object({
|
|
14
|
-
provider: z.nativeEnum(Enums.OAuthConnectionProvider),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type OAuthDisconnectRequestRequest = z.infer<typeof OAuthDisconnectRequestRequestSchema>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthError
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Error response for OAuth endpoints.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Error response for OAuth endpoints.
|
|
11
|
-
*/
|
|
12
|
-
export const OAuthErrorSchema = z.object({
|
|
13
|
-
error: z.string(),
|
|
14
|
-
error_description: z.string().optional(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type OAuthError = z.infer<typeof OAuthErrorSchema>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthProvidersResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Response with available OAuth providers.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Response with available OAuth providers.
|
|
11
|
-
*/
|
|
12
|
-
export const OAuthProvidersResponseSchema = z.object({
|
|
13
|
-
providers: z.array(z.record(z.string(), z.any())),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Infer TypeScript type from Zod schema
|
|
18
|
-
*/
|
|
19
|
-
export type OAuthProvidersResponse = z.infer<typeof OAuthProvidersResponseSchema>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OAuthTokenResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Response with JWT tokens after OAuth authentication.
|
|
6
|
-
|
|
7
|
-
When 2FA is required:
|
|
8
|
-
- requires_2fa: True
|
|
9
|
-
- session_id: UUID of 2FA verification session
|
|
10
|
-
- access/refresh/user: null
|
|
11
|
-
|
|
12
|
-
When 2FA is not required:
|
|
13
|
-
- requires_2fa: False
|
|
14
|
-
- session_id: null
|
|
15
|
-
- access/refresh/user: populated
|
|
16
|
-
* */
|
|
17
|
-
import { z } from 'zod'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Response with JWT tokens after OAuth authentication.
|
|
21
|
-
|
|
22
|
-
When 2FA is required:
|
|
23
|
-
- requires_2fa: True
|
|
24
|
-
- session_id: UUID of 2FA verification session
|
|
25
|
-
- access/refresh/user: null
|
|
26
|
-
|
|
27
|
-
When 2FA is not required:
|
|
28
|
-
- requires_2fa: False
|
|
29
|
-
- session_id: null
|
|
30
|
-
- access/refresh/user: populated
|
|
31
|
-
*/
|
|
32
|
-
export const OAuthTokenResponseSchema = z.object({
|
|
33
|
-
requires_2fa: z.boolean().optional(),
|
|
34
|
-
session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
35
|
-
access: z.string().nullable().optional(),
|
|
36
|
-
refresh: z.string().nullable().optional(),
|
|
37
|
-
user: z.record(z.string(), z.any()).nullable().optional(),
|
|
38
|
-
is_new_user: z.boolean(),
|
|
39
|
-
is_new_connection: z.boolean(),
|
|
40
|
-
should_prompt_2fa: z.boolean().optional(),
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Infer TypeScript type from Zod schema
|
|
45
|
-
*/
|
|
46
|
-
export type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OTPErrorResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Typed error response for OTP operations.
|
|
6
|
-
|
|
7
|
-
error_code values:
|
|
8
|
-
- invalid_identifier — malformed email
|
|
9
|
-
- cooldown — too soon after last request (retry_after = seconds)
|
|
10
|
-
- hourly_limit — hourly quota exceeded (retry_after = seconds until reset)
|
|
11
|
-
- daily_limit — daily quota exceeded (retry_after = seconds until reset)
|
|
12
|
-
- rate_limited — IP-level rate limit hit (no retry_after)
|
|
13
|
-
- user_creation_failed — internal error creating account
|
|
14
|
-
- send_failed — transport error (email / SMS)
|
|
15
|
-
- internal_error — unexpected server error
|
|
16
|
-
* */
|
|
17
|
-
import { z } from 'zod'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Typed error response for OTP operations.
|
|
21
|
-
|
|
22
|
-
error_code values:
|
|
23
|
-
- invalid_identifier — malformed email
|
|
24
|
-
- cooldown — too soon after last request (retry_after = seconds)
|
|
25
|
-
- hourly_limit — hourly quota exceeded (retry_after = seconds until reset)
|
|
26
|
-
- daily_limit — daily quota exceeded (retry_after = seconds until reset)
|
|
27
|
-
- rate_limited — IP-level rate limit hit (no retry_after)
|
|
28
|
-
- user_creation_failed — internal error creating account
|
|
29
|
-
- send_failed — transport error (email / SMS)
|
|
30
|
-
- internal_error — unexpected server error
|
|
31
|
-
*/
|
|
32
|
-
export const OTPErrorResponseSchema = z.object({
|
|
33
|
-
error: z.string(),
|
|
34
|
-
error_code: z.string().nullable().optional(),
|
|
35
|
-
retry_after: z.number().int().nullable().optional(),
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Infer TypeScript type from Zod schema
|
|
40
|
-
*/
|
|
41
|
-
export type OTPErrorResponse = z.infer<typeof OTPErrorResponseSchema>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OTPRequestRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for OTP request.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for OTP request.
|
|
11
|
-
*/
|
|
12
|
-
export const OTPRequestRequestSchema = z.object({
|
|
13
|
-
identifier: z.string().min(1),
|
|
14
|
-
source_url: z.string().optional(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type OTPRequestRequest = z.infer<typeof OTPRequestRequestSchema>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OTPRequestResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * OTP request response.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* OTP request response.
|
|
11
|
-
*/
|
|
12
|
-
export const OTPRequestResponseSchema = z.object({
|
|
13
|
-
message: z.string(),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Infer TypeScript type from Zod schema
|
|
18
|
-
*/
|
|
19
|
-
export type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OTPVerifyRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for OTP verification.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for OTP verification.
|
|
11
|
-
*/
|
|
12
|
-
export const OTPVerifyRequestSchema = z.object({
|
|
13
|
-
identifier: z.string().min(1),
|
|
14
|
-
otp: z.string().min(6).max(6),
|
|
15
|
-
source_url: z.string().optional(),
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Infer TypeScript type from Zod schema
|
|
20
|
-
*/
|
|
21
|
-
export type OTPVerifyRequest = z.infer<typeof OTPVerifyRequestSchema>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for OTPVerifyResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * OTP verification response.
|
|
6
|
-
|
|
7
|
-
When 2FA is required:
|
|
8
|
-
- requires_2fa: True
|
|
9
|
-
- session_id: UUID of 2FA verification session
|
|
10
|
-
- refresh/access/user: null
|
|
11
|
-
|
|
12
|
-
When 2FA is not required:
|
|
13
|
-
- requires_2fa: False
|
|
14
|
-
- session_id: null
|
|
15
|
-
- refresh/access/user: populated
|
|
16
|
-
* */
|
|
17
|
-
import { z } from 'zod'
|
|
18
|
-
import { UserSchema } from './User.schema'
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* OTP verification response.
|
|
22
|
-
|
|
23
|
-
When 2FA is required:
|
|
24
|
-
- requires_2fa: True
|
|
25
|
-
- session_id: UUID of 2FA verification session
|
|
26
|
-
- refresh/access/user: null
|
|
27
|
-
|
|
28
|
-
When 2FA is not required:
|
|
29
|
-
- requires_2fa: False
|
|
30
|
-
- session_id: null
|
|
31
|
-
- refresh/access/user: populated
|
|
32
|
-
*/
|
|
33
|
-
export const OTPVerifyResponseSchema = z.object({
|
|
34
|
-
requires_2fa: z.boolean().optional(),
|
|
35
|
-
session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
36
|
-
refresh: z.string().nullable().optional(),
|
|
37
|
-
access: z.string().nullable().optional(),
|
|
38
|
-
user: UserSchema.nullable().optional(),
|
|
39
|
-
should_prompt_2fa: z.boolean().optional(),
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Infer TypeScript type from Zod schema
|
|
44
|
-
*/
|
|
45
|
-
export type OTPVerifyResponse = z.infer<typeof OTPVerifyResponseSchema>
|
package/src/_api/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for PatchedUserProfileUpdateRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for updating user profile.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for updating user profile.
|
|
11
|
-
*/
|
|
12
|
-
export const PatchedUserProfileUpdateRequestSchema = z.object({
|
|
13
|
-
first_name: z.string().max(50).optional(),
|
|
14
|
-
last_name: z.string().max(50).optional(),
|
|
15
|
-
company: z.string().max(100).optional(),
|
|
16
|
-
phone: z.string().max(20).optional(),
|
|
17
|
-
position: z.string().max(100).optional(),
|
|
18
|
-
language: z.string().max(10).optional(),
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Infer TypeScript type from Zod schema
|
|
23
|
-
*/
|
|
24
|
-
export type PatchedUserProfileUpdateRequest = z.infer<typeof PatchedUserProfileUpdateRequestSchema>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for TokenRefresh
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* */
|
|
6
|
-
import { z } from 'zod'
|
|
7
|
-
|
|
8
|
-
export const TokenRefreshSchema = z.object({
|
|
9
|
-
access: z.string(),
|
|
10
|
-
refresh: z.string(),
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Infer TypeScript type from Zod schema
|
|
15
|
-
*/
|
|
16
|
-
export type TokenRefresh = z.infer<typeof TokenRefreshSchema>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for TokenRefreshRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* */
|
|
6
|
-
import { z } from 'zod'
|
|
7
|
-
|
|
8
|
-
export const TokenRefreshRequestSchema = z.object({
|
|
9
|
-
refresh: z.string().min(1),
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Infer TypeScript type from Zod schema
|
|
14
|
-
*/
|
|
15
|
-
export type TokenRefreshRequest = z.infer<typeof TokenRefreshRequestSchema>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for UserProfileUpdateRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for updating user profile.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for updating user profile.
|
|
11
|
-
*/
|
|
12
|
-
export const UserProfileUpdateRequestSchema = z.object({
|
|
13
|
-
first_name: z.string().max(50).optional(),
|
|
14
|
-
last_name: z.string().max(50).optional(),
|
|
15
|
-
company: z.string().max(100).optional(),
|
|
16
|
-
phone: z.string().max(20).optional(),
|
|
17
|
-
position: z.string().max(100).optional(),
|
|
18
|
-
language: z.string().max(10).optional(),
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Infer TypeScript type from Zod schema
|
|
23
|
-
*/
|
|
24
|
-
export type UserProfileUpdateRequest = z.infer<typeof UserProfileUpdateRequestSchema>
|