@djangocfg/api 2.1.322 → 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,163 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
/**
|
|
4
|
-
* Storage adapters for cross-platform token storage.
|
|
5
|
-
*
|
|
6
|
-
* Supports:
|
|
7
|
-
* - LocalStorage (browser)
|
|
8
|
-
* - Cookies (SSR/browser)
|
|
9
|
-
* - Memory (Node.js/Electron/testing)
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import type { APILogger } from './logger';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Storage adapter interface for cross-platform token storage.
|
|
16
|
-
*/
|
|
17
|
-
export interface StorageAdapter {
|
|
18
|
-
getItem(key: string): string | null;
|
|
19
|
-
setItem(key: string, value: string): void;
|
|
20
|
-
removeItem(key: string): void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* LocalStorage adapter with safe try-catch for browser environments.
|
|
25
|
-
* Works in modern browsers with localStorage support.
|
|
26
|
-
*
|
|
27
|
-
* Note: This adapter uses window.localStorage and should only be used in browser/client environments.
|
|
28
|
-
* For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.
|
|
29
|
-
*/
|
|
30
|
-
export class LocalStorageAdapter implements StorageAdapter {
|
|
31
|
-
private logger?: APILogger;
|
|
32
|
-
|
|
33
|
-
constructor(logger?: APILogger) {
|
|
34
|
-
this.logger = logger;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
getItem(key: string): string | null {
|
|
38
|
-
try {
|
|
39
|
-
if (typeof window !== 'undefined' && window.localStorage) {
|
|
40
|
-
const value = localStorage.getItem(key);
|
|
41
|
-
this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? 'found' : 'not found'}`);
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
this.logger?.warn('LocalStorage not available: window.localStorage is undefined');
|
|
45
|
-
} catch (error) {
|
|
46
|
-
this.logger?.error('LocalStorage.getItem failed:', error);
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
setItem(key: string, value: string): void {
|
|
52
|
-
try {
|
|
53
|
-
if (typeof window !== 'undefined' && window.localStorage) {
|
|
54
|
-
localStorage.setItem(key, value);
|
|
55
|
-
this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
|
|
56
|
-
} else {
|
|
57
|
-
this.logger?.warn('LocalStorage not available: window.localStorage is undefined');
|
|
58
|
-
}
|
|
59
|
-
} catch (error) {
|
|
60
|
-
this.logger?.error('LocalStorage.setItem failed:', error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
removeItem(key: string): void {
|
|
65
|
-
try {
|
|
66
|
-
if (typeof window !== 'undefined' && window.localStorage) {
|
|
67
|
-
localStorage.removeItem(key);
|
|
68
|
-
this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
|
|
69
|
-
} else {
|
|
70
|
-
this.logger?.warn('LocalStorage not available: window.localStorage is undefined');
|
|
71
|
-
}
|
|
72
|
-
} catch (error) {
|
|
73
|
-
this.logger?.error('LocalStorage.removeItem failed:', error);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Cookie-based storage adapter for SSR and browser environments.
|
|
80
|
-
* Useful for Next.js, Nuxt.js, and other SSR frameworks.
|
|
81
|
-
*/
|
|
82
|
-
export class CookieStorageAdapter implements StorageAdapter {
|
|
83
|
-
private logger?: APILogger;
|
|
84
|
-
|
|
85
|
-
constructor(logger?: APILogger) {
|
|
86
|
-
this.logger = logger;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
getItem(key: string): string | null {
|
|
90
|
-
try {
|
|
91
|
-
if (typeof document === 'undefined') {
|
|
92
|
-
this.logger?.warn('Cookies not available: document is undefined (SSR context?)');
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
const value = `; ${document.cookie}`;
|
|
96
|
-
const parts = value.split(`; ${key}=`);
|
|
97
|
-
if (parts.length === 2) {
|
|
98
|
-
const result = parts.pop()?.split(';').shift() || null;
|
|
99
|
-
this.logger?.debug(`CookieStorage.getItem("${key}"): ${result ? 'found' : 'not found'}`);
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
this.logger?.debug(`CookieStorage.getItem("${key}"): not found`);
|
|
103
|
-
} catch (error) {
|
|
104
|
-
this.logger?.error('CookieStorage.getItem failed:', error);
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
setItem(key: string, value: string): void {
|
|
110
|
-
try {
|
|
111
|
-
if (typeof document !== 'undefined') {
|
|
112
|
-
document.cookie = `${key}=${value}; path=/; max-age=31536000`;
|
|
113
|
-
this.logger?.debug(`CookieStorage.setItem("${key}"): success`);
|
|
114
|
-
} else {
|
|
115
|
-
this.logger?.warn('Cookies not available: document is undefined (SSR context?)');
|
|
116
|
-
}
|
|
117
|
-
} catch (error) {
|
|
118
|
-
this.logger?.error('CookieStorage.setItem failed:', error);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
removeItem(key: string): void {
|
|
123
|
-
try {
|
|
124
|
-
if (typeof document !== 'undefined') {
|
|
125
|
-
document.cookie = `${key}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
|
|
126
|
-
this.logger?.debug(`CookieStorage.removeItem("${key}"): success`);
|
|
127
|
-
} else {
|
|
128
|
-
this.logger?.warn('Cookies not available: document is undefined (SSR context?)');
|
|
129
|
-
}
|
|
130
|
-
} catch (error) {
|
|
131
|
-
this.logger?.error('CookieStorage.removeItem failed:', error);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* In-memory storage adapter for Node.js, Electron, and testing environments.
|
|
138
|
-
* Data is stored in RAM and cleared when process exits.
|
|
139
|
-
*/
|
|
140
|
-
export class MemoryStorageAdapter implements StorageAdapter {
|
|
141
|
-
private storage: Map<string, string> = new Map();
|
|
142
|
-
private logger?: APILogger;
|
|
143
|
-
|
|
144
|
-
constructor(logger?: APILogger) {
|
|
145
|
-
this.logger = logger;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
getItem(key: string): string | null {
|
|
149
|
-
const value = this.storage.get(key) || null;
|
|
150
|
-
this.logger?.debug(`MemoryStorage.getItem("${key}"): ${value ? 'found' : 'not found'}`);
|
|
151
|
-
return value;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
setItem(key: string, value: string): void {
|
|
155
|
-
this.storage.set(key, value);
|
|
156
|
-
this.logger?.debug(`MemoryStorage.setItem("${key}"): success`);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
removeItem(key: string): void {
|
|
160
|
-
this.storage.delete(key);
|
|
161
|
-
this.logger?.debug(`MemoryStorage.removeItem("${key}"): success`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
/**
|
|
4
|
-
* Zod Validation Events - Browser CustomEvent integration
|
|
5
|
-
*
|
|
6
|
-
* Dispatches browser CustomEvents when Zod validation fails, allowing
|
|
7
|
-
* React/frontend apps to listen and handle validation errors globally.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // In your React app
|
|
12
|
-
* window.addEventListener('zod-validation-error', (event) => {
|
|
13
|
-
* const { operation, path, method, error, response } = event.detail;
|
|
14
|
-
* console.error(`Validation failed for ${method} ${path}`, error);
|
|
15
|
-
* // Show toast notification, log to Sentry, etc.
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import type { ZodError } from 'zod'
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Validation error event detail
|
|
24
|
-
*/
|
|
25
|
-
export interface ValidationErrorDetail {
|
|
26
|
-
/** Operation/function name that failed validation */
|
|
27
|
-
operation: string
|
|
28
|
-
/** API endpoint path */
|
|
29
|
-
path: string
|
|
30
|
-
/** HTTP method */
|
|
31
|
-
method: string
|
|
32
|
-
/** Zod validation error */
|
|
33
|
-
error: ZodError
|
|
34
|
-
/** Raw response data that failed validation */
|
|
35
|
-
response: any
|
|
36
|
-
/** Timestamp of the error */
|
|
37
|
-
timestamp: Date
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Custom event type for Zod validation errors
|
|
42
|
-
*/
|
|
43
|
-
export type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Dispatch a Zod validation error event.
|
|
47
|
-
*
|
|
48
|
-
* Only dispatches in browser environment (when window is defined).
|
|
49
|
-
* Safe to call in Node.js/SSR - will be a no-op.
|
|
50
|
-
*
|
|
51
|
-
* @param detail - Validation error details
|
|
52
|
-
*/
|
|
53
|
-
export function dispatchValidationError(detail: ValidationErrorDetail): void {
|
|
54
|
-
// Check if running in browser
|
|
55
|
-
if (typeof window === 'undefined') {
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
const event = new CustomEvent<ValidationErrorDetail>('zod-validation-error', {
|
|
61
|
-
detail,
|
|
62
|
-
bubbles: true,
|
|
63
|
-
cancelable: false,
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
window.dispatchEvent(event)
|
|
67
|
-
} catch (error) {
|
|
68
|
-
// Silently fail - validation event dispatch should never crash the app
|
|
69
|
-
console.warn('Failed to dispatch validation error event:', error)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Add a global listener for Zod validation errors.
|
|
75
|
-
*
|
|
76
|
-
* @param callback - Function to call when validation error occurs
|
|
77
|
-
* @returns Cleanup function to remove the listener
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* ```typescript
|
|
81
|
-
* const cleanup = onValidationError(({ operation, error }) => {
|
|
82
|
-
* toast.error(`Validation failed in ${operation}`);
|
|
83
|
-
* logToSentry(error);
|
|
84
|
-
* });
|
|
85
|
-
*
|
|
86
|
-
* // Later, remove listener
|
|
87
|
-
* cleanup();
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
export function onValidationError(
|
|
91
|
-
callback: (detail: ValidationErrorDetail) => void
|
|
92
|
-
): () => void {
|
|
93
|
-
if (typeof window === 'undefined') {
|
|
94
|
-
// Return no-op cleanup function for SSR
|
|
95
|
-
return () => {}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const handler = (event: Event) => {
|
|
99
|
-
if (event instanceof CustomEvent) {
|
|
100
|
-
callback(event.detail)
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
window.addEventListener('zod-validation-error', handler)
|
|
105
|
-
|
|
106
|
-
// Return cleanup function
|
|
107
|
-
return () => {
|
|
108
|
-
window.removeEventListener('zod-validation-error', handler)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Format Zod error for logging/display.
|
|
114
|
-
*
|
|
115
|
-
* @param error - Zod validation error
|
|
116
|
-
* @returns Formatted error message
|
|
117
|
-
*/
|
|
118
|
-
export function formatZodError(error: ZodError): string {
|
|
119
|
-
const issues = error.issues.map((issue, index) => {
|
|
120
|
-
const path = issue.path.join('.') || 'root'
|
|
121
|
-
const parts = [`${index + 1}. ${path}: ${issue.message}`]
|
|
122
|
-
|
|
123
|
-
if ('expected' in issue && issue.expected) {
|
|
124
|
-
parts.push(` Expected: ${issue.expected}`)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if ('received' in issue && issue.received) {
|
|
128
|
-
parts.push(` Received: ${issue.received}`)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return parts.join('\n')
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
return issues.join('\n')
|
|
135
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Django CFG API - Typescript Client
|
|
2
|
-
|
|
3
|
-
Auto-generated. **Do not edit manually.**
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
python manage.py generate_client --groups cfg_centrifugo --typescript
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Stats
|
|
10
|
-
|
|
11
|
-
| | |
|
|
12
|
-
|---|---|
|
|
13
|
-
| Version | 3.1.0 |
|
|
14
|
-
| Operations | 1 |
|
|
15
|
-
| Schemas | 1 |
|
|
16
|
-
|
|
17
|
-
## Resources
|
|
18
|
-
|
|
19
|
-
- **Centrifugo Auth** (1 ops)
|
|
20
|
-
|
|
21
|
-
## Operations
|
|
22
|
-
|
|
23
|
-
**Centrifugo Auth:**
|
|
24
|
-
- `GET` /cfg/centrifugo/auth/token/ → `cfg_centrifugo_auth_token_retrieve`
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
import { APIClient } from './';
|
|
30
|
-
|
|
31
|
-
const client = new APIClient({ baseUrl, token });
|
|
32
|
-
|
|
33
|
-
await client.centrifugo auth.retrieve({ id: 1 });
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**SWR Hooks:**
|
|
37
|
-
```typescript
|
|
38
|
-
import { useCentrifugo authList } from './hooks';
|
|
39
|
-
const { data, isLoading } = useCentrifugo authList();
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## How It Works
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
DRF ViewSets → drf-spectacular → OpenAPI → IR Parser → Generator → This Client
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Configuration** (`api/config.py`):
|
|
49
|
-
```python
|
|
50
|
-
openapi_client = OpenAPIClientConfig(
|
|
51
|
-
enabled=True,
|
|
52
|
-
groups=[OpenAPIGroupConfig(name="cfg_centrifugo", apps=["..."])],
|
|
53
|
-
generate_zod_schemas=True, # → schemas.ts
|
|
54
|
-
generate_fetchers=True, # → fetchers.ts
|
|
55
|
-
generate_swr_hooks=True, # → hooks.ts
|
|
56
|
-
)
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
@see https://djangocfg.com/docs/features/api-generation
|
|
60
|
-
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
/**
|
|
4
|
-
* Typed fetchers for Centrifugo Auth
|
|
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 { ConnectionTokenResponseSchema, type ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'
|
|
36
|
-
import { getAPIInstance } from '../../api-instance'
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Get Centrifugo connection token
|
|
40
|
-
*
|
|
41
|
-
* @method GET
|
|
42
|
-
* @path /cfg/centrifugo/auth/token/
|
|
43
|
-
*/
|
|
44
|
-
export async function getCentrifugoAuthTokenRetrieve( client?: any
|
|
45
|
-
): Promise<ConnectionTokenResponse> {
|
|
46
|
-
const api = client || getAPIInstance()
|
|
47
|
-
const response = await api.centrifugo_auth.tokenRetrieve()
|
|
48
|
-
try {
|
|
49
|
-
return ConnectionTokenResponseSchema.parse(response)
|
|
50
|
-
} catch (error) {
|
|
51
|
-
// Zod validation error - log detailed information
|
|
52
|
-
consola.error('❌ Zod Validation Failed');
|
|
53
|
-
consola.box(`getCentrifugoAuthTokenRetrieve\nPath: /cfg/centrifugo/auth/token/\nMethod: GET`);
|
|
54
|
-
|
|
55
|
-
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
56
|
-
consola.error('Validation Issues:');
|
|
57
|
-
(error as any).issues.forEach((issue: any, index: number) => {
|
|
58
|
-
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
59
|
-
consola.error(` ├─ Message: ${issue.message}`);
|
|
60
|
-
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
61
|
-
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
consola.error('Response data:', response);
|
|
66
|
-
|
|
67
|
-
// Dispatch browser CustomEvent (only if window is defined)
|
|
68
|
-
if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
|
|
69
|
-
try {
|
|
70
|
-
const event = new CustomEvent('zod-validation-error', {
|
|
71
|
-
detail: {
|
|
72
|
-
operation: 'getCentrifugoAuthTokenRetrieve',
|
|
73
|
-
path: '/cfg/centrifugo/auth/token/',
|
|
74
|
-
method: 'GET',
|
|
75
|
-
error: error,
|
|
76
|
-
response: response,
|
|
77
|
-
timestamp: new Date(),
|
|
78
|
-
},
|
|
79
|
-
bubbles: true,
|
|
80
|
-
cancelable: false,
|
|
81
|
-
});
|
|
82
|
-
window.dispatchEvent(event);
|
|
83
|
-
} catch (eventError) {
|
|
84
|
-
// Silently fail - event dispatch should never crash the app
|
|
85
|
-
consola.warn('Failed to dispatch validation error event:', eventError);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Re-throw the error
|
|
90
|
-
throw error;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
/**
|
|
4
|
-
* Typed Fetchers - Universal API functions
|
|
5
|
-
*
|
|
6
|
-
* Auto-generated from OpenAPI specification.
|
|
7
|
-
* These functions work in any JavaScript environment.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Runtime validation with Zod
|
|
11
|
-
* - Type-safe parameters and responses
|
|
12
|
-
* - Works with any data-fetching library (SWR, React Query, etc)
|
|
13
|
-
* - Server Component compatible
|
|
14
|
-
*
|
|
15
|
-
* Usage:
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import * as fetchers from './fetchers'
|
|
18
|
-
*
|
|
19
|
-
* // Direct usage
|
|
20
|
-
* const user = await fetchers.getUser(1)
|
|
21
|
-
*
|
|
22
|
-
* // With SWR
|
|
23
|
-
* const { data } = useSWR('user-1', () => fetchers.getUser(1))
|
|
24
|
-
*
|
|
25
|
-
* // With React Query
|
|
26
|
-
* const { data } = useQuery(['user', 1], () => fetchers.getUser(1))
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
export * from './centrifugo__centrifugo_auth'
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* SWR Hooks for Centrifugo Auth
|
|
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 * as Fetchers from '../fetchers/centrifugo__centrifugo_auth'
|
|
23
|
-
import type { API } from '../../index'
|
|
24
|
-
import type { ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Get Centrifugo connection token
|
|
28
|
-
*
|
|
29
|
-
* @method GET
|
|
30
|
-
* @path /cfg/centrifugo/auth/token/
|
|
31
|
-
*/
|
|
32
|
-
export function useCentrifugoAuthTokenRetrieve(client?: API): ReturnType<typeof useSWR<ConnectionTokenResponse>> {
|
|
33
|
-
return useSWR<ConnectionTokenResponse>(
|
|
34
|
-
'cfg-centrifugo-auth-token',
|
|
35
|
-
() => Fetchers.getCentrifugoAuthTokenRetrieve(client)
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
@@ -1,30 +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 './centrifugo__centrifugo_auth'
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for ConnectionTokenResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Response model for Centrifugo connection token.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Response model for Centrifugo connection token.
|
|
11
|
-
*/
|
|
12
|
-
export const ConnectionTokenResponseSchema = z.object({
|
|
13
|
-
token: z.string(),
|
|
14
|
-
centrifugo_url: z.string(),
|
|
15
|
-
expires_at: z.string(),
|
|
16
|
-
channels: z.array(z.string()),
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Infer TypeScript type from Zod schema
|
|
21
|
-
*/
|
|
22
|
-
export type ConnectionTokenResponse = z.infer<typeof ConnectionTokenResponseSchema>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// Auto-generated by DjangoCFG - see CLAUDE.md
|
|
3
|
-
/**
|
|
4
|
-
* Zod Schemas - Runtime validation and type inference
|
|
5
|
-
*
|
|
6
|
-
* Auto-generated from OpenAPI specification.
|
|
7
|
-
* Provides runtime validation for API requests and responses.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { UserSchema } from './schemas'
|
|
12
|
-
*
|
|
13
|
-
* // Validate data
|
|
14
|
-
* const user = UserSchema.parse(data)
|
|
15
|
-
*
|
|
16
|
-
* // Type inference
|
|
17
|
-
* type User = z.infer<typeof UserSchema>
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
export * from './ConnectionTokenResponse.schema'
|