@djangocfg/api 2.1.327 → 2.1.331
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-server.cjs +185 -3471
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +185 -3471
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +952 -3305
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +35 -35
- package/dist/auth.d.ts +35 -35
- package/dist/auth.mjs +952 -3305
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +90 -3396
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +4 -2508
- package/dist/clients.d.ts +4 -2508
- package/dist/clients.mjs +90 -3396
- package/dist/clients.mjs.map +1 -1
- package/dist/index.cjs +985 -3052
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1544 -1938
- package/dist/index.d.ts +1544 -1938
- package/dist/index.mjs +985 -3052
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/{cfg_centrifugo → _cfg_accounts}/api.ts +11 -55
- package/src/_api/generated/{cfg_totp → _cfg_accounts}/events.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthConnectionsList.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthDisconnectCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthProvidersRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpRequestCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpVerifyCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileAvatarCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileDeleteCreate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdateUpdate.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsTokenRefreshCreate.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_accounts}/index.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/AccountDeleteResponse.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CentrifugoToken.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CfgUserUpdateRequest.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthCallbackRequestRequest.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthConnection.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthDisconnectRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthError.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthProvidersResponse.ts +3 -3
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthTokenResponse.ts +7 -7
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPErrorResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestResponse.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyResponse.ts +6 -6
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/PatchedCfgUserUpdateRequest.ts +4 -4
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/ProviderEnum.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefresh.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefreshRequest.ts +2 -2
- package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/User.ts +13 -13
- package/src/_api/generated/_cfg_accounts/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_accounts/types.gen.ts +5 -0
- package/src/_api/generated/{cfg_totp → _cfg_centrifugo}/api.ts +11 -72
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/events.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_accounts → _cfg_centrifugo}/index.ts +3 -3
- package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/ConnectionTokenResponse.ts +4 -4
- package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_centrifugo/types.gen.ts +5 -0
- package/src/_api/generated/{cfg_accounts → _cfg_totp}/api.ts +11 -78
- package/src/_api/generated/{cfg_accounts → _cfg_totp}/events.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesDestroy.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesRetrieve.ts +5 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDisableCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupConfirmCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyBackupCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyCreate.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/index.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateRequest.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateResponse.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesStatus.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupResponse.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceList.ts +6 -6
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListResponse.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListStatusEnum.ts +2 -2
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DisableRequest.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/SetupRequest.ts +11 -0
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/SetupResponse.ts +4 -4
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/TotpVerifyUser.ts +12 -12
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyBackupRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyRequest.ts +3 -3
- package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyResponse.ts +4 -4
- package/src/_api/generated/_cfg_totp/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_totp/types.gen.ts +5 -0
- package/src/_api/generated/index.ts +11 -13
- package/src/_api/generated/{cfg_accounts/sdk.gen.ts → sdk.gen.ts} +455 -1
- package/src/_api/generated/{cfg_accounts/types.gen.ts → types.gen.ts} +607 -77
- package/src/auth/context/AccountsContext.tsx +10 -10
- package/src/auth/context/AuthContext.tsx +1 -1
- package/src/auth/hooks/useDeleteAccount.ts +2 -1
- package/src/auth/hooks/useGithubAuth.ts +3 -2
- package/src/auth/hooks/useTokenRefresh.ts +2 -1
- package/src/auth/hooks/useTwoFactor.ts +4 -3
- package/src/auth/hooks/useTwoFactorSetup.ts +3 -2
- package/src/auth/hooks/useTwoFactorStatus.ts +4 -3
- package/src/auth/middlewares/tokenRefresh.ts +2 -1
- package/src/clients.ts +3 -3
- package/src/index.ts +22 -5
- package/src/server.ts +9 -9
- package/src/_api/generated/cfg_centrifugo/client/client.gen.ts +0 -280
- package/src/_api/generated/cfg_centrifugo/client/index.ts +0 -25
- package/src/_api/generated/cfg_centrifugo/client/types.gen.ts +0 -217
- package/src/_api/generated/cfg_centrifugo/client/utils.gen.ts +0 -318
- package/src/_api/generated/cfg_centrifugo/client.gen.ts +0 -16
- package/src/_api/generated/cfg_centrifugo/core/auth.gen.ts +0 -41
- package/src/_api/generated/cfg_centrifugo/core/bodySerializer.gen.ts +0 -82
- package/src/_api/generated/cfg_centrifugo/core/params.gen.ts +0 -169
- package/src/_api/generated/cfg_centrifugo/core/pathSerializer.gen.ts +0 -171
- package/src/_api/generated/cfg_centrifugo/core/queryKeySerializer.gen.ts +0 -117
- package/src/_api/generated/cfg_centrifugo/core/serverSentEvents.gen.ts +0 -242
- package/src/_api/generated/cfg_centrifugo/core/types.gen.ts +0 -104
- package/src/_api/generated/cfg_centrifugo/core/utils.gen.ts +0 -140
- package/src/_api/generated/cfg_centrifugo/sdk.gen.ts +0 -64
- package/src/_api/generated/cfg_centrifugo/types.gen.ts +0 -61
- package/src/_api/generated/cfg_totp/client/client.gen.ts +0 -280
- package/src/_api/generated/cfg_totp/client/index.ts +0 -25
- package/src/_api/generated/cfg_totp/client/types.gen.ts +0 -217
- package/src/_api/generated/cfg_totp/client/utils.gen.ts +0 -318
- package/src/_api/generated/cfg_totp/client.gen.ts +0 -16
- package/src/_api/generated/cfg_totp/core/auth.gen.ts +0 -41
- package/src/_api/generated/cfg_totp/core/bodySerializer.gen.ts +0 -82
- package/src/_api/generated/cfg_totp/core/params.gen.ts +0 -169
- package/src/_api/generated/cfg_totp/core/pathSerializer.gen.ts +0 -171
- package/src/_api/generated/cfg_totp/core/queryKeySerializer.gen.ts +0 -117
- package/src/_api/generated/cfg_totp/core/serverSentEvents.gen.ts +0 -242
- package/src/_api/generated/cfg_totp/core/types.gen.ts +0 -104
- package/src/_api/generated/cfg_totp/core/utils.gen.ts +0 -140
- package/src/_api/generated/cfg_totp/schemas/SetupRequest.ts +0 -11
- package/src/_api/generated/cfg_totp/sdk.gen.ts +0 -432
- package/src/_api/generated/cfg_totp/types.gen.ts +0 -479
- /package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/index.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/client.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/index.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/types.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client → client}/utils.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/client.gen.ts → client.gen.ts} +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/auth.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/bodySerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/params.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/pathSerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/queryKeySerializer.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/serverSentEvents.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/types.gen.ts +0 -0
- /package/src/_api/generated/{cfg_accounts/core → core}/utils.gen.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/errors.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/index.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/logger.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/storage.ts +0 -0
- /package/src/_api/generated/{_shared → helpers}/validation-events.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { UserSchema } from "./User";
|
|
7
7
|
|
|
8
8
|
export const OTPVerifyResponseSchema = z.object({
|
|
9
|
-
requires_2fa: z.boolean().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
9
|
access: z.string().nullable().optional(),
|
|
13
|
-
|
|
10
|
+
refresh: z.string().nullable().optional(),
|
|
11
|
+
requires_2fa: z.boolean().default(false).optional(),
|
|
12
|
+
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(),
|
|
14
13
|
should_prompt_2fa: z.boolean().optional(),
|
|
14
|
+
user: UserSchema.nullable().optional(),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export type OTPVerifyResponse = z.infer<typeof OTPVerifyResponseSchema>;
|
package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/PatchedCfgUserUpdateRequest.ts
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
export const PatchedCfgUserUpdateRequestSchema = z.object({
|
|
8
|
+
company: z.string().max(100).optional(),
|
|
8
9
|
first_name: z.string().max(50).optional(),
|
|
10
|
+
language: z.string().max(10).optional(),
|
|
9
11
|
last_name: z.string().max(50).optional(),
|
|
10
|
-
company: z.string().max(100).optional(),
|
|
11
12
|
phone: z.string().max(20).optional(),
|
|
12
13
|
position: z.string().max(100).optional(),
|
|
13
|
-
language: z.string().max(10).optional(),
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export type PatchedCfgUserUpdateRequest = z.infer<typeof PatchedCfgUserUpdateRequestSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { CentrifugoTokenSchema } from "./CentrifugoToken";
|
|
7
7
|
|
|
8
8
|
export const UserSchema = z.object({
|
|
9
|
-
|
|
9
|
+
avatar: z.string().nullable(),
|
|
10
|
+
centrifugo: CentrifugoTokenSchema.nullable(),
|
|
11
|
+
company: z.string().max(100).optional(),
|
|
12
|
+
date_joined: z.string().datetime({ offset: true }),
|
|
13
|
+
display_username: z.string(),
|
|
10
14
|
email: z.email(),
|
|
11
15
|
first_name: z.string().max(50).optional(),
|
|
12
|
-
last_name: z.string().max(50).optional(),
|
|
13
16
|
full_name: z.string(),
|
|
17
|
+
id: z.number().int(),
|
|
14
18
|
initials: z.string(),
|
|
15
|
-
display_username: z.string(),
|
|
16
|
-
company: z.string().max(100).optional(),
|
|
17
|
-
phone: z.string().max(20).optional(),
|
|
18
|
-
position: z.string().max(100).optional(),
|
|
19
|
-
language: z.string().max(10).optional(),
|
|
20
|
-
avatar: z.string().nullable(),
|
|
21
19
|
is_staff: z.boolean(),
|
|
22
20
|
is_superuser: z.boolean(),
|
|
23
|
-
|
|
21
|
+
language: z.string().max(10).optional(),
|
|
24
22
|
last_login: z.string().datetime({ offset: true }).nullable(),
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
last_name: z.string().max(50).optional(),
|
|
24
|
+
phone: z.string().max(20).optional(),
|
|
25
|
+
position: z.string().max(100).optional(),
|
|
26
|
+
unanswered_messages_count: z.number().int().default(0),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export type User = z.infer<typeof UserSchema>;
|
|
@@ -1,46 +1,18 @@
|
|
|
1
1
|
// AUTO-GENERATED by django_generator / ts_extras.wrapper
|
|
2
2
|
// Self-contained API wrapper for this group. DO NOT EDIT — re-run `make gen`.
|
|
3
3
|
|
|
4
|
-
import { client } from '
|
|
5
|
-
import type { StorageAdapter } from '../
|
|
6
|
-
import { LocalStorageAdapter } from '../
|
|
7
|
-
import { APILogger, type LoggerConfig } from '../
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { BackupCodes } from './sdk.gen';
|
|
12
|
-
import { TotpManagement } from './sdk.gen';
|
|
13
|
-
import { TotpSetup } from './sdk.gen';
|
|
14
|
-
import { TotpVerification } from './sdk.gen';
|
|
15
|
-
import type { ZodTypeAny } from 'zod';
|
|
16
|
-
import {
|
|
17
|
-
BackupCodesRegenerateResponseSchema,
|
|
18
|
-
BackupCodesStatusSchema,
|
|
19
|
-
ConfirmSetupResponseSchema,
|
|
20
|
-
DeviceListResponseSchema,
|
|
21
|
-
SetupResponseSchema,
|
|
22
|
-
VerifyResponseSchema,
|
|
23
|
-
} from './schemas';
|
|
24
|
-
import { dispatchValidationError } from '../_shared/validation-events';
|
|
4
|
+
import { client } from '../client.gen';
|
|
5
|
+
import type { StorageAdapter } from '../helpers/storage';
|
|
6
|
+
import { LocalStorageAdapter } from '../helpers/storage';
|
|
7
|
+
import { APILogger, type LoggerConfig } from '../helpers/logger';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
25
11
|
|
|
26
12
|
const ACCESS_KEY = 'cfg.access_token';
|
|
27
13
|
const REFRESH_KEY = 'cfg.refresh_token';
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
method: string;
|
|
31
|
-
re: RegExp;
|
|
32
|
-
schema: ZodTypeAny;
|
|
33
|
-
path: string;
|
|
34
|
-
}
|
|
35
|
-
const VALIDATION_ROUTES: ReadonlyArray<ValidationRoute> = [
|
|
36
|
-
{ method: 'GET', re: new RegExp('^/cfg/totp/backup\\-codes/?$'), schema: BackupCodesStatusSchema, path: '/cfg/totp/backup-codes/' },
|
|
37
|
-
{ method: 'POST', re: new RegExp('^/cfg/totp/backup\\-codes/regenerate/?$'), schema: BackupCodesRegenerateResponseSchema, path: '/cfg/totp/backup-codes/regenerate/' },
|
|
38
|
-
{ method: 'GET', re: new RegExp('^/cfg/totp/devices/?$'), schema: DeviceListResponseSchema, path: '/cfg/totp/devices/' },
|
|
39
|
-
{ method: 'POST', re: new RegExp('^/cfg/totp/setup/?$'), schema: SetupResponseSchema, path: '/cfg/totp/setup/' },
|
|
40
|
-
{ method: 'POST', re: new RegExp('^/cfg/totp/setup/confirm/?$'), schema: ConfirmSetupResponseSchema, path: '/cfg/totp/setup/confirm/' },
|
|
41
|
-
{ method: 'POST', re: new RegExp('^/cfg/totp/verify/?$'), schema: VerifyResponseSchema, path: '/cfg/totp/verify/' },
|
|
42
|
-
{ method: 'POST', re: new RegExp('^/cfg/totp/verify/backup/?$'), schema: VerifyResponseSchema, path: '/cfg/totp/verify/backup/' }
|
|
43
|
-
];
|
|
15
|
+
|
|
44
16
|
|
|
45
17
|
/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language. */
|
|
46
18
|
function detectLocale(): string | null {
|
|
@@ -86,12 +58,7 @@ export class API {
|
|
|
86
58
|
private apiKey: string | null;
|
|
87
59
|
readonly logger: APILogger;
|
|
88
60
|
|
|
89
|
-
|
|
90
|
-
readonly totp = Totp;
|
|
91
|
-
readonly backupCodes = BackupCodes;
|
|
92
|
-
readonly totpManagement = TotpManagement;
|
|
93
|
-
readonly totpSetup = TotpSetup;
|
|
94
|
-
readonly totpVerification = TotpVerification;
|
|
61
|
+
|
|
95
62
|
|
|
96
63
|
constructor(baseUrl: string, opts: APIOptions = {}) {
|
|
97
64
|
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
@@ -115,35 +82,7 @@ export class API {
|
|
|
115
82
|
return request;
|
|
116
83
|
});
|
|
117
84
|
|
|
118
|
-
|
|
119
|
-
if (!response.ok) return response;
|
|
120
|
-
const ct = response.headers.get('content-type') || '';
|
|
121
|
-
if (!ct.includes('application/json')) return response;
|
|
122
|
-
const url = new URL(request.url);
|
|
123
|
-
const method = request.method.toUpperCase();
|
|
124
|
-
const route = VALIDATION_ROUTES.find(
|
|
125
|
-
(r) => r.method === method && r.re.test(url.pathname),
|
|
126
|
-
);
|
|
127
|
-
if (!route) return response;
|
|
128
|
-
let payload: unknown;
|
|
129
|
-
try {
|
|
130
|
-
payload = await response.clone().json();
|
|
131
|
-
} catch {
|
|
132
|
-
return response;
|
|
133
|
-
}
|
|
134
|
-
const result = route.schema.safeParse(payload);
|
|
135
|
-
if (!result.success) {
|
|
136
|
-
dispatchValidationError({
|
|
137
|
-
operation: `${method} ${route.path}`,
|
|
138
|
-
path: route.path,
|
|
139
|
-
method,
|
|
140
|
-
error: result.error,
|
|
141
|
-
response: payload,
|
|
142
|
-
timestamp: new Date(),
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
return response;
|
|
146
|
-
});
|
|
85
|
+
|
|
147
86
|
}
|
|
148
87
|
|
|
149
88
|
// ── Base URL ────────────────────────────────────────────────────────────
|
|
@@ -177,5 +116,5 @@ export class API {
|
|
|
177
116
|
setApiKey(key: string | null): void { this.apiKey = key; }
|
|
178
117
|
}
|
|
179
118
|
|
|
180
|
-
export {
|
|
119
|
+
export { };
|
|
181
120
|
export { client };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras.events
|
|
2
2
|
// Hooks Hey API client interceptors → typed CustomEvents on `window`.
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
//
|
|
5
5
|
// Usage:
|
|
6
6
|
// import "./generated/events" // side-effect: registers interceptors
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// console.log(e.detail.status, e.detail.method, e.detail.url);
|
|
10
10
|
// });
|
|
11
11
|
|
|
12
|
-
import { client } from "
|
|
12
|
+
import { client } from "../client.gen";
|
|
13
13
|
|
|
14
14
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
15
15
|
// Event names + detail types
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// Get Centrifugo connection token
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWR from "swr";
|
|
6
6
|
import type { SWRConfiguration } from "swr";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgCentrifugoAuthTokenRetrieveData, CfgCentrifugoAuthTokenRetrieveResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
|
-
type Args = Omit<CfgCentrifugoAuthTokenRetrieveData, "url"> | undefined;
|
|
11
10
|
type Result = CfgCentrifugoAuthTokenRetrieveResponses[keyof CfgCentrifugoAuthTokenRetrieveResponses];
|
|
12
11
|
|
|
13
12
|
export function useCfgCentrifugoAuthTokenRetrieve(
|
|
14
|
-
args
|
|
13
|
+
args?: Omit<CfgCentrifugoAuthTokenRetrieveData, "url" | "body">,
|
|
15
14
|
config?: SWRConfiguration<Result>,
|
|
16
15
|
) {
|
|
17
|
-
const key =
|
|
16
|
+
const key = ["cfg_centrifugo_auth_token_retrieve", args ?? {}] as const;
|
|
18
17
|
return useSWR<Result>(
|
|
19
18
|
key,
|
|
20
19
|
async () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Group barrel. DO NOT EDIT — re-run `make gen`.
|
|
3
3
|
|
|
4
4
|
// Wrapper class + per-group SDK re-exports
|
|
5
|
-
export { API, type APIOptions,
|
|
5
|
+
export { API, type APIOptions, } from './api';
|
|
6
6
|
|
|
7
7
|
// Shared utilities (storage / errors / logger / validation events)
|
|
8
8
|
export {
|
|
@@ -23,7 +23,7 @@ export {
|
|
|
23
23
|
formatZodError,
|
|
24
24
|
type ValidationErrorDetail,
|
|
25
25
|
type ValidationErrorEvent,
|
|
26
|
-
} from '../
|
|
26
|
+
} from '../helpers';
|
|
27
27
|
|
|
28
28
|
// Generated artifacts (Hey API)
|
|
29
|
-
export type * from '
|
|
29
|
+
export type * from '../types.gen';
|
package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/ConnectionTokenResponse.ts
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
export const ConnectionTokenResponseSchema = z.object({
|
|
8
|
-
token: z.string(),
|
|
9
8
|
centrifugo_url: z.string(),
|
|
10
|
-
expires_at: z.string(),
|
|
11
9
|
channels: z.array(z.string()),
|
|
10
|
+
expires_at: z.string(),
|
|
11
|
+
token: z.string(),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
export type ConnectionTokenResponse = z.infer<typeof ConnectionTokenResponseSchema>;
|
|
@@ -1,53 +1,18 @@
|
|
|
1
1
|
// AUTO-GENERATED by django_generator / ts_extras.wrapper
|
|
2
2
|
// Self-contained API wrapper for this group. DO NOT EDIT — re-run `make gen`.
|
|
3
3
|
|
|
4
|
-
import { client } from '
|
|
5
|
-
import type { StorageAdapter } from '../
|
|
6
|
-
import { LocalStorageAdapter } from '../
|
|
7
|
-
import { APILogger, type LoggerConfig } from '../
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { OAuth } from './sdk.gen';
|
|
12
|
-
import { UserProfile } from './sdk.gen';
|
|
13
|
-
import { Auth } from './sdk.gen';
|
|
14
|
-
import type { ZodTypeAny } from 'zod';
|
|
15
|
-
import {
|
|
16
|
-
AccountDeleteResponseSchema,
|
|
17
|
-
OAuthAuthorizeResponseSchema,
|
|
18
|
-
OAuthProvidersResponseSchema,
|
|
19
|
-
OAuthTokenResponseSchema,
|
|
20
|
-
OTPRequestResponseSchema,
|
|
21
|
-
OTPVerifyResponseSchema,
|
|
22
|
-
TokenRefreshSchema,
|
|
23
|
-
UserSchema,
|
|
24
|
-
} from './schemas';
|
|
25
|
-
import { dispatchValidationError } from '../_shared/validation-events';
|
|
4
|
+
import { client } from '../client.gen';
|
|
5
|
+
import type { StorageAdapter } from '../helpers/storage';
|
|
6
|
+
import { LocalStorageAdapter } from '../helpers/storage';
|
|
7
|
+
import { APILogger, type LoggerConfig } from '../helpers/logger';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
26
11
|
|
|
27
12
|
const ACCESS_KEY = 'cfg.access_token';
|
|
28
13
|
const REFRESH_KEY = 'cfg.refresh_token';
|
|
29
14
|
|
|
30
|
-
|
|
31
|
-
method: string;
|
|
32
|
-
re: RegExp;
|
|
33
|
-
schema: ZodTypeAny;
|
|
34
|
-
path: string;
|
|
35
|
-
}
|
|
36
|
-
const VALIDATION_ROUTES: ReadonlyArray<ValidationRoute> = [
|
|
37
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/oauth/github/authorize/?$'), schema: OAuthAuthorizeResponseSchema, path: '/cfg/accounts/oauth/github/authorize/' },
|
|
38
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/oauth/github/callback/?$'), schema: OAuthTokenResponseSchema, path: '/cfg/accounts/oauth/github/callback/' },
|
|
39
|
-
{ method: 'GET', re: new RegExp('^/cfg/accounts/oauth/providers/?$'), schema: OAuthProvidersResponseSchema, path: '/cfg/accounts/oauth/providers/' },
|
|
40
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/otp/request/?$'), schema: OTPRequestResponseSchema, path: '/cfg/accounts/otp/request/' },
|
|
41
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/otp/verify/?$'), schema: OTPVerifyResponseSchema, path: '/cfg/accounts/otp/verify/' },
|
|
42
|
-
{ method: 'GET', re: new RegExp('^/cfg/accounts/profile/?$'), schema: UserSchema, path: '/cfg/accounts/profile/' },
|
|
43
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/profile/avatar/?$'), schema: UserSchema, path: '/cfg/accounts/profile/avatar/' },
|
|
44
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/profile/delete/?$'), schema: AccountDeleteResponseSchema, path: '/cfg/accounts/profile/delete/' },
|
|
45
|
-
{ method: 'PUT', re: new RegExp('^/cfg/accounts/profile/partial/?$'), schema: UserSchema, path: '/cfg/accounts/profile/partial/' },
|
|
46
|
-
{ method: 'PATCH', re: new RegExp('^/cfg/accounts/profile/partial/?$'), schema: UserSchema, path: '/cfg/accounts/profile/partial/' },
|
|
47
|
-
{ method: 'PUT', re: new RegExp('^/cfg/accounts/profile/update/?$'), schema: UserSchema, path: '/cfg/accounts/profile/update/' },
|
|
48
|
-
{ method: 'PATCH', re: new RegExp('^/cfg/accounts/profile/update/?$'), schema: UserSchema, path: '/cfg/accounts/profile/update/' },
|
|
49
|
-
{ method: 'POST', re: new RegExp('^/cfg/accounts/token/refresh/?$'), schema: TokenRefreshSchema, path: '/cfg/accounts/token/refresh/' }
|
|
50
|
-
];
|
|
15
|
+
|
|
51
16
|
|
|
52
17
|
/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language. */
|
|
53
18
|
function detectLocale(): string | null {
|
|
@@ -93,11 +58,7 @@ export class API {
|
|
|
93
58
|
private apiKey: string | null;
|
|
94
59
|
readonly logger: APILogger;
|
|
95
60
|
|
|
96
|
-
|
|
97
|
-
readonly accounts = Accounts;
|
|
98
|
-
readonly oAuth = OAuth;
|
|
99
|
-
readonly userProfile = UserProfile;
|
|
100
|
-
readonly auth = Auth;
|
|
61
|
+
|
|
101
62
|
|
|
102
63
|
constructor(baseUrl: string, opts: APIOptions = {}) {
|
|
103
64
|
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
@@ -121,35 +82,7 @@ export class API {
|
|
|
121
82
|
return request;
|
|
122
83
|
});
|
|
123
84
|
|
|
124
|
-
|
|
125
|
-
if (!response.ok) return response;
|
|
126
|
-
const ct = response.headers.get('content-type') || '';
|
|
127
|
-
if (!ct.includes('application/json')) return response;
|
|
128
|
-
const url = new URL(request.url);
|
|
129
|
-
const method = request.method.toUpperCase();
|
|
130
|
-
const route = VALIDATION_ROUTES.find(
|
|
131
|
-
(r) => r.method === method && r.re.test(url.pathname),
|
|
132
|
-
);
|
|
133
|
-
if (!route) return response;
|
|
134
|
-
let payload: unknown;
|
|
135
|
-
try {
|
|
136
|
-
payload = await response.clone().json();
|
|
137
|
-
} catch {
|
|
138
|
-
return response;
|
|
139
|
-
}
|
|
140
|
-
const result = route.schema.safeParse(payload);
|
|
141
|
-
if (!result.success) {
|
|
142
|
-
dispatchValidationError({
|
|
143
|
-
operation: `${method} ${route.path}`,
|
|
144
|
-
path: route.path,
|
|
145
|
-
method,
|
|
146
|
-
error: result.error,
|
|
147
|
-
response: payload,
|
|
148
|
-
timestamp: new Date(),
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
return response;
|
|
152
|
-
});
|
|
85
|
+
|
|
153
86
|
}
|
|
154
87
|
|
|
155
88
|
// ── Base URL ────────────────────────────────────────────────────────────
|
|
@@ -183,5 +116,5 @@ export class API {
|
|
|
183
116
|
setApiKey(key: string | null): void { this.apiKey = key; }
|
|
184
117
|
}
|
|
185
118
|
|
|
186
|
-
export {
|
|
119
|
+
export { };
|
|
187
120
|
export { client };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras.events
|
|
2
2
|
// Hooks Hey API client interceptors → typed CustomEvents on `window`.
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
//
|
|
5
5
|
// Usage:
|
|
6
6
|
// import "./generated/events" // side-effect: registers interceptors
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// console.log(e.detail.status, e.detail.method, e.detail.url);
|
|
10
10
|
// });
|
|
11
11
|
|
|
12
|
-
import { client } from "
|
|
12
|
+
import { client } from "../client.gen";
|
|
13
13
|
|
|
14
14
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
15
15
|
// Event names + detail types
|
package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRegenerateCreate.ts
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// POST /cfg/totp/backup-codes/regenerate/
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWRMutation from "swr/mutation";
|
|
6
6
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgTotpBackupCodesRegenerateCreateData, CfgTotpBackupCodesRegenerateCreateResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
10
|
type Args = Omit<CfgTotpBackupCodesRegenerateCreateData, "url">;
|
|
11
11
|
type Result = CfgTotpBackupCodesRegenerateCreateResponses[keyof CfgTotpBackupCodesRegenerateCreateResponses];
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// GET /cfg/totp/backup-codes/
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWR from "swr";
|
|
6
6
|
import type { SWRConfiguration } from "swr";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgTotpBackupCodesRetrieveData, CfgTotpBackupCodesRetrieveResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
|
-
type Args = Omit<CfgTotpBackupCodesRetrieveData, "url"> | undefined;
|
|
11
10
|
type Result = CfgTotpBackupCodesRetrieveResponses[keyof CfgTotpBackupCodesRetrieveResponses];
|
|
12
11
|
|
|
13
12
|
export function useCfgTotpBackupCodesRetrieve(
|
|
14
|
-
args
|
|
13
|
+
args?: Omit<CfgTotpBackupCodesRetrieveData, "url" | "body">,
|
|
15
14
|
config?: SWRConfiguration<Result>,
|
|
16
15
|
) {
|
|
17
|
-
const key =
|
|
16
|
+
const key = ["cfg_totp_backup_codes_retrieve", args ?? {}] as const;
|
|
18
17
|
return useSWR<Result>(
|
|
19
18
|
key,
|
|
20
19
|
async () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// DELETE /cfg/totp/devices/{id}/
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWRMutation from "swr/mutation";
|
|
6
6
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
10
|
type Args = Omit<CfgTotpDevicesDestroyData, "url">;
|
|
11
11
|
type Result = CfgTotpDevicesDestroyResponses[keyof CfgTotpDevicesDestroyResponses];
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// GET /cfg/totp/devices/
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWR from "swr";
|
|
6
6
|
import type { SWRConfiguration } from "swr";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgTotpDevicesRetrieveData, CfgTotpDevicesRetrieveResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
|
-
type Args = Omit<CfgTotpDevicesRetrieveData, "url"> | undefined;
|
|
11
10
|
type Result = CfgTotpDevicesRetrieveResponses[keyof CfgTotpDevicesRetrieveResponses];
|
|
12
11
|
|
|
13
12
|
export function useCfgTotpDevicesRetrieve(
|
|
14
|
-
args
|
|
13
|
+
args?: Omit<CfgTotpDevicesRetrieveData, "url" | "body">,
|
|
15
14
|
config?: SWRConfiguration<Result>,
|
|
16
15
|
) {
|
|
17
|
-
const key =
|
|
16
|
+
const key = ["cfg_totp_devices_retrieve", args ?? {}] as const;
|
|
18
17
|
return useSWR<Result>(
|
|
19
18
|
key,
|
|
20
19
|
async () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// POST /cfg/totp/disable/
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWRMutation from "swr/mutation";
|
|
6
6
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgTotpDisableCreateData, CfgTotpDisableCreateResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgTotpDisableCreateData, CfgTotpDisableCreateResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
10
|
type Args = Omit<CfgTotpDisableCreateData, "url">;
|
|
11
11
|
type Result = CfgTotpDisableCreateResponses[keyof CfgTotpDisableCreateResponses];
|