@djangocfg/api 2.1.356 → 2.1.358
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
- package/src/lib/env.ts +10 -0
package/dist/clients.d.ts
CHANGED
|
@@ -49,6 +49,1682 @@ declare class APILogger {
|
|
|
49
49
|
withTag(tag: string): ConsolaInstance;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
type AuthToken = string | undefined;
|
|
53
|
+
interface Auth {
|
|
54
|
+
/**
|
|
55
|
+
* Which part of the request do we use to send the auth?
|
|
56
|
+
*
|
|
57
|
+
* @default 'header'
|
|
58
|
+
*/
|
|
59
|
+
in?: 'header' | 'query' | 'cookie';
|
|
60
|
+
/**
|
|
61
|
+
* Header or query parameter name.
|
|
62
|
+
*
|
|
63
|
+
* @default 'Authorization'
|
|
64
|
+
*/
|
|
65
|
+
name?: string;
|
|
66
|
+
scheme?: 'basic' | 'bearer';
|
|
67
|
+
type: 'apiKey' | 'http';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface SerializerOptions<T> {
|
|
71
|
+
/**
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
explode: boolean;
|
|
75
|
+
style: T;
|
|
76
|
+
}
|
|
77
|
+
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
78
|
+
type ObjectStyle = 'form' | 'deepObject';
|
|
79
|
+
|
|
80
|
+
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
81
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
82
|
+
type QuerySerializerOptionsObject = {
|
|
83
|
+
allowReserved?: boolean;
|
|
84
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
85
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
86
|
+
};
|
|
87
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
88
|
+
/**
|
|
89
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
90
|
+
* override the global array/object settings for specific parameter names.
|
|
91
|
+
*/
|
|
92
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
96
|
+
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
97
|
+
/**
|
|
98
|
+
* Returns the final request URL.
|
|
99
|
+
*/
|
|
100
|
+
buildUrl: BuildUrlFn;
|
|
101
|
+
getConfig: () => Config;
|
|
102
|
+
request: RequestFn;
|
|
103
|
+
setConfig: (config: Config) => Config;
|
|
104
|
+
} & {
|
|
105
|
+
[K in HttpMethod]: MethodFn;
|
|
106
|
+
} & ([SseFn] extends [never] ? {
|
|
107
|
+
sse?: never;
|
|
108
|
+
} : {
|
|
109
|
+
sse: {
|
|
110
|
+
[K in HttpMethod]: SseFn;
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
interface Config$1 {
|
|
114
|
+
/**
|
|
115
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
116
|
+
* added to the request payload as defined by its `security` array.
|
|
117
|
+
*/
|
|
118
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
119
|
+
/**
|
|
120
|
+
* A function for serializing request body parameter. By default,
|
|
121
|
+
* {@link JSON.stringify()} will be used.
|
|
122
|
+
*/
|
|
123
|
+
bodySerializer?: BodySerializer | null;
|
|
124
|
+
/**
|
|
125
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
126
|
+
* `Headers` object with.
|
|
127
|
+
*
|
|
128
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
129
|
+
*/
|
|
130
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
131
|
+
/**
|
|
132
|
+
* The request method.
|
|
133
|
+
*
|
|
134
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
135
|
+
*/
|
|
136
|
+
method?: Uppercase<HttpMethod>;
|
|
137
|
+
/**
|
|
138
|
+
* A function for serializing request query parameters. By default, arrays
|
|
139
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
140
|
+
* style, and reserved characters are percent-encoded.
|
|
141
|
+
*
|
|
142
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
143
|
+
* API function is used.
|
|
144
|
+
*
|
|
145
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
146
|
+
*/
|
|
147
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
148
|
+
/**
|
|
149
|
+
* A function validating request data. This is useful if you want to ensure
|
|
150
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
151
|
+
* the server.
|
|
152
|
+
*/
|
|
153
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
154
|
+
/**
|
|
155
|
+
* A function transforming response data before it's returned. This is useful
|
|
156
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
157
|
+
*/
|
|
158
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* A function validating response data. This is useful if you want to ensure
|
|
161
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
162
|
+
* the transformers and returned to the user.
|
|
163
|
+
*/
|
|
164
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
168
|
+
/**
|
|
169
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
170
|
+
* fetch instance.
|
|
171
|
+
*
|
|
172
|
+
* @default globalThis.fetch
|
|
173
|
+
*/
|
|
174
|
+
fetch?: typeof fetch;
|
|
175
|
+
/**
|
|
176
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
177
|
+
*/
|
|
178
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
179
|
+
/**
|
|
180
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
181
|
+
*
|
|
182
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
183
|
+
*
|
|
184
|
+
* @param error The error that occurred.
|
|
185
|
+
*/
|
|
186
|
+
onSseError?: (error: unknown) => void;
|
|
187
|
+
/**
|
|
188
|
+
* Callback invoked when an event is streamed from the server.
|
|
189
|
+
*
|
|
190
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
191
|
+
*
|
|
192
|
+
* @param event Event streamed from the server.
|
|
193
|
+
* @returns Nothing (void).
|
|
194
|
+
*/
|
|
195
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
196
|
+
serializedBody?: RequestInit['body'];
|
|
197
|
+
/**
|
|
198
|
+
* Default retry delay in milliseconds.
|
|
199
|
+
*
|
|
200
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
201
|
+
*
|
|
202
|
+
* @default 3000
|
|
203
|
+
*/
|
|
204
|
+
sseDefaultRetryDelay?: number;
|
|
205
|
+
/**
|
|
206
|
+
* Maximum number of retry attempts before giving up.
|
|
207
|
+
*/
|
|
208
|
+
sseMaxRetryAttempts?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Maximum retry delay in milliseconds.
|
|
211
|
+
*
|
|
212
|
+
* Applies only when exponential backoff is used.
|
|
213
|
+
*
|
|
214
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
215
|
+
*
|
|
216
|
+
* @default 30000
|
|
217
|
+
*/
|
|
218
|
+
sseMaxRetryDelay?: number;
|
|
219
|
+
/**
|
|
220
|
+
* Optional sleep function for retry backoff.
|
|
221
|
+
*
|
|
222
|
+
* Defaults to using `setTimeout`.
|
|
223
|
+
*/
|
|
224
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
225
|
+
url: string;
|
|
226
|
+
};
|
|
227
|
+
interface StreamEvent<TData = unknown> {
|
|
228
|
+
data: TData;
|
|
229
|
+
event?: string;
|
|
230
|
+
id?: string;
|
|
231
|
+
retry?: number;
|
|
232
|
+
}
|
|
233
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
234
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
238
|
+
/** response may be undefined due to a network error where no response object is produced */
|
|
239
|
+
response: Res | undefined,
|
|
240
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
241
|
+
request: Req | undefined, options: Options) => Err | Promise<Err>;
|
|
242
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
243
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
244
|
+
declare class Interceptors<Interceptor> {
|
|
245
|
+
fns: Array<Interceptor | null>;
|
|
246
|
+
clear(): void;
|
|
247
|
+
eject(id: number | Interceptor): void;
|
|
248
|
+
exists(id: number | Interceptor): boolean;
|
|
249
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
250
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
251
|
+
use(fn: Interceptor): number;
|
|
252
|
+
}
|
|
253
|
+
interface Middleware<Req, Res, Err, Options> {
|
|
254
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
255
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
256
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
type ResponseStyle = 'data' | 'fields';
|
|
260
|
+
interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
|
|
261
|
+
/**
|
|
262
|
+
* Base URL for all requests made by this client.
|
|
263
|
+
*/
|
|
264
|
+
baseUrl?: T['baseUrl'];
|
|
265
|
+
/**
|
|
266
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
267
|
+
* fetch instance.
|
|
268
|
+
*
|
|
269
|
+
* @default globalThis.fetch
|
|
270
|
+
*/
|
|
271
|
+
fetch?: typeof fetch;
|
|
272
|
+
/**
|
|
273
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
274
|
+
* options won't have any effect.
|
|
275
|
+
*
|
|
276
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
277
|
+
*/
|
|
278
|
+
next?: never;
|
|
279
|
+
/**
|
|
280
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
281
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
282
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
283
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
284
|
+
*
|
|
285
|
+
* @default 'auto'
|
|
286
|
+
*/
|
|
287
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
288
|
+
/**
|
|
289
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
290
|
+
*
|
|
291
|
+
* @default 'fields'
|
|
292
|
+
*/
|
|
293
|
+
responseStyle?: ResponseStyle;
|
|
294
|
+
/**
|
|
295
|
+
* Throw an error instead of returning it in the response?
|
|
296
|
+
*
|
|
297
|
+
* @default false
|
|
298
|
+
*/
|
|
299
|
+
throwOnError?: T['throwOnError'];
|
|
300
|
+
}
|
|
301
|
+
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
302
|
+
responseStyle: TResponseStyle;
|
|
303
|
+
throwOnError: ThrowOnError;
|
|
304
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
305
|
+
/**
|
|
306
|
+
* Any body that you want to add to your request.
|
|
307
|
+
*
|
|
308
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
309
|
+
*/
|
|
310
|
+
body?: unknown;
|
|
311
|
+
path?: Record<string, unknown>;
|
|
312
|
+
query?: Record<string, unknown>;
|
|
313
|
+
/**
|
|
314
|
+
* Security mechanism(s) to use for the request.
|
|
315
|
+
*/
|
|
316
|
+
security?: ReadonlyArray<Auth>;
|
|
317
|
+
url: Url;
|
|
318
|
+
}
|
|
319
|
+
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
320
|
+
headers: Headers;
|
|
321
|
+
serializedBody?: string;
|
|
322
|
+
}
|
|
323
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
324
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
325
|
+
request: Request;
|
|
326
|
+
response: Response;
|
|
327
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
328
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
329
|
+
error: undefined;
|
|
330
|
+
} | {
|
|
331
|
+
data: undefined;
|
|
332
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
333
|
+
}) & {
|
|
334
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
335
|
+
request?: Request;
|
|
336
|
+
/** response may be undefined, because error may be from building the request object itself or from a network error */
|
|
337
|
+
response?: Response;
|
|
338
|
+
}>;
|
|
339
|
+
interface ClientOptions {
|
|
340
|
+
baseUrl?: string;
|
|
341
|
+
responseStyle?: ResponseStyle;
|
|
342
|
+
throwOnError?: boolean;
|
|
343
|
+
}
|
|
344
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
345
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
346
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
347
|
+
type BuildUrlFn = <TData extends {
|
|
348
|
+
body?: unknown;
|
|
349
|
+
path?: Record<string, unknown>;
|
|
350
|
+
query?: Record<string, unknown>;
|
|
351
|
+
url: string;
|
|
352
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
353
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
354
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
355
|
+
};
|
|
356
|
+
interface TDataShape {
|
|
357
|
+
body?: unknown;
|
|
358
|
+
headers?: unknown;
|
|
359
|
+
path?: unknown;
|
|
360
|
+
query?: unknown;
|
|
361
|
+
url: string;
|
|
362
|
+
}
|
|
363
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
364
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Serializer for API key response (masked).
|
|
368
|
+
*/
|
|
369
|
+
type ApiKey = {
|
|
370
|
+
/**
|
|
371
|
+
* Masked API key
|
|
372
|
+
*/
|
|
373
|
+
key: string;
|
|
374
|
+
/**
|
|
375
|
+
* When the key was last regenerated
|
|
376
|
+
*/
|
|
377
|
+
reissued_at: string | null;
|
|
378
|
+
/**
|
|
379
|
+
* When the key was created
|
|
380
|
+
*/
|
|
381
|
+
created_at: string;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Serializer for API key regeneration response (full key shown once).
|
|
385
|
+
*/
|
|
386
|
+
type ApiKeyRegenerate = {
|
|
387
|
+
/**
|
|
388
|
+
* New API key (shown only once)
|
|
389
|
+
*/
|
|
390
|
+
key: string;
|
|
391
|
+
/**
|
|
392
|
+
* When the key was regenerated
|
|
393
|
+
*/
|
|
394
|
+
reissued_at: string;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Serializer for API key response (masked).
|
|
398
|
+
*/
|
|
399
|
+
type ApiKeyRequest = {
|
|
400
|
+
/**
|
|
401
|
+
* Masked API key
|
|
402
|
+
*/
|
|
403
|
+
key: string;
|
|
404
|
+
/**
|
|
405
|
+
* When the key was last regenerated
|
|
406
|
+
*/
|
|
407
|
+
reissued_at: string | null;
|
|
408
|
+
/**
|
|
409
|
+
* When the key was created
|
|
410
|
+
*/
|
|
411
|
+
created_at: string;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Serializer for testing an API key.
|
|
415
|
+
*/
|
|
416
|
+
type ApiKeyTestRequest = {
|
|
417
|
+
/**
|
|
418
|
+
* API key to test
|
|
419
|
+
*/
|
|
420
|
+
key: string;
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Serializer for API key test result.
|
|
424
|
+
*/
|
|
425
|
+
type ApiKeyTestResult = {
|
|
426
|
+
/**
|
|
427
|
+
* Whether the key is valid
|
|
428
|
+
*/
|
|
429
|
+
valid: boolean;
|
|
430
|
+
/**
|
|
431
|
+
* User ID if valid, null otherwise
|
|
432
|
+
*/
|
|
433
|
+
user_id: string | null;
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* Response serializer for account deletion.
|
|
437
|
+
*/
|
|
438
|
+
type AccountDeleteResponse = {
|
|
439
|
+
/**
|
|
440
|
+
* Whether the account was successfully deleted
|
|
441
|
+
*/
|
|
442
|
+
success: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Human-readable message about the deletion
|
|
445
|
+
*/
|
|
446
|
+
message: string;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* Serializer for regenerating backup codes.
|
|
450
|
+
*/
|
|
451
|
+
type BackupCodesRegenerateRequest = {
|
|
452
|
+
/**
|
|
453
|
+
* TOTP code for verification
|
|
454
|
+
*/
|
|
455
|
+
code: string;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Response serializer for backup codes regeneration.
|
|
459
|
+
*/
|
|
460
|
+
type BackupCodesRegenerateResponse = {
|
|
461
|
+
/**
|
|
462
|
+
* List of new backup codes (save these!)
|
|
463
|
+
*/
|
|
464
|
+
backup_codes: Array<string>;
|
|
465
|
+
/**
|
|
466
|
+
* Warning about previous codes being invalidated
|
|
467
|
+
*/
|
|
468
|
+
warning: string;
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* Serializer for backup codes status.
|
|
472
|
+
*/
|
|
473
|
+
type BackupCodesStatus = {
|
|
474
|
+
/**
|
|
475
|
+
* Number of unused backup codes
|
|
476
|
+
*/
|
|
477
|
+
remaining_count: number;
|
|
478
|
+
/**
|
|
479
|
+
* Total number of codes generated
|
|
480
|
+
*/
|
|
481
|
+
total_generated: number;
|
|
482
|
+
/**
|
|
483
|
+
* Warning if running low on codes
|
|
484
|
+
*/
|
|
485
|
+
warning?: string | null;
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* Nested serializer for Centrifugo WebSocket connection token.
|
|
489
|
+
*/
|
|
490
|
+
type CentrifugoToken = {
|
|
491
|
+
/**
|
|
492
|
+
* JWT token for Centrifugo WebSocket connection
|
|
493
|
+
*/
|
|
494
|
+
token: string;
|
|
495
|
+
/**
|
|
496
|
+
* Centrifugo WebSocket URL
|
|
497
|
+
*/
|
|
498
|
+
centrifugo_url: string;
|
|
499
|
+
/**
|
|
500
|
+
* Token expiration time (ISO 8601)
|
|
501
|
+
*/
|
|
502
|
+
expires_at: string;
|
|
503
|
+
/**
|
|
504
|
+
* List of allowed channels for this user
|
|
505
|
+
*/
|
|
506
|
+
channels: Array<string>;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Serializer for updating user profile.
|
|
510
|
+
*/
|
|
511
|
+
type CfgUserUpdateRequest = {
|
|
512
|
+
first_name?: string;
|
|
513
|
+
last_name?: string;
|
|
514
|
+
company?: string;
|
|
515
|
+
phone?: string;
|
|
516
|
+
position?: string;
|
|
517
|
+
language?: string;
|
|
518
|
+
/**
|
|
519
|
+
* IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
|
|
520
|
+
*/
|
|
521
|
+
timezone?: string;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* Serializer for confirming 2FA setup with first code.
|
|
525
|
+
*/
|
|
526
|
+
type ConfirmSetupRequest = {
|
|
527
|
+
/**
|
|
528
|
+
* Device ID from setup response
|
|
529
|
+
*/
|
|
530
|
+
device_id: string;
|
|
531
|
+
/**
|
|
532
|
+
* 6-digit TOTP code from authenticator app
|
|
533
|
+
*/
|
|
534
|
+
code: string;
|
|
535
|
+
};
|
|
536
|
+
/**
|
|
537
|
+
* Response serializer for setup confirmation.
|
|
538
|
+
*/
|
|
539
|
+
type ConfirmSetupResponse = {
|
|
540
|
+
message: string;
|
|
541
|
+
/**
|
|
542
|
+
* List of backup recovery codes (save these!)
|
|
543
|
+
*/
|
|
544
|
+
backup_codes: Array<string>;
|
|
545
|
+
/**
|
|
546
|
+
* Warning message about backup codes
|
|
547
|
+
*/
|
|
548
|
+
backup_codes_warning: string;
|
|
549
|
+
};
|
|
550
|
+
/**
|
|
551
|
+
* ConnectionTokenResponse
|
|
552
|
+
*
|
|
553
|
+
* Response model for Centrifugo connection token.
|
|
554
|
+
*/
|
|
555
|
+
type ConnectionTokenResponse = {
|
|
556
|
+
/**
|
|
557
|
+
* Token
|
|
558
|
+
*
|
|
559
|
+
* JWT token for Centrifugo connection
|
|
560
|
+
*/
|
|
561
|
+
token: string;
|
|
562
|
+
/**
|
|
563
|
+
* Centrifugo Url
|
|
564
|
+
*
|
|
565
|
+
* Centrifugo WebSocket URL
|
|
566
|
+
*/
|
|
567
|
+
centrifugo_url: string;
|
|
568
|
+
/**
|
|
569
|
+
* Expires At
|
|
570
|
+
*
|
|
571
|
+
* Token expiration time (ISO 8601)
|
|
572
|
+
*/
|
|
573
|
+
expires_at: string;
|
|
574
|
+
/**
|
|
575
|
+
* Channels
|
|
576
|
+
*
|
|
577
|
+
* List of allowed channels
|
|
578
|
+
*/
|
|
579
|
+
channels: Array<string>;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Serializer for listing TOTP devices.
|
|
583
|
+
*/
|
|
584
|
+
type DeviceList = {
|
|
585
|
+
readonly id: string;
|
|
586
|
+
/**
|
|
587
|
+
* Device name for identification
|
|
588
|
+
*/
|
|
589
|
+
readonly name: string;
|
|
590
|
+
/**
|
|
591
|
+
* Primary device used for verification
|
|
592
|
+
*/
|
|
593
|
+
readonly is_primary: boolean;
|
|
594
|
+
readonly status: DeviceStatusEnum;
|
|
595
|
+
readonly created_at: string;
|
|
596
|
+
/**
|
|
597
|
+
* When device setup was confirmed
|
|
598
|
+
*/
|
|
599
|
+
readonly confirmed_at: string | null;
|
|
600
|
+
/**
|
|
601
|
+
* Last successful verification
|
|
602
|
+
*/
|
|
603
|
+
readonly last_used_at: string | null;
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* Response serializer for device list endpoint.
|
|
607
|
+
*/
|
|
608
|
+
type DeviceListResponse = {
|
|
609
|
+
devices: Array<DeviceList>;
|
|
610
|
+
has_2fa_enabled: boolean;
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* * `pending` - Pending Confirmation
|
|
614
|
+
* * `active` - Active
|
|
615
|
+
* * `disabled` - Disabled
|
|
616
|
+
*/
|
|
617
|
+
declare enum DeviceStatusEnum {
|
|
618
|
+
PENDING = "pending",
|
|
619
|
+
ACTIVE = "active",
|
|
620
|
+
DISABLED = "disabled"
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Serializer for completely disabling 2FA.
|
|
624
|
+
*/
|
|
625
|
+
type DisableRequest = {
|
|
626
|
+
/**
|
|
627
|
+
* TOTP code for verification
|
|
628
|
+
*/
|
|
629
|
+
code: string;
|
|
630
|
+
};
|
|
631
|
+
/**
|
|
632
|
+
* Request to start OAuth flow.
|
|
633
|
+
*/
|
|
634
|
+
type OAuthAuthorizeRequestRequest = {
|
|
635
|
+
/**
|
|
636
|
+
* URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path
|
|
637
|
+
*/
|
|
638
|
+
redirect_uri?: string;
|
|
639
|
+
/**
|
|
640
|
+
* Optional source URL for registration tracking
|
|
641
|
+
*/
|
|
642
|
+
source_url?: string;
|
|
643
|
+
};
|
|
644
|
+
/**
|
|
645
|
+
* Response with OAuth authorization URL.
|
|
646
|
+
*/
|
|
647
|
+
type OAuthAuthorizeResponse = {
|
|
648
|
+
/**
|
|
649
|
+
* Full URL to redirect user to OAuth provider
|
|
650
|
+
*/
|
|
651
|
+
authorization_url: string;
|
|
652
|
+
/**
|
|
653
|
+
* State token for CSRF protection. Store this and verify on callback.
|
|
654
|
+
*/
|
|
655
|
+
state: string;
|
|
656
|
+
};
|
|
657
|
+
/**
|
|
658
|
+
* Request to complete OAuth flow (callback handler).
|
|
659
|
+
*/
|
|
660
|
+
type OAuthCallbackRequestRequest = {
|
|
661
|
+
/**
|
|
662
|
+
* Authorization code from OAuth provider callback
|
|
663
|
+
*/
|
|
664
|
+
code: string;
|
|
665
|
+
/**
|
|
666
|
+
* State token for CSRF verification (from authorize response)
|
|
667
|
+
*/
|
|
668
|
+
state: string;
|
|
669
|
+
/**
|
|
670
|
+
* Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path
|
|
671
|
+
*/
|
|
672
|
+
redirect_uri?: string;
|
|
673
|
+
};
|
|
674
|
+
/**
|
|
675
|
+
* Serializer for OAuth connection info (user-facing).
|
|
676
|
+
*/
|
|
677
|
+
type OAuthConnection = {
|
|
678
|
+
readonly id: number;
|
|
679
|
+
/**
|
|
680
|
+
* OAuth provider name (github, google, etc.)
|
|
681
|
+
*
|
|
682
|
+
* * `github` - GitHub
|
|
683
|
+
*/
|
|
684
|
+
readonly provider: OAuthProviderEnum;
|
|
685
|
+
readonly provider_display: string;
|
|
686
|
+
/**
|
|
687
|
+
* Username on the OAuth provider platform
|
|
688
|
+
*/
|
|
689
|
+
readonly provider_username: string;
|
|
690
|
+
/**
|
|
691
|
+
* Email from OAuth provider (may differ from user.email)
|
|
692
|
+
*/
|
|
693
|
+
readonly provider_email: string;
|
|
694
|
+
/**
|
|
695
|
+
* Avatar URL from OAuth provider
|
|
696
|
+
*/
|
|
697
|
+
readonly provider_avatar_url: string;
|
|
698
|
+
/**
|
|
699
|
+
* When this OAuth connection was created
|
|
700
|
+
*/
|
|
701
|
+
readonly connected_at: string;
|
|
702
|
+
/**
|
|
703
|
+
* Last time this OAuth connection was used for login
|
|
704
|
+
*/
|
|
705
|
+
readonly last_login_at: string;
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* Request to disconnect OAuth provider.
|
|
709
|
+
*/
|
|
710
|
+
type OAuthDisconnectRequestRequest = {
|
|
711
|
+
/**
|
|
712
|
+
* OAuth provider to disconnect
|
|
713
|
+
*
|
|
714
|
+
* * `github` - GitHub
|
|
715
|
+
*/
|
|
716
|
+
provider: OAuthProviderEnum;
|
|
717
|
+
};
|
|
718
|
+
/**
|
|
719
|
+
* Error response for OAuth endpoints.
|
|
720
|
+
*/
|
|
721
|
+
type OAuthError = {
|
|
722
|
+
/**
|
|
723
|
+
* Error code
|
|
724
|
+
*/
|
|
725
|
+
error: string;
|
|
726
|
+
/**
|
|
727
|
+
* Human-readable error description
|
|
728
|
+
*/
|
|
729
|
+
error_description?: string;
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* * `github` - GitHub
|
|
733
|
+
*/
|
|
734
|
+
declare enum OAuthProviderEnum {
|
|
735
|
+
GITHUB = "github"
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Response with available OAuth providers.
|
|
739
|
+
*/
|
|
740
|
+
type OAuthProvidersResponse = {
|
|
741
|
+
/**
|
|
742
|
+
* List of available OAuth providers
|
|
743
|
+
*/
|
|
744
|
+
providers: Array<{
|
|
745
|
+
[key: string]: unknown;
|
|
746
|
+
}>;
|
|
747
|
+
};
|
|
748
|
+
/**
|
|
749
|
+
* Response with JWT tokens after OAuth authentication.
|
|
750
|
+
*
|
|
751
|
+
* When 2FA is required:
|
|
752
|
+
* - requires_2fa: True
|
|
753
|
+
* - session_id: UUID of 2FA verification session
|
|
754
|
+
* - access/refresh/user: null
|
|
755
|
+
*
|
|
756
|
+
* When 2FA is not required:
|
|
757
|
+
* - requires_2fa: False
|
|
758
|
+
* - session_id: null
|
|
759
|
+
* - access/refresh/user: populated
|
|
760
|
+
*/
|
|
761
|
+
type OAuthTokenResponse = {
|
|
762
|
+
/**
|
|
763
|
+
* True if 2FA verification is required
|
|
764
|
+
*/
|
|
765
|
+
requires_2fa?: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* 2FA session ID (only when requires_2fa=True)
|
|
768
|
+
*/
|
|
769
|
+
session_id?: string | null;
|
|
770
|
+
/**
|
|
771
|
+
* JWT access token (null when requires_2fa=True)
|
|
772
|
+
*/
|
|
773
|
+
access?: string | null;
|
|
774
|
+
/**
|
|
775
|
+
* JWT refresh token (null when requires_2fa=True)
|
|
776
|
+
*/
|
|
777
|
+
refresh?: string | null;
|
|
778
|
+
/**
|
|
779
|
+
* Authenticated user info (null when requires_2fa=True)
|
|
780
|
+
*/
|
|
781
|
+
user?: {
|
|
782
|
+
[key: string]: unknown;
|
|
783
|
+
} | null;
|
|
784
|
+
/**
|
|
785
|
+
* True if a new user was created during this OAuth flow
|
|
786
|
+
*/
|
|
787
|
+
is_new_user: boolean;
|
|
788
|
+
/**
|
|
789
|
+
* True if a new OAuth connection was created
|
|
790
|
+
*/
|
|
791
|
+
is_new_connection: boolean;
|
|
792
|
+
/**
|
|
793
|
+
* True if user should be prompted to enable 2FA
|
|
794
|
+
*/
|
|
795
|
+
should_prompt_2fa?: boolean;
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* Typed error response for OTP operations.
|
|
799
|
+
*
|
|
800
|
+
* error_code values:
|
|
801
|
+
* - invalid_identifier — malformed email
|
|
802
|
+
* - cooldown — too soon after last request (retry_after = seconds)
|
|
803
|
+
* - hourly_limit — hourly quota exceeded (retry_after = seconds until reset)
|
|
804
|
+
* - daily_limit — daily quota exceeded (retry_after = seconds until reset)
|
|
805
|
+
* - rate_limited — IP-level rate limit hit (no retry_after)
|
|
806
|
+
* - user_creation_failed — internal error creating account
|
|
807
|
+
* - send_failed — transport error (email / SMS)
|
|
808
|
+
* - internal_error — unexpected server error
|
|
809
|
+
*/
|
|
810
|
+
type OtpErrorResponse = {
|
|
811
|
+
/**
|
|
812
|
+
* Human-readable error message
|
|
813
|
+
*/
|
|
814
|
+
error: string;
|
|
815
|
+
/**
|
|
816
|
+
* Machine-readable error code
|
|
817
|
+
*/
|
|
818
|
+
error_code?: string | null;
|
|
819
|
+
/**
|
|
820
|
+
* Seconds until the client may retry (present only for rate-limit errors)
|
|
821
|
+
*/
|
|
822
|
+
retry_after?: number | null;
|
|
823
|
+
};
|
|
824
|
+
/**
|
|
825
|
+
* Serializer for OTP request.
|
|
826
|
+
*/
|
|
827
|
+
type OtpRequestRequest = {
|
|
828
|
+
/**
|
|
829
|
+
* Email address for OTP delivery
|
|
830
|
+
*/
|
|
831
|
+
identifier: string;
|
|
832
|
+
/**
|
|
833
|
+
* Source URL for tracking registration (e.g., https://my.djangocfg.com)
|
|
834
|
+
*/
|
|
835
|
+
source_url?: string;
|
|
836
|
+
};
|
|
837
|
+
/**
|
|
838
|
+
* OTP request response.
|
|
839
|
+
*/
|
|
840
|
+
type OtpRequestResponse = {
|
|
841
|
+
/**
|
|
842
|
+
* Success message
|
|
843
|
+
*/
|
|
844
|
+
message: string;
|
|
845
|
+
};
|
|
846
|
+
/**
|
|
847
|
+
* Serializer for OTP verification.
|
|
848
|
+
*/
|
|
849
|
+
type OtpVerifyRequest = {
|
|
850
|
+
/**
|
|
851
|
+
* Email address used for OTP request
|
|
852
|
+
*/
|
|
853
|
+
identifier: string;
|
|
854
|
+
otp: string;
|
|
855
|
+
/**
|
|
856
|
+
* Source URL for tracking login (e.g., https://my.djangocfg.com)
|
|
857
|
+
*/
|
|
858
|
+
source_url?: string;
|
|
859
|
+
};
|
|
860
|
+
/**
|
|
861
|
+
* OTP verification response.
|
|
862
|
+
*
|
|
863
|
+
* When 2FA is required:
|
|
864
|
+
* - requires_2fa: True
|
|
865
|
+
* - session_id: UUID of 2FA verification session
|
|
866
|
+
* - refresh/access/user: null
|
|
867
|
+
*
|
|
868
|
+
* When 2FA is not required:
|
|
869
|
+
* - requires_2fa: False
|
|
870
|
+
* - session_id: null
|
|
871
|
+
* - refresh/access/user: populated
|
|
872
|
+
*/
|
|
873
|
+
type OtpVerifyResponse = {
|
|
874
|
+
/**
|
|
875
|
+
* Whether 2FA verification is required
|
|
876
|
+
*/
|
|
877
|
+
requires_2fa?: boolean;
|
|
878
|
+
/**
|
|
879
|
+
* 2FA session ID (if requires_2fa is True)
|
|
880
|
+
*/
|
|
881
|
+
session_id?: string | null;
|
|
882
|
+
/**
|
|
883
|
+
* JWT refresh token (if requires_2fa is False)
|
|
884
|
+
*/
|
|
885
|
+
refresh?: string | null;
|
|
886
|
+
/**
|
|
887
|
+
* JWT access token (if requires_2fa is False)
|
|
888
|
+
*/
|
|
889
|
+
access?: string | null;
|
|
890
|
+
/**
|
|
891
|
+
* User information (if requires_2fa is False)
|
|
892
|
+
*/
|
|
893
|
+
user?: User | null;
|
|
894
|
+
/**
|
|
895
|
+
* Whether user should be prompted to enable 2FA
|
|
896
|
+
*/
|
|
897
|
+
should_prompt_2fa?: boolean;
|
|
898
|
+
};
|
|
899
|
+
/**
|
|
900
|
+
* Serializer for updating user profile.
|
|
901
|
+
*/
|
|
902
|
+
type PatchedCfgUserUpdateRequest = {
|
|
903
|
+
first_name?: string;
|
|
904
|
+
last_name?: string;
|
|
905
|
+
company?: string;
|
|
906
|
+
phone?: string;
|
|
907
|
+
position?: string;
|
|
908
|
+
language?: string;
|
|
909
|
+
/**
|
|
910
|
+
* IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
|
|
911
|
+
*/
|
|
912
|
+
timezone?: string;
|
|
913
|
+
};
|
|
914
|
+
/**
|
|
915
|
+
* Serializer for starting 2FA setup.
|
|
916
|
+
*/
|
|
917
|
+
type SetupRequest = {
|
|
918
|
+
/**
|
|
919
|
+
* Device name for identification (e.g., 'My iPhone')
|
|
920
|
+
*/
|
|
921
|
+
device_name?: string;
|
|
922
|
+
};
|
|
923
|
+
/**
|
|
924
|
+
* Response serializer for setup initiation.
|
|
925
|
+
*/
|
|
926
|
+
type SetupResponse = {
|
|
927
|
+
/**
|
|
928
|
+
* Device ID to use for confirmation
|
|
929
|
+
*/
|
|
930
|
+
device_id: string;
|
|
931
|
+
/**
|
|
932
|
+
* Base32-encoded TOTP secret (for manual entry)
|
|
933
|
+
*/
|
|
934
|
+
secret: string;
|
|
935
|
+
/**
|
|
936
|
+
* otpauth:// URI for QR code generation
|
|
937
|
+
*/
|
|
938
|
+
provisioning_uri: string;
|
|
939
|
+
/**
|
|
940
|
+
* Base64-encoded QR code image (data URI)
|
|
941
|
+
*/
|
|
942
|
+
qr_code_base64: string;
|
|
943
|
+
/**
|
|
944
|
+
* Seconds until setup expires (typically 600 = 10 minutes)
|
|
945
|
+
*/
|
|
946
|
+
expires_in: number;
|
|
947
|
+
};
|
|
948
|
+
type TokenRefresh = {
|
|
949
|
+
readonly access: string;
|
|
950
|
+
refresh: string;
|
|
951
|
+
};
|
|
952
|
+
type TokenRefreshRequest = {
|
|
953
|
+
refresh: string;
|
|
954
|
+
};
|
|
955
|
+
/**
|
|
956
|
+
* User data returned after 2FA verification.
|
|
957
|
+
*/
|
|
958
|
+
type TotpVerifyUser = {
|
|
959
|
+
readonly id: number;
|
|
960
|
+
readonly email: string;
|
|
961
|
+
first_name?: string;
|
|
962
|
+
last_name?: string;
|
|
963
|
+
/**
|
|
964
|
+
* Get user's full name.
|
|
965
|
+
*/
|
|
966
|
+
readonly full_name: string;
|
|
967
|
+
/**
|
|
968
|
+
* Get user's initials for avatar fallback.
|
|
969
|
+
*/
|
|
970
|
+
readonly initials: string;
|
|
971
|
+
/**
|
|
972
|
+
* Get formatted username for display.
|
|
973
|
+
*/
|
|
974
|
+
readonly display_username: string;
|
|
975
|
+
company?: string;
|
|
976
|
+
phone?: string;
|
|
977
|
+
position?: string;
|
|
978
|
+
language?: string;
|
|
979
|
+
/**
|
|
980
|
+
* IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
|
|
981
|
+
*/
|
|
982
|
+
timezone?: string;
|
|
983
|
+
readonly avatar: string | null;
|
|
984
|
+
/**
|
|
985
|
+
* Staff status
|
|
986
|
+
*
|
|
987
|
+
* Designates whether the user can log into this admin site.
|
|
988
|
+
*/
|
|
989
|
+
readonly is_staff: boolean;
|
|
990
|
+
/**
|
|
991
|
+
* Superuser status
|
|
992
|
+
*
|
|
993
|
+
* Designates that this user has all permissions without explicitly assigning them.
|
|
994
|
+
*/
|
|
995
|
+
readonly is_superuser: boolean;
|
|
996
|
+
readonly date_joined: string;
|
|
997
|
+
readonly last_login: string | null;
|
|
998
|
+
readonly unanswered_messages_count: number;
|
|
999
|
+
readonly api_key: string | null;
|
|
1000
|
+
};
|
|
1001
|
+
/**
|
|
1002
|
+
* Serializer for user details.
|
|
1003
|
+
*/
|
|
1004
|
+
type User = {
|
|
1005
|
+
readonly id: number;
|
|
1006
|
+
readonly email: string;
|
|
1007
|
+
first_name?: string;
|
|
1008
|
+
last_name?: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* Get user's full name.
|
|
1011
|
+
*/
|
|
1012
|
+
readonly full_name: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* Get user's initials for avatar fallback.
|
|
1015
|
+
*/
|
|
1016
|
+
readonly initials: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* Get formatted username for display.
|
|
1019
|
+
*/
|
|
1020
|
+
readonly display_username: string;
|
|
1021
|
+
company?: string;
|
|
1022
|
+
phone?: string;
|
|
1023
|
+
position?: string;
|
|
1024
|
+
language?: string;
|
|
1025
|
+
/**
|
|
1026
|
+
* IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
|
|
1027
|
+
*/
|
|
1028
|
+
timezone?: string;
|
|
1029
|
+
readonly avatar: string | null;
|
|
1030
|
+
/**
|
|
1031
|
+
* Staff status
|
|
1032
|
+
*
|
|
1033
|
+
* Designates whether the user can log into this admin site.
|
|
1034
|
+
*/
|
|
1035
|
+
readonly is_staff: boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* Superuser status
|
|
1038
|
+
*
|
|
1039
|
+
* Designates that this user has all permissions without explicitly assigning them.
|
|
1040
|
+
*/
|
|
1041
|
+
readonly is_superuser: boolean;
|
|
1042
|
+
readonly date_joined: string;
|
|
1043
|
+
readonly last_login: string | null;
|
|
1044
|
+
readonly unanswered_messages_count: number;
|
|
1045
|
+
readonly centrifugo: CentrifugoToken | null;
|
|
1046
|
+
readonly api_key: string | null;
|
|
1047
|
+
};
|
|
1048
|
+
/**
|
|
1049
|
+
* Serializer for backup code verification during login.
|
|
1050
|
+
*/
|
|
1051
|
+
type VerifyBackupRequest = {
|
|
1052
|
+
/**
|
|
1053
|
+
* 2FA session ID from login response
|
|
1054
|
+
*/
|
|
1055
|
+
session_id: string;
|
|
1056
|
+
/**
|
|
1057
|
+
* 8-character backup recovery code
|
|
1058
|
+
*/
|
|
1059
|
+
backup_code: string;
|
|
1060
|
+
};
|
|
1061
|
+
/**
|
|
1062
|
+
* Serializer for TOTP code verification during login.
|
|
1063
|
+
*/
|
|
1064
|
+
type VerifyRequest = {
|
|
1065
|
+
/**
|
|
1066
|
+
* 2FA session ID from login response
|
|
1067
|
+
*/
|
|
1068
|
+
session_id: string;
|
|
1069
|
+
/**
|
|
1070
|
+
* 6-digit TOTP code from authenticator app
|
|
1071
|
+
*/
|
|
1072
|
+
code: string;
|
|
1073
|
+
};
|
|
1074
|
+
/**
|
|
1075
|
+
* Response serializer for successful 2FA verification.
|
|
1076
|
+
*/
|
|
1077
|
+
type VerifyResponse = {
|
|
1078
|
+
message: string;
|
|
1079
|
+
/**
|
|
1080
|
+
* JWT access token
|
|
1081
|
+
*/
|
|
1082
|
+
access_token: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* JWT refresh token
|
|
1085
|
+
*/
|
|
1086
|
+
refresh_token: string;
|
|
1087
|
+
/**
|
|
1088
|
+
* User profile data
|
|
1089
|
+
*/
|
|
1090
|
+
user: TotpVerifyUser;
|
|
1091
|
+
/**
|
|
1092
|
+
* Number of remaining backup codes (if backup code was used)
|
|
1093
|
+
*/
|
|
1094
|
+
remaining_backup_codes?: number;
|
|
1095
|
+
/**
|
|
1096
|
+
* Warning message (e.g., low backup codes)
|
|
1097
|
+
*/
|
|
1098
|
+
warning?: string;
|
|
1099
|
+
};
|
|
1100
|
+
type CfgAccountsOauthConnectionsResponse200AutoRef = Array<OAuthConnection>;
|
|
1101
|
+
type CfgAccountsOauthDisconnectResponse200AutoRef = {
|
|
1102
|
+
message?: string;
|
|
1103
|
+
};
|
|
1104
|
+
/**
|
|
1105
|
+
* 2FA disabled successfully
|
|
1106
|
+
*/
|
|
1107
|
+
type CfgTotpDisableResponse200AutoRef = unknown;
|
|
1108
|
+
type CfgAccountsApiKeyRetrieveData = {
|
|
1109
|
+
body?: never;
|
|
1110
|
+
path?: never;
|
|
1111
|
+
query?: never;
|
|
1112
|
+
url: '/cfg/accounts/api-key/';
|
|
1113
|
+
};
|
|
1114
|
+
type CfgAccountsApiKeyRetrieveErrors = {
|
|
1115
|
+
/**
|
|
1116
|
+
* Authentication credentials were not provided.
|
|
1117
|
+
*/
|
|
1118
|
+
401: unknown;
|
|
1119
|
+
};
|
|
1120
|
+
type CfgAccountsApiKeyRetrieveResponses = {
|
|
1121
|
+
200: ApiKey;
|
|
1122
|
+
};
|
|
1123
|
+
type CfgAccountsApiKeyRegenerateCreateData = {
|
|
1124
|
+
body: ApiKeyRequest;
|
|
1125
|
+
path?: never;
|
|
1126
|
+
query?: never;
|
|
1127
|
+
url: '/cfg/accounts/api-key/regenerate/';
|
|
1128
|
+
};
|
|
1129
|
+
type CfgAccountsApiKeyRegenerateCreateErrors = {
|
|
1130
|
+
/**
|
|
1131
|
+
* Authentication credentials were not provided.
|
|
1132
|
+
*/
|
|
1133
|
+
401: unknown;
|
|
1134
|
+
};
|
|
1135
|
+
type CfgAccountsApiKeyRegenerateCreateResponses = {
|
|
1136
|
+
200: ApiKeyRegenerate;
|
|
1137
|
+
};
|
|
1138
|
+
type CfgAccountsApiKeyTestCreateData = {
|
|
1139
|
+
body: ApiKeyTestRequest;
|
|
1140
|
+
path?: never;
|
|
1141
|
+
query?: never;
|
|
1142
|
+
url: '/cfg/accounts/api-key/test/';
|
|
1143
|
+
};
|
|
1144
|
+
type CfgAccountsApiKeyTestCreateResponses = {
|
|
1145
|
+
200: ApiKeyTestResult;
|
|
1146
|
+
};
|
|
1147
|
+
type CfgAccountsOauthConnectionsListData = {
|
|
1148
|
+
body?: never;
|
|
1149
|
+
path?: never;
|
|
1150
|
+
query?: never;
|
|
1151
|
+
url: '/cfg/accounts/oauth/connections/';
|
|
1152
|
+
};
|
|
1153
|
+
type CfgAccountsOauthConnectionsListResponses = {
|
|
1154
|
+
200: CfgAccountsOauthConnectionsResponse200AutoRef;
|
|
1155
|
+
};
|
|
1156
|
+
type CfgAccountsOauthDisconnectCreateData = {
|
|
1157
|
+
body: OAuthDisconnectRequestRequest;
|
|
1158
|
+
path?: never;
|
|
1159
|
+
query?: never;
|
|
1160
|
+
url: '/cfg/accounts/oauth/disconnect/';
|
|
1161
|
+
};
|
|
1162
|
+
type CfgAccountsOauthDisconnectCreateErrors = {
|
|
1163
|
+
400: OAuthError;
|
|
1164
|
+
404: OAuthError;
|
|
1165
|
+
};
|
|
1166
|
+
type CfgAccountsOauthDisconnectCreateResponses = {
|
|
1167
|
+
200: CfgAccountsOauthDisconnectResponse200AutoRef;
|
|
1168
|
+
};
|
|
1169
|
+
type CfgAccountsOauthGithubAuthorizeCreateData = {
|
|
1170
|
+
body?: OAuthAuthorizeRequestRequest;
|
|
1171
|
+
path?: never;
|
|
1172
|
+
query?: never;
|
|
1173
|
+
url: '/cfg/accounts/oauth/github/authorize/';
|
|
1174
|
+
};
|
|
1175
|
+
type CfgAccountsOauthGithubAuthorizeCreateErrors = {
|
|
1176
|
+
503: OAuthError;
|
|
1177
|
+
};
|
|
1178
|
+
type CfgAccountsOauthGithubAuthorizeCreateResponses = {
|
|
1179
|
+
200: OAuthAuthorizeResponse;
|
|
1180
|
+
};
|
|
1181
|
+
type CfgAccountsOauthGithubCallbackCreateData = {
|
|
1182
|
+
body: OAuthCallbackRequestRequest;
|
|
1183
|
+
path?: never;
|
|
1184
|
+
query?: never;
|
|
1185
|
+
url: '/cfg/accounts/oauth/github/callback/';
|
|
1186
|
+
};
|
|
1187
|
+
type CfgAccountsOauthGithubCallbackCreateErrors = {
|
|
1188
|
+
400: OAuthError;
|
|
1189
|
+
};
|
|
1190
|
+
type CfgAccountsOauthGithubCallbackCreateResponses = {
|
|
1191
|
+
200: OAuthTokenResponse;
|
|
1192
|
+
};
|
|
1193
|
+
type CfgAccountsOauthProvidersRetrieveData = {
|
|
1194
|
+
body?: never;
|
|
1195
|
+
path?: never;
|
|
1196
|
+
query?: never;
|
|
1197
|
+
url: '/cfg/accounts/oauth/providers/';
|
|
1198
|
+
};
|
|
1199
|
+
type CfgAccountsOauthProvidersRetrieveResponses = {
|
|
1200
|
+
200: OAuthProvidersResponse;
|
|
1201
|
+
};
|
|
1202
|
+
type CfgAccountsOtpRequestCreateData = {
|
|
1203
|
+
body: OtpRequestRequest;
|
|
1204
|
+
path?: never;
|
|
1205
|
+
query?: never;
|
|
1206
|
+
url: '/cfg/accounts/otp/request/';
|
|
1207
|
+
};
|
|
1208
|
+
type CfgAccountsOtpRequestCreateErrors = {
|
|
1209
|
+
400: OtpErrorResponse;
|
|
1210
|
+
429: OtpErrorResponse;
|
|
1211
|
+
500: OtpErrorResponse;
|
|
1212
|
+
};
|
|
1213
|
+
type CfgAccountsOtpRequestCreateResponses = {
|
|
1214
|
+
200: OtpRequestResponse;
|
|
1215
|
+
};
|
|
1216
|
+
type CfgAccountsOtpVerifyCreateData = {
|
|
1217
|
+
body: OtpVerifyRequest;
|
|
1218
|
+
path?: never;
|
|
1219
|
+
query?: never;
|
|
1220
|
+
url: '/cfg/accounts/otp/verify/';
|
|
1221
|
+
};
|
|
1222
|
+
type CfgAccountsOtpVerifyCreateErrors = {
|
|
1223
|
+
401: OtpErrorResponse;
|
|
1224
|
+
429: OtpErrorResponse;
|
|
1225
|
+
};
|
|
1226
|
+
type CfgAccountsOtpVerifyCreateResponses = {
|
|
1227
|
+
200: OtpVerifyResponse;
|
|
1228
|
+
};
|
|
1229
|
+
type CfgAccountsProfileRetrieveData = {
|
|
1230
|
+
body?: never;
|
|
1231
|
+
path?: never;
|
|
1232
|
+
query?: never;
|
|
1233
|
+
url: '/cfg/accounts/profile/';
|
|
1234
|
+
};
|
|
1235
|
+
type CfgAccountsProfileRetrieveErrors = {
|
|
1236
|
+
/**
|
|
1237
|
+
* Authentication credentials were not provided.
|
|
1238
|
+
*/
|
|
1239
|
+
401: unknown;
|
|
1240
|
+
};
|
|
1241
|
+
type CfgAccountsProfileRetrieveResponses = {
|
|
1242
|
+
200: User;
|
|
1243
|
+
};
|
|
1244
|
+
type CfgAccountsProfileAvatarCreateData = {
|
|
1245
|
+
body?: {
|
|
1246
|
+
/**
|
|
1247
|
+
* Avatar image file (JPEG, PNG, GIF, WebP, max 5MB)
|
|
1248
|
+
*/
|
|
1249
|
+
avatar: Blob | File;
|
|
1250
|
+
};
|
|
1251
|
+
path?: never;
|
|
1252
|
+
query?: never;
|
|
1253
|
+
url: '/cfg/accounts/profile/avatar/';
|
|
1254
|
+
};
|
|
1255
|
+
type CfgAccountsProfileAvatarCreateErrors = {
|
|
1256
|
+
/**
|
|
1257
|
+
* Invalid file or validation error.
|
|
1258
|
+
*/
|
|
1259
|
+
400: unknown;
|
|
1260
|
+
/**
|
|
1261
|
+
* Authentication credentials were not provided.
|
|
1262
|
+
*/
|
|
1263
|
+
401: unknown;
|
|
1264
|
+
};
|
|
1265
|
+
type CfgAccountsProfileAvatarCreateResponses = {
|
|
1266
|
+
200: User;
|
|
1267
|
+
};
|
|
1268
|
+
type CfgAccountsProfileDeleteCreateData = {
|
|
1269
|
+
body?: never;
|
|
1270
|
+
path?: never;
|
|
1271
|
+
query?: never;
|
|
1272
|
+
url: '/cfg/accounts/profile/delete/';
|
|
1273
|
+
};
|
|
1274
|
+
type CfgAccountsProfileDeleteCreateErrors = {
|
|
1275
|
+
/**
|
|
1276
|
+
* Account is already deleted.
|
|
1277
|
+
*/
|
|
1278
|
+
400: unknown;
|
|
1279
|
+
/**
|
|
1280
|
+
* Authentication credentials were not provided.
|
|
1281
|
+
*/
|
|
1282
|
+
401: unknown;
|
|
1283
|
+
};
|
|
1284
|
+
type CfgAccountsProfileDeleteCreateResponses = {
|
|
1285
|
+
200: AccountDeleteResponse;
|
|
1286
|
+
};
|
|
1287
|
+
type CfgAccountsProfilePartialPartialUpdateData = {
|
|
1288
|
+
body?: PatchedCfgUserUpdateRequest;
|
|
1289
|
+
path?: never;
|
|
1290
|
+
query?: never;
|
|
1291
|
+
url: '/cfg/accounts/profile/partial/';
|
|
1292
|
+
};
|
|
1293
|
+
type CfgAccountsProfilePartialPartialUpdateErrors = {
|
|
1294
|
+
/**
|
|
1295
|
+
* Invalid data provided.
|
|
1296
|
+
*/
|
|
1297
|
+
400: unknown;
|
|
1298
|
+
/**
|
|
1299
|
+
* Authentication credentials were not provided.
|
|
1300
|
+
*/
|
|
1301
|
+
401: unknown;
|
|
1302
|
+
};
|
|
1303
|
+
type CfgAccountsProfilePartialPartialUpdateResponses = {
|
|
1304
|
+
200: User;
|
|
1305
|
+
};
|
|
1306
|
+
type CfgAccountsProfilePartialUpdateData = {
|
|
1307
|
+
body?: CfgUserUpdateRequest;
|
|
1308
|
+
path?: never;
|
|
1309
|
+
query?: never;
|
|
1310
|
+
url: '/cfg/accounts/profile/partial/';
|
|
1311
|
+
};
|
|
1312
|
+
type CfgAccountsProfilePartialUpdateErrors = {
|
|
1313
|
+
/**
|
|
1314
|
+
* Invalid data provided.
|
|
1315
|
+
*/
|
|
1316
|
+
400: unknown;
|
|
1317
|
+
/**
|
|
1318
|
+
* Authentication credentials were not provided.
|
|
1319
|
+
*/
|
|
1320
|
+
401: unknown;
|
|
1321
|
+
};
|
|
1322
|
+
type CfgAccountsProfilePartialUpdateResponses = {
|
|
1323
|
+
200: User;
|
|
1324
|
+
};
|
|
1325
|
+
type CfgAccountsProfileUpdatePartialUpdateData = {
|
|
1326
|
+
body?: PatchedCfgUserUpdateRequest;
|
|
1327
|
+
path?: never;
|
|
1328
|
+
query?: never;
|
|
1329
|
+
url: '/cfg/accounts/profile/update/';
|
|
1330
|
+
};
|
|
1331
|
+
type CfgAccountsProfileUpdatePartialUpdateErrors = {
|
|
1332
|
+
/**
|
|
1333
|
+
* Invalid data provided.
|
|
1334
|
+
*/
|
|
1335
|
+
400: unknown;
|
|
1336
|
+
/**
|
|
1337
|
+
* Authentication credentials were not provided.
|
|
1338
|
+
*/
|
|
1339
|
+
401: unknown;
|
|
1340
|
+
};
|
|
1341
|
+
type CfgAccountsProfileUpdatePartialUpdateResponses = {
|
|
1342
|
+
200: User;
|
|
1343
|
+
};
|
|
1344
|
+
type CfgAccountsProfileUpdateUpdateData = {
|
|
1345
|
+
body?: CfgUserUpdateRequest;
|
|
1346
|
+
path?: never;
|
|
1347
|
+
query?: never;
|
|
1348
|
+
url: '/cfg/accounts/profile/update/';
|
|
1349
|
+
};
|
|
1350
|
+
type CfgAccountsProfileUpdateUpdateErrors = {
|
|
1351
|
+
/**
|
|
1352
|
+
* Invalid data provided.
|
|
1353
|
+
*/
|
|
1354
|
+
400: unknown;
|
|
1355
|
+
/**
|
|
1356
|
+
* Authentication credentials were not provided.
|
|
1357
|
+
*/
|
|
1358
|
+
401: unknown;
|
|
1359
|
+
};
|
|
1360
|
+
type CfgAccountsProfileUpdateUpdateResponses = {
|
|
1361
|
+
200: User;
|
|
1362
|
+
};
|
|
1363
|
+
type CfgAccountsTokenRefreshCreateData = {
|
|
1364
|
+
body: TokenRefreshRequest;
|
|
1365
|
+
path?: never;
|
|
1366
|
+
query?: never;
|
|
1367
|
+
url: '/cfg/accounts/token/refresh/';
|
|
1368
|
+
};
|
|
1369
|
+
type CfgAccountsTokenRefreshCreateResponses = {
|
|
1370
|
+
200: TokenRefresh;
|
|
1371
|
+
};
|
|
1372
|
+
type CfgCentrifugoAuthTokenRetrieveData = {
|
|
1373
|
+
body?: never;
|
|
1374
|
+
path?: never;
|
|
1375
|
+
query?: never;
|
|
1376
|
+
url: '/cfg/centrifugo/auth/token/';
|
|
1377
|
+
};
|
|
1378
|
+
type CfgCentrifugoAuthTokenRetrieveErrors = {
|
|
1379
|
+
/**
|
|
1380
|
+
* Unauthorized - authentication required
|
|
1381
|
+
*/
|
|
1382
|
+
401: unknown;
|
|
1383
|
+
/**
|
|
1384
|
+
* Server error
|
|
1385
|
+
*/
|
|
1386
|
+
500: unknown;
|
|
1387
|
+
};
|
|
1388
|
+
type CfgCentrifugoAuthTokenRetrieveResponses = {
|
|
1389
|
+
200: ConnectionTokenResponse;
|
|
1390
|
+
};
|
|
1391
|
+
type CfgTotpBackupCodesRetrieveData = {
|
|
1392
|
+
body?: never;
|
|
1393
|
+
path?: never;
|
|
1394
|
+
query?: never;
|
|
1395
|
+
url: '/cfg/totp/backup-codes/';
|
|
1396
|
+
};
|
|
1397
|
+
type CfgTotpBackupCodesRetrieveResponses = {
|
|
1398
|
+
200: BackupCodesStatus;
|
|
1399
|
+
};
|
|
1400
|
+
type CfgTotpBackupCodesRegenerateCreateData = {
|
|
1401
|
+
body: BackupCodesRegenerateRequest;
|
|
1402
|
+
path?: never;
|
|
1403
|
+
query?: never;
|
|
1404
|
+
url: '/cfg/totp/backup-codes/regenerate/';
|
|
1405
|
+
};
|
|
1406
|
+
type CfgTotpBackupCodesRegenerateCreateErrors = {
|
|
1407
|
+
/**
|
|
1408
|
+
* Invalid code or 2FA not enabled
|
|
1409
|
+
*/
|
|
1410
|
+
400: unknown;
|
|
1411
|
+
};
|
|
1412
|
+
type CfgTotpBackupCodesRegenerateCreateResponses = {
|
|
1413
|
+
200: BackupCodesRegenerateResponse;
|
|
1414
|
+
};
|
|
1415
|
+
type CfgTotpDevicesRetrieveData = {
|
|
1416
|
+
body?: never;
|
|
1417
|
+
path?: never;
|
|
1418
|
+
query?: never;
|
|
1419
|
+
url: '/cfg/totp/devices/';
|
|
1420
|
+
};
|
|
1421
|
+
type CfgTotpDevicesRetrieveResponses = {
|
|
1422
|
+
200: DeviceListResponse;
|
|
1423
|
+
};
|
|
1424
|
+
type CfgTotpDevicesDestroyData = {
|
|
1425
|
+
body?: never;
|
|
1426
|
+
path: {
|
|
1427
|
+
id: string;
|
|
1428
|
+
};
|
|
1429
|
+
query?: never;
|
|
1430
|
+
url: '/cfg/totp/devices/{id}/';
|
|
1431
|
+
};
|
|
1432
|
+
type CfgTotpDevicesDestroyResponses = {
|
|
1433
|
+
/**
|
|
1434
|
+
* No response body
|
|
1435
|
+
*/
|
|
1436
|
+
204: void;
|
|
1437
|
+
};
|
|
1438
|
+
type CfgTotpDisableCreateData = {
|
|
1439
|
+
body: DisableRequest;
|
|
1440
|
+
path?: never;
|
|
1441
|
+
query?: never;
|
|
1442
|
+
url: '/cfg/totp/disable/';
|
|
1443
|
+
};
|
|
1444
|
+
type CfgTotpDisableCreateErrors = {
|
|
1445
|
+
/**
|
|
1446
|
+
* Invalid code
|
|
1447
|
+
*/
|
|
1448
|
+
400: unknown;
|
|
1449
|
+
};
|
|
1450
|
+
type CfgTotpDisableCreateResponses = {
|
|
1451
|
+
200: CfgTotpDisableResponse200AutoRef;
|
|
1452
|
+
};
|
|
1453
|
+
type CfgTotpSetupCreateData = {
|
|
1454
|
+
body?: SetupRequest;
|
|
1455
|
+
path?: never;
|
|
1456
|
+
query?: never;
|
|
1457
|
+
url: '/cfg/totp/setup/';
|
|
1458
|
+
};
|
|
1459
|
+
type CfgTotpSetupCreateErrors = {
|
|
1460
|
+
/**
|
|
1461
|
+
* 2FA already enabled or invalid request
|
|
1462
|
+
*/
|
|
1463
|
+
400: unknown;
|
|
1464
|
+
};
|
|
1465
|
+
type CfgTotpSetupCreateResponses = {
|
|
1466
|
+
200: SetupResponse;
|
|
1467
|
+
};
|
|
1468
|
+
type CfgTotpSetupConfirmCreateData = {
|
|
1469
|
+
body: ConfirmSetupRequest;
|
|
1470
|
+
path?: never;
|
|
1471
|
+
query?: never;
|
|
1472
|
+
url: '/cfg/totp/setup/confirm/';
|
|
1473
|
+
};
|
|
1474
|
+
type CfgTotpSetupConfirmCreateErrors = {
|
|
1475
|
+
/**
|
|
1476
|
+
* Invalid code or setup expired
|
|
1477
|
+
*/
|
|
1478
|
+
400: unknown;
|
|
1479
|
+
};
|
|
1480
|
+
type CfgTotpSetupConfirmCreateResponses = {
|
|
1481
|
+
200: ConfirmSetupResponse;
|
|
1482
|
+
};
|
|
1483
|
+
type CfgTotpVerifyCreateData = {
|
|
1484
|
+
body: VerifyRequest;
|
|
1485
|
+
path?: never;
|
|
1486
|
+
query?: never;
|
|
1487
|
+
url: '/cfg/totp/verify/';
|
|
1488
|
+
};
|
|
1489
|
+
type CfgTotpVerifyCreateErrors = {
|
|
1490
|
+
/**
|
|
1491
|
+
* Invalid code or session
|
|
1492
|
+
*/
|
|
1493
|
+
400: unknown;
|
|
1494
|
+
/**
|
|
1495
|
+
* Too many attempts
|
|
1496
|
+
*/
|
|
1497
|
+
403: unknown;
|
|
1498
|
+
};
|
|
1499
|
+
type CfgTotpVerifyCreateResponses = {
|
|
1500
|
+
200: VerifyResponse;
|
|
1501
|
+
};
|
|
1502
|
+
type CfgTotpVerifyBackupCreateData = {
|
|
1503
|
+
body: VerifyBackupRequest;
|
|
1504
|
+
path?: never;
|
|
1505
|
+
query?: never;
|
|
1506
|
+
url: '/cfg/totp/verify/backup/';
|
|
1507
|
+
};
|
|
1508
|
+
type CfgTotpVerifyBackupCreateErrors = {
|
|
1509
|
+
/**
|
|
1510
|
+
* Invalid backup code or session
|
|
1511
|
+
*/
|
|
1512
|
+
400: unknown;
|
|
1513
|
+
};
|
|
1514
|
+
type CfgTotpVerifyBackupCreateResponses = {
|
|
1515
|
+
200: VerifyResponse;
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
1519
|
+
/**
|
|
1520
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
1521
|
+
* individual options. This might be also useful if you want to implement a
|
|
1522
|
+
* custom client.
|
|
1523
|
+
*/
|
|
1524
|
+
client?: Client;
|
|
1525
|
+
/**
|
|
1526
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
1527
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
1528
|
+
*/
|
|
1529
|
+
meta?: Record<string, unknown>;
|
|
1530
|
+
};
|
|
1531
|
+
declare class CfgAccountsApiKey {
|
|
1532
|
+
/**
|
|
1533
|
+
* Get API key details
|
|
1534
|
+
*
|
|
1535
|
+
* Retrieve the current user's API key (masked) and metadata.
|
|
1536
|
+
*/
|
|
1537
|
+
static cfgAccountsApiKeyRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsApiKeyRetrieveData, ThrowOnError>): RequestResult<CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRetrieveErrors, ThrowOnError, "fields">;
|
|
1538
|
+
/**
|
|
1539
|
+
* Regenerate API key
|
|
1540
|
+
*
|
|
1541
|
+
* Generate a new API key. The full key is returned only once.
|
|
1542
|
+
*/
|
|
1543
|
+
static cfgAccountsApiKeyRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyRegenerateCreateData, ThrowOnError>): RequestResult<CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRegenerateCreateErrors, ThrowOnError, "fields">;
|
|
1544
|
+
/**
|
|
1545
|
+
* Test API key
|
|
1546
|
+
*
|
|
1547
|
+
* Test whether an API key is valid without consuming it.
|
|
1548
|
+
*/
|
|
1549
|
+
static cfgAccountsApiKeyTestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsApiKeyTestCreateData, ThrowOnError>): RequestResult<CfgAccountsApiKeyTestCreateResponses, unknown, ThrowOnError, "fields">;
|
|
1550
|
+
}
|
|
1551
|
+
declare class CfgAccountsOauth {
|
|
1552
|
+
/**
|
|
1553
|
+
* List OAuth connections
|
|
1554
|
+
*
|
|
1555
|
+
* Get all OAuth connections for the current user.
|
|
1556
|
+
*/
|
|
1557
|
+
static cfgAccountsOauthConnectionsList<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthConnectionsListData, ThrowOnError>): RequestResult<CfgAccountsOauthConnectionsListResponses, unknown, ThrowOnError, "fields">;
|
|
1558
|
+
/**
|
|
1559
|
+
* Disconnect OAuth provider
|
|
1560
|
+
*
|
|
1561
|
+
* Remove OAuth connection for the specified provider.
|
|
1562
|
+
*/
|
|
1563
|
+
static cfgAccountsOauthDisconnectCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthDisconnectCreateData, ThrowOnError>): RequestResult<CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthDisconnectCreateErrors, ThrowOnError, "fields">;
|
|
1564
|
+
/**
|
|
1565
|
+
* Start GitHub OAuth
|
|
1566
|
+
*
|
|
1567
|
+
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
1568
|
+
*/
|
|
1569
|
+
static cfgAccountsOauthGithubAuthorizeCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthGithubAuthorizeCreateData, ThrowOnError>): RequestResult<CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubAuthorizeCreateErrors, ThrowOnError, "fields">;
|
|
1570
|
+
/**
|
|
1571
|
+
* Complete GitHub OAuth
|
|
1572
|
+
*
|
|
1573
|
+
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
1574
|
+
*/
|
|
1575
|
+
static cfgAccountsOauthGithubCallbackCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOauthGithubCallbackCreateData, ThrowOnError>): RequestResult<CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthGithubCallbackCreateErrors, ThrowOnError, "fields">;
|
|
1576
|
+
/**
|
|
1577
|
+
* List OAuth providers
|
|
1578
|
+
*
|
|
1579
|
+
* Get list of available OAuth providers for authentication.
|
|
1580
|
+
*/
|
|
1581
|
+
static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>): RequestResult<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError, "fields">;
|
|
1582
|
+
}
|
|
1583
|
+
declare class CfgAccounts {
|
|
1584
|
+
/**
|
|
1585
|
+
* Request OTP code to email.
|
|
1586
|
+
*/
|
|
1587
|
+
static cfgAccountsOtpRequestCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpRequestCreateData, ThrowOnError>): RequestResult<CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpRequestCreateErrors, ThrowOnError, "fields">;
|
|
1588
|
+
/**
|
|
1589
|
+
* Verify OTP code and return JWT tokens or 2FA session.
|
|
1590
|
+
*
|
|
1591
|
+
* If user has 2FA enabled:
|
|
1592
|
+
* - Returns requires_2fa=True with session_id
|
|
1593
|
+
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
1594
|
+
*
|
|
1595
|
+
* If user has no 2FA:
|
|
1596
|
+
* - Returns JWT tokens and user data directly
|
|
1597
|
+
*/
|
|
1598
|
+
static cfgAccountsOtpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsOtpVerifyCreateData, ThrowOnError>): RequestResult<CfgAccountsOtpVerifyCreateResponses, CfgAccountsOtpVerifyCreateErrors, ThrowOnError, "fields">;
|
|
1599
|
+
}
|
|
1600
|
+
declare class CfgAccountsProfile {
|
|
1601
|
+
/**
|
|
1602
|
+
* Get current user profile
|
|
1603
|
+
*
|
|
1604
|
+
* Retrieve the current authenticated user's profile information.
|
|
1605
|
+
*/
|
|
1606
|
+
static cfgAccountsProfileRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileRetrieveData, ThrowOnError>): RequestResult<CfgAccountsProfileRetrieveResponses, CfgAccountsProfileRetrieveErrors, ThrowOnError, "fields">;
|
|
1607
|
+
/**
|
|
1608
|
+
* Upload user avatar
|
|
1609
|
+
*
|
|
1610
|
+
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
1611
|
+
*/
|
|
1612
|
+
static cfgAccountsProfileAvatarCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileAvatarCreateData, ThrowOnError>): RequestResult<CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileAvatarCreateErrors, ThrowOnError, "fields">;
|
|
1613
|
+
/**
|
|
1614
|
+
* Delete user account
|
|
1615
|
+
*
|
|
1616
|
+
*
|
|
1617
|
+
* Permanently delete the current user's account.
|
|
1618
|
+
*
|
|
1619
|
+
* This operation:
|
|
1620
|
+
* - Deactivates the account (user cannot log in)
|
|
1621
|
+
* - Anonymizes personal data (GDPR compliance)
|
|
1622
|
+
* - Frees up the email address for re-registration
|
|
1623
|
+
* - Preserves audit trail
|
|
1624
|
+
*
|
|
1625
|
+
* The account can be restored by an administrator if needed.
|
|
1626
|
+
*
|
|
1627
|
+
*/
|
|
1628
|
+
static cfgAccountsProfileDeleteCreate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileDeleteCreateData, ThrowOnError>): RequestResult<CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfileDeleteCreateErrors, ThrowOnError, "fields">;
|
|
1629
|
+
/**
|
|
1630
|
+
* Partial update user profile
|
|
1631
|
+
*
|
|
1632
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
1633
|
+
*/
|
|
1634
|
+
static cfgAccountsProfilePartialPartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialPartialUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialPartialUpdateErrors, ThrowOnError, "fields">;
|
|
1635
|
+
/**
|
|
1636
|
+
* Partial update user profile
|
|
1637
|
+
*
|
|
1638
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
1639
|
+
*/
|
|
1640
|
+
static cfgAccountsProfilePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfilePartialUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfilePartialUpdateErrors, ThrowOnError, "fields">;
|
|
1641
|
+
/**
|
|
1642
|
+
* Update user profile
|
|
1643
|
+
*
|
|
1644
|
+
* Update the current authenticated user's profile information.
|
|
1645
|
+
*/
|
|
1646
|
+
static cfgAccountsProfileUpdatePartialUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdatePartialUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdatePartialUpdateErrors, ThrowOnError, "fields">;
|
|
1647
|
+
/**
|
|
1648
|
+
* Update user profile
|
|
1649
|
+
*
|
|
1650
|
+
* Update the current authenticated user's profile information.
|
|
1651
|
+
*/
|
|
1652
|
+
static cfgAccountsProfileUpdateUpdate<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsProfileUpdateUpdateData, ThrowOnError>): RequestResult<CfgAccountsProfileUpdateUpdateResponses, CfgAccountsProfileUpdateUpdateErrors, ThrowOnError, "fields">;
|
|
1653
|
+
}
|
|
1654
|
+
declare class CfgAccountsAuth {
|
|
1655
|
+
/**
|
|
1656
|
+
* Refresh JWT token.
|
|
1657
|
+
*/
|
|
1658
|
+
static cfgAccountsTokenRefreshCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenRefreshCreateData, ThrowOnError>): RequestResult<CfgAccountsTokenRefreshCreateResponses, unknown, ThrowOnError, "fields">;
|
|
1659
|
+
}
|
|
1660
|
+
declare class CfgCentrifugo {
|
|
1661
|
+
/**
|
|
1662
|
+
* Get Centrifugo connection token
|
|
1663
|
+
*
|
|
1664
|
+
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
1665
|
+
*/
|
|
1666
|
+
static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>): RequestResult<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError, "fields">;
|
|
1667
|
+
}
|
|
1668
|
+
declare class CfgTotpBackupCodes {
|
|
1669
|
+
/**
|
|
1670
|
+
* Get backup codes status for user.
|
|
1671
|
+
*/
|
|
1672
|
+
static cfgTotpBackupCodesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpBackupCodesRetrieveData, ThrowOnError>): RequestResult<CfgTotpBackupCodesRetrieveResponses, unknown, ThrowOnError, "fields">;
|
|
1673
|
+
/**
|
|
1674
|
+
* Regenerate backup codes.
|
|
1675
|
+
*
|
|
1676
|
+
* Requires TOTP code for verification.
|
|
1677
|
+
* Invalidates all existing codes.
|
|
1678
|
+
*/
|
|
1679
|
+
static cfgTotpBackupCodesRegenerateCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpBackupCodesRegenerateCreateData, ThrowOnError>): RequestResult<CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRegenerateCreateErrors, ThrowOnError, "fields">;
|
|
1680
|
+
}
|
|
1681
|
+
declare class CfgTotp {
|
|
1682
|
+
/**
|
|
1683
|
+
* List all TOTP devices for user.
|
|
1684
|
+
*/
|
|
1685
|
+
static cfgTotpDevicesRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgTotpDevicesRetrieveData, ThrowOnError>): RequestResult<CfgTotpDevicesRetrieveResponses, unknown, ThrowOnError, "fields">;
|
|
1686
|
+
/**
|
|
1687
|
+
* Delete a TOTP device.
|
|
1688
|
+
*
|
|
1689
|
+
* Requires verification code if removing the last/primary device.
|
|
1690
|
+
*/
|
|
1691
|
+
static cfgTotpDevicesDestroy<ThrowOnError extends boolean = false>(options: Options<CfgTotpDevicesDestroyData, ThrowOnError>): RequestResult<CfgTotpDevicesDestroyResponses, unknown, ThrowOnError, "fields">;
|
|
1692
|
+
/**
|
|
1693
|
+
* Completely disable 2FA for account.
|
|
1694
|
+
*
|
|
1695
|
+
* Requires verification code.
|
|
1696
|
+
*/
|
|
1697
|
+
static cfgTotpDisableCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpDisableCreateData, ThrowOnError>): RequestResult<CfgTotpDisableCreateResponses, CfgTotpDisableCreateErrors, ThrowOnError, "fields">;
|
|
1698
|
+
}
|
|
1699
|
+
declare class CfgTotpSetup {
|
|
1700
|
+
/**
|
|
1701
|
+
* Start 2FA setup process.
|
|
1702
|
+
*
|
|
1703
|
+
* Creates a new TOTP device and returns QR code for scanning.
|
|
1704
|
+
*/
|
|
1705
|
+
static cfgTotpSetupCreate<ThrowOnError extends boolean = false>(options?: Options<CfgTotpSetupCreateData, ThrowOnError>): RequestResult<CfgTotpSetupCreateResponses, CfgTotpSetupCreateErrors, ThrowOnError, "fields">;
|
|
1706
|
+
/**
|
|
1707
|
+
* Confirm 2FA setup with first valid code.
|
|
1708
|
+
*
|
|
1709
|
+
* Activates the device and generates backup codes.
|
|
1710
|
+
*/
|
|
1711
|
+
static cfgTotpSetupConfirmCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpSetupConfirmCreateData, ThrowOnError>): RequestResult<CfgTotpSetupConfirmCreateResponses, CfgTotpSetupConfirmCreateErrors, ThrowOnError, "fields">;
|
|
1712
|
+
}
|
|
1713
|
+
declare class CfgTotpVerify {
|
|
1714
|
+
/**
|
|
1715
|
+
* Verify TOTP code for 2FA session.
|
|
1716
|
+
*
|
|
1717
|
+
* Completes authentication and returns JWT tokens on success.
|
|
1718
|
+
*/
|
|
1719
|
+
static cfgTotpVerifyCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyCreateData, ThrowOnError>): RequestResult<CfgTotpVerifyCreateResponses, CfgTotpVerifyCreateErrors, ThrowOnError, "fields">;
|
|
1720
|
+
/**
|
|
1721
|
+
* Verify backup recovery code for 2FA session.
|
|
1722
|
+
*
|
|
1723
|
+
* Alternative verification method when TOTP device unavailable.
|
|
1724
|
+
*/
|
|
1725
|
+
static cfgTotpVerifyBackupCreate<ThrowOnError extends boolean = false>(options: Options<CfgTotpVerifyBackupCreateData, ThrowOnError>): RequestResult<CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyBackupCreateErrors, ThrowOnError, "fields">;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
52
1728
|
interface APIOptions$2 {
|
|
53
1729
|
/** Logger config (defaults to dev-only). */
|
|
54
1730
|
logger?: Partial<LoggerConfig>;
|
|
@@ -71,6 +1747,11 @@ interface APIOptions$2 {
|
|
|
71
1747
|
*/
|
|
72
1748
|
declare class API$2 {
|
|
73
1749
|
readonly logger: APILogger;
|
|
1750
|
+
readonly cfgAccountsApiKey: typeof CfgAccountsApiKey;
|
|
1751
|
+
readonly cfgAccountsOauth: typeof CfgAccountsOauth;
|
|
1752
|
+
readonly cfgAccounts: typeof CfgAccounts;
|
|
1753
|
+
readonly cfgAccountsProfile: typeof CfgAccountsProfile;
|
|
1754
|
+
readonly cfgAccountsAuth: typeof CfgAccountsAuth;
|
|
74
1755
|
constructor(_baseUrl?: string, opts?: APIOptions$2);
|
|
75
1756
|
getBaseUrl(): string;
|
|
76
1757
|
setBaseUrl(url: string): void;
|
|
@@ -115,6 +1796,7 @@ interface APIOptions$1 {
|
|
|
115
1796
|
*/
|
|
116
1797
|
declare class API$1 {
|
|
117
1798
|
readonly logger: APILogger;
|
|
1799
|
+
readonly cfgCentrifugo: typeof CfgCentrifugo;
|
|
118
1800
|
constructor(_baseUrl?: string, opts?: APIOptions$1);
|
|
119
1801
|
getBaseUrl(): string;
|
|
120
1802
|
setBaseUrl(url: string): void;
|
|
@@ -159,6 +1841,10 @@ interface APIOptions {
|
|
|
159
1841
|
*/
|
|
160
1842
|
declare class API {
|
|
161
1843
|
readonly logger: APILogger;
|
|
1844
|
+
readonly cfgTotpBackupCodes: typeof CfgTotpBackupCodes;
|
|
1845
|
+
readonly cfgTotp: typeof CfgTotp;
|
|
1846
|
+
readonly cfgTotpSetup: typeof CfgTotpSetup;
|
|
1847
|
+
readonly cfgTotpVerify: typeof CfgTotpVerify;
|
|
162
1848
|
constructor(_baseUrl?: string, opts?: APIOptions);
|
|
163
1849
|
getBaseUrl(): string;
|
|
164
1850
|
setBaseUrl(url: string): void;
|