@djangocfg/api 2.1.541 → 2.1.543

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.
Files changed (67) hide show
  1. package/README.md +1 -2
  2. package/dist/auth-server.cjs +1 -0
  3. package/dist/auth-server.cjs.map +1 -1
  4. package/dist/auth.cjs +156 -170
  5. package/dist/auth.cjs.map +1 -1
  6. package/dist/auth.d.cts +134 -29
  7. package/dist/auth.d.ts +134 -29
  8. package/dist/auth.mjs +168 -183
  9. package/dist/auth.mjs.map +1 -1
  10. package/dist/clients.cjs +4 -99
  11. package/dist/clients.cjs.map +1 -1
  12. package/dist/clients.d.cts +4 -136
  13. package/dist/clients.d.ts +4 -136
  14. package/dist/clients.mjs +3 -99
  15. package/dist/clients.mjs.map +1 -1
  16. package/dist/hooks.cjs +1 -0
  17. package/dist/hooks.cjs.map +1 -1
  18. package/dist/hooks.d.cts +2 -4
  19. package/dist/hooks.d.ts +2 -4
  20. package/dist/hooks.mjs.map +1 -1
  21. package/dist/index.cjs +4 -100
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +10 -340
  24. package/dist/index.d.ts +10 -340
  25. package/dist/index.mjs +3 -100
  26. package/dist/index.mjs.map +1 -1
  27. package/package.json +5 -4
  28. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRetrieve.ts +8 -2
  29. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +8 -2
  30. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +8 -2
  31. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpConsentPolicyRetrieve.ts +8 -2
  32. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +8 -2
  33. package/src/_api/generated/_cfg_accounts/openapi.json +0 -45
  34. package/src/_api/generated/_cfg_accounts/schemas/User.ts +0 -2
  35. package/src/_api/generated/_cfg_accounts/schemas/index.ts +0 -1
  36. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +8 -2
  37. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +8 -2
  38. package/src/_api/generated/index.ts +1 -5
  39. package/src/_api/generated/openapi.json +0 -135
  40. package/src/_api/generated/sdk.gen.ts +1 -20
  41. package/src/_api/generated/types.gen.ts +0 -79
  42. package/src/_api/index.ts +1 -1
  43. package/src/auth/__tests__/useTwoFactorStatus.test.ts +2 -2
  44. package/src/auth/context/AccountsContext.tsx +15 -11
  45. package/src/auth/hooks/useAuthForm.ts +0 -1
  46. package/src/auth/hooks/useCfgRouter.ts +1 -4
  47. package/src/auth/hooks/useGithubAuth.ts +25 -3
  48. package/src/auth/hooks/useLocalStorage.ts +7 -30
  49. package/src/auth/hooks/useSessionStorage.ts +6 -29
  50. package/src/auth/hooks/useTwoFactorVerify.ts +5 -9
  51. package/src/auth/utils/analytics.ts +22 -2
  52. package/src/auth/utils/errors.ts +22 -11
  53. package/src/auth/utils/storage.ts +64 -0
  54. package/src/clients.ts +2 -4
  55. package/src/index.ts +0 -2
  56. package/src/log-control.ts +1 -1
  57. package/src/server.ts +0 -4
  58. package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +0 -14
  59. package/src/_api/generated/_cfg_centrifugo/api.ts +0 -87
  60. package/src/_api/generated/_cfg_centrifugo/hooks/index.ts +0 -4
  61. package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +0 -74
  62. package/src/_api/generated/_cfg_centrifugo/index.ts +0 -29
  63. package/src/_api/generated/_cfg_centrifugo/openapi.json +0 -136
  64. package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +0 -14
  65. package/src/_api/generated/_cfg_centrifugo/schemas/index.ts +0 -4
  66. package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +0 -5
  67. package/src/_api/generated/_cfg_centrifugo/types.gen.ts +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "2.1.541",
3
+ "version": "2.1.543",
4
4
  "description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
