@djangocfg/api 2.1.546 → 2.1.547

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 (40) hide show
  1. package/dist/auth.cjs +331 -73
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.d.cts +90 -1
  4. package/dist/auth.d.ts +90 -1
  5. package/dist/auth.mjs +331 -73
  6. package/dist/auth.mjs.map +1 -1
  7. package/dist/clients.cjs +18 -0
  8. package/dist/clients.cjs.map +1 -1
  9. package/dist/clients.d.cts +96 -0
  10. package/dist/clients.d.ts +96 -0
  11. package/dist/clients.mjs +18 -0
  12. package/dist/clients.mjs.map +1 -1
  13. package/dist/hooks.cjs.map +1 -1
  14. package/dist/hooks.mjs.map +1 -1
  15. package/dist/index.cjs +18 -0
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +171 -3
  18. package/dist/index.d.ts +171 -3
  19. package/dist/index.mjs +18 -0
  20. package/dist/index.mjs.map +1 -1
  21. package/package.json +2 -2
  22. package/src/_api/generated/_cfg_accounts/hooks/index.ts +1 -0
  23. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenCreate.ts +64 -0
  24. package/src/_api/generated/_cfg_accounts/openapi.json +157 -0
  25. package/src/_api/generated/_cfg_accounts/schemas/PasswordLoginError.ts +13 -0
  26. package/src/_api/generated/_cfg_accounts/schemas/PasswordLoginRequest.ts +13 -0
  27. package/src/_api/generated/_cfg_accounts/schemas/PasswordLoginResponse.ts +18 -0
  28. package/src/_api/generated/_cfg_accounts/schemas/index.ts +3 -0
  29. package/src/_api/generated/openapi.json +157 -0
  30. package/src/_api/generated/sdk.gen.ts +20 -1
  31. package/src/_api/generated/types.gen.ts +149 -0
  32. package/src/auth/__tests__/passwordLogin.test.tsx +239 -0
  33. package/src/auth/context/AccountsContext.tsx +32 -7
  34. package/src/auth/context/AuthContext.tsx +104 -1
  35. package/src/auth/context/types.ts +10 -1
  36. package/src/auth/hooks/useAuthForm.ts +84 -0
  37. package/src/auth/hooks/useAuthFormState.ts +3 -0
  38. package/src/auth/types/form.ts +41 -1
  39. package/src/auth/types/index.ts +2 -0
  40. package/src/auth/utils/analytics.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "2.1.546",
3
+ "version": "2.1.547",
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",
@@ -85,7 +85,7 @@
85
85
  "zod": "^4.3.6"
86
86
  },
87
87
  "devDependencies": {
88
- "@djangocfg/typescript-config": "^2.1.546",
88
+ "@djangocfg/typescript-config": "^2.1.547",
89
89
  "@testing-library/react": "^16.3.2",
90
90
  "@types/node": "^25.9.5",
91
91
  "@types/react": "19.2.15",
@@ -21,4 +21,5 @@ export { useCfgAccountsProfileRetrieve } from "./useCfgAccountsProfileRetrieve";
21
21
  export { useCfgAccountsProfileUpdatePartialUpdate } from "./useCfgAccountsProfileUpdatePartialUpdate";
22
22
  export { useCfgAccountsProfileUpdateUpdate } from "./useCfgAccountsProfileUpdateUpdate";
23
23
  export { useCfgAccountsTokenBlacklistCreate } from "./useCfgAccountsTokenBlacklistCreate";
24
+ export { useCfgAccountsTokenCreate } from "./useCfgAccountsTokenCreate";
24
25
  export { useCfgAccountsTokenRefreshCreate } from "./useCfgAccountsTokenRefreshCreate";
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+
3
+ // AUTO-GENERATED by openapi_processor / ts.hooks
4
+ // POST /cfg/accounts/token/
5
+ // DO NOT EDIT — re-run `make gen`.
6
+
7
+ import useSWRMutation from "swr/mutation";
8
+ import type { SWRMutationConfiguration } from "swr/mutation";
9
+ import { CfgAccountsAuth } from "../../sdk.gen";
10
+ import type { CfgAccountsTokenCreateData, CfgAccountsTokenCreateResponses } from "../../types.gen";
11
+ import { PasswordLoginResponseSchema } from "../schemas/PasswordLoginResponse";
12
+
13
+ type Args = Omit<CfgAccountsTokenCreateData, "url">;
14
+ type Result = CfgAccountsTokenCreateResponses[keyof CfgAccountsTokenCreateResponses];
15
+
16
+ export function useCfgAccountsTokenCreate(
17
+ config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_accounts_token_create"], Args>,
18
+ ) {
19
+ return useSWRMutation<Result, Error, readonly ["cfg_accounts_token_create"], Args>(
20
+ ["cfg_accounts_token_create"] as const,
21
+ async (_key, { arg }: { arg: Args }) => {
22
+ const res = await CfgAccountsAuth.cfgAccountsTokenCreate({ ...arg, throwOnError: true } as never);
23
+ const data = res.data as Result;
24
+ const parsed = PasswordLoginResponseSchema.safeParse(data);
25
+ if (!parsed.success) {
26
+ // Log first so the failure is always visible, even if the
27
+ // event handler swallows it.
28
+ console.warn(
29
+ "[zod] response did not match schema",
30
+ {
31
+ operation: "cfg_accounts_token_create",
32
+ method: "POST",
33
+ path: "/cfg/accounts/token/",
34
+ issues: parsed.error.issues,
35
+ data,
36
+ },
37
+ );
38
+ if (typeof window !== "undefined") {
39
+ try {
40
+ window.dispatchEvent(
41
+ new CustomEvent("zod-validation-error", {
42
+ detail: {
43
+ operation: "cfg_accounts_token_create",
44
+ method: "POST",
45
+ path: "/cfg/accounts/token/",
46
+ issues: parsed.error.issues,
47
+ data,
48
+ timestamp: new Date(),
49
+ },
50
+ bubbles: true,
51
+ cancelable: false,
52
+ }),
53
+ );
54
+ } catch {
55
+ // Event dispatch is best-effort.
56
+ }
57
+ }
58
+ return data;
59
+ }
60
+ return parsed.data as unknown as Result;
61
+ },
62
+ config,
63
+ );
64
+ }
@@ -1071,6 +1071,61 @@
1071
1071
  "x-async-capable": false
1072
1072
  }
