@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,24 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Update user profile
|
|
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 { CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgAccountsProfileUpdatePartialUpdateData, "url">;
|
|
11
|
+
type Result = CfgAccountsProfileUpdatePartialUpdateResponses[keyof CfgAccountsProfileUpdatePartialUpdateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgAccountsProfileUpdatePartialUpdate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_accounts_profile_update_partial_update"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_accounts_profile_update_partial_update"], Args>(
|
|
17
|
+
["cfg_accounts_profile_update_partial_update"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgAccountsProfileUpdatePartialUpdate({ ...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
|
+
// Update user profile
|
|
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 { CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgAccountsProfileUpdateUpdateData, "url">;
|
|
11
|
+
type Result = CfgAccountsProfileUpdateUpdateResponses[keyof CfgAccountsProfileUpdateUpdateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgAccountsProfileUpdateUpdate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_accounts_profile_update_update"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_accounts_profile_update_update"], Args>(
|
|
17
|
+
["cfg_accounts_profile_update_update"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgAccountsProfileUpdateUpdate({ ...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/accounts/token/refresh/
|
|
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 { CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses } from "../types.gen";
|
|
9
|
+
|
|
10
|
+
type Args = Omit<CfgAccountsTokenRefreshCreateData, "url">;
|
|
11
|
+
type Result = CfgAccountsTokenRefreshCreateResponses[keyof CfgAccountsTokenRefreshCreateResponses];
|
|
12
|
+
|
|
13
|
+
export function useCfgAccountsTokenRefreshCreate(
|
|
14
|
+
config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_accounts_token_refresh_create"], Args>,
|
|
15
|
+
) {
|
|
16
|
+
return useSWRMutation<Result, Error, readonly ["cfg_accounts_token_refresh_create"], Args>(
|
|
17
|
+
["cfg_accounts_token_refresh_create"] as const,
|
|
18
|
+
async (_key, { arg }: { arg: Args }) => {
|
|
19
|
+
const res = await Cfg.cfgAccountsTokenRefreshCreate({ ...arg, throwOnError: true } as never);
|
|
20
|
+
return res.data as Result;
|
|
21
|
+
},
|
|
22
|
+
config,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -1,338 +1,29 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
/**
|
|
4
|
-
* Django CFG API - API Client with JWT Management
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { API } from './api';
|
|
9
|
-
*
|
|
10
|
-
* const api = new API('https://api.example.com');
|
|
11
|
-
*
|
|
12
|
-
* // Set JWT token
|
|
13
|
-
* api.setToken('your-jwt-token', 'refresh-token');
|
|
14
|
-
*
|
|
15
|
-
* // Use API
|
|
16
|
-
* const posts = await api.posts.list();
|
|
17
|
-
* const user = await api.users.retrieve(1);
|
|
18
|
-
*
|
|
19
|
-
* // Check authentication
|
|
20
|
-
* if (api.isAuthenticated()) {
|
|
21
|
-
* // ...
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* // Custom storage with logging (for Electron/Node.js)
|
|
25
|
-
* import { MemoryStorageAdapter, APILogger } from './storage';
|
|
26
|
-
* const logger = new APILogger({ enabled: true, logLevel: 'debug' });
|
|
27
|
-
* const api = new API('https://api.example.com', {
|
|
28
|
-
* storage: new MemoryStorageAdapter(logger),
|
|
29
|
-
* loggerConfig: { enabled: true, logLevel: 'debug' }
|
|
30
|
-
* });
|
|
31
|
-
*
|
|
32
|
-
* // Get OpenAPI schema
|
|
33
|
-
* const schema = api.getSchema();
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
1
|
+
// AUTO-GENERATED by django_generator / ts_extras.wrapper
|
|
2
|
+
// Group barrel. DO NOT EDIT — re-run `make gen`.
|
|
36
3
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
StorageAdapter,
|
|
40
|
-
LocalStorageAdapter,
|
|
41
|
-
CookieStorageAdapter,
|
|
42
|
-
MemoryStorageAdapter
|
|
43
|
-
} from "./storage";
|
|
44
|
-
import type { RetryConfig } from "./retry";
|
|
45
|
-
import type { LoggerConfig } from "./logger";
|
|
46
|
-
import { APILogger } from "./logger";
|
|
47
|
-
import { Auth } from "./accounts__auth/client";
|
|
48
|
-
import { Oauth } from "./accounts__oauth/client";
|
|
49
|
-
import { UserProfile } from "./accounts__user_profile/client";
|
|
50
|
-
import { Accounts } from "./accounts/client";
|
|
51
|
-
export * as AuthTypes from "./accounts__auth/models";
|
|
52
|
-
// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts
|
|
53
|
-
// Use namespace exports like CfgAccountsTypes.User or import from specific modules
|
|
54
|
-
export * as OauthTypes from "./accounts__oauth/models";
|
|
55
|
-
// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts
|
|
56
|
-
// Use namespace exports like CfgAccountsTypes.User or import from specific modules
|
|
57
|
-
export * as UserProfileTypes from "./accounts__user_profile/models";
|
|
58
|
-
// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts
|
|
59
|
-
// Use namespace exports like CfgAccountsTypes.User or import from specific modules
|
|
60
|
-
export * as AccountsTypes from "./accounts/models";
|
|
61
|
-
// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts
|
|
62
|
-
// Use namespace exports like CfgAccountsTypes.User or import from specific modules
|
|
63
|
-
export * as Enums from "./enums";
|
|
64
|
-
|
|
65
|
-
// Re-export Zod schemas for runtime validation
|
|
66
|
-
export * as Schemas from "./_utils/schemas";
|
|
67
|
-
// Also export all schemas directly for convenience
|
|
68
|
-
export * from "./_utils/schemas";
|
|
4
|
+
// Wrapper class + per-group SDK re-exports
|
|
5
|
+
export { API, type APIOptions, Cfg, Accounts, OAuth, UserProfile, Auth } from './api';
|
|
69
6
|
|
|
70
|
-
//
|
|
71
|
-
export type { ValidationErrorDetail, ValidationErrorEvent } from "./validation-events";
|
|
72
|
-
export { dispatchValidationError, onValidationError, formatZodError } from "./validation-events";
|
|
73
|
-
|
|
74
|
-
// Re-export typed fetchers for universal usage
|
|
75
|
-
export * as Fetchers from "./_utils/fetchers";
|
|
76
|
-
export * from "./_utils/fetchers";
|
|
77
|
-
|
|
78
|
-
// Re-export API instance configuration functions
|
|
7
|
+
// Shared utilities (storage / errors / logger / validation events)
|
|
79
8
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
export
|
|
101
|
-
|
|
102
|
-
// Re-export HTTP adapters for custom implementations
|
|
103
|
-
export type { HttpClientAdapter, HttpRequest, HttpResponse } from "./http";
|
|
104
|
-
export { FetchAdapter, KeepAliveFetchAdapter } from "./http";
|
|
105
|
-
|
|
106
|
-
// Re-export logger types and classes
|
|
107
|
-
export type { LoggerConfig, RequestLog, ResponseLog, ErrorLog } from "./logger";
|
|
108
|
-
export { APILogger } from "./logger";
|
|
109
|
-
|
|
110
|
-
// Re-export retry configuration and utilities
|
|
111
|
-
export type { RetryConfig, FailedAttemptInfo } from "./retry";
|
|
112
|
-
export { withRetry, shouldRetry, DEFAULT_RETRY_CONFIG } from "./retry";
|
|
113
|
-
|
|
114
|
-
export const TOKEN_KEY = "auth_token";
|
|
115
|
-
export const REFRESH_TOKEN_KEY = "refresh_token";
|
|
116
|
-
|
|
117
|
-
/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language */
|
|
118
|
-
function detectLocale(): string | null {
|
|
119
|
-
try {
|
|
120
|
-
if (typeof document !== 'undefined') {
|
|
121
|
-
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
122
|
-
if (match) return match[1];
|
|
123
|
-
}
|
|
124
|
-
if (typeof navigator !== 'undefined' && navigator.language) {
|
|
125
|
-
return navigator.language;
|
|
126
|
-
}
|
|
127
|
-
} catch {}
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export interface APIOptions {
|
|
132
|
-
/** Custom storage adapter (defaults to LocalStorageAdapter) */
|
|
133
|
-
storage?: StorageAdapter;
|
|
134
|
-
/** Custom HTTP client adapter (defaults to FetchAdapter) */
|
|
135
|
-
httpClient?: HttpClientAdapter;
|
|
136
|
-
/** Retry configuration for failed requests */
|
|
137
|
-
retryConfig?: RetryConfig;
|
|
138
|
-
/** Logger configuration */
|
|
139
|
-
loggerConfig?: Partial<LoggerConfig>;
|
|
140
|
-
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
141
|
-
locale?: string;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export class API {
|
|
145
|
-
private baseUrl: string;
|
|
146
|
-
private _client: APIClient;
|
|
147
|
-
private _token: string | null = null;
|
|
148
|
-
private _refreshToken: string | null = null;
|
|
149
|
-
private _locale: string | null = null;
|
|
150
|
-
private storage: StorageAdapter;
|
|
151
|
-
private options?: APIOptions;
|
|
152
|
-
|
|
153
|
-
// Sub-clients
|
|
154
|
-
public auth!: Auth;
|
|
155
|
-
public oauth!: Oauth;
|
|
156
|
-
public user_profile!: UserProfile;
|
|
157
|
-
public accounts!: Accounts;
|
|
158
|
-
|
|
159
|
-
constructor(baseUrl: string, options?: APIOptions) {
|
|
160
|
-
this.baseUrl = baseUrl;
|
|
161
|
-
this.options = options;
|
|
162
|
-
|
|
163
|
-
// Create logger if config provided
|
|
164
|
-
const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : undefined;
|
|
165
|
-
|
|
166
|
-
// Initialize storage with logger
|
|
167
|
-
this.storage = options?.storage || new LocalStorageAdapter(logger);
|
|
168
|
-
|
|
169
|
-
this._locale = options?.locale || null;
|
|
170
|
-
|
|
171
|
-
this._loadTokensFromStorage();
|
|
172
|
-
|
|
173
|
-
// Initialize APIClient with token getter for URL authentication
|
|
174
|
-
this._client = new APIClient(this.baseUrl, {
|
|
175
|
-
httpClient: this.options?.httpClient,
|
|
176
|
-
retryConfig: this.options?.retryConfig,
|
|
177
|
-
loggerConfig: this.options?.loggerConfig,
|
|
178
|
-
tokenGetter: () => this.getToken(),
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Always inject auth header wrapper (reads token dynamically from storage)
|
|
182
|
-
this._injectAuthHeader();
|
|
183
|
-
|
|
184
|
-
// Initialize sub-clients from APIClient
|
|
185
|
-
this.auth = this._client.auth;
|
|
186
|
-
this.oauth = this._client.oauth;
|
|
187
|
-
this.user_profile = this._client.user_profile;
|
|
188
|
-
this.accounts = this._client.accounts;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
private _loadTokensFromStorage(): void {
|
|
192
|
-
this._token = this.storage.getItem(TOKEN_KEY);
|
|
193
|
-
this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
private _reinitClients(): void {
|
|
197
|
-
this._client = new APIClient(this.baseUrl, {
|
|
198
|
-
httpClient: this.options?.httpClient,
|
|
199
|
-
retryConfig: this.options?.retryConfig,
|
|
200
|
-
loggerConfig: this.options?.loggerConfig,
|
|
201
|
-
tokenGetter: () => this.getToken(),
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
// Always inject auth header wrapper (reads token dynamically from storage)
|
|
205
|
-
this._injectAuthHeader();
|
|
206
|
-
|
|
207
|
-
// Reinitialize sub-clients
|
|
208
|
-
this.auth = this._client.auth;
|
|
209
|
-
this.oauth = this._client.oauth;
|
|
210
|
-
this.user_profile = this._client.user_profile;
|
|
211
|
-
this.accounts = this._client.accounts;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
private _injectAuthHeader(): void {
|
|
215
|
-
// Override request method to inject auth header
|
|
216
|
-
const originalRequest = this._client.request.bind(this._client);
|
|
217
|
-
this._client.request = async <T>(
|
|
218
|
-
method: string,
|
|
219
|
-
path: string,
|
|
220
|
-
options?: { params?: Record<string, any>; body?: any; formData?: FormData; headers?: Record<string, string> }
|
|
221
|
-
): Promise<T> => {
|
|
222
|
-
// Read token from storage dynamically (supports JWT injection after instantiation)
|
|
223
|
-
const token = this.getToken();
|
|
224
|
-
const locale = this._locale || detectLocale();
|
|
225
|
-
const mergedOptions = {
|
|
226
|
-
...options,
|
|
227
|
-
headers: {
|
|
228
|
-
...(options?.headers || {}),
|
|
229
|
-
...(token ? { 'Authorization': `Bearer ${token}` } : {}),
|
|
230
|
-
...(locale ? { 'Accept-Language': locale } : {}),
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
return originalRequest(method, path, mergedOptions);
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Get current JWT token
|
|
240
|
-
*/
|
|
241
|
-
getToken(): string | null {
|
|
242
|
-
return this.storage.getItem(TOKEN_KEY);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Get current refresh token
|
|
247
|
-
*/
|
|
248
|
-
getRefreshToken(): string | null {
|
|
249
|
-
return this.storage.getItem(REFRESH_TOKEN_KEY);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Set JWT token and refresh token
|
|
254
|
-
* @param token - JWT access token
|
|
255
|
-
* @param refreshToken - JWT refresh token (optional)
|
|
256
|
-
*/
|
|
257
|
-
setToken(token: string, refreshToken?: string): void {
|
|
258
|
-
this._token = token;
|
|
259
|
-
this.storage.setItem(TOKEN_KEY, token);
|
|
260
|
-
|
|
261
|
-
if (refreshToken) {
|
|
262
|
-
this._refreshToken = refreshToken;
|
|
263
|
-
this.storage.setItem(REFRESH_TOKEN_KEY, refreshToken);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// Reinitialize clients with new token
|
|
267
|
-
this._reinitClients();
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Clear all tokens
|
|
272
|
-
*/
|
|
273
|
-
clearTokens(): void {
|
|
274
|
-
this._token = null;
|
|
275
|
-
this._refreshToken = null;
|
|
276
|
-
this.storage.removeItem(TOKEN_KEY);
|
|
277
|
-
this.storage.removeItem(REFRESH_TOKEN_KEY);
|
|
278
|
-
|
|
279
|
-
// Reinitialize clients without token
|
|
280
|
-
this._reinitClients();
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Check if user is authenticated
|
|
285
|
-
*/
|
|
286
|
-
isAuthenticated(): boolean {
|
|
287
|
-
return !!this.getToken();
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Update base URL and reinitialize clients
|
|
292
|
-
* @param url - New base URL
|
|
293
|
-
*/
|
|
294
|
-
setBaseUrl(url: string): void {
|
|
295
|
-
this.baseUrl = url;
|
|
296
|
-
this._reinitClients();
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Get current base URL
|
|
301
|
-
*/
|
|
302
|
-
getBaseUrl(): string {
|
|
303
|
-
return this.baseUrl;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Set locale for Accept-Language header
|
|
308
|
-
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
309
|
-
*/
|
|
310
|
-
setLocale(locale: string | null): void {
|
|
311
|
-
this._locale = locale;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Get current locale
|
|
316
|
-
*/
|
|
317
|
-
getLocale(): string | null {
|
|
318
|
-
return this._locale;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Get OpenAPI schema path
|
|
323
|
-
* @returns Path to the OpenAPI schema JSON file
|
|
324
|
-
*
|
|
325
|
-
* Note: The OpenAPI schema is available in the schema.json file.
|
|
326
|
-
* You can load it dynamically using:
|
|
327
|
-
* ```typescript
|
|
328
|
-
* const schema = await fetch('./schema.json').then(r => r.json());
|
|
329
|
-
* // or using fs in Node.js:
|
|
330
|
-
* // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
|
|
331
|
-
* ```
|
|
332
|
-
*/
|
|
333
|
-
getSchemaPath(): string {
|
|
334
|
-
return './schema.json';
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export default API;
|
|
9
|
+
type StorageAdapter,
|
|
10
|
+
LocalStorageAdapter,
|
|
11
|
+
MemoryStorageAdapter,
|
|
12
|
+
CookieStorageAdapter,
|
|
13
|
+
APIError,
|
|
14
|
+
NetworkError,
|
|
15
|
+
APILogger,
|
|
16
|
+
defaultLogger,
|
|
17
|
+
type LoggerConfig,
|
|
18
|
+
type RequestLog,
|
|
19
|
+
type ResponseLog,
|
|
20
|
+
type ErrorLog,
|
|
21
|
+
dispatchValidationError,
|
|
22
|
+
onValidationError,
|
|
23
|
+
formatZodError,
|
|
24
|
+
type ValidationErrorDetail,
|
|
25
|
+
type ValidationErrorEvent,
|
|
26
|
+
} from '../_shared';
|
|
27
|
+
|
|
28
|
+
// Generated artifacts (Hey API)
|
|
29
|
+
export type * from './types.gen';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const AccountDeleteResponseSchema = z.object({
|
|
8
|
+
success: z.boolean(),
|
|
9
|
+
message: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type AccountDeleteResponse = z.infer<typeof AccountDeleteResponseSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const CentrifugoTokenSchema = z.object({
|
|
8
|
+
token: z.string(),
|
|
9
|
+
centrifugo_url: z.string(),
|
|
10
|
+
expires_at: z.string().datetime({ offset: true }),
|
|
11
|
+
channels: z.array(z.string()),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type CentrifugoToken = z.infer<typeof CentrifugoTokenSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const CfgUserUpdateRequestSchema = z.object({
|
|
8
|
+
first_name: z.string().max(50).optional(),
|
|
9
|
+
last_name: z.string().max(50).optional(),
|
|
10
|
+
company: z.string().max(100).optional(),
|
|
11
|
+
phone: z.string().max(20).optional(),
|
|
12
|
+
position: z.string().max(100).optional(),
|
|
13
|
+
language: z.string().max(10).optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type CfgUserUpdateRequest = z.infer<typeof CfgUserUpdateRequestSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthAuthorizeRequestRequestSchema = z.object({
|
|
8
|
+
redirect_uri: z.string().optional(),
|
|
9
|
+
source_url: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type OAuthAuthorizeRequestRequest = z.infer<typeof OAuthAuthorizeRequestRequestSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthAuthorizeResponseSchema = z.object({
|
|
8
|
+
authorization_url: z.string(),
|
|
9
|
+
state: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type OAuthAuthorizeResponse = z.infer<typeof OAuthAuthorizeResponseSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthCallbackRequestRequestSchema = z.object({
|
|
8
|
+
code: z.string().min(10).max(500),
|
|
9
|
+
state: z.string().min(20).max(100),
|
|
10
|
+
redirect_uri: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { ProviderEnumSchema } from "./ProviderEnum";
|
|
7
|
+
|
|
8
|
+
export const OAuthConnectionSchema = z.object({
|
|
9
|
+
id: z.number().int(),
|
|
10
|
+
provider: ProviderEnumSchema,
|
|
11
|
+
provider_display: z.string(),
|
|
12
|
+
provider_username: z.string(),
|
|
13
|
+
provider_email: z.email(),
|
|
14
|
+
provider_avatar_url: z.string(),
|
|
15
|
+
connected_at: z.string().datetime({ offset: true }),
|
|
16
|
+
last_login_at: z.string().datetime({ offset: true }),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type OAuthConnection = z.infer<typeof OAuthConnectionSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { ProviderEnumSchema } from "./ProviderEnum";
|
|
7
|
+
|
|
8
|
+
export const OAuthDisconnectRequestRequestSchema = z.object({
|
|
9
|
+
provider: ProviderEnumSchema,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type OAuthDisconnectRequestRequest = z.infer<typeof OAuthDisconnectRequestRequestSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthErrorSchema = z.object({
|
|
8
|
+
error: z.string(),
|
|
9
|
+
error_description: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type OAuthError = z.infer<typeof OAuthErrorSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthProvidersResponseSchema = z.object({
|
|
8
|
+
providers: z.array(z.object({})),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type OAuthProvidersResponse = z.infer<typeof OAuthProvidersResponseSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthTokenResponseSchema = z.object({
|
|
8
|
+
requires_2fa: z.boolean().optional(),
|
|
9
|
+
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(),
|
|
10
|
+
access: z.string().nullable().optional(),
|
|
11
|
+
refresh: z.string().nullable().optional(),
|
|
12
|
+
user: z.object({}).nullable().optional(),
|
|
13
|
+
is_new_user: z.boolean(),
|
|
14
|
+
is_new_connection: z.boolean(),
|
|
15
|
+
should_prompt_2fa: z.boolean().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OTPErrorResponseSchema = z.object({
|
|
8
|
+
error: z.string(),
|
|
9
|
+
error_code: z.string().nullable().optional(),
|
|
10
|
+
retry_after: z.number().int().nullable().optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type OTPErrorResponse = z.infer<typeof OTPErrorResponseSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OTPRequestRequestSchema = z.object({
|
|
8
|
+
identifier: z.string().min(1),
|
|
9
|
+
source_url: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type OTPRequestRequest = z.infer<typeof OTPRequestRequestSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OTPRequestResponseSchema = z.object({
|
|
8
|
+
message: z.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OTPVerifyRequestSchema = z.object({
|
|
8
|
+
identifier: z.string().min(1),
|
|
9
|
+
otp: z.string().min(6).max(6),
|
|
10
|
+
source_url: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type OTPVerifyRequest = z.infer<typeof OTPVerifyRequestSchema>;
|