5
5
  "keywords": [
6
6
  "django",
@@ -71,6 +71,7 @@
71
71
  "build": "tsup",
72
72
  "clean": "rm -rf dist",
73
73
  "dev": "tsup --watch",
74
+ "lint": "eslint .",
74
75
  "check": "tsc --noEmit",
75
76
  "test": "vitest run",
76
77
  "test:watch": "vitest"
@@ -79,12 +80,12 @@
79
80
  "consola": "^3.4.2",
80
81
  "next": "^16.2.2",
81
82
  "p-retry": "^7.0.0",
82
- "react": "^19.2.4",
83
+ "react": "^19.0.0",
83
84
  "swr": "^2.3.7",
84
85
  "zod": "^4.3.6"
85
86
  },
86
87
  "devDependencies": {
87
- "@djangocfg/typescript-config": "^2.1.541",
88
+ "@djangocfg/typescript-config": "^2.1.543",
88
89
  "@testing-library/react": "^16.3.2",
89
90
  "@types/node": "^25.9.5",
90
91
  "@types/react": "19.2.15",
@@ -93,6 +94,6 @@
93
94
  "react": "19.2.7",
94
95
  "tsup": "^8.5.1",
95
96
  "typescript": "^5.9.3",
96
- "vitest": "^3.2.7"
97
+ "vitest": "^4.1.10"
97
98
  }
98
99
  }
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgAccountsApiKey } from "../../sdk.gen";
10
10
  import type { CfgAccountsApiKeyRetrieveData, CfgAccountsApiKeyRetrieveResponses } from "../../types.gen";
11
11
  import { APIKeySchema } from "../schemas/APIKey";