1073
1073
  },
1074
+ "/cfg/accounts/token/": {
1075
+ "post": {
1076
+ "operationId": "cfg_accounts_token_create",
1077
+ "description": "Obtain a JWT pair with email + password.\n\nReturns the same envelope as OTP verify: either ``requires_2fa=True`` with\na session id, or the token pair plus the user object. Failures are uniform\n(401 ``invalid_credentials``) whether the email is unknown, the password is\nwrong, or the account is inactive/soft-deleted — no enumeration.",
1078
+ "tags": [
1079
+ "cfg_accounts_auth"
1080
+ ],
1081
+ "requestBody": {
1082
+ "content": {
1083
+ "application/json": {
1084
+ "schema": {
1085
+ "$ref": "#/components/schemas/PasswordLoginRequest"
1086
+ }
1087
+ }
1088
+ },
1089
+ "required": true
1090
+ },
1091
+ "security": [
1092
+ {}
1093
+ ],
1094
+ "responses": {
1095
+ "200": {
1096
+ "content": {
1097
+ "application/json": {
1098
+ "schema": {
1099
+ "$ref": "#/components/schemas/PasswordLoginResponse"
1100
+ }
1101
+ }
1102
+ },
1103
+ "description": ""
1104
+ },
1105
+ "401": {
1106
+ "content": {
1107
+ "application/json": {
1108
+ "schema": {
1109
+ "$ref": "#/components/schemas/PasswordLoginError"
1110
+ }
1111
+ }
1112
+ },
1113
+ "description": ""
1114
+ },
1115
+ "429": {
1116
+ "content": {
1117
+ "application/json": {
1118
+ "schema": {
1119
+ "$ref": "#/components/schemas/PasswordLoginError"
1120
+ }
1121
+ }
1122
+ },
1123
+ "description": ""
1124
+ }
1125
+ },
1126
+ "x-async-capable": false
1127
+ }
1128
+ },
1074
1129
  "/cfg/accounts/token/blacklist/": {
1075
1130
  "post": {
1076
1131
  "operationId": "cfg_accounts_token_blacklist_create",
@@ -1763,6 +1818,108 @@
1763
1818
  }
1764
1819
  }
1765
1820
  },
