@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
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
/**
|
|
4
|
-
* Typed fetchers for Oauth
|
|
5
|
-
*
|
|
6
|
-
* Universal functions that work in any environment:
|
|
7
|
-
* - Next.js (App Router / Pages Router / Server Components)
|
|
8
|
-
* - React Native
|
|
9
|
-
* - Node.js backend
|
|
10
|
-
*
|
|
11
|
-
* These fetchers use Zod schemas for runtime validation.
|
|
12
|
-
*
|
|
13
|
-
* Usage:
|
|
14
|
-
* ```typescript
|
|
15
|
-
* // Configure API once (in your app entry point)
|
|
16
|
-
* import { configureAPI } from '../../api-instance'
|
|
17
|
-
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
18
|
-
*
|
|
19
|
-
* // Then use fetchers anywhere
|
|
20
|
-
* const users = await getUsers({ page: 1 })
|
|
21
|
-
*
|
|
22
|
-
* // With SWR
|
|
23
|
-
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
24
|
-
*
|
|
25
|
-
* // With React Query
|
|
26
|
-
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
27
|
-
*
|
|
28
|
-
* // In Server Component or SSR (pass custom client)
|
|
29
|
-
* import { API } from '../../index'
|
|
30
|
-
* const api = new API('https://api.example.com')
|
|
31
|
-
* const users = await getUsers({ page: 1 }, api)
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
import { consola } from 'consola'
|
|
35
|
-
import { OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeRequestRequest } from '../schemas/OAuthAuthorizeRequestRequest.schema'
|
|
36
|
-
import { OAuthAuthorizeResponseSchema, type OAuthAuthorizeResponse } from '../schemas/OAuthAuthorizeResponse.schema'
|
|
37
|
-
import { OAuthCallbackRequestRequestSchema, type OAuthCallbackRequestRequest } from '../schemas/OAuthCallbackRequestRequest.schema'
|
|
38
|
-
import { OAuthConnectionSchema, type OAuthConnection } from '../schemas/OAuthConnection.schema'
|
|
39
|
-
import { OAuthDisconnectRequestRequestSchema, type OAuthDisconnectRequestRequest } from '../schemas/OAuthDisconnectRequestRequest.schema'
|
|
40
|
-
import { OAuthProvidersResponseSchema, type OAuthProvidersResponse } from '../schemas/OAuthProvidersResponse.schema'
|
|
41
|
-
import { OAuthTokenResponseSchema, type OAuthTokenResponse } from '../schemas/OAuthTokenResponse.schema'
|
|
42
|
-
import { getAPIInstance } from '../../api-instance'
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* List OAuth connections
|
|
46
|
-
*
|
|
47
|
-
* @method GET
|
|
48
|
-
* @path /cfg/accounts/oauth/connections/
|
|
49
|
-
*/
|
|
50
|
-
export async function getAccountsOauthConnectionsList( client?: any
|
|
51
|
-
): Promise<OAuthConnection[]> {
|
|
52
|
-
const api = client || getAPIInstance()
|
|
53
|
-
const response = await api.oauth.accountsOauthConnectionsList()
|
|
54
|
-
try {
|
|
55
|
-
return OAuthConnectionSchema.array().parse(response)
|
|
56
|
-
} catch (error) {
|
|
57
|
-
// Zod validation error - log detailed information
|
|
58
|
-
consola.error('❌ Zod Validation Failed');
|
|
59
|
-
consola.box(`getAccountsOauthConnectionsList\nPath: /cfg/accounts/oauth/connections/\nMethod: GET`);
|
|
60
|
-
|
|
61
|
-
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
62
|
-
consola.error('Validation Issues:');
|
|
63
|
-
(error as any).issues.forEach((issue: any, index: number) => {
|
|
64
|
-
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
65
|
-
consola.error(` ├─ Message: ${issue.message}`);
|
|
66
|
-
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
67
|
-
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
consola.error('Response data:', response);
|
|
72
|
-
|
|
73
|
-
// Dispatch browser CustomEvent (only if window is defined)
|
|
74
|
-
if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
|
|
75
|
-
try {
|
|
76
|
-
const event = new CustomEvent('zod-validation-error', {
|
|
77
|
-
detail: {
|
|
78
|
-
operation: 'getAccountsOauthConnectionsList',
|
|
79
|
-
path: '/cfg/accounts/oauth/connections/',
|
|
80
|
-
method: 'GET',
|
|
81
|
-
error: error,
|
|
82
|
-
response: response,
|
|
83
|
-
timestamp: new Date(),
|
|
84
|
-
},
|
|
85
|
-
bubbles: true,
|
|
86
|
-
cancelable: false,
|
|
87
|
-
});
|
|
88
|
-
window.dispatchEvent(event);
|
|
89
|
-
} catch (eventError) {
|
|
90
|
-
// Silently fail - event dispatch should never crash the app
|
|
91
|
-
consola.warn('Failed to dispatch validation error event:', eventError);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Re-throw the error
|
|
96
|
-
throw error;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Disconnect OAuth provider
|
|
103
|
-
*
|
|
104
|
-
* @method POST
|
|
105
|
-
* @path /cfg/accounts/oauth/disconnect/
|
|
106
|
-
*/
|
|
107
|
-
export async function createAccountsOauthDisconnectCreate( data: OAuthDisconnectRequestRequest, client?: any
|
|
108
|
-
): Promise<any> {
|
|
109
|
-
const api = client || getAPIInstance()
|
|
110
|
-
const response = await api.oauth.accountsOauthDisconnectCreate(data)
|
|
111
|
-
return response
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Start GitHub OAuth
|
|
117
|
-
*
|
|
118
|
-
* @method POST
|
|
119
|
-
* @path /cfg/accounts/oauth/github/authorize/
|
|
120
|
-
*/
|
|
121
|
-
export async function createAccountsOauthGithubAuthorizeCreate( data: OAuthAuthorizeRequestRequest, client?: any
|
|
122
|
-
): Promise<OAuthAuthorizeResponse> {
|
|
123
|
-
const api = client || getAPIInstance()
|
|
124
|
-
const response = await api.oauth.accountsOauthGithubAuthorizeCreate(data)
|
|
125
|
-
try {
|
|
126
|
-
return OAuthAuthorizeResponseSchema.parse(response)
|
|
127
|
-
} catch (error) {
|
|
128
|
-
// Zod validation error - log detailed information
|
|
129
|
-
consola.error('❌ Zod Validation Failed');
|
|
130
|
-
consola.box(`createAccountsOauthGithubAuthorizeCreate\nPath: /cfg/accounts/oauth/github/authorize/\nMethod: POST`);
|
|
131
|
-
|
|
132
|
-
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
133
|
-
consola.error('Validation Issues:');
|
|
134
|
-
(error as any).issues.forEach((issue: any, index: number) => {
|
|
135
|
-
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
136
|
-
consola.error(` ├─ Message: ${issue.message}`);
|
|
137
|
-
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
138
|
-
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
consola.error('Response data:', response);
|
|
143
|
-
|
|
144
|
-
// Dispatch browser CustomEvent (only if window is defined)
|
|
145
|
-
if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
|
|
146
|
-
try {
|
|
147
|
-
const event = new CustomEvent('zod-validation-error', {
|
|
148
|
-
detail: {
|
|
149
|
-
operation: 'createAccountsOauthGithubAuthorizeCreate',
|
|
150
|
-
path: '/cfg/accounts/oauth/github/authorize/',
|
|
151
|
-
method: 'POST',
|
|
152
|
-
error: error,
|
|
153
|
-
response: response,
|
|
154
|
-
timestamp: new Date(),
|
|
155
|
-
},
|
|
156
|
-
bubbles: true,
|
|
157
|
-
cancelable: false,
|
|
158
|
-
});
|
|
159
|
-
window.dispatchEvent(event);
|
|
160
|
-
} catch (eventError) {
|
|
161
|
-
// Silently fail - event dispatch should never crash the app
|
|
162
|
-
consola.warn('Failed to dispatch validation error event:', eventError);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Re-throw the error
|
|
167
|
-
throw error;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Complete GitHub OAuth
|
|
174
|
-
*
|
|
175
|
-
* @method POST
|
|
176
|
-
* @path /cfg/accounts/oauth/github/callback/
|
|
177
|
-
*/
|
|
178
|
-
export async function createAccountsOauthGithubCallbackCreate( data: OAuthCallbackRequestRequest, client?: any
|
|
179
|
-
): Promise<OAuthTokenResponse> {
|
|
180
|
-
const api = client || getAPIInstance()
|
|
181
|
-
const response = await api.oauth.accountsOauthGithubCallbackCreate(data)
|
|
182
|
-
try {
|
|
183
|
-
return OAuthTokenResponseSchema.parse(response)
|
|
184
|
-
} catch (error) {
|
|
185
|
-
// Zod validation error - log detailed information
|
|
186
|
-
consola.error('❌ Zod Validation Failed');
|
|
187
|
-
consola.box(`createAccountsOauthGithubCallbackCreate\nPath: /cfg/accounts/oauth/github/callback/\nMethod: POST`);
|
|
188
|
-
|
|
189
|
-
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
190
|
-
consola.error('Validation Issues:');
|
|
191
|
-
(error as any).issues.forEach((issue: any, index: number) => {
|
|
192
|
-
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
193
|
-
consola.error(` ├─ Message: ${issue.message}`);
|
|
194
|
-
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
195
|
-
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
consola.error('Response data:', response);
|
|
200
|
-
|
|
201
|
-
// Dispatch browser CustomEvent (only if window is defined)
|
|
202
|
-
if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
|
|
203
|
-
try {
|
|
204
|
-
const event = new CustomEvent('zod-validation-error', {
|
|
205
|
-
detail: {
|
|
206
|
-
operation: 'createAccountsOauthGithubCallbackCreate',
|
|
207
|
-
path: '/cfg/accounts/oauth/github/callback/',
|
|
208
|
-
method: 'POST',
|
|
209
|
-
error: error,
|
|
210
|
-
response: response,
|
|
211
|
-
timestamp: new Date(),
|
|
212
|
-
},
|
|
213
|
-
bubbles: true,
|
|
214
|
-
cancelable: false,
|
|
215
|
-
});
|
|
216
|
-
window.dispatchEvent(event);
|
|
217
|
-
} catch (eventError) {
|
|
218
|
-
// Silently fail - event dispatch should never crash the app
|
|
219
|
-
consola.warn('Failed to dispatch validation error event:', eventError);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Re-throw the error
|
|
224
|
-
throw error;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* List OAuth providers
|
|
231
|
-
*
|
|
232
|
-
* @method GET
|
|
233
|
-
* @path /cfg/accounts/oauth/providers/
|
|
234
|
-
*/
|
|
235
|
-
export async function getAccountsOauthProvidersRetrieve( client?: any
|
|
236
|
-
): Promise<OAuthProvidersResponse> {
|
|
237
|
-
const api = client || getAPIInstance()
|
|
238
|
-
const response = await api.oauth.accountsOauthProvidersRetrieve()
|
|
239
|
-
try {
|
|
240
|
-
return OAuthProvidersResponseSchema.parse(response)
|
|
241
|
-
} catch (error) {
|
|
242
|
-
// Zod validation error - log detailed information
|
|
243
|
-
consola.error('❌ Zod Validation Failed');
|
|
244
|
-
consola.box(`getAccountsOauthProvidersRetrieve\nPath: /cfg/accounts/oauth/providers/\nMethod: GET`);
|
|
245
|
-
|
|
246
|
-
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
247
|
-
consola.error('Validation Issues:');
|
|
248
|
-
(error as any).issues.forEach((issue: any, index: number) => {
|
|
249
|
-
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
250
|
-
consola.error(` ├─ Message: ${issue.message}`);
|
|
251
|
-
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
252
|
-
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
consola.error('Response data:', response);
|
|
257
|
-
|
|
258
|
-
// Dispatch browser CustomEvent (only if window is defined)
|
|
259
|
-
if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
|
|
260
|
-
try {
|
|
261
|
-
const event = new CustomEvent('zod-validation-error', {
|
|
262
|
-
detail: {
|
|
263
|
-
operation: 'getAccountsOauthProvidersRetrieve',
|
|
264
|
-
path: '/cfg/accounts/oauth/providers/',
|
|
265
|
-
method: 'GET',
|
|
266
|
-
error: error,
|
|
267
|
-
response: response,
|
|
268
|
-
timestamp: new Date(),
|
|
269
|
-
},
|
|
270
|
-
bubbles: true,
|
|
271
|
-
cancelable: false,
|
|
272
|
-
});
|
|
273
|
-
window.dispatchEvent(event);
|
|
274
|
-
} catch (eventError) {
|
|
275
|
-
// Silently fail - event dispatch should never crash the app
|
|
276
|
-
consola.warn('Failed to dispatch validation error event:', eventError);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// Re-throw the error
|
|
281
|
-
throw error;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|