@@ -20,10 +20,16 @@ type Result = CfgAccountsApiKeyRetrieveResponses[keyof CfgAccountsApiKeyRetrieve
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgAccountsApiKeyRetrieve(
24
30
  args?: Omit<CfgAccountsApiKeyRetrieveData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_accounts_api_key_retrieve", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgAccountsOauth } from "../../sdk.gen";
10
10
  import type { CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses } from "../../types.gen";
11
11
  import { cfg_accounts_oauth_connections_response_200_AutoRefSchema } from "../schemas/cfg_accounts_oauth_connections_response_200_AutoRef";
@@ -20,10 +20,16 @@ type Result = CfgAccountsOauthConnectionsListResponses[keyof CfgAccountsOauthCon
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgAccountsOauthConnectionsList(
24
30
  args?: Omit<CfgAccountsOauthConnectionsListData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_accounts_oauth_connections_list", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgAccountsOauth } from "../../sdk.gen";
10
10
  import type { CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses } from "../../types.gen";
11
11
  import { OAuthProvidersResponseSchema } from "../schemas/OAuthProvidersResponse";
@@ -20,10 +20,16 @@ type Result = CfgAccountsOauthProvidersRetrieveResponses[keyof CfgAccountsOauthP
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgAccountsOauthProvidersRetrieve(
24
30
  args?: Omit<CfgAccountsOauthProvidersRetrieveData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_accounts_oauth_providers_retrieve", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgAccountsOtp } from "../../sdk.gen";
10
10
  import type { CfgAccountsOtpConsentPolicyRetrieveData, CfgAccountsOtpConsentPolicyRetrieveResponses } from "../../types.gen";
11
11
  import { ConsentPolicySchema } from "../schemas/ConsentPolicy";
@@ -20,10 +20,16 @@ type Result = CfgAccountsOtpConsentPolicyRetrieveResponses[keyof CfgAccountsOtpC
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgAccountsOtpConsentPolicyRetrieve(
24
30
  args?: Omit<CfgAccountsOtpConsentPolicyRetrieveData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_accounts_otp_consent_policy_retrieve", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgAccountsProfile } from "../../sdk.gen";
10
10
  import type { CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveResponses } from "../../types.gen";
11
11
  import { UserSchema } from "../schemas/User";
@@ -20,10 +20,16 @@ type Result = CfgAccountsProfileRetrieveResponses[keyof CfgAccountsProfileRetrie
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgAccountsProfileRetrieve(
24
30
  args?: Omit<CfgAccountsProfileRetrieveData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_accounts_profile_retrieve", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -1288,39 +1288,6 @@
1288
1288
  "success"
1289
1289
  ]
1290
1290
  },
1291
- "CentrifugoToken": {
1292
- "type": "object",
1293
- "description": "Nested serializer for Centrifugo WebSocket connection token.",
1294
- "properties": {
1295
- "token": {
1296
- "type": "string",
1297
- "description": "JWT token for Centrifugo WebSocket connection"
1298
- },
1299
- "centrifugo_url": {
1300
- "type": "string",
1301
- "format": "uri",
1302
- "description": "Centrifugo WebSocket URL"
1303
- },
1304
- "expires_at": {
1305
- "type": "string",
1306
- "format": "date-time",
1307
- "description": "Token expiration time (ISO 8601)"
1308
- },
1309
- "channels": {
1310
- "type": "array",
1311
- "items": {
1312
- "type": "string"
1313
- },
1314
- "description": "List of allowed channels for this user"
1315
- }
1316
- },
1317
- "required": [
1318
- "centrifugo_url",
1319
- "channels",
1320
- "expires_at",
1321
- "token"
1322
- ]
1323
- },
1324
1291
  "CfgUserUpdateRequest": {
1325
1292
  "type": "object",
1326
1293
  "description": "Serializer for updating user profile.",
@@ -1987,17 +1954,6 @@
1987
1954
  "readOnly": true,
1988
1955
  "default": 0
1989
1956
  },
1990
- "centrifugo": {
1991
- "oneOf": [
1992
- {
1993
- "$ref": "#/components/schemas/CentrifugoToken"
1994
- },
1995
- {
1996
- "type": "null"
1997
- }
1998
- ],
1999
- "readOnly": true
2000
- },
2001
1957
  "api_key": {
2002
1958
  "type": [
2003
1959
  "string",
@@ -2009,7 +1965,6 @@
2009
1965
  "required": [
2010
1966
  "api_key",
2011
1967
  "avatar",
2012
- "centrifugo",
2013
1968
  "date_joined",
2014
1969
  "display_username",
2015
1970
  "email",
@@ -3,7 +3,6 @@
3
3
  // DO NOT EDIT — re-run `make gen-clients`.
4
4
 
5
5
  import { z } from "zod";
6
- import { CentrifugoTokenSchema } from "./CentrifugoToken";
7
6
 
8
7
  export const UserSchema = z.object({
9
8
  id: z.number().int(),
@@ -24,7 +23,6 @@ export const UserSchema = z.object({
24
23
  date_joined: z.string().datetime({ offset: true }),
25
24
  last_login: z.string().datetime({ offset: true }).nullable(),
26
25
  unanswered_messages_count: z.number().int().default(0),
27
- centrifugo: CentrifugoTokenSchema.nullable(),
28
26
  api_key: z.string().nullable(),
29
27
  });
30
28
 
@@ -8,7 +8,6 @@ export * from "./APIKeyReveal";
8
8
  export * from "./APIKeyTestRequest";
9
9
  export * from "./APIKeyTestResult";
10
10
  export * from "./AccountDeleteResponse";
11
- export * from "./CentrifugoToken";
12
11
  export * from "./CfgUserUpdateRequest";
13
12
  export * from "./ConsentPolicy";
14
13
  export * from "./MarketingConsentDefaultEnum";
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgTotpBackupCodes } from "../../sdk.gen";
10
10
  import type { CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses } from "../../types.gen";
11
11
  import { BackupCodesStatusSchema } from "../schemas/BackupCodesStatus";
@@ -20,10 +20,16 @@ type Result = CfgTotpBackupCodesRetrieveResponses[keyof CfgTotpBackupCodesRetrie
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgTotpBackupCodesRetrieve(
24
30
  args?: Omit<CfgTotpBackupCodesRetrieveData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_totp_backup_codes_retrieve", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -5,7 +5,7 @@
5
5
  // DO NOT EDIT — re-run `make gen`.
6
6
 
7
7
  import useSWR from "swr";
8
- import type { SWRConfiguration } from "swr";
8
+ import type { SWRConfiguration, SWRResponse } from "swr";
9
9
  import { CfgTotp } from "../../sdk.gen";
10
10
  import type { CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses } from "../../types.gen";
11
11
  import { DeviceListResponseSchema } from "../schemas/DeviceListResponse";
@@ -20,10 +20,16 @@ type Result = CfgTotpDevicesRetrieveResponses[keyof CfgTotpDevicesRetrieveRespon
20
20
  */
21
21
  type HookConfig = SWRConfiguration<Result> & { enabled?: boolean };
22
22
 
23
+ // The return type is ANNOTATED, not inferred. Left to inference, tsc reaches
24
+ // into swr's internal `dist/types-*` module to name the result and fails with
25
+ // TS2742 ("cannot be named without a reference to ... not portable") in every
26
+ // consumer that has swr hoisted to a different node_modules depth. Naming
27
+ // SWRResponse here keeps the public surface expressible from the package's own
28
+ // imports.
23
29
  export function useCfgTotpDevicesRetrieve(
24
30
  args?: Omit<CfgTotpDevicesRetrieveData, "url" | "body">,
25
31
  config?: HookConfig,
26
- ) {
32
+ ): SWRResponse<Result> {
27
33
  const { enabled = true, ...swrConfig } = config ?? {};
28
34
  const key = enabled ? ["cfg_totp_devices_retrieve", args ?? {}] as const : null;
29
35
  return useSWR<Result>(
@@ -10,22 +10,19 @@ import './helpers/auth';
10
10
  export { auth, type Auth } from './helpers/auth';
11
11
 
12
12
  import { API as CfgAccountsAPI } from './_cfg_accounts';
13
- import { API as CfgCentrifugoAPI } from './_cfg_centrifugo';
14
13
  import { API as CfgTotpAPI } from './_cfg_totp';
15
14
 
16
15
  // Singletons for ergonomic access (`import { apiAccounts } from '@your/api'`).
17
16
  // All instances share the same global `auth` store.
18
17
  export const CfgAccountsApi = new CfgAccountsAPI();
19
- export const CfgCentrifugoApi = new CfgCentrifugoAPI();
20
18
  export const CfgTotpApi = new CfgTotpAPI();
21
19
 
22
20
  // Per-group wrapper classes (e.g. for tests / SSR isolation of options).
23
21
  export { API as CfgAccountsAPI } from './_cfg_accounts';
24
- export { API as CfgCentrifugoAPI } from './_cfg_centrifugo';
25
22
  export { API as CfgTotpAPI } from './_cfg_totp';
26
23
 
27
24
  // Hey API SDK classes — one per OpenAPI tag. Lets consumers call
28
- // `Centrifugo.cfgCentrifugoAuthTokenRetrieve({...})` directly.
25
+ // `Accounts.cfgAccountsProfileRetrieve({...})` directly.
29
26
  //
30
27
  // NOTE: classes whose name would collide with a barrel-level type
31
28
  // alias (e.g. `Auth`, which is also `type Auth = typeof auth`) are
@@ -34,7 +31,6 @@ export { API as CfgTotpAPI } from './_cfg_totp';
34
31
  // '<api>/_auth'`. To remove the alias, rename the OpenAPI tag on the
35
32
  // backend so the SDK class doesn't collide.
36
33
  export { CfgAccountsApiKey, CfgAccountsOauth, CfgAccountsOtp, CfgAccountsProfile, CfgAccountsAuth } from './_cfg_accounts';
37
- export { CfgCentrifugo } from './_cfg_centrifugo';
38
34
  export { CfgTotpBackupCodes, CfgTotp, CfgTotpSetup, CfgTotpVerify } from './_cfg_totp';
39
35
 
40
36
  // Generated DTO / schema types (Hey API). The per-group barrels each
@@ -1120,60 +1120,6 @@
1120
1120
  "x-async-capable": false
1121
1121
  }
1122
1122
  },
1123
- "/cfg/centrifugo/auth/token/": {
1124
- "get": {
1125
- "operationId": "cfg_centrifugo_auth_token_retrieve",
1126
- "description": "Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.",
1127
- "summary": "Get Centrifugo connection token",
1128
- "tags": [
1129
- "cfg_centrifugo"
1130
- ],
1131
- "security": [
1132
- {
1133
- "apiKeyAuth": []
1134
- },
1135
- {
1136
- "jwtAuthWithLastLogin": []
1137
- },
1138
- {
1139
- "tokenAuth": []
1140
- }
1141
- ],
1142
- "responses": {
1143
- "200": {
1144
- "content": {
1145
- "application/json": {
1146
- "schema": {
1147
- "$ref": "#/components/schemas/ConnectionTokenResponse"
1148
- }
1149
- }
1150
- },
1151
- "description": ""
1152
- },
1153
- "401": {
1154
- "content": {
1155
- "application/json": {
1156
- "schema": {
1157
- "description": "Unauthorized - authentication required"
1158
- }
1159
- }
1160
- },
1161
- "description": ""
1162
- },
1163
- "500": {
1164
- "content": {
1165
- "application/json": {
1166
- "schema": {
1167
- "description": "Server error"
1168
- }
1169
- }
1170
- },
1171
- "description": ""
1172
- }
1173
- },
1174
- "x-async-capable": false
1175
- }
1176
- },
1177
1123
  "/cfg/totp/backup-codes/": {
1178
1124
  "get": {
1179
1125
  "operationId": "cfg_totp_backup_codes_retrieve",
@@ -1827,39 +1773,6 @@
1827
1773
  "total_generated"
1828
1774
  ]
1829
1775
  },
1830
- "CentrifugoToken": {
1831
- "type": "object",
1832
- "description": "Nested serializer for Centrifugo WebSocket connection token.",
1833
- "properties": {
1834
- "token": {
1835
- "type": "string",
1836
- "description": "JWT token for Centrifugo WebSocket connection"
1837
- },
1838
- "centrifugo_url": {
1839
- "type": "string",
1840
- "format": "uri",
1841
- "description": "Centrifugo WebSocket URL"
1842
- },
1843
- "expires_at": {
1844
- "type": "string",
1845
- "format": "date-time",
1846
- "description": "Token expiration time (ISO 8601)"
1847
- },
1848
- "channels": {
1849
- "type": "array",
1850
- "items": {
1851
- "type": "string"
1852
- },
1853
- "description": "List of allowed channels for this user"
1854
- }
1855
- },
1856
- "required": [
1857
- "centrifugo_url",
1858
- "channels",
1859
- "expires_at",
1860
- "token"
1861
- ]
1862
- },
1863
1776
  "CfgUserUpdateRequest": {
1864
1777
  "type": "object",
1865
1778
  "description": "Serializer for updating user profile.",
@@ -1941,42 +1854,6 @@
1941
1854
  "message"
1942
1855
  ]
1943
1856
  },
1944
- "ConnectionTokenResponse": {
1945
- "description": "Response model for Centrifugo connection token.",
1946
- "properties": {
1947
- "token": {
1948
- "description": "JWT token for Centrifugo connection",
1949
- "title": "Token",
1950
- "type": "string"
1951
- },
1952
- "centrifugo_url": {
1953
- "description": "Centrifugo WebSocket URL",
1954
- "title": "Centrifugo Url",
1955
- "type": "string"
1956
- },
1957
- "expires_at": {
1958
- "description": "Token expiration time (ISO 8601)",
1959
- "title": "Expires At",
1960
- "type": "string"
1961
- },
1962
- "channels": {
1963
- "description": "List of allowed channels",
1964
- "items": {
1965
- "type": "string"
1966
- },
1967
- "title": "Channels",
1968
- "type": "array"
1969
- }
1970
- },
1971
- "required": [
1972
- "token",
1973
- "centrifugo_url",
1974
- "expires_at",
1975
- "channels"
1976
- ],
1977
- "title": "ConnectionTokenResponse",
1978
- "type": "object"
1979
- },
1980
1857
  "ConsentPolicy": {
1981
1858
  "type": "object",
1982
1859
  "description": "Marketing-consent UI policy derived from the request's geo context.",
@@ -2897,17 +2774,6 @@
2897
2774
  "readOnly": true,
2898
2775
  "default": 0
2899
2776
  },
2900
- "centrifugo": {
2901
- "oneOf": [
2902
- {
2903
- "$ref": "#/components/schemas/CentrifugoToken"
2904
- },
2905
- {
2906
- "type": "null"
2907
- }
2908
- ],
2909
- "readOnly": true
2910
- },
2911
2777
  "api_key": {
2912
2778
  "type": [
2913
2779
  "string",
@@ -2919,7 +2785,6 @@
2919
2785
  "required": [
2920
2786
  "api_key",
2921
2787
  "avatar",
2922
- "centrifugo",
2923
2788
  "date_joined",
2924
2789
  "display_username",
2925
2790
  "email",
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';
4
4
  import { client } from './client.gen';
5
- import type { CfgAccountsApiKeyRegenerateCreateData, CfgAccountsApiKeyRegenerateCreateErrors, CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRetrieveData, CfgAccountsApiKeyRetrieveErrors, CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRevealCreateData, CfgAccountsApiKeyRevealCreateErrors, CfgAccountsApiKeyRevealCreateResponses, CfgAccountsApiKeyTestCreateData, CfgAccountsApiKeyTestCreateResponses, CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpConsentPolicyRetrieveData, CfgAccountsOtpConsentPolicyRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenBlacklistCreateData, CfgAccountsTokenBlacklistCreateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses, CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveErrors, CfgCentrifugoAuthTokenRetrieveResponses, CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateErrors, CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses, CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses, CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses, CfgTotpDisableCreateData, CfgTotpDisableCreateErrors, CfgTotpDisableCreateResponses, CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateErrors, CfgTotpSetupConfirmCreateResponses, CfgTotpSetupCreateData, CfgTotpSetupCreateErrors, CfgTotpSetupCreateResponses, CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateErrors, CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyCreateData, CfgTotpVerifyCreateErrors, CfgTotpVerifyCreateResponses } from './types.gen';
5
+ import type { CfgAccountsApiKeyRegenerateCreateData, CfgAccountsApiKeyRegenerateCreateErrors, CfgAccountsApiKeyRegenerateCreateResponses, CfgAccountsApiKeyRetrieveData, CfgAccountsApiKeyRetrieveErrors, CfgAccountsApiKeyRetrieveResponses, CfgAccountsApiKeyRevealCreateData, CfgAccountsApiKeyRevealCreateErrors, CfgAccountsApiKeyRevealCreateResponses, CfgAccountsApiKeyTestCreateData, CfgAccountsApiKeyTestCreateResponses, CfgAccountsOauthConnectionsListData, CfgAccountsOauthConnectionsListResponses, CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateErrors, CfgAccountsOauthDisconnectCreateResponses, CfgAccountsOauthGithubAuthorizeCreateData, CfgAccountsOauthGithubAuthorizeCreateErrors, CfgAccountsOauthGithubAuthorizeCreateResponses, CfgAccountsOauthGithubCallbackCreateData, CfgAccountsOauthGithubCallbackCreateErrors, CfgAccountsOauthGithubCallbackCreateResponses, CfgAccountsOauthProvidersRetrieveData, CfgAccountsOauthProvidersRetrieveResponses, CfgAccountsOtpConsentPolicyRetrieveData, CfgAccountsOtpConsentPolicyRetrieveResponses, CfgAccountsOtpRequestCreateData, CfgAccountsOtpRequestCreateErrors, CfgAccountsOtpRequestCreateResponses, CfgAccountsOtpVerifyCreateData, CfgAccountsOtpVerifyCreateErrors, CfgAccountsOtpVerifyCreateResponses, CfgAccountsProfileAvatarCreateData, CfgAccountsProfileAvatarCreateErrors, CfgAccountsProfileAvatarCreateResponses, CfgAccountsProfileDeleteCreateData, CfgAccountsProfileDeleteCreateErrors, CfgAccountsProfileDeleteCreateResponses, CfgAccountsProfilePartialPartialUpdateData, CfgAccountsProfilePartialPartialUpdateErrors, CfgAccountsProfilePartialPartialUpdateResponses, CfgAccountsProfilePartialUpdateData, CfgAccountsProfilePartialUpdateErrors, CfgAccountsProfilePartialUpdateResponses, CfgAccountsProfileRetrieveData, CfgAccountsProfileRetrieveErrors, CfgAccountsProfileRetrieveResponses, CfgAccountsProfileUpdatePartialUpdateData, CfgAccountsProfileUpdatePartialUpdateErrors, CfgAccountsProfileUpdatePartialUpdateResponses, CfgAccountsProfileUpdateUpdateData, CfgAccountsProfileUpdateUpdateErrors, CfgAccountsProfileUpdateUpdateResponses, CfgAccountsTokenBlacklistCreateData, CfgAccountsTokenBlacklistCreateResponses, CfgAccountsTokenRefreshCreateData, CfgAccountsTokenRefreshCreateResponses, CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateErrors, CfgTotpBackupCodesRegenerateCreateResponses, CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses, CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses, CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses, CfgTotpDisableCreateData, CfgTotpDisableCreateErrors, CfgTotpDisableCreateResponses, CfgTotpSetupConfirmCreateData, CfgTotpSetupConfirmCreateErrors, CfgTotpSetupConfirmCreateResponses, CfgTotpSetupCreateData, CfgTotpSetupCreateErrors, CfgTotpSetupCreateResponses, CfgTotpVerifyBackupCreateData, CfgTotpVerifyBackupCreateErrors, CfgTotpVerifyBackupCreateResponses, CfgTotpVerifyCreateData, CfgTotpVerifyCreateErrors, CfgTotpVerifyCreateResponses } from './types.gen';
6
6
 
7
7
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
8
8
  /**
@@ -455,25 +455,6 @@ export class CfgAccountsAuth {
455
455
  }
456
456
  }
457
457
 
458
- export class CfgCentrifugo {
459
- /**
460
- * Get Centrifugo connection token
461
- *
462
- * Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
463
- */
464
- public static cfgCentrifugoAuthTokenRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgCentrifugoAuthTokenRetrieveData, ThrowOnError>): RequestResult<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError> {
465
- return (options?.client ?? client).get<CfgCentrifugoAuthTokenRetrieveResponses, CfgCentrifugoAuthTokenRetrieveErrors, ThrowOnError>({
466
- security: [
467
- { name: 'X-API-Key', type: 'apiKey' },
468
- { scheme: 'bearer', type: 'http' },
469
- { name: 'Authorization', type: 'apiKey' }
470
- ],
471
- url: '/cfg/centrifugo/auth/token/',
472
- ...options
473
- });
474
- }
475
- }
476
-
477
458
  export class CfgTotpBackupCodes {
478
459
  /**
479
460
  * Get backup codes status for user.