1821
+ "PasswordLoginError": {
1822
+ "type": "object",
1823
+ "description": "Typed error response for password login.\n\nerror_code values:\n - invalid_credentials — wrong email/password, inactive or deleted account\n - rate_limited — IP rate limit hit\n - locked_out — too many failed attempts for this email",
1824
+ "properties": {
1825
+ "error": {
1826
+ "type": "string",
1827
+ "description": "Human-readable error message"
1828
+ },
1829
+ "error_code": {
1830
+ "type": "string",
1831
+ "description": "Machine-readable error code"
1832
+ },
1833
+ "retry_after": {
1834
+ "type": [
1835
+ "integer",
1836
+ "null"
1837
+ ],
1838
+ "description": "Seconds until the caller may retry (throttled responses only)"
1839
+ }
1840
+ },
1841
+ "required": [
1842
+ "error",
1843
+ "error_code"
1844
+ ]
1845
+ },
1846
+ "PasswordLoginRequest": {
1847
+ "type": "object",
1848
+ "description": "Validate email+password against live accounts only.\n\nSubclasses SimpleJWT so the field/validation contract stays theirs, but\nreplaces ``validate()`` — the token pair itself is minted by the view via\n``mint_tokens_for_request`` so the DPoP binding and remembered-session\nlifetime match OTP, OAuth and TOTP exactly.",
1849
+ "properties": {
1850
+ "remember_me": {
1851
+ "type": "boolean",
1852
+ "default": false,
1853
+ "description": "Keep this browser signed in for 30 days"
1854
+ },
1855
+ "email": {
1856
+ "type": "string",
1857
+ "format": "email",
1858
+ "writeOnly": true,
1859
+ "minLength": 1
1860
+ },
1861
+ "password": {
1862
+ "type": "string",
1863
+ "writeOnly": true
1864
+ }
1865
+ },
1866
+ "required": [
1867
+ "email",
1868
+ "password"
1869
+ ]
1870
+ },
1871
+ "PasswordLoginResponse": {
1872
+ "type": "object",
1873
+ "description": "Password-login response.\n\nMirrors the OTP verify response so a client can treat every login flow\nidentically. ``requires_2fa=True`` carries a session id instead of tokens.",
1874
+ "properties": {
1875
+ "requires_2fa": {
1876
+ "type": "boolean",
1877
+ "default": false,
1878
+ "description": "Whether 2FA verification is required"
1879
+ },
1880
+ "session_id": {
1881
+ "type": [
1882
+ "string",
1883
+ "null"
1884
+ ],
1885
+ "format": "uuid",
1886
+ "description": "2FA session ID (if requires_2fa is True)"
1887
+ },
1888
+ "refresh": {
1889
+ "type": [
1890
+ "string",
1891
+ "null"
1892
+ ],
1893
+ "description": "JWT refresh token (if requires_2fa is False)"
1894
+ },
1895
+ "access": {
1896
+ "type": [
1897
+ "string",
1898
+ "null"
1899
+ ],
1900
+ "description": "JWT access token (if requires_2fa is False)"
1901
+ },
1902
+ "user": {
1903
+ "oneOf": [
1904
+ {
1905
+ "$ref": "#/components/schemas/User"
1906
+ },
1907
+ {
1908
+ "type": "null"
1909
+ }
1910
+ ],
1911
+ "description": "User information (if requires_2fa is False)"
1912
+ },
1913
+ "should_prompt_2fa": {
1914
+ "type": "boolean",
1915
+ "description": "Whether user should be prompted to enable 2FA"
1916
+ },
1917
+ "persistent_session": {
1918
+ "type": "boolean",
1919
+ "description": "Whether this login should persist across browser restarts"
1920
+ }
1921
+ }
1922
+ },
1766
1923
  "PatchedCfgUserUpdateRequest": {
1767
1924
  "type": "object",
1768
1925
  "description": "Serializer for updating user profile.",
@@ -0,0 +1,13 @@
1
+ // AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
2
+ // Source: OpenAPI 3.1 components.schemas
3
+ // DO NOT EDIT — re-run `make gen-clients`.
4
+
5
+ import { z } from "zod";
6
+
7
+ export const PasswordLoginErrorSchema = z.object({
8
+ error: z.string(),
9
+ error_code: z.string(),
10
+ retry_after: z.number().int().nullable().optional(),
11
+ });
12
+
13
+ export type PasswordLoginError = z.infer<typeof PasswordLoginErrorSchema>;
@@ -0,0 +1,13 @@
1
+ // AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
2
+ // Source: OpenAPI 3.1 components.schemas
3
+ // DO NOT EDIT — re-run `make gen-clients`.
4
+
5
+ import { z } from "zod";
6
+
7
+ export const PasswordLoginRequestSchema = z.object({
8
+ remember_me: z.boolean().default(false).optional(),
9
+ email: z.email(),
10
+ password: z.string(),
11
+ });
12
+
13
+ export type PasswordLoginRequest = z.infer<typeof PasswordLoginRequestSchema>;
@@ -0,0 +1,18 @@
1
+ // AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
2
+ // Source: OpenAPI 3.1 components.schemas
3
+ // DO NOT EDIT — re-run `make gen-clients`.
4
+
5
+ import { z } from "zod";
6
+ import { UserSchema } from "./User";
7
+
8
+ export const PasswordLoginResponseSchema = z.object({
9
+ requires_2fa: z.boolean().default(false).optional(),
10
+ session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
11
+ refresh: z.string().nullable().optional(),
12
+ access: z.string().nullable().optional(),
13
+ user: UserSchema.nullable().optional(),
14
+ should_prompt_2fa: z.boolean().optional(),
15
+ persistent_session: z.boolean().optional(),
16
+ });
17
+
18
+ export type PasswordLoginResponse = z.infer<typeof PasswordLoginResponseSchema>;
@@ -25,6 +25,9 @@ export * from "./OTPRequestRequest";
25
25
  export * from "./OTPRequestResponse";
26
26
  export * from "./OTPVerifyRequest";
27
27
  export * from "./OTPVerifyResponse";
28
+ export * from "./PasswordLoginError";
29
+ export * from "./PasswordLoginRequest";
30
+ export * from "./PasswordLoginResponse";
28
31
  export * from "./PatchedCfgUserUpdateRequest";
29
32
  export * from "./TokenBlacklistRequest";
30
33
  export * from "./TokenRefresh";
@@ -1063,6 +1063,61 @@
1063
1063
  "x-async-capable": false
1064
1064
  }
