@djangocfg/api 2.1.327 → 2.1.332
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 +328 -3553
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +328 -3553
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +744 -3036
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +35 -35
- package/dist/auth.d.ts +35 -35
- package/dist/auth.mjs +744 -3036
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +303 -3548
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +28 -2557
- package/dist/clients.d.ts +28 -2557
- package/dist/clients.mjs +303 -3548
- package/dist/clients.mjs.map +1 -1
- package/dist/index.cjs +1130 -3099
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1807 -2165
- package/dist/index.d.ts +1807 -2165
- package/dist/index.mjs +1130 -3099
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/_cfg_accounts/api.ts +67 -0
- package/src/_api/generated/{cfg_totp → _cfg_accounts}/events.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthConnectionsList.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthDisconnectCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthProvidersRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpRequestCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpVerifyCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileAvatarCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileDeleteCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdateUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsTokenRefreshCreate.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_accounts}/index.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/AccountDeleteResponse.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CentrifugoToken.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CfgUserUpdateRequest.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthCallbackRequestRequest.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthConnection.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthDisconnectRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthError.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthProvidersResponse.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthTokenResponse.ts +7 -7
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPErrorResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyResponse.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/PatchedCfgUserUpdateRequest.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/ProviderEnum.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefresh.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefreshRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/User.ts +13 -13
- package/src/_api/generated/_cfg_accounts/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_accounts/types.gen.ts +5 -0
- package/src/_api/generated/_cfg_centrifugo/api.ts +67 -0
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/events.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_centrifugo}/index.ts +6 -6
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/ConnectionTokenResponse.ts +4 -4
- package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_centrifugo/types.gen.ts +5 -0
- package/src/_api/generated/_cfg_totp/api.ts +67 -0
- package/src/_api/generated/{cfg_accounts → _cfg_totp}/events.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesDestroy.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDisableCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupConfirmCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyBackupCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/index.ts +6 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateRequest.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateResponse.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesStatus.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupResponse.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceList.ts +6 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListResponse.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListStatusEnum.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DisableRequest.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/SetupRequest.ts +11 -0
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/SetupResponse.ts +4 -4
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/TotpVerifyUser.ts +12 -12
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyBackupRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyResponse.ts +4 -4
- package/src/_api/generated/_cfg_totp/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_totp/types.gen.ts +5 -0
- package/src/_api/generated/{cfg_centrifugo/client.gen.ts → client.gen.ts} +3 -0
- package/src/_api/generated/helpers/auth.ts +223 -0
- package/src/_api/generated/{_shared → helpers}/index.ts +1 -0
- package/src/_api/generated/index.ts +22 -20
- package/src/_api/generated/{cfg_accounts/sdk.gen.ts → sdk.gen.ts} +455 -1
- package/src/_api/generated/{cfg_accounts/types.gen.ts → types.gen.ts} +607 -77
- package/src/auth/context/AccountsContext.tsx +10 -10
- package/src/auth/context/AuthContext.tsx +1 -1
- package/src/auth/hooks/useDeleteAccount.ts +2 -1
- package/src/auth/hooks/useGithubAuth.ts +3 -2
- package/src/auth/hooks/useTokenRefresh.ts +2 -1
- package/src/auth/hooks/useTwoFactor.ts +4 -3
- package/src/auth/hooks/useTwoFactorSetup.ts +3 -2
- package/src/auth/hooks/useTwoFactorStatus.ts +4 -3
- package/src/auth/middlewares/tokenRefresh.ts +2 -1
- package/src/clients.ts +3 -3
- package/src/index.ts +22 -5
- package/src/server.ts +9 -9
- package/src/_api/generated/cfg_accounts/api.ts +0 -187
- package/src/_api/generated/cfg_accounts/client.gen.ts +0 -16
- package/src/_api/generated/cfg_centrifugo/api.ts +0 -164
- package/src/_api/generated/cfg_centrifugo/client/client.gen.ts +0 -280
- package/src/_api/generated/cfg_centrifugo/client/index.ts +0 -25
- package/src/_api/generated/cfg_centrifugo/client/types.gen.ts +0 -217
- package/src/_api/generated/cfg_centrifugo/client/utils.gen.ts +0 -318
- package/src/_api/generated/cfg_centrifugo/core/auth.gen.ts +0 -41
- package/src/_api/generated/cfg_centrifugo/core/bodySerializer.gen.ts +0 -82
- package/src/_api/generated/cfg_centrifugo/core/params.gen.ts +0 -169
- package/src/_api/generated/cfg_centrifugo/core/pathSerializer.gen.ts +0 -171
- package/src/_api/generated/cfg_centrifugo/core/queryKeySerializer.gen.ts +0 -117
- package/src/_api/generated/cfg_centrifugo/core/serverSentEvents.gen.ts +0 -242
- package/src/_api/generated/cfg_centrifugo/core/types.gen.ts +0 -104
- package/src/_api/generated/cfg_centrifugo/core/utils.gen.ts +0 -140
- package/src/_api/generated/cfg_centrifugo/sdk.gen.ts +0 -64
- package/src/_api/generated/cfg_centrifugo/types.gen.ts +0 -61
- package/src/_api/generated/cfg_totp/api.ts +0 -181
- package/src/_api/generated/cfg_totp/client/client.gen.ts +0 -280
- package/src/_api/generated/cfg_totp/client/index.ts +0 -25
- package/src/_api/generated/cfg_totp/client/types.gen.ts +0 -217
- package/src/_api/generated/cfg_totp/client/utils.gen.ts +0 -318
- package/src/_api/generated/cfg_totp/client.gen.ts +0 -16
- package/src/_api/generated/cfg_totp/core/auth.gen.ts +0 -41
- package/src/_api/generated/cfg_totp/core/bodySerializer.gen.ts +0 -82
- package/src/_api/generated/cfg_totp/core/params.gen.ts +0 -169
- package/src/_api/generated/cfg_totp/core/pathSerializer.gen.ts +0 -171
- package/src/_api/generated/cfg_totp/core/queryKeySerializer.gen.ts +0 -117
- package/src/_api/generated/cfg_totp/core/serverSentEvents.gen.ts +0 -242
- package/src/_api/generated/cfg_totp/core/types.gen.ts +0 -104
- package/src/_api/generated/cfg_totp/core/utils.gen.ts +0 -140
- package/src/_api/generated/cfg_totp/schemas/SetupRequest.ts +0 -11
- package/src/_api/generated/cfg_totp/sdk.gen.ts +0 -432
- package/src/_api/generated/cfg_totp/types.gen.ts +0 -479
- /package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/client.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/index.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/types.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/utils.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/auth.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/bodySerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/params.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/pathSerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/queryKeySerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/serverSentEvents.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/types.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/utils.gen.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/errors.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/logger.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/storage.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/validation-events.ts +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
-
import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
|
|
4
|
-
import {
|
|
5
|
-
type ArraySeparatorStyle,
|
|
6
|
-
serializeArrayParam,
|
|
7
|
-
serializeObjectParam,
|
|
8
|
-
serializePrimitiveParam,
|
|
9
|
-
} from './pathSerializer.gen';
|
|
10
|
-
|
|
11
|
-
export interface PathSerializer {
|
|
12
|
-
path: Record<string, unknown>;
|
|
13
|
-
url: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
17
|
-
|
|
18
|
-
export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
|
19
|
-
let url = _url;
|
|
20
|
-
const matches = _url.match(PATH_PARAM_RE);
|
|
21
|
-
if (matches) {
|
|
22
|
-
for (const match of matches) {
|
|
23
|
-
let explode = false;
|
|
24
|
-
let name = match.substring(1, match.length - 1);
|
|
25
|
-
let style: ArraySeparatorStyle = 'simple';
|
|
26
|
-
|
|
27
|
-
if (name.endsWith('*')) {
|
|
28
|
-
explode = true;
|
|
29
|
-
name = name.substring(0, name.length - 1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (name.startsWith('.')) {
|
|
33
|
-
name = name.substring(1);
|
|
34
|
-
style = 'label';
|
|
35
|
-
} else if (name.startsWith(';')) {
|
|
36
|
-
name = name.substring(1);
|
|
37
|
-
style = 'matrix';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const value = path[name];
|
|
41
|
-
|
|
42
|
-
if (value === undefined || value === null) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (Array.isArray(value)) {
|
|
47
|
-
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (typeof value === 'object') {
|
|
52
|
-
url = url.replace(
|
|
53
|
-
match,
|
|
54
|
-
serializeObjectParam({
|
|
55
|
-
explode,
|
|
56
|
-
name,
|
|
57
|
-
style,
|
|
58
|
-
value: value as Record<string, unknown>,
|
|
59
|
-
valueOnly: true,
|
|
60
|
-
}),
|
|
61
|
-
);
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (style === 'matrix') {
|
|
66
|
-
url = url.replace(
|
|
67
|
-
match,
|
|
68
|
-
`;${serializePrimitiveParam({
|
|
69
|
-
name,
|
|
70
|
-
value: value as string,
|
|
71
|
-
})}`,
|
|
72
|
-
);
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const replaceValue = encodeURIComponent(
|
|
77
|
-
style === 'label' ? `.${value as string}` : (value as string),
|
|
78
|
-
);
|
|
79
|
-
url = url.replace(match, replaceValue);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return url;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const getUrl = ({
|
|
86
|
-
baseUrl,
|
|
87
|
-
path,
|
|
88
|
-
query,
|
|
89
|
-
querySerializer,
|
|
90
|
-
url: _url,
|
|
91
|
-
}: {
|
|
92
|
-
baseUrl?: string;
|
|
93
|
-
path?: Record<string, unknown>;
|
|
94
|
-
query?: Record<string, unknown>;
|
|
95
|
-
querySerializer: QuerySerializer;
|
|
96
|
-
url: string;
|
|
97
|
-
}) => {
|
|
98
|
-
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
99
|
-
let url = (baseUrl ?? '') + pathUrl;
|
|
100
|
-
if (path) {
|
|
101
|
-
url = defaultPathSerializer({ path, url });
|
|
102
|
-
}
|
|
103
|
-
let search = query ? querySerializer(query) : '';
|
|
104
|
-
if (search.startsWith('?')) {
|
|
105
|
-
search = search.substring(1);
|
|
106
|
-
}
|
|
107
|
-
if (search) {
|
|
108
|
-
url += `?${search}`;
|
|
109
|
-
}
|
|
110
|
-
return url;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export function getValidRequestBody(options: {
|
|
114
|
-
body?: unknown;
|
|
115
|
-
bodySerializer?: BodySerializer | null;
|
|
116
|
-
serializedBody?: unknown;
|
|
117
|
-
}) {
|
|
118
|
-
const hasBody = options.body !== undefined;
|
|
119
|
-
const isSerializedBody = hasBody && options.bodySerializer;
|
|
120
|
-
|
|
121
|
-
if (isSerializedBody) {
|
|
122
|
-
if ('serializedBody' in options) {
|
|
123
|
-
const hasSerializedBody =
|
|
124
|
-
options.serializedBody !== undefined && options.serializedBody !== '';
|
|
125
|
-
|
|
126
|
-
return hasSerializedBody ? options.serializedBody : null;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
130
|
-
return options.body !== '' ? options.body : null;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// plain/text body
|
|
134
|
-
if (hasBody) {
|
|
135
|
-
return options.body;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// no body was provided
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
-
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
-
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
export const SetupRequestSchema = z.object({
|
|
8
|
-
device_name: z.string().min(1).max(100).optional(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export type SetupRequest = z.infer<typeof SetupRequestSchema>;
|
|
@@ -1,432 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
-
import type { Client, Options as Options2, TDataShape } from './client';
|
|
4
|
-
import { client } from './client.gen';
|
|
5
|
-
import type { 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
|
-
|
|
7
|
-
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
8
|
-
/**
|
|
9
|
-
* You can provide a client instance returned by `createClient()` instead of
|
|
10
|
-
* individual options. This might be also useful if you want to implement a
|
|
11
|
-
* custom client.
|
|
12
|
-
*/
|
|
13
|
-
client?: Client;
|
|
14
|
-
/**
|
|
15
|
-
* You can pass arbitrary values through the `meta` object. This can be
|
|
16
|
-
* used to access values that aren't defined as part of the SDK function.
|
|
17
|
-
*/
|
|
18
|
-
meta?: Record<string, unknown>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export class Cfg {
|
|
22
|
-
/**
|
|
23
|
-
* Get backup codes status for user.
|
|
24
|
-
*/
|
|
25
|
-
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
26
|
-
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
27
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
28
|
-
url: '/cfg/totp/backup-codes/',
|
|
29
|
-
...options
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Regenerate backup codes.
|
|
35
|
-
*
|
|
36
|
-
* Requires TOTP code for verification.
|
|
37
|
-
* Invalidates all existing codes.
|
|
38
|
-
*/
|
|
39
|
-
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
40
|
-
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
41
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
42
|
-
url: '/cfg/totp/backup-codes/regenerate/',
|
|
43
|
-
...options,
|
|
44
|
-
headers: {
|
|
45
|
-
'Content-Type': 'application/json',
|
|
46
|
-
...options.headers
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* List all TOTP devices for user.
|
|
53
|
-
*/
|
|
54
|
-
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
55
|
-
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
56
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
57
|
-
url: '/cfg/totp/devices/',
|
|
58
|
-
...options
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Delete a TOTP device.
|
|
64
|
-
*
|
|
65
|
-
* Requires verification code if removing the last/primary device.
|
|
66
|
-
*/
|
|
67
|
-
public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>) {
|
|
68
|
-
return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
|
|
69
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
70
|
-
url: '/cfg/totp/devices/{id}/',
|
|
71
|
-
...options
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Completely disable 2FA for account.
|
|
77
|
-
*
|
|
78
|
-
* Requires verification code.
|
|
79
|
-
*/
|
|
80
|
-
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
81
|
-
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
82
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
83
|
-
url: '/cfg/totp/disable/',
|
|
84
|
-
...options,
|
|
85
|
-
headers: {
|
|
86
|
-
'Content-Type': 'application/json',
|
|
87
|
-
...options.headers
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Start 2FA setup process.
|
|
94
|
-
*
|
|
95
|
-
* Creates a new TOTP device and returns QR code for scanning.
|
|
96
|
-
*/
|
|
97
|
-
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
98
|
-
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
99
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
100
|
-
url: '/cfg/totp/setup/',
|
|
101
|
-
...options,
|
|
102
|
-
headers: {
|
|
103
|
-
'Content-Type': 'application/json',
|
|
104
|
-
...options?.headers
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Confirm 2FA setup with first valid code.
|
|
111
|
-
*
|
|
112
|
-
* Activates the device and generates backup codes.
|
|
113
|
-
*/
|
|
114
|
-
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
115
|
-
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
116
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
117
|
-
url: '/cfg/totp/setup/confirm/',
|
|
118
|
-
...options,
|
|
119
|
-
headers: {
|
|
120
|
-
'Content-Type': 'application/json',
|
|
121
|
-
...options.headers
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Verify TOTP code for 2FA session.
|
|
128
|
-
*
|
|
129
|
-
* Completes authentication and returns JWT tokens on success.
|
|
130
|
-
*/
|
|
131
|
-
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
132
|
-
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
133
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
134
|
-
url: '/cfg/totp/verify/',
|
|
135
|
-
...options,
|
|
136
|
-
headers: {
|
|
137
|
-
'Content-Type': 'application/json',
|
|
138
|
-
...options.headers
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Verify backup recovery code for 2FA session.
|
|
145
|
-
*
|
|
146
|
-
* Alternative verification method when TOTP device unavailable.
|
|
147
|
-
*/
|
|
148
|
-
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
149
|
-
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
150
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
151
|
-
url: '/cfg/totp/verify/backup/',
|
|
152
|
-
...options,
|
|
153
|
-
headers: {
|
|
154
|
-
'Content-Type': 'application/json',
|
|
155
|
-
...options.headers
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export class Totp {
|
|
162
|
-
/**
|
|
163
|
-
* Get backup codes status for user.
|
|
164
|
-
*/
|
|
165
|
-
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
166
|
-
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
167
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
168
|
-
url: '/cfg/totp/backup-codes/',
|
|
169
|
-
...options
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Regenerate backup codes.
|
|
175
|
-
*
|
|
176
|
-
* Requires TOTP code for verification.
|
|
177
|
-
* Invalidates all existing codes.
|
|
178
|
-
*/
|
|
179
|
-
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
180
|
-
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
181
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
182
|
-
url: '/cfg/totp/backup-codes/regenerate/',
|
|
183
|
-
...options,
|
|
184
|
-
headers: {
|
|
185
|
-
'Content-Type': 'application/json',
|
|
186
|
-
...options.headers
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* List all TOTP devices for user.
|
|
193
|
-
*/
|
|
194
|
-
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
195
|
-
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
196
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
197
|
-
url: '/cfg/totp/devices/',
|
|
198
|
-
...options
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Delete a TOTP device.
|
|
204
|
-
*
|
|
205
|
-
* Requires verification code if removing the last/primary device.
|
|
206
|
-
*/
|
|
207
|
-
public static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>) {
|
|
208
|
-
return (options.client ?? client).delete<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError>({
|
|
209
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
210
|
-
url: '/cfg/totp/devices/{id}/',
|
|
211
|
-
...options
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Completely disable 2FA for account.
|
|
217
|
-
*
|
|
218
|
-
* Requires verification code.
|
|
219
|
-
*/
|
|
220
|
-
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
221
|
-
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
222
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
223
|
-
url: '/cfg/totp/disable/',
|
|
224
|
-
...options,
|
|
225
|
-
headers: {
|
|
226
|
-
'Content-Type': 'application/json',
|
|
227
|
-
...options.headers
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Start 2FA setup process.
|
|
234
|
-
*
|
|
235
|
-
* Creates a new TOTP device and returns QR code for scanning.
|
|
236
|
-
*/
|
|
237
|
-
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
238
|
-
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
239
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
240
|
-
url: '/cfg/totp/setup/',
|
|
241
|
-
...options,
|
|
242
|
-
headers: {
|
|
243
|
-
'Content-Type': 'application/json',
|
|
244
|
-
...options?.headers
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Confirm 2FA setup with first valid code.
|
|
251
|
-
*
|
|
252
|
-
* Activates the device and generates backup codes.
|
|
253
|
-
*/
|
|
254
|
-
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
255
|
-
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
256
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
257
|
-
url: '/cfg/totp/setup/confirm/',
|
|
258
|
-
...options,
|
|
259
|
-
headers: {
|
|
260
|
-
'Content-Type': 'application/json',
|
|
261
|
-
...options.headers
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Verify TOTP code for 2FA session.
|
|
268
|
-
*
|
|
269
|
-
* Completes authentication and returns JWT tokens on success.
|
|
270
|
-
*/
|
|
271
|
-
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
272
|
-
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
273
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
274
|
-
url: '/cfg/totp/verify/',
|
|
275
|
-
...options,
|
|
276
|
-
headers: {
|
|
277
|
-
'Content-Type': 'application/json',
|
|
278
|
-
...options.headers
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Verify backup recovery code for 2FA session.
|
|
285
|
-
*
|
|
286
|
-
* Alternative verification method when TOTP device unavailable.
|
|
287
|
-
*/
|
|
288
|
-
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
289
|
-
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
290
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
291
|
-
url: '/cfg/totp/verify/backup/',
|
|
292
|
-
...options,
|
|
293
|
-
headers: {
|
|
294
|
-
'Content-Type': 'application/json',
|
|
295
|
-
...options.headers
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export class BackupCodes {
|
|
302
|
-
/**
|
|
303
|
-
* Get backup codes status for user.
|
|
304
|
-
*/
|
|
305
|
-
public static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>) {
|
|
306
|
-
return (options?.client ?? client).get<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError>({
|
|
307
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
308
|
-
url: '/cfg/totp/backup-codes/',
|
|
309
|
-
...options
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Regenerate backup codes.
|
|
315
|
-
*
|
|
316
|
-
* Requires TOTP code for verification.
|
|
317
|
-
* Invalidates all existing codes.
|
|
318
|
-
*/
|
|
319
|
-
public static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>) {
|
|
320
|
-
return (options.client ?? client).post<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError>({
|
|
321
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
322
|
-
url: '/cfg/totp/backup-codes/regenerate/',
|
|
323
|
-
...options,
|
|
324
|
-
headers: {
|
|
325
|
-
'Content-Type': 'application/json',
|
|
326
|
-
...options.headers
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export class TotpManagement {
|
|
333
|
-
/**
|
|
334
|
-
* List all TOTP devices for user.
|
|
335
|
-
*/
|
|
336
|
-
public static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>) {
|
|
337
|
-
return (options?.client ?? client).get<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError>({
|
|
338
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
339
|
-
url: '/cfg/totp/devices/',
|
|
340
|
-
...options
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Completely disable 2FA for account.
|
|
346
|
-
*
|
|
347
|
-
* Requires verification code.
|
|
348
|
-
*/
|
|
349
|
-
public static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>) {
|
|
350
|
-
return (options.client ?? client).post<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError>({
|
|
351
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
352
|
-
url: '/cfg/totp/disable/',
|
|
353
|
-
...options,
|
|
354
|
-
headers: {
|
|
355
|
-
'Content-Type': 'application/json',
|
|
356
|
-
...options.headers
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export class TotpSetup {
|
|
363
|
-
/**
|
|
364
|
-
* Start 2FA setup process.
|
|
365
|
-
*
|
|
366
|
-
* Creates a new TOTP device and returns QR code for scanning.
|
|
367
|
-
*/
|
|
368
|
-
public static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>) {
|
|
369
|
-
return (options?.client ?? client).post<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError>({
|
|
370
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
371
|
-
url: '/cfg/totp/setup/',
|
|
372
|
-
...options,
|
|
373
|
-
headers: {
|
|
374
|
-
'Content-Type': 'application/json',
|
|
375
|
-
...options?.headers
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Confirm 2FA setup with first valid code.
|
|
382
|
-
*
|
|
383
|
-
* Activates the device and generates backup codes.
|
|
384
|
-
*/
|
|
385
|
-
public static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>) {
|
|
386
|
-
return (options.client ?? client).post<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError>({
|
|
387
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
388
|
-
url: '/cfg/totp/setup/confirm/',
|
|
389
|
-
...options,
|
|
390
|
-
headers: {
|
|
391
|
-
'Content-Type': 'application/json',
|
|
392
|
-
...options.headers
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export class TotpVerification {
|
|
399
|
-
/**
|
|
400
|
-
* Verify TOTP code for 2FA session.
|
|
401
|
-
*
|
|
402
|
-
* Completes authentication and returns JWT tokens on success.
|
|
403
|
-
*/
|
|
404
|
-
public static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>) {
|
|
405
|
-
return (options.client ?? client).post<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError>({
|
|
406
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
407
|
-
url: '/cfg/totp/verify/',
|
|
408
|
-
...options,
|
|
409
|
-
headers: {
|
|
410
|
-
'Content-Type': 'application/json',
|
|
411
|
-
...options.headers
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Verify backup recovery code for 2FA session.
|
|
418
|
-
*
|
|
419
|
-
* Alternative verification method when TOTP device unavailable.
|
|
420
|
-
*/
|
|
421
|
-
public static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>) {
|
|
422
|
-
return (options.client ?? client).post<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError>({
|
|
423
|
-
security: [{ scheme: 'bearer', type: 'http' }],
|
|
424
|
-
url: '/cfg/totp/verify/backup/',
|
|
425
|
-
...options,
|
|
426
|
-
headers: {
|
|
427
|
-
'Content-Type': 'application/json',
|
|
428
|
-
...options.headers
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|