@djangocfg/api 1.2.24 → 1.2.26
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/index.cjs +6859 -24179
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1243 -20744
- package/dist/index.d.ts +1243 -20744
- package/dist/index.mjs +6766 -24089
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/contexts/index.ts +0 -11
- package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +175 -6
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_auth.ts +77 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +117 -4
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +88 -19
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_activity.ts +1 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_api_zones.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_charts.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_commands.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_config.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_overview.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_statistics.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_system.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_api_keys.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_charts.ts +204 -7
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_configuration.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_monitoring.ts +119 -21
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_proto_files.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_services.ts +92 -6
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_testing.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +1422 -49
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +175 -6
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_jobs.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_monitoring.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_queues.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_registries.ts +204 -7
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_schedules.ts +117 -4
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_testing.ts +117 -4
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_workers.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +291 -10
- package/src/cfg/generated/_utils/fetchers/index.ts +1 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__accounts__auth.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_admin_api.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_auth.ts +35 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_testing.ts +0 -21
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_activity.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_api_zones.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_charts.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_config.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_overview.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_statistics.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_system.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_api_keys.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_charts.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_configuration.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_monitoring.ts +5 -21
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_services.ts +3 -3
- package/src/cfg/generated/_utils/hooks/cfg__health.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__leads__lead_submission.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__bulk_email.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__logs.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__newsletters.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__testing.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_monitoring.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_workers.ts +0 -1
- package/src/cfg/generated/_utils/hooks/index.ts +1 -0
- package/src/cfg/generated/_utils/schemas/ApiKeyStats.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/AppStatistics.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/AppStatisticsData.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/AxesConfig.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsResult.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoMetrics.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceResult.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoToken.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ConnectionTokenResponse.schema.ts +3 -2
- package/src/cfg/generated/_utils/schemas/ConstanceConfig.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/DjangoConfig.schema.ts +14 -7
- package/src/cfg/generated/_utils/schemas/DjangoRQConfig.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/GRPCOverviewStats.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/GRPCRegisteredService.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/GRPCServerConfig.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/GRPCServerStatus.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/NextJSAdminConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/NgrokConfig.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/OpenAPIClientConfig.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PaginatedRecentRequestList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedServiceSummaryList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/RQSchedule.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ServiceSummary.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/TelegramConfig.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/User.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/index.ts +14 -3
- package/src/cfg/generated/cfg__accounts/models.ts +20 -3
- package/src/cfg/generated/cfg__accounts__user_profile/models.ts +19 -2
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +27 -17
- package/src/cfg/generated/cfg__centrifugo__centrifugo_auth/client.ts +26 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_auth/index.ts +2 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_auth/models.ts +16 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/client.ts +0 -10
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +0 -26
- package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +1 -1
- package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +2 -2
- package/src/cfg/generated/cfg__dashboard__dashboard_config/models.ts +159 -26
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +18 -5
- package/src/cfg/generated/cfg__grpc__grpc_api_keys/models.ts +1 -1
- package/src/cfg/generated/cfg__grpc__grpc_charts/models.ts +5 -5
- package/src/cfg/generated/cfg__grpc__grpc_configuration/models.ts +6 -6
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/client.ts +4 -25
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/models.ts +99 -47
- package/src/cfg/generated/cfg__grpc__grpc_services/client.ts +6 -5
- package/src/cfg/generated/cfg__grpc__grpc_services/models.ts +51 -2
- package/src/cfg/generated/cfg__grpc__grpc_testing/models.ts +6 -6
- package/src/cfg/generated/cfg__knowbase/models.ts +12 -12
- package/src/cfg/generated/cfg__leads__lead_submission/models.ts +1 -1
- package/src/cfg/generated/cfg__newsletter/models.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__campaigns/models.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__logs/models.ts +4 -4
- package/src/cfg/generated/cfg__newsletter__subscriptions/models.ts +1 -1
- package/src/cfg/generated/cfg__payments/models.ts +12 -12
- package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +2 -2
- package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +1 -1
- package/src/cfg/generated/cfg__rq__rq_queues/models.ts +1 -1
- package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +3 -3
- package/src/cfg/generated/cfg__rq__rq_testing/models.ts +2 -2
- package/src/cfg/generated/cfg__support/models.ts +2 -2
- package/src/cfg/generated/client.ts +3 -0
- package/src/cfg/generated/index.ts +17 -8
- package/src/cfg/generated/{schema.ts → schema.json} +19349 -18798
- package/src/index.ts +7 -2
- package/src/types/auth.ts +40 -0
- package/src/types/index.ts +7 -0
- package/src/cfg/contexts/AccountsContext.tsx +0 -205
- package/src/cfg/generated/_utils/schemas/ConnectionTokenRequestRequest.schema.ts +0 -20
- package/src/cfg/generated/_utils/schemas/MonitoringServiceStats.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/ServiceList.schema.ts +0 -21
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Centrifugo Auth
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
33
|
+
import { ConnectionTokenResponseSchema, type ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get Centrifugo connection token
|
|
38
|
+
*
|
|
39
|
+
* @method GET
|
|
40
|
+
* @path /cfg/centrifugo/auth/token/
|
|
41
|
+
*/
|
|
42
|
+
export async function getCentrifugoAuthTokenRetrieve( client?: any
|
|
43
|
+
): Promise<ConnectionTokenResponse> {
|
|
44
|
+
const api = client || getAPIInstance()
|
|
45
|
+
const response = await api.cfg_centrifugo_auth.tokenRetrieve()
|
|
46
|
+
try {
|
|
47
|
+
return ConnectionTokenResponseSchema.parse(response)
|
|
48
|
+
} catch (error) {
|
|
49
|
+
// Zod validation error - log detailed information
|
|
50
|
+
consola.error('❌ Zod Validation Failed');
|
|
51
|
+
consola.box({
|
|
52
|
+
title: 'getCentrifugoAuthTokenRetrieve',
|
|
53
|
+
message: `Path: /cfg/centrifugo/auth/token/\nMethod: GET`,
|
|
54
|
+
style: {
|
|
55
|
+
borderColor: 'red',
|
|
56
|
+
borderStyle: 'rounded'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
61
|
+
consola.error('Validation Issues:');
|
|
62
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
63
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
64
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
65
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
66
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
consola.error('Response data:', response);
|
|
71
|
+
|
|
72
|
+
// Re-throw the error
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { CentrifugoOverviewStatsSchema, type CentrifugoOverviewStats } from '../schemas/CentrifugoOverviewStats.schema'
|
|
33
34
|
import { ChannelListSchema, type ChannelList } from '../schemas/ChannelList.schema'
|
|
34
35
|
import { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.schema'
|
|
@@ -45,7 +46,35 @@ export async function getCentrifugoMonitorHealthRetrieve( client?: any
|
|
|
45
46
|
): Promise<HealthCheck> {
|
|
46
47
|
const api = client || getAPIInstance()
|
|
47
48
|
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorHealthRetrieve()
|
|
48
|
-
|
|
49
|
+
try {
|
|
50
|
+
return HealthCheckSchema.parse(response)
|
|
51
|
+
} catch (error) {
|
|
52
|
+
// Zod validation error - log detailed information
|
|
53
|
+
consola.error('❌ Zod Validation Failed');
|
|
54
|
+
consola.box({
|
|
55
|
+
title: 'getCentrifugoMonitorHealthRetrieve',
|
|
56
|
+
message: `Path: /cfg/centrifugo/monitor/health/\nMethod: GET`,
|
|
57
|
+
style: {
|
|
58
|
+
borderColor: 'red',
|
|
59
|
+
borderStyle: 'rounded'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
64
|
+
consola.error('Validation Issues:');
|
|
65
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
66
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
67
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
68
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
69
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
consola.error('Response data:', response);
|
|
74
|
+
|
|
75
|
+
// Re-throw the error
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
49
78
|
}
|
|
50
79
|
|
|
51
80
|
|
|
@@ -59,7 +88,35 @@ export async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?:
|
|
|
59
88
|
): Promise<CentrifugoOverviewStats> {
|
|
60
89
|
const api = client || getAPIInstance()
|
|
61
90
|
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours)
|
|
62
|
-
|
|
91
|
+
try {
|
|
92
|
+
return CentrifugoOverviewStatsSchema.parse(response)
|
|
93
|
+
} catch (error) {
|
|
94
|
+
// Zod validation error - log detailed information
|
|
95
|
+
consola.error('❌ Zod Validation Failed');
|
|
96
|
+
consola.box({
|
|
97
|
+
title: 'getCentrifugoMonitorOverviewRetrieve',
|
|
98
|
+
message: `Path: /cfg/centrifugo/monitor/overview/\nMethod: GET`,
|
|
99
|
+
style: {
|
|
100
|
+
borderColor: 'red',
|
|
101
|
+
borderStyle: 'rounded'
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
106
|
+
consola.error('Validation Issues:');
|
|
107
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
108
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
109
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
110
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
111
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
consola.error('Response data:', response);
|
|
116
|
+
|
|
117
|
+
// Re-throw the error
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
63
120
|
}
|
|
64
121
|
|
|
65
122
|
|
|
@@ -73,7 +130,35 @@ export async function getCentrifugoMonitorPublishesList( params?: { channel?: s
|
|
|
73
130
|
): Promise<PaginatedPublishList> {
|
|
74
131
|
const api = client || getAPIInstance()
|
|
75
132
|
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorPublishesList(params?.channel, params?.page, params?.page_size, params?.status)
|
|
76
|
-
|
|
133
|
+
try {
|
|
134
|
+
return PaginatedPublishListSchema.parse(response)
|
|
135
|
+
} catch (error) {
|
|
136
|
+
// Zod validation error - log detailed information
|
|
137
|
+
consola.error('❌ Zod Validation Failed');
|
|
138
|
+
consola.box({
|
|
139
|
+
title: 'getCentrifugoMonitorPublishesList',
|
|
140
|
+
message: `Path: /cfg/centrifugo/monitor/publishes/\nMethod: GET`,
|
|
141
|
+
style: {
|
|
142
|
+
borderColor: 'red',
|
|
143
|
+
borderStyle: 'rounded'
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
148
|
+
consola.error('Validation Issues:');
|
|
149
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
150
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
151
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
152
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
153
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
consola.error('Response data:', response);
|
|
158
|
+
|
|
159
|
+
// Re-throw the error
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
77
162
|
}
|
|
78
163
|
|
|
79
164
|
|
|
@@ -87,7 +172,35 @@ export async function getCentrifugoMonitorTimelineRetrieve( params?: { hours?:
|
|
|
87
172
|
): Promise<ChannelList> {
|
|
88
173
|
const api = client || getAPIInstance()
|
|
89
174
|
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval)
|
|
90
|
-
|
|
175
|
+
try {
|
|
176
|
+
return ChannelListSchema.parse(response)
|
|
177
|
+
} catch (error) {
|
|
178
|
+
// Zod validation error - log detailed information
|
|
179
|
+
consola.error('❌ Zod Validation Failed');
|
|
180
|
+
consola.box({
|
|
181
|
+
title: 'getCentrifugoMonitorTimelineRetrieve',
|
|
182
|
+
message: `Path: /cfg/centrifugo/monitor/timeline/\nMethod: GET`,
|
|
183
|
+
style: {
|
|
184
|
+
borderColor: 'red',
|
|
185
|
+
borderStyle: 'rounded'
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
190
|
+
consola.error('Validation Issues:');
|
|
191
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
192
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
193
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
194
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
195
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
consola.error('Response data:', response);
|
|
200
|
+
|
|
201
|
+
// Re-throw the error
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
91
204
|
}
|
|
92
205
|
|
|
93
206
|
|
|
@@ -29,28 +29,13 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
import {
|
|
33
|
-
import { ConnectionTokenResponseSchema, type ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'
|
|
32
|
+
import { consola } from 'consola'
|
|
34
33
|
import { ManualAckRequestRequestSchema, type ManualAckRequestRequest } from '../schemas/ManualAckRequestRequest.schema'
|
|
35
34
|
import { ManualAckResponseSchema, type ManualAckResponse } from '../schemas/ManualAckResponse.schema'
|
|
36
35
|
import { PublishTestRequestRequestSchema, type PublishTestRequestRequest } from '../schemas/PublishTestRequestRequest.schema'
|
|
37
36
|
import { PublishTestResponseSchema, type PublishTestResponse } from '../schemas/PublishTestResponse.schema'
|
|
38
37
|
import { getAPIInstance } from '../../api-instance'
|
|
39
38
|
|
|
40
|
-
/**
|
|
41
|
-
* Generate connection token
|
|
42
|
-
*
|
|
43
|
-
* @method POST
|
|
44
|
-
* @path /cfg/centrifugo/testing/connection-token/
|
|
45
|
-
*/
|
|
46
|
-
export async function createCentrifugoTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client?: any
|
|
47
|
-
): Promise<ConnectionTokenResponse> {
|
|
48
|
-
const api = client || getAPIInstance()
|
|
49
|
-
const response = await api.cfg_centrifugo_testing.connectionTokenCreate(data)
|
|
50
|
-
return ConnectionTokenResponseSchema.parse(response)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
39
|
/**
|
|
55
40
|
* Publish test message
|
|
56
41
|
*
|
|
@@ -61,7 +46,35 @@ export async function createCentrifugoTestingPublishTestCreate( data: PublishTe
|
|
|
61
46
|
): Promise<PublishTestResponse> {
|
|
62
47
|
const api = client || getAPIInstance()
|
|
63
48
|
const response = await api.cfg_centrifugo_testing.publishTestCreate(data)
|
|
64
|
-
|
|
49
|
+
try {
|
|
50
|
+
return PublishTestResponseSchema.parse(response)
|
|
51
|
+
} catch (error) {
|
|
52
|
+
// Zod validation error - log detailed information
|
|
53
|
+
consola.error('❌ Zod Validation Failed');
|
|
54
|
+
consola.box({
|
|
55
|
+
title: 'createCentrifugoTestingPublishTestCreate',
|
|
56
|
+
message: `Path: /cfg/centrifugo/testing/publish-test/\nMethod: POST`,
|
|
57
|
+
style: {
|
|
58
|
+
borderColor: 'red',
|
|
59
|
+
borderStyle: 'rounded'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
64
|
+
consola.error('Validation Issues:');
|
|
65
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
66
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
67
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
68
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
69
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
consola.error('Response data:', response);
|
|
74
|
+
|
|
75
|
+
// Re-throw the error
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
65
78
|
}
|
|
66
79
|
|
|
67
80
|
|
|
@@ -75,7 +88,35 @@ export async function createCentrifugoTestingPublishWithLoggingCreate( data: Pu
|
|
|
75
88
|
): Promise<PublishTestResponse> {
|
|
76
89
|
const api = client || getAPIInstance()
|
|
77
90
|
const response = await api.cfg_centrifugo_testing.publishWithLoggingCreate(data)
|
|
78
|
-
|
|
91
|
+
try {
|
|
92
|
+
return PublishTestResponseSchema.parse(response)
|
|
93
|
+
} catch (error) {
|
|
94
|
+
// Zod validation error - log detailed information
|
|
95
|
+
consola.error('❌ Zod Validation Failed');
|
|
96
|
+
consola.box({
|
|
97
|
+
title: 'createCentrifugoTestingPublishWithLoggingCreate',
|
|
98
|
+
message: `Path: /cfg/centrifugo/testing/publish-with-logging/\nMethod: POST`,
|
|
99
|
+
style: {
|
|
100
|
+
borderColor: 'red',
|
|
101
|
+
borderStyle: 'rounded'
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
106
|
+
consola.error('Validation Issues:');
|
|
107
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
108
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
109
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
110
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
111
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
consola.error('Response data:', response);
|
|
116
|
+
|
|
117
|
+
// Re-throw the error
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
79
120
|
}
|
|
80
121
|
|
|
81
122
|
|
|
@@ -89,7 +130,35 @@ export async function createCentrifugoTestingSendAckCreate( data: ManualAckRequ
|
|
|
89
130
|
): Promise<ManualAckResponse> {
|
|
90
131
|
const api = client || getAPIInstance()
|
|
91
132
|
const response = await api.cfg_centrifugo_testing.sendAckCreate(data)
|
|
92
|
-
|
|
133
|
+
try {
|
|
134
|
+
return ManualAckResponseSchema.parse(response)
|
|
135
|
+
} catch (error) {
|
|
136
|
+
// Zod validation error - log detailed information
|
|
137
|
+
consola.error('❌ Zod Validation Failed');
|
|
138
|
+
consola.box({
|
|
139
|
+
title: 'createCentrifugoTestingSendAckCreate',
|
|
140
|
+
message: `Path: /cfg/centrifugo/testing/send-ack/\nMethod: POST`,
|
|
141
|
+
style: {
|
|
142
|
+
borderColor: 'red',
|
|
143
|
+
borderStyle: 'rounded'
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
148
|
+
consola.error('Validation Issues:');
|
|
149
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
150
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
151
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
152
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
153
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
consola.error('Response data:', response);
|
|
158
|
+
|
|
159
|
+
// Re-throw the error
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
93
162
|
}
|
|
94
163
|
|
|
95
164
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { APIZonesSummarySchema, type APIZonesSummary } from '../schemas/APIZonesSummary.schema'
|
|
33
34
|
import { getAPIInstance } from '../../api-instance'
|
|
34
35
|
|
|
@@ -56,7 +57,35 @@ export async function getDashboardApiZonesSummaryRetrieve( client?: any
|
|
|
56
57
|
): Promise<APIZonesSummary> {
|
|
57
58
|
const api = client || getAPIInstance()
|
|
58
59
|
const response = await api.cfg_dashboard_api_zones.summaryRetrieve()
|
|
59
|
-
|
|
60
|
+
try {
|
|
61
|
+
return APIZonesSummarySchema.parse(response)
|
|
62
|
+
} catch (error) {
|
|
63
|
+
// Zod validation error - log detailed information
|
|
64
|
+
consola.error('❌ Zod Validation Failed');
|
|
65
|
+
consola.box({
|
|
66
|
+
title: 'getDashboardApiZonesSummaryRetrieve',
|
|
67
|
+
message: `Path: /cfg/dashboard/api/zones/summary/\nMethod: GET`,
|
|
68
|
+
style: {
|
|
69
|
+
borderColor: 'red',
|
|
70
|
+
borderStyle: 'rounded'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
75
|
+
consola.error('Validation Issues:');
|
|
76
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
77
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
78
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
79
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
80
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
consola.error('Response data:', response);
|
|
85
|
+
|
|
86
|
+
// Re-throw the error
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
60
89
|
}
|
|
61
90
|
|
|
62
91
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { ChartDataSchema, type ChartData } from '../schemas/ChartData.schema'
|
|
33
34
|
import { getAPIInstance } from '../../api-instance'
|
|
34
35
|
|
|
@@ -42,7 +43,35 @@ export async function getDashboardApiChartsActivityRetrieve( params?: { days?:
|
|
|
42
43
|
): Promise<ChartData> {
|
|
43
44
|
const api = client || getAPIInstance()
|
|
44
45
|
const response = await api.cfg_dashboard_charts.dashboardApiChartsActivityRetrieve(params?.days)
|
|
45
|
-
|
|
46
|
+
try {
|
|
47
|
+
return ChartDataSchema.parse(response)
|
|
48
|
+
} catch (error) {
|
|
49
|
+
// Zod validation error - log detailed information
|
|
50
|
+
consola.error('❌ Zod Validation Failed');
|
|
51
|
+
consola.box({
|
|
52
|
+
title: 'getDashboardApiChartsActivityRetrieve',
|
|
53
|
+
message: `Path: /cfg/dashboard/api/charts/activity/\nMethod: GET`,
|
|
54
|
+
style: {
|
|
55
|
+
borderColor: 'red',
|
|
56
|
+
borderStyle: 'rounded'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
61
|
+
consola.error('Validation Issues:');
|
|
62
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
63
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
64
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
65
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
66
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
consola.error('Response data:', response);
|
|
71
|
+
|
|
72
|
+
// Re-throw the error
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
|
|
@@ -70,7 +99,35 @@ export async function getDashboardApiChartsRegistrationsRetrieve( params?: { da
|
|
|
70
99
|
): Promise<ChartData> {
|
|
71
100
|
const api = client || getAPIInstance()
|
|
72
101
|
const response = await api.cfg_dashboard_charts.dashboardApiChartsRegistrationsRetrieve(params?.days)
|
|
73
|
-
|
|
102
|
+
try {
|
|
103
|
+
return ChartDataSchema.parse(response)
|
|
104
|
+
} catch (error) {
|
|
105
|
+
// Zod validation error - log detailed information
|
|
106
|
+
consola.error('❌ Zod Validation Failed');
|
|
107
|
+
consola.box({
|
|
108
|
+
title: 'getDashboardApiChartsRegistrationsRetrieve',
|
|
109
|
+
message: `Path: /cfg/dashboard/api/charts/registrations/\nMethod: GET`,
|
|
110
|
+
style: {
|
|
111
|
+
borderColor: 'red',
|
|
112
|
+
borderStyle: 'rounded'
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
117
|
+
consola.error('Validation Issues:');
|
|
118
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
119
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
120
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
121
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
122
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
consola.error('Response data:', response);
|
|
127
|
+
|
|
128
|
+
// Re-throw the error
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
74
131
|
}
|
|
75
132
|
|
|
76
133
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { CommandExecuteRequestRequestSchema, type CommandExecuteRequestRequest } from '../schemas/CommandExecuteRequestRequest.schema'
|
|
33
34
|
import { CommandHelpResponseSchema, type CommandHelpResponse } from '../schemas/CommandHelpResponse.schema'
|
|
34
35
|
import { CommandsSummarySchema, type CommandsSummary } from '../schemas/CommandsSummary.schema'
|
|
@@ -58,7 +59,35 @@ export async function getDashboardApiCommandsHelpRetrieve( id: string, client?
|
|
|
58
59
|
): Promise<CommandHelpResponse> {
|
|
59
60
|
const api = client || getAPIInstance()
|
|
60
61
|
const response = await api.cfg_dashboard_commands.dashboardApiCommandsHelpRetrieve(id)
|
|
61
|
-
|
|
62
|
+
try {
|
|
63
|
+
return CommandHelpResponseSchema.parse(response)
|
|
64
|
+
} catch (error) {
|
|
65
|
+
// Zod validation error - log detailed information
|
|
66
|
+
consola.error('❌ Zod Validation Failed');
|
|
67
|
+
consola.box({
|
|
68
|
+
title: 'getDashboardApiCommandsHelpRetrieve',
|
|
69
|
+
message: `Path: /cfg/dashboard/api/commands/{id}/help/\nMethod: GET`,
|
|
70
|
+
style: {
|
|
71
|
+
borderColor: 'red',
|
|
72
|
+
borderStyle: 'rounded'
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
77
|
+
consola.error('Validation Issues:');
|
|
78
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
79
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
80
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
81
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
82
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
consola.error('Response data:', response);
|
|
87
|
+
|
|
88
|
+
// Re-throw the error
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
62
91
|
}
|
|
63
92
|
|
|
64
93
|
|
|
@@ -86,7 +115,35 @@ export async function getDashboardApiCommandsSummaryRetrieve( client?: any
|
|
|
86
115
|
): Promise<CommandsSummary> {
|
|
87
116
|
const api = client || getAPIInstance()
|
|
88
117
|
const response = await api.cfg_dashboard_commands.dashboardApiCommandsSummaryRetrieve()
|
|
89
|
-
|
|
118
|
+
try {
|
|
119
|
+
return CommandsSummarySchema.parse(response)
|
|
120
|
+
} catch (error) {
|
|
121
|
+
// Zod validation error - log detailed information
|
|
122
|
+
consola.error('❌ Zod Validation Failed');
|
|
123
|
+
consola.box({
|
|
124
|
+
title: 'getDashboardApiCommandsSummaryRetrieve',
|
|
125
|
+
message: `Path: /cfg/dashboard/api/commands/summary/\nMethod: GET`,
|
|
126
|
+
style: {
|
|
127
|
+
borderColor: 'red',
|
|
128
|
+
borderStyle: 'rounded'
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
133
|
+
consola.error('Validation Issues:');
|
|
134
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
135
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
136
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
137
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
138
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
consola.error('Response data:', response);
|
|
143
|
+
|
|
144
|
+
// Re-throw the error
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
90
147
|
}
|
|
91
148
|
|
|
92
149
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { ConfigDataSchema, type ConfigData } from '../schemas/ConfigData.schema'
|
|
33
34
|
import { getAPIInstance } from '../../api-instance'
|
|
34
35
|
|
|
@@ -42,7 +43,35 @@ export async function getDashboardApiConfigConfigRetrieve( client?: any
|
|
|
42
43
|
): Promise<ConfigData> {
|
|
43
44
|
const api = client || getAPIInstance()
|
|
44
45
|
const response = await api.cfg_dashboard_config.dashboardApiConfigConfigRetrieve()
|
|
45
|
-
|
|
46
|
+
try {
|
|
47
|
+
return ConfigDataSchema.parse(response)
|
|
48
|
+
} catch (error) {
|
|
49
|
+
// Zod validation error - log detailed information
|
|
50
|
+
consola.error('❌ Zod Validation Failed');
|
|
51
|
+
consola.box({
|
|
52
|
+
title: 'getDashboardApiConfigConfigRetrieve',
|
|
53
|
+
message: `Path: /cfg/dashboard/api/config/config/\nMethod: GET`,
|
|
54
|
+
style: {
|
|
55
|
+
borderColor: 'red',
|
|
56
|
+
borderStyle: 'rounded'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
61
|
+
consola.error('Validation Issues:');
|
|
62
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
63
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
64
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
65
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
66
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
consola.error('Response data:', response);
|
|
71
|
+
|
|
72
|
+
// Re-throw the error
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { DashboardOverviewSchema, type DashboardOverview } from '../schemas/DashboardOverview.schema'
|
|
33
34
|
import { getAPIInstance } from '../../api-instance'
|
|
34
35
|
|
|
@@ -42,7 +43,35 @@ export async function getDashboardApiOverviewOverviewRetrieve( client?: any
|
|
|
42
43
|
): Promise<DashboardOverview> {
|
|
43
44
|
const api = client || getAPIInstance()
|
|
44
45
|
const response = await api.cfg_dashboard_overview.dashboardApiOverviewOverviewRetrieve()
|
|
45
|
-
|
|
46
|
+
try {
|
|
47
|
+
return DashboardOverviewSchema.parse(response)
|
|
48
|
+
} catch (error) {
|
|
49
|
+
// Zod validation error - log detailed information
|
|
50
|
+
consola.error('❌ Zod Validation Failed');
|
|
51
|
+
consola.box({
|
|
52
|
+
title: 'getDashboardApiOverviewOverviewRetrieve',
|
|
53
|
+
message: `Path: /cfg/dashboard/api/overview/overview/\nMethod: GET`,
|
|
54
|
+
style: {
|
|
55
|
+
borderColor: 'red',
|
|
56
|
+
borderStyle: 'rounded'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
61
|
+
consola.error('Validation Issues:');
|
|
62
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
63
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
64
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
65
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
66
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
consola.error('Response data:', response);
|
|
71
|
+
|
|
72
|
+
// Re-throw the error
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
|