1065
1065
  },
1066
+ "/cfg/accounts/token/": {
1067
+ "post": {
1068
+ "operationId": "cfg_accounts_token_create",
1069
+ "description": "Obtain a JWT pair with email + password.\n\nReturns the same envelope as OTP verify: either ``requires_2fa=True`` with\na session id, or the token pair plus the user object. Failures are uniform\n(401 ``invalid_credentials``) whether the email is unknown, the password is\nwrong, or the account is inactive/soft-deleted — no enumeration.",
1070
+ "tags": [
1071
+ "cfg_accounts_auth"
1072
+ ],
1073
+ "requestBody": {
1074
+ "content": {
1075
+ "application/json": {
1076
+ "schema": {
1077
+ "$ref": "#/components/schemas/PasswordLoginRequest"
1078
+ }
1079
+ }
1080
+ },
1081
+ "required": true
1082
+ },
1083
+ "security": [
1084
+ {}
1085
+ ],
1086
+ "responses": {
1087
+ "200": {
1088
+ "content": {
1089
+ "application/json": {
1090
+ "schema": {
1091
+ "$ref": "#/components/schemas/PasswordLoginResponse"
1092
+ }
1093
+ }
1094
+ },
1095
+ "description": ""
1096
+ },
1097
+ "401": {
1098
+ "content": {
1099
+ "application/json": {
1100
+ "schema": {
1101
+ "$ref": "#/components/schemas/PasswordLoginError"
1102
+ }
1103
+ }
1104
+ },
1105
+ "description": ""
1106
+ },
1107
+ "429": {
1108
+ "content": {
1109
+ "application/json": {
1110
+ "schema": {
1111
+ "$ref": "#/components/schemas/PasswordLoginError"
1112
+ }
1113
+ }
1114
+ },
1115
+ "description": ""
1116
+ }
1117
+ },
1118
+ "x-async-capable": false
1119
+ }
1120
+ },
1066
1121
  "/cfg/accounts/token/blacklist/": {
1067
1122
  "post": {
1068
1123
  "operationId": "cfg_accounts_token_blacklist_create",
@@ -2398,6 +2453,108 @@
2398
2453
  }
2399
2454
  }
2400
2455
  },
