@djangocfg/api 2.1.572 → 2.1.574
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/APIKey-EYCSY3JW.mjs +14 -0
- package/dist/APIKey-EYCSY3JW.mjs.map +1 -0
- package/dist/APIKey-I5QBXTLD.mjs +9 -0
- package/dist/APIKey-I5QBXTLD.mjs.map +1 -0
- package/dist/APIKeyRegenerate-3WIY3UIL.mjs +9 -0
- package/dist/APIKeyRegenerate-3WIY3UIL.mjs.map +1 -0
- package/dist/APIKeyRegenerate-AV5FCM32.mjs +13 -0
- package/dist/APIKeyRegenerate-AV5FCM32.mjs.map +1 -0
- package/dist/APIKeyReveal-JDXZMXKO.mjs +9 -0
- package/dist/APIKeyReveal-JDXZMXKO.mjs.map +1 -0
- package/dist/APIKeyReveal-ZY7ZD4WX.mjs +14 -0
- package/dist/APIKeyReveal-ZY7ZD4WX.mjs.map +1 -0
- package/dist/APIKeyTestResult-MQM2Q7XN.mjs +9 -0
- package/dist/APIKeyTestResult-MQM2Q7XN.mjs.map +1 -0
- package/dist/APIKeyTestResult-NPKQLHSQ.mjs +13 -0
- package/dist/APIKeyTestResult-NPKQLHSQ.mjs.map +1 -0
- package/dist/AccountDeleteResponse-32BGUXEK.mjs +13 -0
- package/dist/AccountDeleteResponse-32BGUXEK.mjs.map +1 -0
- package/dist/AccountDeleteResponse-NISN5UOR.mjs +9 -0
- package/dist/AccountDeleteResponse-NISN5UOR.mjs.map +1 -0
- package/dist/ConsentPolicy-67GXCYPA.mjs +9 -0
- package/dist/ConsentPolicy-67GXCYPA.mjs.map +1 -0
- package/dist/ConsentPolicy-A5WZFHO7.mjs +19 -0
- package/dist/ConsentPolicy-A5WZFHO7.mjs.map +1 -0
- package/dist/OAuthAuthorizeResponse-JQ5W7ZOZ.mjs +9 -0
- package/dist/OAuthAuthorizeResponse-JQ5W7ZOZ.mjs.map +1 -0
- package/dist/OAuthAuthorizeResponse-TQMQXACC.mjs +13 -0
- package/dist/OAuthAuthorizeResponse-TQMQXACC.mjs.map +1 -0
- package/dist/OAuthProvidersResponse-5DUH2AT7.mjs +9 -0
- package/dist/OAuthProvidersResponse-5DUH2AT7.mjs.map +1 -0
- package/dist/OAuthProvidersResponse-VM3YO5FZ.mjs +12 -0
- package/dist/OAuthProvidersResponse-VM3YO5FZ.mjs.map +1 -0
- package/dist/OAuthTokenResponse-4SJDK73L.mjs +9 -0
- package/dist/OAuthTokenResponse-4SJDK73L.mjs.map +1 -0
- package/dist/OAuthTokenResponse-ELAZFNHE.mjs +20 -0
- package/dist/OAuthTokenResponse-ELAZFNHE.mjs.map +1 -0
- package/dist/OTPRequestResponse-KKEOYXXS.mjs +9 -0
- package/dist/OTPRequestResponse-KKEOYXXS.mjs.map +1 -0
- package/dist/OTPRequestResponse-ZU5KRNSW.mjs +30 -0
- package/dist/OTPRequestResponse-ZU5KRNSW.mjs.map +1 -0
- package/dist/OTPVerifyResponse-LJVUP5JS.mjs +21 -0
- package/dist/OTPVerifyResponse-LJVUP5JS.mjs.map +1 -0
- package/dist/OTPVerifyResponse-XBXVMTO3.mjs +10 -0
- package/dist/OTPVerifyResponse-XBXVMTO3.mjs.map +1 -0
- package/dist/PasswordLoginResponse-3IRCBQIN.mjs +10 -0
- package/dist/PasswordLoginResponse-3IRCBQIN.mjs.map +1 -0
- package/dist/PasswordLoginResponse-A7QRJTAQ.mjs +21 -0
- package/dist/PasswordLoginResponse-A7QRJTAQ.mjs.map +1 -0
- package/dist/TokenRefresh-JAUMGIFS.mjs +13 -0
- package/dist/TokenRefresh-JAUMGIFS.mjs.map +1 -0
- package/dist/TokenRefresh-MKEUOQCX.mjs +9 -0
- package/dist/TokenRefresh-MKEUOQCX.mjs.map +1 -0
- package/dist/User-7OXQV7XG.mjs +9 -0
- package/dist/User-7OXQV7XG.mjs.map +1 -0
- package/dist/auth.cjs +163 -347
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -12
- package/dist/auth.d.ts +1 -12
- package/dist/auth.mjs +39 -349
- package/dist/auth.mjs.map +1 -1
- package/dist/cfg_accounts_oauth_connections_response_200_AutoRef-ILSH4EVV.mjs +31 -0
- package/dist/cfg_accounts_oauth_connections_response_200_AutoRef-ILSH4EVV.mjs.map +1 -0
- package/dist/cfg_accounts_oauth_connections_response_200_AutoRef-J3IH5YMW.mjs +9 -0
- package/dist/cfg_accounts_oauth_connections_response_200_AutoRef-J3IH5YMW.mjs.map +1 -0
- package/dist/cfg_accounts_oauth_disconnect_response_200_AutoRef-4ZCO4CSB.mjs +12 -0
- package/dist/cfg_accounts_oauth_disconnect_response_200_AutoRef-4ZCO4CSB.mjs.map +1 -0
- package/dist/cfg_accounts_oauth_disconnect_response_200_AutoRef-6JT7B4EX.mjs +9 -0
- package/dist/cfg_accounts_oauth_disconnect_response_200_AutoRef-6JT7B4EX.mjs.map +1 -0
- package/dist/chunk-53YKWR6F.mjs +8 -0
- package/dist/chunk-53YKWR6F.mjs.map +1 -0
- package/dist/chunk-6MHVHTWT.mjs +30 -0
- package/dist/chunk-6MHVHTWT.mjs.map +1 -0
- package/dist/chunk-AQ2RQ4BQ.mjs +21 -0
- package/dist/chunk-AQ2RQ4BQ.mjs.map +1 -0
- package/dist/chunk-AXBITHBG.mjs +13 -0
- package/dist/chunk-AXBITHBG.mjs.map +1 -0
- package/dist/chunk-B22YGMM3.mjs +30 -0
- package/dist/chunk-B22YGMM3.mjs.map +1 -0
- package/dist/chunk-GCRGQTJ4.mjs +13 -0
- package/dist/chunk-GCRGQTJ4.mjs.map +1 -0
- package/dist/chunk-IPXJOS2Y.mjs +32 -0
- package/dist/chunk-IPXJOS2Y.mjs.map +1 -0
- package/dist/chunk-K5HZ55SP.mjs +21 -0
- package/dist/chunk-K5HZ55SP.mjs.map +1 -0
- package/dist/chunk-NTSWD2CP.mjs +20 -0
- package/dist/chunk-NTSWD2CP.mjs.map +1 -0
- package/dist/chunk-NZGOHTNF.mjs +14 -0
- package/dist/chunk-NZGOHTNF.mjs.map +1 -0
- package/dist/chunk-OGDF6IJV.mjs +13 -0
- package/dist/chunk-OGDF6IJV.mjs.map +1 -0
- package/dist/chunk-PDARU7RC.mjs +14 -0
- package/dist/chunk-PDARU7RC.mjs.map +1 -0
- package/dist/chunk-RQDZ2EMB.mjs +13 -0
- package/dist/chunk-RQDZ2EMB.mjs.map +1 -0
- package/dist/chunk-SUTMTPAG.mjs +12 -0
- package/dist/chunk-SUTMTPAG.mjs.map +1 -0
- package/dist/chunk-X5FEPK4J.mjs +13 -0
- package/dist/chunk-X5FEPK4J.mjs.map +1 -0
- package/dist/chunk-XSAHOB2U.mjs +19 -0
- package/dist/chunk-XSAHOB2U.mjs.map +1 -0
- package/dist/chunk-YMOOSBRI.mjs +12 -0
- package/dist/chunk-YMOOSBRI.mjs.map +1 -0
- package/dist/hooks.cjs +131 -76
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs +33 -78
- package/dist/hooks.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRegenerateCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRetrieve.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRevealCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyTestCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpConsentPolicyRetrieve.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenCreate.ts +41 -37
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDisableCreate.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupCreate.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +41 -37
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyCreate.ts +41 -37
- package/src/auth/context/AccountsContext.tsx +0 -2
- package/src/auth/context/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.574",
|
|
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.
|
|
88
|
+
"@djangocfg/typescript-config": "^2.1.574",
|
|
89
89
|
"@testing-library/react": "^16.3.2",
|
|
90
90
|
"@types/node": "^25.9.5",
|
|
91
91
|
"@types/react": "19.2.15",
|
|
@@ -8,7 +8,7 @@ import useSWRMutation from "swr/mutation";
|
|
|
8
8
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
9
9
|
import { CfgAccountsApiKey } from "../../sdk.gen";
|
|
10
10
|
import type { CfgAccountsApiKeyRegenerateCreateData, CfgAccountsApiKeyRegenerateCreateResponses } from "../../types.gen";
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
type Args = Omit<CfgAccountsApiKeyRegenerateCreateData, "url">;
|
|
14
14
|
type Result = CfgAccountsApiKeyRegenerateCreateResponses[keyof CfgAccountsApiKeyRegenerateCreateResponses];
|
|
@@ -21,43 +21,47 @@ export function useCfgAccountsApiKeyRegenerateCreate(
|
|
|
21
21
|
async (_key, { arg }: { arg: Args }) => {
|
|
22
22
|
const res = await CfgAccountsApiKey.cfgAccountsApiKeyRegenerateCreate({ ...arg, throwOnError: true } as never);
|
|
23
23
|
const data = res.data as Result;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
24
|
+
void import("../schemas/APIKeyRegenerate")
|
|
25
|
+
.then(({ APIKeyRegenerateSchema }) => {
|
|
26
|
+
const parsed = APIKeyRegenerateSchema.safeParse(data);
|
|
27
|
+
if (parsed.success) return;
|
|
28
|
+
// Log first so the failure is always visible, even if the
|
|
29
|
+
// event handler swallows it.
|
|
30
|
+
console.warn(
|
|
31
|
+
"[zod] response did not match schema",
|
|
32
|
+
{
|
|
33
|
+
operation: "cfg_accounts_api_key_regenerate_create",
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/cfg/accounts/api-key/regenerate/",
|
|
36
|
+
issues: parsed.error.issues,
|
|
37
|
+
data,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
try {
|
|
42
|
+
window.dispatchEvent(
|
|
43
|
+
new CustomEvent("zod-validation-error", {
|
|
44
|
+
detail: {
|
|
45
|
+
operation: "cfg_accounts_api_key_regenerate_create",
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/cfg/accounts/api-key/regenerate/",
|
|
48
|
+
issues: parsed.error.issues,
|
|
49
|
+
data,
|
|
50
|
+
timestamp: new Date(),
|
|
51
|
+
},
|
|
52
|
+
bubbles: true,
|
|
53
|
+
cancelable: false,
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
} catch {
|
|
57
|
+
// Event dispatch is best-effort.
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
})
|
|
61
|
+
.catch(() => {
|
|
62
|
+
// A schema chunk that fails to load is not the caller's problem.
|
|
63
|
+
});
|
|
64
|
+
return data;
|
|
61
65
|
},
|
|
62
66
|
config,
|
|
63
67
|
);
|
|
@@ -8,7 +8,7 @@ import useSWR from "swr";
|
|
|
8
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
|
+
|
|
12
12
|
|
|
13
13
|
type Result = CfgAccountsApiKeyRetrieveResponses[keyof CfgAccountsApiKeyRetrieveResponses];
|
|
14
14
|
|
|
@@ -37,43 +37,47 @@ export function useCfgAccountsApiKeyRetrieve(
|
|
|
37
37
|
async () => {
|
|
38
38
|
const res = await CfgAccountsApiKey.cfgAccountsApiKeyRetrieve({ ...(args ?? {}), throwOnError: true } as never);
|
|
39
39
|
const data = res.data as Result;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
40
|
+
void import("../schemas/APIKey")
|
|
41
|
+
.then(({ APIKeySchema }) => {
|
|
42
|
+
const parsed = APIKeySchema.safeParse(data);
|
|
43
|
+
if (parsed.success) return;
|
|
44
|
+
// Log first so the failure is always visible, even if the
|
|
45
|
+
// event handler swallows it.
|
|
46
|
+
console.warn(
|
|
47
|
+
"[zod] response did not match schema",
|
|
48
|
+
{
|
|
49
|
+
operation: "cfg_accounts_api_key_retrieve",
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: "/cfg/accounts/api-key/",
|
|
52
|
+
issues: parsed.error.issues,
|
|
53
|
+
data,
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
if (typeof window !== "undefined") {
|
|
57
|
+
try {
|
|
58
|
+
window.dispatchEvent(
|
|
59
|
+
new CustomEvent("zod-validation-error", {
|
|
60
|
+
detail: {
|
|
61
|
+
operation: "cfg_accounts_api_key_retrieve",
|
|
62
|
+
method: "GET",
|
|
63
|
+
path: "/cfg/accounts/api-key/",
|
|
64
|
+
issues: parsed.error.issues,
|
|
65
|
+
data,
|
|
66
|
+
timestamp: new Date(),
|
|
67
|
+
},
|
|
68
|
+
bubbles: true,
|
|
69
|
+
cancelable: false,
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
} catch {
|
|
73
|
+
// Event dispatch is best-effort.
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
})
|
|
77
|
+
.catch(() => {
|
|
78
|
+
// A schema chunk that fails to load is not the caller's problem.
|
|
79
|
+
});
|
|
80
|
+
return data;
|
|
77
81
|
},
|
|
78
82
|
swrConfig,
|
|
79
83
|
);
|
|
@@ -8,7 +8,7 @@ import useSWRMutation from "swr/mutation";
|
|
|
8
8
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
9
9
|
import { CfgAccountsApiKey } from "../../sdk.gen";
|
|
10
10
|
import type { CfgAccountsApiKeyRevealCreateData, CfgAccountsApiKeyRevealCreateResponses } from "../../types.gen";
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
type Args = Omit<CfgAccountsApiKeyRevealCreateData, "url">;
|
|
14
14
|
type Result = CfgAccountsApiKeyRevealCreateResponses[keyof CfgAccountsApiKeyRevealCreateResponses];
|
|
@@ -21,43 +21,47 @@ export function useCfgAccountsApiKeyRevealCreate(
|
|
|
21
21
|
async (_key, { arg }: { arg: Args }) => {
|
|
22
22
|
const res = await CfgAccountsApiKey.cfgAccountsApiKeyRevealCreate({ ...arg, throwOnError: true } as never);
|
|
23
23
|
const data = res.data as Result;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
24
|
+
void import("../schemas/APIKeyReveal")
|
|
25
|
+
.then(({ APIKeyRevealSchema }) => {
|
|
26
|
+
const parsed = APIKeyRevealSchema.safeParse(data);
|
|
27
|
+
if (parsed.success) return;
|
|
28
|
+
// Log first so the failure is always visible, even if the
|
|
29
|
+
// event handler swallows it.
|
|
30
|
+
console.warn(
|
|
31
|
+
"[zod] response did not match schema",
|
|
32
|
+
{
|
|
33
|
+
operation: "cfg_accounts_api_key_reveal_create",
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/cfg/accounts/api-key/reveal/",
|
|
36
|
+
issues: parsed.error.issues,
|
|
37
|
+
data,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
try {
|
|
42
|
+
window.dispatchEvent(
|
|
43
|
+
new CustomEvent("zod-validation-error", {
|
|
44
|
+
detail: {
|
|
45
|
+
operation: "cfg_accounts_api_key_reveal_create",
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/cfg/accounts/api-key/reveal/",
|
|
48
|
+
issues: parsed.error.issues,
|
|
49
|
+
data,
|
|
50
|
+
timestamp: new Date(),
|
|
51
|
+
},
|
|
52
|
+
bubbles: true,
|
|
53
|
+
cancelable: false,
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
} catch {
|
|
57
|
+
// Event dispatch is best-effort.
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
})
|
|
61
|
+
.catch(() => {
|
|
62
|
+
// A schema chunk that fails to load is not the caller's problem.
|
|
63
|
+
});
|
|
64
|
+
return data;
|
|
61
65
|
},
|
|
62
66
|
config,
|
|
63
67
|
);
|
|
@@ -8,7 +8,7 @@ import useSWRMutation from "swr/mutation";
|
|
|
8
8
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
9
9
|
import { CfgAccountsApiKey } from "../../sdk.gen";
|
|
10
10
|
import type { CfgAccountsApiKeyTestCreateData, CfgAccountsApiKeyTestCreateResponses } from "../../types.gen";
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
type Args = Omit<CfgAccountsApiKeyTestCreateData, "url">;
|
|
14
14
|
type Result = CfgAccountsApiKeyTestCreateResponses[keyof CfgAccountsApiKeyTestCreateResponses];
|
|
@@ -21,43 +21,47 @@ export function useCfgAccountsApiKeyTestCreate(
|
|
|
21
21
|
async (_key, { arg }: { arg: Args }) => {
|
|
22
22
|
const res = await CfgAccountsApiKey.cfgAccountsApiKeyTestCreate({ ...arg, throwOnError: true } as never);
|
|
23
23
|
const data = res.data as Result;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
24
|
+
void import("../schemas/APIKeyTestResult")
|
|
25
|
+
.then(({ APIKeyTestResultSchema }) => {
|
|
26
|
+
const parsed = APIKeyTestResultSchema.safeParse(data);
|
|
27
|
+
if (parsed.success) return;
|
|
28
|
+
// Log first so the failure is always visible, even if the
|
|
29
|
+
// event handler swallows it.
|
|
30
|
+
console.warn(
|
|
31
|
+
"[zod] response did not match schema",
|
|
32
|
+
{
|
|
33
|
+
operation: "cfg_accounts_api_key_test_create",
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/cfg/accounts/api-key/test/",
|
|
36
|
+
issues: parsed.error.issues,
|
|
37
|
+
data,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
try {
|
|
42
|
+
window.dispatchEvent(
|
|
43
|
+
new CustomEvent("zod-validation-error", {
|
|
44
|
+
detail: {
|
|
45
|
+
operation: "cfg_accounts_api_key_test_create",
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/cfg/accounts/api-key/test/",
|
|
48
|
+
issues: parsed.error.issues,
|
|
49
|
+
data,
|
|
50
|
+
timestamp: new Date(),
|
|
51
|
+
},
|
|
52
|
+
bubbles: true,
|
|
53
|
+
cancelable: false,
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
} catch {
|
|
57
|
+
// Event dispatch is best-effort.
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
})
|
|
61
|
+
.catch(() => {
|
|
62
|
+
// A schema chunk that fails to load is not the caller's problem.
|
|
63
|
+
});
|
|
64
|
+
return data;
|
|
61
65
|
},
|
|
62
66
|
config,
|
|
63
67
|
);
|
|
@@ -8,7 +8,7 @@ import useSWR from "swr";
|
|
|
8
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
|
+
|
|
12
12
|
|
|
13
13
|
type Result = CfgAccountsOauthConnectionsListResponses[keyof CfgAccountsOauthConnectionsListResponses];
|
|
14
14
|
|
|
@@ -37,43 +37,47 @@ export function useCfgAccountsOauthConnectionsList(
|
|
|
37
37
|
async () => {
|
|
38
38
|
const res = await CfgAccountsOauth.cfgAccountsOauthConnectionsList({ ...(args ?? {}), throwOnError: true } as never);
|
|
39
39
|
const data = res.data as Result;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
40
|
+
void import("../schemas/cfg_accounts_oauth_connections_response_200_AutoRef")
|
|
41
|
+
.then(({ cfg_accounts_oauth_connections_response_200_AutoRefSchema }) => {
|
|
42
|
+
const parsed = cfg_accounts_oauth_connections_response_200_AutoRefSchema.safeParse(data);
|
|
43
|
+
if (parsed.success) return;
|
|
44
|
+
// Log first so the failure is always visible, even if the
|
|
45
|
+
// event handler swallows it.
|
|
46
|
+
console.warn(
|
|
47
|
+
"[zod] response did not match schema",
|
|
48
|
+
{
|
|
49
|
+
operation: "cfg_accounts_oauth_connections_list",
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: "/cfg/accounts/oauth/connections/",
|
|
52
|
+
issues: parsed.error.issues,
|
|
53
|
+
data,
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
if (typeof window !== "undefined") {
|
|
57
|
+
try {
|
|
58
|
+
window.dispatchEvent(
|
|
59
|
+
new CustomEvent("zod-validation-error", {
|
|
60
|
+
detail: {
|
|
61
|
+
operation: "cfg_accounts_oauth_connections_list",
|
|
62
|
+
method: "GET",
|
|
63
|
+
path: "/cfg/accounts/oauth/connections/",
|
|
64
|
+
issues: parsed.error.issues,
|
|
65
|
+
data,
|
|
66
|
+
timestamp: new Date(),
|
|
67
|
+
},
|
|
68
|
+
bubbles: true,
|
|
69
|
+
cancelable: false,
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
} catch {
|
|
73
|
+
// Event dispatch is best-effort.
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
})
|
|
77
|
+
.catch(() => {
|
|
78
|
+
// A schema chunk that fails to load is not the caller's problem.
|
|
79
|
+
});
|
|
80
|
+
return data;
|
|
77
81
|
},
|
|
78
82
|
swrConfig,
|
|
79
83
|
);
|
|
@@ -8,7 +8,7 @@ import useSWRMutation from "swr/mutation";
|
|
|
8
8
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
9
9
|
import { CfgAccountsOauth } from "../../sdk.gen";
|
|
10
10
|
import type { CfgAccountsOauthDisconnectCreateData, CfgAccountsOauthDisconnectCreateResponses } from "../../types.gen";
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
type Args = Omit<CfgAccountsOauthDisconnectCreateData, "url">;
|
|
14
14
|
type Result = CfgAccountsOauthDisconnectCreateResponses[keyof CfgAccountsOauthDisconnectCreateResponses];
|
|
@@ -21,43 +21,47 @@ export function useCfgAccountsOauthDisconnectCreate(
|
|
|
21
21
|
async (_key, { arg }: { arg: Args }) => {
|
|
22
22
|
const res = await CfgAccountsOauth.cfgAccountsOauthDisconnectCreate({ ...arg, throwOnError: true } as never);
|
|
23
23
|
const data = res.data as Result;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
24
|
+
void import("../schemas/cfg_accounts_oauth_disconnect_response_200_AutoRef")
|
|
25
|
+
.then(({ cfg_accounts_oauth_disconnect_response_200_AutoRefSchema }) => {
|
|
26
|
+
const parsed = cfg_accounts_oauth_disconnect_response_200_AutoRefSchema.safeParse(data);
|
|
27
|
+
if (parsed.success) return;
|
|
28
|
+
// Log first so the failure is always visible, even if the
|
|
29
|
+
// event handler swallows it.
|
|
30
|
+
console.warn(
|
|
31
|
+
"[zod] response did not match schema",
|
|
32
|
+
{
|
|
33
|
+
operation: "cfg_accounts_oauth_disconnect_create",
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/cfg/accounts/oauth/disconnect/",
|
|
36
|
+
issues: parsed.error.issues,
|
|
37
|
+
data,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
try {
|
|
42
|
+
window.dispatchEvent(
|
|
43
|
+
new CustomEvent("zod-validation-error", {
|
|
44
|
+
detail: {
|
|
45
|
+
operation: "cfg_accounts_oauth_disconnect_create",
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/cfg/accounts/oauth/disconnect/",
|
|
48
|
+
issues: parsed.error.issues,
|
|
49
|
+
data,
|
|
50
|
+
timestamp: new Date(),
|
|
51
|
+
},
|
|
52
|
+
bubbles: true,
|
|
53
|
+
cancelable: false,
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
} catch {
|
|
57
|
+
// Event dispatch is best-effort.
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
})
|
|
61
|
+
.catch(() => {
|
|
62
|
+
// A schema chunk that fails to load is not the caller's problem.
|
|
63
|
+
});
|
|
64
|
+
return data;
|
|
61
65
|
},
|
|
62
66
|
config,
|
|
63
67
|
);
|