@djangocfg/api 2.1.356 → 2.1.357
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/README.md +53 -632
- package/dist/auth-server.cjs +717 -200
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +717 -200
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +843 -783
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +58 -37
- package/dist/auth.d.ts +58 -37
- package/dist/auth.mjs +846 -784
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +1427 -0
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +1686 -0
- package/dist/clients.d.ts +1686 -0
- package/dist/clients.mjs +1427 -0
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1277 -1924
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +18 -1206
- package/dist/hooks.d.ts +18 -1206
- package/dist/hooks.mjs +1253 -1900
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +545 -1232
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1389 -1455
- package/dist/index.d.ts +1389 -1455
- package/dist/index.mjs +545 -1232
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
- package/src/_api/generated/_cfg_accounts/api.ts +11 -3
- package/src/_api/generated/_cfg_accounts/hooks/index.ts +3 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRegenerateCreate.ts +64 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRetrieve.ts +65 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyTestCreate.ts +64 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/index.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/APIKey.ts +13 -0
- package/src/_api/generated/_cfg_accounts/schemas/APIKeyRegenerate.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/APIKeyRequest.ts +13 -0
- package/src/_api/generated/{_cfg_totp/schemas/DeviceListStatusEnum.ts → _cfg_accounts/schemas/APIKeyTestRequest.ts} +4 -2
- package/src/_api/generated/_cfg_accounts/schemas/APIKeyTestResult.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/AccountDeleteResponse.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/CfgUserUpdateRequest.ts +3 -2
- package/src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/OAuthConnection.ts +6 -6
- package/src/_api/generated/_cfg_accounts/schemas/OAuthDisconnectRequestRequest.ts +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/{ProviderEnum.ts → OAuthProviderEnum.ts} +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/OAuthTokenResponse.ts +5 -5
- package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyRequest.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyResponse.ts +3 -3
- package/src/_api/generated/_cfg_accounts/schemas/PatchedCfgUserUpdateRequest.ts +3 -2
- package/src/_api/generated/_cfg_accounts/schemas/User.ts +12 -10
- package/src/_api/generated/_cfg_accounts/schemas/cfg_accounts_oauth_connections_response_200_AutoRef.ts +10 -0
- package/src/_api/generated/_cfg_accounts/schemas/cfg_accounts_oauth_disconnect_response_200_AutoRef.ts +11 -0
- package/src/_api/generated/_cfg_accounts/schemas/index.ts +8 -1
- package/src/_api/generated/_cfg_centrifugo/api.ts +3 -3
- package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_centrifugo/index.ts +1 -1
- package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +2 -2
- package/src/_api/generated/_cfg_totp/api.ts +9 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +7 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDisableCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/index.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupRequest.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupResponse.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/DeviceList.ts +5 -5
- package/src/_api/generated/_cfg_totp/schemas/DeviceStatusEnum.ts +9 -0
- package/src/_api/generated/_cfg_totp/schemas/SetupResponse.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/TotpVerifyUser.ts +11 -9
- package/src/_api/generated/_cfg_totp/schemas/VerifyBackupRequest.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/VerifyRequest.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/VerifyResponse.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/cfg_totp_disable_response_200_AutoRef.ts +9 -0
- package/src/_api/generated/_cfg_totp/schemas/index.ts +2 -1
- package/src/_api/generated/index.ts +3 -1
- package/src/_api/generated/sdk.gen.ts +80 -813
- package/src/_api/generated/types.gen.ts +320 -159
- package/src/auth/context/AccountsContext.tsx +18 -6
- package/src/auth/context/AuthContext.tsx +11 -3
- package/src/auth/hooks/useDeleteAccount.ts +2 -2
- package/src/auth/hooks/useGithubAuth.ts +3 -3
- package/src/auth/hooks/useTokenRefresh.ts +2 -2
- package/src/auth/hooks/useTwoFactor.ts +3 -3
- package/src/auth/hooks/useTwoFactorSetup.ts +3 -3
- package/src/auth/hooks/useTwoFactorStatus.ts +3 -3
- package/src/auth/middlewares/tokenRefresh.ts +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useApiKey.ts +73 -0
- package/src/index.ts +12 -16
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
|
|
4
4
|
import { client } from './client.gen';
|
|
5
|
-
import type { CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses, CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveErrors, CfgCentrifugoAuthTokenRetrieveResponses, CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateErrors, CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses, CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses, CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses, CfgTotpDisableCreateData, CfgTotpDisableCreateErrors, CfgTotpDisableCreateResponses, CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateErrors, CfgTotpSetupConfirmCreateResponses, CfgTotpSetupCreateData, CfgTotpSetupCreateErrors, CfgTotpSetupCreateResponses, CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateErrors, CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyCreateData, CfgTotpVerifyCreateErrors, CfgTotpVerifyCreateResponses } from './types.gen';
|
|
5
|
+
import type { CfgAccountsApiKeyRegenerateCreateData, CfgAccountsApiKeyRegenerateCreateErrors, CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRetrieveData, CfgAccountsApiKeyRetrieveErrors, CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyTestCreateData, CfgAccountsApiKeyTestCreateResponses, CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses, CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveErrors, CfgCentrifugoAuthTokenRetrieveResponses, CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateErrors, CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses, CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses, CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses, CfgTotpDisableCreateData, CfgTotpDisableCreateErrors, CfgTotpDisableCreateResponses, CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateErrors, CfgTotpSetupConfirmCreateResponses, CfgTotpSetupCreateData, CfgTotpSetupCreateErrors, CfgTotpSetupCreateResponses, CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateErrors, CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyCreateData, CfgTotpVerifyCreateErrors, CfgTotpVerifyCreateResponses } from './types.gen';
|
|
6
6
|
|
|
7
7
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
8
8
|
/**
|
|
@@ -18,688 +18,58 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
18
18
|
meta?: Record<string, unknown>;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export class
|
|
21
|
+
export class CfgAccountsApiKey {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Get all OAuth connections for the current user.
|
|
26
|
-
*/
|
|
27
|
-
public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>) {
|
|
28
|
-
return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
|
|
29
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
30
|
-
url: '/cfg/accounts/oauth/connections/',
|
|
31
|
-
...options
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Disconnect OAuth provider
|
|
37
|
-
*
|
|
38
|
-
* Remove OAuth connection for the specified provider.
|
|
39
|
-
*/
|
|
40
|
-
public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>) {
|
|
41
|
-
return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
|
|
42
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
43
|
-
url: '/cfg/accounts/oauth/disconnect/',
|
|
44
|
-
...options,
|
|
45
|
-
headers: {
|
|
46
|
-
'Content-Type': 'application/json',
|
|
47
|
-
...options.headers
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Start GitHub OAuth
|
|
54
|
-
*
|
|
55
|
-
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
56
|
-
*/
|
|
57
|
-
public static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>) {
|
|
58
|
-
return (options?.client ?? client).post<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError>({
|
|
59
|
-
url: '/cfg/accounts/oauth/github/authorize/',
|
|
60
|
-
...options,
|
|
61
|
-
headers: {
|
|
62
|
-
'Content-Type': 'application/json',
|
|
63
|
-
...options?.headers
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Complete GitHub OAuth
|
|
70
|
-
*
|
|
71
|
-
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
72
|
-
*/
|
|
73
|
-
public static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>) {
|
|
74
|
-
return (options.client ?? client).post<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError>({
|
|
75
|
-
url: '/cfg/accounts/oauth/github/callback/',
|
|
76
|
-
...options,
|
|
77
|
-
headers: {
|
|
78
|
-
'Content-Type': 'application/json',
|
|
79
|
-
...options.headers
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* List OAuth providers
|
|
86
|
-
*
|
|
87
|
-
* Get list of available OAuth providers for authentication.
|
|
88
|
-
*/
|
|
89
|
-
public static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>) {
|
|
90
|
-
return (options?.client ?? client).get<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>({ url: '/cfg/accounts/oauth/providers/', ...options });
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Request OTP code to email.
|
|
95
|
-
*/
|
|
96
|
-
public static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>) {
|
|
97
|
-
return (options.client ?? client).post<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError>({
|
|
98
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
99
|
-
url: '/cfg/accounts/otp/request/',
|
|
100
|
-
...options,
|
|
101
|
-
headers: {
|
|
102
|
-
'Content-Type': 'application/json',
|
|
103
|
-
...options.headers
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Verify OTP code and return JWT tokens or 2FA session.
|
|
110
|
-
*
|
|
111
|
-
* If user has 2FA enabled:
|
|
112
|
-
* - Returns requires_2fa=True with session_id
|
|
113
|
-
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
114
|
-
*
|
|
115
|
-
* If user has no 2FA:
|
|
116
|
-
* - Returns JWT tokens and user data directly
|
|
117
|
-
*/
|
|
118
|
-
public static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>) {
|
|
119
|
-
return (options.client ?? client).post<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError>({
|
|
120
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
121
|
-
url: '/cfg/accounts/otp/verify/',
|
|
122
|
-
...options,
|
|
123
|
-
headers: {
|
|
124
|
-
'Content-Type': 'application/json',
|
|
125
|
-
...options.headers
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Get current user profile
|
|
132
|
-
*
|
|
133
|
-
* Retrieve the current authenticated user's profile information.
|
|
134
|
-
*/
|
|
135
|
-
public static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>) {
|
|
136
|
-
return (options?.client ?? client).get<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError>({
|
|
137
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
138
|
-
in: 'cookie',
|
|
139
|
-
name: 'sessionid',
|
|
140
|
-
type: 'apiKey'
|
|
141
|
-
}],
|
|
142
|
-
url: '/cfg/accounts/profile/',
|
|
143
|
-
...options
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Upload user avatar
|
|
149
|
-
*
|
|
150
|
-
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
151
|
-
*/
|
|
152
|
-
public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>) {
|
|
153
|
-
return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
|
|
154
|
-
...formDataBodySerializer,
|
|
155
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
156
|
-
url: '/cfg/accounts/profile/avatar/',
|
|
157
|
-
...options,
|
|
158
|
-
headers: {
|
|
159
|
-
'Content-Type': null,
|
|
160
|
-
...options?.headers
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Delete user account
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* Permanently delete the current user's account.
|
|
170
|
-
*
|
|
171
|
-
* This operation:
|
|
172
|
-
* - Deactivates the account (user cannot log in)
|
|
173
|
-
* - Anonymizes personal data (GDPR compliance)
|
|
174
|
-
* - Frees up the email address for re-registration
|
|
175
|
-
* - Preserves audit trail
|
|
176
|
-
*
|
|
177
|
-
* The account can be restored by an administrator if needed.
|
|
178
|
-
*
|
|
179
|
-
*/
|
|
180
|
-
public static cfgAccountsProfileDeleteCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileDeleteCreateData, ThrowOnError>) {
|
|
181
|
-
return (options?.client ?? client).post<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError>({
|
|
182
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
183
|
-
in: 'cookie',
|
|
184
|
-
name: 'sessionid',
|
|
185
|
-
type: 'apiKey'
|
|
186
|
-
}],
|
|
187
|
-
url: '/cfg/accounts/profile/delete/',
|
|
188
|
-
...options
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Partial update user profile
|
|
194
|
-
*
|
|
195
|
-
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
196
|
-
*/
|
|
197
|
-
public static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>) {
|
|
198
|
-
return (options?.client ?? client).patch<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError>({
|
|
199
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
200
|
-
in: 'cookie',
|
|
201
|
-
name: 'sessionid',
|
|
202
|
-
type: 'apiKey'
|
|
203
|
-
}],
|
|
204
|
-
url: '/cfg/accounts/profile/partial/',
|
|
205
|
-
...options,
|
|
206
|
-
headers: {
|
|
207
|
-
'Content-Type': 'application/json',
|
|
208
|
-
...options?.headers
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Partial update user profile
|
|
215
|
-
*
|
|
216
|
-
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
217
|
-
*/
|
|
218
|
-
public static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>) {
|
|
219
|
-
return (options?.client ?? client).put<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError>({
|
|
220
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
221
|
-
in: 'cookie',
|
|
222
|
-
name: 'sessionid',
|
|
223
|
-
type: 'apiKey'
|
|
224
|
-
}],
|
|
225
|
-
url: '/cfg/accounts/profile/partial/',
|
|
226
|
-
...options,
|
|
227
|
-
headers: {
|
|
228
|
-
'Content-Type': 'application/json',
|
|
229
|
-
...options?.headers
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Update user profile
|
|
236
|
-
*
|
|
237
|
-
* Update the current authenticated user's profile information.
|
|
238
|
-
*/
|
|
239
|
-
public static cfgAccountsProfileUpdatePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdatePartialUpdateData, ThrowOnError>) {
|
|
240
|
-
return (options?.client ?? client).patch<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError>({
|
|
241
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
242
|
-
in: 'cookie',
|
|
243
|
-
name: 'sessionid',
|
|
244
|
-
type: 'apiKey'
|
|
245
|
-
}],
|
|
246
|
-
url: '/cfg/accounts/profile/update/',
|
|
247
|
-
...options,
|
|
248
|
-
headers: {
|
|
249
|
-
'Content-Type': 'application/json',
|
|
250
|
-
...options?.headers
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Update user profile
|
|
257
|
-
*
|
|
258
|
-
* Update the current authenticated user's profile information.
|
|
259
|
-
*/
|
|
260
|
-
public static cfgAccountsProfileUpdateUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdateUpdateData, ThrowOnError>) {
|
|
261
|
-
return (options?.client ?? client).put<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError>({
|
|
262
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
263
|
-
in: 'cookie',
|
|
264
|
-
name: 'sessionid',
|
|
265
|
-
type: 'apiKey'
|
|
266
|
-
}],
|
|
267
|
-
url: '/cfg/accounts/profile/update/',
|
|
268
|
-
...options,
|
|
269
|
-
headers: {
|
|
270
|
-
'Content-Type': 'application/json',
|
|
271
|
-
...options?.headers
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Refresh JWT token.
|
|
278
|
-
*/
|
|
279
|
-
public static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>) {
|
|
280
|
-
return (options.client ?? client).post<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError>({
|
|
281
|
-
url: '/cfg/accounts/token/refresh/',
|
|
282
|
-
...options,
|
|
283
|
-
headers: {
|
|
284
|
-
'Content-Type': 'application/json',
|
|
285
|
-
...options.headers
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Get Centrifugo connection token
|
|
292
|
-
*
|
|
293
|
-
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
294
|
-
*/
|
|
295
|
-
public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>) {
|
|
296
|
-
return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
|
|
297
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
298
|
-
url: '/cfg/centrifugo/auth/token/',
|
|
299
|
-
...options
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Get backup codes status for user.
|
|
305
|
-
*/
|
|
306
|
-
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
307
|
-
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
308
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
309
|
-
url: '/cfg/totp/backup-codes/',
|
|
310
|
-
...options
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Regenerate backup codes.
|
|
316
|
-
*
|
|
317
|
-
* Requires TOTP code for verification.
|
|
318
|
-
* Invalidates all existing codes.
|
|
319
|
-
*/
|
|
320
|
-
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
321
|
-
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
322
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
323
|
-
url: '/cfg/totp/backup-codes/regenerate/',
|
|
324
|
-
...options,
|
|
325
|
-
headers: {
|
|
326
|
-
'Content-Type': 'application/json',
|
|
327
|
-
...options.headers
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* List all TOTP devices for user.
|
|
334
|
-
*/
|
|
335
|
-
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
336
|
-
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
337
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
338
|
-
url: '/cfg/totp/devices/',
|
|
339
|
-
...options
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Delete a TOTP device.
|
|
345
|
-
*
|
|
346
|
-
* Requires verification code if removing the last/primary device.
|
|
347
|
-
*/
|
|
348
|
-
public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>) {
|
|
349
|
-
return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
|
|
350
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
351
|
-
url: '/cfg/totp/devices/{id}/',
|
|
352
|
-
...options
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Completely disable 2FA for account.
|
|
358
|
-
*
|
|
359
|
-
* Requires verification code.
|
|
360
|
-
*/
|
|
361
|
-
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
362
|
-
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
363
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
364
|
-
url: '/cfg/totp/disable/',
|
|
365
|
-
...options,
|
|
366
|
-
headers: {
|
|
367
|
-
'Content-Type': 'application/json',
|
|
368
|
-
...options.headers
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Start 2FA setup process.
|
|
375
|
-
*
|
|
376
|
-
* Creates a new TOTP device and returns QR code for scanning.
|
|
377
|
-
*/
|
|
378
|
-
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
379
|
-
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
380
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
381
|
-
url: '/cfg/totp/setup/',
|
|
382
|
-
...options,
|
|
383
|
-
headers: {
|
|
384
|
-
'Content-Type': 'application/json',
|
|
385
|
-
...options?.headers
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* Confirm 2FA setup with first valid code.
|
|
392
|
-
*
|
|
393
|
-
* Activates the device and generates backup codes.
|
|
394
|
-
*/
|
|
395
|
-
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
396
|
-
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
397
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
398
|
-
url: '/cfg/totp/setup/confirm/',
|
|
399
|
-
...options,
|
|
400
|
-
headers: {
|
|
401
|
-
'Content-Type': 'application/json',
|
|
402
|
-
...options.headers
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Verify TOTP code for 2FA session.
|
|
409
|
-
*
|
|
410
|
-
* Completes authentication and returns JWT tokens on success.
|
|
411
|
-
*/
|
|
412
|
-
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
413
|
-
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
414
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
415
|
-
url: '/cfg/totp/verify/',
|
|
416
|
-
...options,
|
|
417
|
-
headers: {
|
|
418
|
-
'Content-Type': 'application/json',
|
|
419
|
-
...options.headers
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Verify backup recovery code for 2FA session.
|
|
426
|
-
*
|
|
427
|
-
* Alternative verification method when TOTP device unavailable.
|
|
428
|
-
*/
|
|
429
|
-
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
430
|
-
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
431
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
432
|
-
url: '/cfg/totp/verify/backup/',
|
|
433
|
-
...options,
|
|
434
|
-
headers: {
|
|
435
|
-
'Content-Type': 'application/json',
|
|
436
|
-
...options.headers
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
export class Accounts {
|
|
443
|
-
/**
|
|
444
|
-
* List OAuth connections
|
|
445
|
-
*
|
|
446
|
-
* Get all OAuth connections for the current user.
|
|
447
|
-
*/
|
|
448
|
-
public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>) {
|
|
449
|
-
return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
|
|
450
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
451
|
-
url: '/cfg/accounts/oauth/connections/',
|
|
452
|
-
...options
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Disconnect OAuth provider
|
|
458
|
-
*
|
|
459
|
-
* Remove OAuth connection for the specified provider.
|
|
460
|
-
*/
|
|
461
|
-
public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>) {
|
|
462
|
-
return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
|
|
463
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
464
|
-
url: '/cfg/accounts/oauth/disconnect/',
|
|
465
|
-
...options,
|
|
466
|
-
headers: {
|
|
467
|
-
'Content-Type': 'application/json',
|
|
468
|
-
...options.headers
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
* Start GitHub OAuth
|
|
475
|
-
*
|
|
476
|
-
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
477
|
-
*/
|
|
478
|
-
public static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>) {
|
|
479
|
-
return (options?.client ?? client).post<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError>({
|
|
480
|
-
url: '/cfg/accounts/oauth/github/authorize/',
|
|
481
|
-
...options,
|
|
482
|
-
headers: {
|
|
483
|
-
'Content-Type': 'application/json',
|
|
484
|
-
...options?.headers
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Complete GitHub OAuth
|
|
491
|
-
*
|
|
492
|
-
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
493
|
-
*/
|
|
494
|
-
public static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>) {
|
|
495
|
-
return (options.client ?? client).post<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError>({
|
|
496
|
-
url: '/cfg/accounts/oauth/github/callback/',
|
|
497
|
-
...options,
|
|
498
|
-
headers: {
|
|
499
|
-
'Content-Type': 'application/json',
|
|
500
|
-
...options.headers
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* List OAuth providers
|
|
507
|
-
*
|
|
508
|
-
* Get list of available OAuth providers for authentication.
|
|
509
|
-
*/
|
|
510
|
-
public static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>) {
|
|
511
|
-
return (options?.client ?? client).get<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>({ url: '/cfg/accounts/oauth/providers/', ...options });
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Request OTP code to email.
|
|
516
|
-
*/
|
|
517
|
-
public static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>) {
|
|
518
|
-
return (options.client ?? client).post<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError>({
|
|
519
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
520
|
-
url: '/cfg/accounts/otp/request/',
|
|
521
|
-
...options,
|
|
522
|
-
headers: {
|
|
523
|
-
'Content-Type': 'application/json',
|
|
524
|
-
...options.headers
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Verify OTP code and return JWT tokens or 2FA session.
|
|
531
|
-
*
|
|
532
|
-
* If user has 2FA enabled:
|
|
533
|
-
* - Returns requires_2fa=True with session_id
|
|
534
|
-
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
535
|
-
*
|
|
536
|
-
* If user has no 2FA:
|
|
537
|
-
* - Returns JWT tokens and user data directly
|
|
538
|
-
*/
|
|
539
|
-
public static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>) {
|
|
540
|
-
return (options.client ?? client).post<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError>({
|
|
541
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
542
|
-
url: '/cfg/accounts/otp/verify/',
|
|
543
|
-
...options,
|
|
544
|
-
headers: {
|
|
545
|
-
'Content-Type': 'application/json',
|
|
546
|
-
...options.headers
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
* Get current user profile
|
|
553
|
-
*
|
|
554
|
-
* Retrieve the current authenticated user's profile information.
|
|
555
|
-
*/
|
|
556
|
-
public static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>) {
|
|
557
|
-
return (options?.client ?? client).get<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError>({
|
|
558
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
559
|
-
in: 'cookie',
|
|
560
|
-
name: 'sessionid',
|
|
561
|
-
type: 'apiKey'
|
|
562
|
-
}],
|
|
563
|
-
url: '/cfg/accounts/profile/',
|
|
564
|
-
...options
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Upload user avatar
|
|
570
|
-
*
|
|
571
|
-
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
572
|
-
*/
|
|
573
|
-
public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>) {
|
|
574
|
-
return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
|
|
575
|
-
...formDataBodySerializer,
|
|
576
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
577
|
-
url: '/cfg/accounts/profile/avatar/',
|
|
578
|
-
...options,
|
|
579
|
-
headers: {
|
|
580
|
-
'Content-Type': null,
|
|
581
|
-
...options?.headers
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Delete user account
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* Permanently delete the current user's account.
|
|
591
|
-
*
|
|
592
|
-
* This operation:
|
|
593
|
-
* - Deactivates the account (user cannot log in)
|
|
594
|
-
* - Anonymizes personal data (GDPR compliance)
|
|
595
|
-
* - Frees up the email address for re-registration
|
|
596
|
-
* - Preserves audit trail
|
|
597
|
-
*
|
|
598
|
-
* The account can be restored by an administrator if needed.
|
|
23
|
+
* Get API key details
|
|
599
24
|
*
|
|
25
|
+
* Retrieve the current user's API key (masked) and metadata.
|
|
600
26
|
*/
|
|
601
|
-
public static
|
|
602
|
-
return (options?.client ?? client).
|
|
27
|
+
public static cfgAccountsApiKeyRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsApiKeyRetrieveData, ThrowOnError>) {
|
|
28
|
+
return (options?.client ?? client).get<CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRetrieveErrors, ThrowOnError>({
|
|
603
29
|
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
604
30
|
in: 'cookie',
|
|
605
31
|
name: 'sessionid',
|
|
606
32
|
type: 'apiKey'
|
|
607
33
|
}],
|
|
608
|
-
url: '/cfg/accounts/
|
|
34
|
+
url: '/cfg/accounts/api-key/',
|
|
609
35
|
...options
|
|
610
36
|
});
|
|
611
37
|
}
|
|
612
38
|
|
|
613
39
|
/**
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
617
|
-
*/
|
|
618
|
-
public static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>) {
|
|
619
|
-
return (options?.client ?? client).patch<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError>({
|
|
620
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
621
|
-
in: 'cookie',
|
|
622
|
-
name: 'sessionid',
|
|
623
|
-
type: 'apiKey'
|
|
624
|
-
}],
|
|
625
|
-
url: '/cfg/accounts/profile/partial/',
|
|
626
|
-
...options,
|
|
627
|
-
headers: {
|
|
628
|
-
'Content-Type': 'application/json',
|
|
629
|
-
...options?.headers
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Partial update user profile
|
|
636
|
-
*
|
|
637
|
-
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
638
|
-
*/
|
|
639
|
-
public static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>) {
|
|
640
|
-
return (options?.client ?? client).put<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError>({
|
|
641
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
642
|
-
in: 'cookie',
|
|
643
|
-
name: 'sessionid',
|
|
644
|
-
type: 'apiKey'
|
|
645
|
-
}],
|
|
646
|
-
url: '/cfg/accounts/profile/partial/',
|
|
647
|
-
...options,
|
|
648
|
-
headers: {
|
|
649
|
-
'Content-Type': 'application/json',
|
|
650
|
-
...options?.headers
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Update user profile
|
|
40
|
+
* Regenerate API key
|
|
657
41
|
*
|
|
658
|
-
*
|
|
42
|
+
* Generate a new API key. The full key is returned only once.
|
|
659
43
|
*/
|
|
660
|
-
public static
|
|
661
|
-
return (options
|
|
44
|
+
public static cfgAccountsApiKeyRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyRegenerateCreateData, ThrowOnError>) {
|
|
45
|
+
return (options.client ?? client).post<CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRegenerateCreateErrors, ThrowOnError>({
|
|
662
46
|
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
663
47
|
in: 'cookie',
|
|
664
48
|
name: 'sessionid',
|
|
665
49
|
type: 'apiKey'
|
|
666
50
|
}],
|
|
667
|
-
url: '/cfg/accounts/
|
|
51
|
+
url: '/cfg/accounts/api-key/regenerate/',
|
|
668
52
|
...options,
|
|
669
53
|
headers: {
|
|
670
54
|
'Content-Type': 'application/json',
|
|
671
|
-
...options
|
|
55
|
+
...options.headers
|
|
672
56
|
}
|
|
673
57
|
});
|
|
674
58
|
}
|
|
675
59
|
|
|
676
60
|
/**
|
|
677
|
-
*
|
|
61
|
+
* Test API key
|
|
678
62
|
*
|
|
679
|
-
*
|
|
63
|
+
* Test whether an API key is valid without consuming it.
|
|
680
64
|
*/
|
|
681
|
-
public static
|
|
682
|
-
return (options
|
|
65
|
+
public static cfgAccountsApiKeyTestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyTestCreateData, ThrowOnError>) {
|
|
66
|
+
return (options.client ?? client).post<CfgAccountsApiKeyTestCreateResponses, unknown, ThrowOnError>({
|
|
683
67
|
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
684
68
|
in: 'cookie',
|
|
685
69
|
name: 'sessionid',
|
|
686
70
|
type: 'apiKey'
|
|
687
71
|
}],
|
|
688
|
-
url: '/cfg/accounts/
|
|
689
|
-
...options,
|
|
690
|
-
headers: {
|
|
691
|
-
'Content-Type': 'application/json',
|
|
692
|
-
...options?.headers
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Refresh JWT token.
|
|
699
|
-
*/
|
|
700
|
-
public static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>) {
|
|
701
|
-
return (options.client ?? client).post<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError>({
|
|
702
|
-
url: '/cfg/accounts/token/refresh/',
|
|
72
|
+
url: '/cfg/accounts/api-key/test/',
|
|
703
73
|
...options,
|
|
704
74
|
headers: {
|
|
705
75
|
'Content-Type': 'application/json',
|
|
@@ -709,7 +79,7 @@ export class Accounts {
|
|
|
709
79
|
}
|
|
710
80
|
}
|
|
711
81
|
|
|
712
|
-
export class
|
|
82
|
+
export class CfgAccountsOauth {
|
|
713
83
|
/**
|
|
714
84
|
* List OAuth connections
|
|
715
85
|
*
|
|
@@ -717,7 +87,7 @@ export class OAuth {
|
|
|
717
87
|
*/
|
|
718
88
|
public static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>) {
|
|
719
89
|
return (options?.client ?? client).get<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError>({
|
|
720
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
90
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
721
91
|
url: '/cfg/accounts/oauth/connections/',
|
|
722
92
|
...options
|
|
723
93
|
});
|
|
@@ -730,7 +100,7 @@ export class OAuth {
|
|
|
730
100
|
*/
|
|
731
101
|
public static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>) {
|
|
732
102
|
return (options.client ?? client).post<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError>({
|
|
733
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
103
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
734
104
|
url: '/cfg/accounts/oauth/disconnect/',
|
|
735
105
|
...options,
|
|
736
106
|
headers: {
|
|
@@ -782,7 +152,46 @@ export class OAuth {
|
|
|
782
152
|
}
|
|
783
153
|
}
|
|
784
154
|
|
|
785
|
-
export class
|
|
155
|
+
export class CfgAccounts {
|
|
156
|
+
/**
|
|
157
|
+
* Request OTP code to email.
|
|
158
|
+
*/
|
|
159
|
+
public static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>) {
|
|
160
|
+
return (options.client ?? client).post<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError>({
|
|
161
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
162
|
+
url: '/cfg/accounts/otp/request/',
|
|
163
|
+
...options,
|
|
164
|
+
headers: {
|
|
165
|
+
'Content-Type': 'application/json',
|
|
166
|
+
...options.headers
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Verify OTP code and return JWT tokens or 2FA session.
|
|
173
|
+
*
|
|
174
|
+
* If user has 2FA enabled:
|
|
175
|
+
* - Returns requires_2fa=True with session_id
|
|
176
|
+
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
177
|
+
*
|
|
178
|
+
* If user has no 2FA:
|
|
179
|
+
* - Returns JWT tokens and user data directly
|
|
180
|
+
*/
|
|
181
|
+
public static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>) {
|
|
182
|
+
return (options.client ?? client).post<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError>({
|
|
183
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
184
|
+
url: '/cfg/accounts/otp/verify/',
|
|
185
|
+
...options,
|
|
186
|
+
headers: {
|
|
187
|
+
'Content-Type': 'application/json',
|
|
188
|
+
...options.headers
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export class CfgAccountsProfile {
|
|
786
195
|
/**
|
|
787
196
|
* Get current user profile
|
|
788
197
|
*
|
|
@@ -808,7 +217,7 @@ export class UserProfile {
|
|
|
808
217
|
public static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>) {
|
|
809
218
|
return (options?.client ?? client).post<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError>({
|
|
810
219
|
...formDataBodySerializer,
|
|
811
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
220
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
812
221
|
url: '/cfg/accounts/profile/avatar/',
|
|
813
222
|
...options,
|
|
814
223
|
headers: {
|
|
@@ -930,7 +339,7 @@ export class UserProfile {
|
|
|
930
339
|
}
|
|
931
340
|
}
|
|
932
341
|
|
|
933
|
-
export class
|
|
342
|
+
export class CfgAccountsAuth {
|
|
934
343
|
/**
|
|
935
344
|
* Refresh JWT token.
|
|
936
345
|
*/
|
|
@@ -946,22 +355,7 @@ export class Auth {
|
|
|
946
355
|
}
|
|
947
356
|
}
|
|
948
357
|
|
|
949
|
-
export class
|
|
950
|
-
/**
|
|
951
|
-
* Get Centrifugo connection token
|
|
952
|
-
*
|
|
953
|
-
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
954
|
-
*/
|
|
955
|
-
public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>) {
|
|
956
|
-
return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
|
|
957
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
958
|
-
url: '/cfg/centrifugo/auth/token/',
|
|
959
|
-
...options
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
export class CentrifugoAuth {
|
|
358
|
+
export class CfgCentrifugo {
|
|
965
359
|
/**
|
|
966
360
|
* Get Centrifugo connection token
|
|
967
361
|
*
|
|
@@ -969,20 +363,20 @@ export class CentrifugoAuth {
|
|
|
969
363
|
*/
|
|
970
364
|
public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>) {
|
|
971
365
|
return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
|
|
972
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
366
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
973
367
|
url: '/cfg/centrifugo/auth/token/',
|
|
974
368
|
...options
|
|
975
369
|
});
|
|
976
370
|
}
|
|
977
371
|
}
|
|
978
372
|
|
|
979
|
-
export class
|
|
373
|
+
export class CfgTotpBackupCodes {
|
|
980
374
|
/**
|
|
981
375
|
* Get backup codes status for user.
|
|
982
376
|
*/
|
|
983
377
|
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
984
378
|
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
985
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
379
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
986
380
|
url: '/cfg/totp/backup-codes/',
|
|
987
381
|
...options
|
|
988
382
|
});
|
|
@@ -996,7 +390,7 @@ export class Totp {
|
|
|
996
390
|
*/
|
|
997
391
|
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
998
392
|
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
999
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
393
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1000
394
|
url: '/cfg/totp/backup-codes/regenerate/',
|
|
1001
395
|
...options,
|
|
1002
396
|
headers: {
|
|
@@ -1005,13 +399,15 @@ export class Totp {
|
|
|
1005
399
|
}
|
|
1006
400
|
});
|
|
1007
401
|
}
|
|
1008
|
-
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export class CfgTotp {
|
|
1009
405
|
/**
|
|
1010
406
|
* List all TOTP devices for user.
|
|
1011
407
|
*/
|
|
1012
408
|
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
1013
409
|
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
1014
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
410
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1015
411
|
url: '/cfg/totp/devices/',
|
|
1016
412
|
...options
|
|
1017
413
|
});
|
|
@@ -1024,7 +420,7 @@ export class Totp {
|
|
|
1024
420
|
*/
|
|
1025
421
|
public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>) {
|
|
1026
422
|
return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
|
|
1027
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
423
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1028
424
|
url: '/cfg/totp/devices/{id}/',
|
|
1029
425
|
...options
|
|
1030
426
|
});
|
|
@@ -1037,136 +433,7 @@ export class Totp {
|
|
|
1037
433
|
*/
|
|
1038
434
|
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
1039
435
|
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
1040
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1041
|
-
url: '/cfg/totp/disable/',
|
|
1042
|
-
...options,
|
|
1043
|
-
headers: {
|
|
1044
|
-
'Content-Type': 'application/json',
|
|
1045
|
-
...options.headers
|
|
1046
|
-
}
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
/**
|
|
1051
|
-
* Start 2FA setup process.
|
|
1052
|
-
*
|
|
1053
|
-
* Creates a new TOTP device and returns QR code for scanning.
|
|
1054
|
-
*/
|
|
1055
|
-
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
1056
|
-
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
1057
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1058
|
-
url: '/cfg/totp/setup/',
|
|
1059
|
-
...options,
|
|
1060
|
-
headers: {
|
|
1061
|
-
'Content-Type': 'application/json',
|
|
1062
|
-
...options?.headers
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
/**
|
|
1068
|
-
* Confirm 2FA setup with first valid code.
|
|
1069
|
-
*
|
|
1070
|
-
* Activates the device and generates backup codes.
|
|
1071
|
-
*/
|
|
1072
|
-
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
1073
|
-
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
1074
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1075
|
-
url: '/cfg/totp/setup/confirm/',
|
|
1076
|
-
...options,
|
|
1077
|
-
headers: {
|
|
1078
|
-
'Content-Type': 'application/json',
|
|
1079
|
-
...options.headers
|
|
1080
|
-
}
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* Verify TOTP code for 2FA session.
|
|
1086
|
-
*
|
|
1087
|
-
* Completes authentication and returns JWT tokens on success.
|
|
1088
|
-
*/
|
|
1089
|
-
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
1090
|
-
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
1091
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1092
|
-
url: '/cfg/totp/verify/',
|
|
1093
|
-
...options,
|
|
1094
|
-
headers: {
|
|
1095
|
-
'Content-Type': 'application/json',
|
|
1096
|
-
...options.headers
|
|
1097
|
-
}
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
/**
|
|
1102
|
-
* Verify backup recovery code for 2FA session.
|
|
1103
|
-
*
|
|
1104
|
-
* Alternative verification method when TOTP device unavailable.
|
|
1105
|
-
*/
|
|
1106
|
-
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
1107
|
-
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
1108
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1109
|
-
url: '/cfg/totp/verify/backup/',
|
|
1110
|
-
...options,
|
|
1111
|
-
headers: {
|
|
1112
|
-
'Content-Type': 'application/json',
|
|
1113
|
-
...options.headers
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
export class BackupCodes {
|
|
1120
|
-
/**
|
|
1121
|
-
* Get backup codes status for user.
|
|
1122
|
-
*/
|
|
1123
|
-
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
1124
|
-
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
1125
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1126
|
-
url: '/cfg/totp/backup-codes/',
|
|
1127
|
-
...options
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* Regenerate backup codes.
|
|
1133
|
-
*
|
|
1134
|
-
* Requires TOTP code for verification.
|
|
1135
|
-
* Invalidates all existing codes.
|
|
1136
|
-
*/
|
|
1137
|
-
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
1138
|
-
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
1139
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1140
|
-
url: '/cfg/totp/backup-codes/regenerate/',
|
|
1141
|
-
...options,
|
|
1142
|
-
headers: {
|
|
1143
|
-
'Content-Type': 'application/json',
|
|
1144
|
-
...options.headers
|
|
1145
|
-
}
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
export class TotpManagement {
|
|
1151
|
-
/**
|
|
1152
|
-
* List all TOTP devices for user.
|
|
1153
|
-
*/
|
|
1154
|
-
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
1155
|
-
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
1156
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1157
|
-
url: '/cfg/totp/devices/',
|
|
1158
|
-
...options
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
/**
|
|
1163
|
-
* Completely disable 2FA for account.
|
|
1164
|
-
*
|
|
1165
|
-
* Requires verification code.
|
|
1166
|
-
*/
|
|
1167
|
-
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
1168
|
-
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
1169
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
436
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1170
437
|
url: '/cfg/totp/disable/',
|
|
1171
438
|
...options,
|
|
1172
439
|
headers: {
|
|
@@ -1177,7 +444,7 @@ export class TotpManagement {
|
|
|
1177
444
|
}
|
|
1178
445
|
}
|
|
1179
446
|
|
|
1180
|
-
export class
|
|
447
|
+
export class CfgTotpSetup {
|
|
1181
448
|
/**
|
|
1182
449
|
* Start 2FA setup process.
|
|
1183
450
|
*
|
|
@@ -1185,7 +452,7 @@ export class TotpSetup {
|
|
|
1185
452
|
*/
|
|
1186
453
|
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
1187
454
|
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
1188
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
455
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1189
456
|
url: '/cfg/totp/setup/',
|
|
1190
457
|
...options,
|
|
1191
458
|
headers: {
|
|
@@ -1202,7 +469,7 @@ export class TotpSetup {
|
|
|
1202
469
|
*/
|
|
1203
470
|
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
1204
471
|
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
1205
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
472
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1206
473
|
url: '/cfg/totp/setup/confirm/',
|
|
1207
474
|
...options,
|
|
1208
475
|
headers: {
|
|
@@ -1213,7 +480,7 @@ export class TotpSetup {
|
|
|
1213
480
|
}
|
|
1214
481
|
}
|
|
1215
482
|
|
|
1216
|
-
export class
|
|
483
|
+
export class CfgTotpVerify {
|
|
1217
484
|
/**
|
|
1218
485
|
* Verify TOTP code for 2FA session.
|
|
1219
486
|
*
|
|
@@ -1221,7 +488,7 @@ export class TotpVerification {
|
|
|
1221
488
|
*/
|
|
1222
489
|
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
1223
490
|
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
1224
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
491
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1225
492
|
url: '/cfg/totp/verify/',
|
|
1226
493
|
...options,
|
|
1227
494
|
headers: {
|
|
@@ -1238,7 +505,7 @@ export class TotpVerification {
|
|
|
1238
505
|
*/
|
|
1239
506
|
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
1240
507
|
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
1241
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
508
|
+
security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
|
|
1242
509
|
url: '/cfg/totp/verify/backup/',
|
|
1243
510
|
...options,
|
|
1244
511
|
headers: {
|