2456
+ "PasswordLoginError": {
2457
+ "type": "object",
2458
+ "description": "Typed error response for password login.\n\nerror_code values:\n - invalid_credentials — wrong email/password, inactive or deleted account\n - rate_limited — IP rate limit hit\n - locked_out — too many failed attempts for this email",
2459
+ "properties": {
2460
+ "error": {
2461
+ "type": "string",
2462
+ "description": "Human-readable error message"
2463
+ },
2464
+ "error_code": {
2465
+ "type": "string",
2466
+ "description": "Machine-readable error code"
2467
+ },
2468
+ "retry_after": {
2469
+ "type": [
2470
+ "integer",
2471
+ "null"
2472
+ ],
2473
+ "description": "Seconds until the caller may retry (throttled responses only)"
2474
+ }
2475
+ },
2476
+ "required": [
2477
+ "error",
2478
+ "error_code"
2479
+ ]
2480
+ },
2481
+ "PasswordLoginRequest": {
2482
+ "type": "object",
2483
+ "description": "Validate email+password against live accounts only.\n\nSubclasses SimpleJWT so the field/validation contract stays theirs, but\nreplaces ``validate()`` — the token pair itself is minted by the view via\n``mint_tokens_for_request`` so the DPoP binding and remembered-session\nlifetime match OTP, OAuth and TOTP exactly.",
2484
+ "properties": {
2485
+ "remember_me": {
2486
+ "type": "boolean",
2487
+ "default": false,
2488
+ "description": "Keep this browser signed in for 30 days"
2489
+ },
2490
+ "email": {
2491
+ "type": "string",
2492
+ "format": "email",
2493
+ "writeOnly": true,
2494
+ "minLength": 1
2495
+ },
2496
+ "password": {
2497
+ "type": "string",
2498
+ "writeOnly": true
2499
+ }
2500
+ },
2501
+ "required": [
2502
+ "email",
2503
+ "password"
2504
+ ]
2505
+ },
2506
+ "PasswordLoginResponse": {
2507
+ "type": "object",
2508
+ "description": "Password-login response.\n\nMirrors the OTP verify response so a client can treat every login flow\nidentically. ``requires_2fa=True`` carries a session id instead of tokens.",
2509
+ "properties": {
2510
+ "requires_2fa": {
2511
+ "type": "boolean",
2512
+ "default": false,
2513
+ "description": "Whether 2FA verification is required"
2514
+ },
2515
+ "session_id": {
2516
+ "type": [
2517
+ "string",
2518
+ "null"
2519
+ ],
2520
+ "format": "uuid",
2521
+ "description": "2FA session ID (if requires_2fa is True)"
2522
+ },
2523
+ "refresh": {
2524
+ "type": [
2525
+ "string",
2526
+ "null"
2527
+ ],
2528
+ "description": "JWT refresh token (if requires_2fa is False)"
2529
+ },
2530
+ "access": {
2531
+ "type": [
2532
+ "string",
2533
+ "null"
2534
+ ],
2535
+ "description": "JWT access token (if requires_2fa is False)"
2536
+ },
2537
+ "user": {
2538
+ "oneOf": [
2539
+ {
2540
+ "$ref": "#/components/schemas/User"
2541
+ },
2542
+ {
2543
+ "type": "null"
2544
+ }
2545
+ ],
2546
+ "description": "User information (if requires_2fa is False)"
2547
+ },
2548
+ "should_prompt_2fa": {
2549
+ "type": "boolean",
2550
+ "description": "Whether user should be prompted to enable 2FA"
2551
+ },
2552
+ "persistent_session": {
2553
+ "type": "boolean",
2554
+ "description": "Whether this login should persist across browser restarts"
2555
+ }
2556
+ }
2557
+ },
2401
2558
  "PatchedCfgUserUpdateRequest": {
2402
2559
  "type": "object",
2403
2560
  "description": "Serializer for updating user profile.",
@@ -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, 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, CfgAccountsTokenCreateData, CfgAccountsTokenCreateErrors, CfgAccountsTokenCreateResponses, 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
  /**
@@ -416,6 +416,25 @@ export class CfgAccountsProfile {
416
416
  }
417
417
 
418
418
  export class CfgAccountsAuth {
419
+ /**
420
+ * Obtain a JWT pair with email + password.
421
+ *
422
+ * Returns the same envelope as OTP verify: either ``requires_2fa=True`` with
423
+ * a session id, or the token pair plus the user object. Failures are uniform
424
+ * (401 ``invalid_credentials``) whether the email is unknown, the password is
425
+ * wrong, or the account is inactive/soft-deleted — no enumeration.
426
+ */
427
+ public static cfgAccountsTokenCreate<ThrowOnError extends boolean = false>(options: Options<CfgAccountsTokenCreateData, ThrowOnError>): RequestResult<CfgAccountsTokenCreateResponses, CfgAccountsTokenCreateErrors, ThrowOnError> {
428
+ return (options.client ?? client).post<CfgAccountsTokenCreateResponses, CfgAccountsTokenCreateErrors, ThrowOnError>({
429
+ url: '/cfg/accounts/token/',
430
+ ...options,
431
+ headers: {
432
+ 'Content-Type': 'application/json',
433
+ ...options.headers
434
+ }
435
+ });
436
+ }
437
+
419
438
  /**
420
439
  * Revoke a refresh token (logout).
421
440
  *