@djangocfg/api 1.2.21 → 1.2.23
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 +11030 -6472
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10395 -4022
- package/dist/index.d.ts +10395 -4022
- package/dist/index.mjs +11117 -6580
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +3 -3
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_config.ts +48 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_charts.ts +138 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_configuration.ts +63 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_monitoring.ts +11 -11
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_services.ts +77 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_testing.ts +79 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +5 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +3 -3
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_config.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_charts.ts +126 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_configuration.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_monitoring.ts +9 -9
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_services.ts +65 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_testing.ts +71 -0
- package/src/cfg/generated/_utils/hooks/index.ts +5 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoClientInfo.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/CentrifugoConfig.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/{OverviewStats.schema.ts → CentrifugoOverviewStats.schema.ts} +3 -3
- package/src/cfg/generated/_utils/schemas/CentrifugoPublication.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ConfigData.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/ConfigMeta.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ConfigValidation.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/DRFConfig.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/DashboardCharts.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/DatabaseConfig.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/DjangoConfig.schema.ts +86 -0
- package/src/cfg/generated/_utils/schemas/DjangoRQConfig.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/EmailConfig.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/ErrorDistributionChart.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ErrorDistributionChartSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ErrorDistributionDataPoint.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCCallRequestRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/GRPCCallResponse.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/GRPCConfig.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/GRPCConfigDashboard.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/GRPCExampleSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/GRPCExamplesList.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/GRPCFeaturesSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCFrameworkConfigSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCHealthCheck.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/GRPCInterceptorInfoSerializer.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/GRPCOverviewStats.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/GRPCServerConfigSerializer.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/GRPCServerInfo.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/GRPCServiceInfoSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCStatsSerializer.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/GRPCTestLog.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/JWTConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/MethodInfoSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/MethodSummarySerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/MonitoringServiceStatsSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaymentsConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/PaymentsNowPayments.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/RecentErrorSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/RecentRequest.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/RedisQueueConfig.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/RequestVolumeChart.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/RequestVolumeChartSerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/RequestVolumeDataPoint.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/ResponseTimeChart.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ResponseTimeChartSerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ResponseTimeDataPoint.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ServerLifecycleChart.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ServerLifecycleEvent.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ServerUptimeChart.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ServerUptimeChartSerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ServerUptimeDataPoint.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ServiceActivityChart.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ServiceActivityChartSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ServiceActivityDataPoint.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ServiceDetail.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/ServiceList.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/ServiceMethods.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ServiceStatsSerializer.schema.ts +8 -8
- package/src/cfg/generated/_utils/schemas/SpectacularConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/index.ts +56 -2
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +5 -5
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +4 -4
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +1 -1
- package/src/cfg/generated/cfg__dashboard__dashboard_config/client.ts +25 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_config/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_config/models.ts +240 -0
- package/src/cfg/generated/cfg__endpoints/client.ts +1 -1
- package/src/cfg/generated/cfg__grpc__grpc_charts/client.ts +162 -0
- package/src/cfg/generated/cfg__grpc__grpc_charts/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_charts/models.ts +335 -0
- package/src/cfg/generated/cfg__grpc__grpc_configuration/client.ts +35 -0
- package/src/cfg/generated/cfg__grpc__grpc_configuration/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_configuration/models.ts +128 -0
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/client.ts +12 -11
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/models.ts +45 -31
- package/src/cfg/generated/cfg__grpc__grpc_services/client.ts +55 -0
- package/src/cfg/generated/cfg__grpc__grpc_services/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_services/models.ts +138 -0
- package/src/cfg/generated/cfg__grpc__grpc_testing/client.ts +67 -0
- package/src/cfg/generated/cfg__grpc__grpc_testing/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_testing/models.ts +106 -0
- package/src/cfg/generated/cfg__payments/client.ts +1 -1
- package/src/cfg/generated/client.ts +15 -0
- package/src/cfg/generated/index.ts +25 -0
- package/src/cfg/generated/schema.ts +8264 -4968
- package/src/cfg/generated/_utils/schemas/RecentRequests.schema.ts +0 -23
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Charts
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__grpc__grpc_charts'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { DashboardCharts } from '../schemas/DashboardCharts.schema'
|
|
22
|
+
import type { ErrorDistributionChart } from '../schemas/ErrorDistributionChart.schema'
|
|
23
|
+
import type { RequestVolumeChart } from '../schemas/RequestVolumeChart.schema'
|
|
24
|
+
import type { ResponseTimeChart } from '../schemas/ResponseTimeChart.schema'
|
|
25
|
+
import type { ServerLifecycleChart } from '../schemas/ServerLifecycleChart.schema'
|
|
26
|
+
import type { ServerUptimeChart } from '../schemas/ServerUptimeChart.schema'
|
|
27
|
+
import type { ServiceActivityChart } from '../schemas/ServiceActivityChart.schema'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get all dashboard charts data
|
|
31
|
+
*
|
|
32
|
+
* @method GET
|
|
33
|
+
* @path /cfg/grpc/charts/dashboard/
|
|
34
|
+
*/
|
|
35
|
+
export function useGrpcChartsDashboardRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<DashboardCharts>> {
|
|
36
|
+
return useSWR<DashboardCharts>(
|
|
37
|
+
params ? ['cfg-grpc-charts-dashboard', params] : 'cfg-grpc-charts-dashboard',
|
|
38
|
+
() => Fetchers.getGrpcChartsDashboardRetrieve(params, client)
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get error distribution chart data
|
|
45
|
+
*
|
|
46
|
+
* @method GET
|
|
47
|
+
* @path /cfg/grpc/charts/error-distribution/
|
|
48
|
+
*/
|
|
49
|
+
export function useGrpcChartsErrorDistributionRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ErrorDistributionChart>> {
|
|
50
|
+
return useSWR<ErrorDistributionChart>(
|
|
51
|
+
params ? ['cfg-grpc-charts-error-distribution', params] : 'cfg-grpc-charts-error-distribution',
|
|
52
|
+
() => Fetchers.getGrpcChartsErrorDistributionRetrieve(params, client)
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get request volume chart data
|
|
59
|
+
*
|
|
60
|
+
* @method GET
|
|
61
|
+
* @path /cfg/grpc/charts/request-volume/
|
|
62
|
+
*/
|
|
63
|
+
export function useGrpcChartsRequestVolumeRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<RequestVolumeChart>> {
|
|
64
|
+
return useSWR<RequestVolumeChart>(
|
|
65
|
+
params ? ['cfg-grpc-charts-request-volume', params] : 'cfg-grpc-charts-request-volume',
|
|
66
|
+
() => Fetchers.getGrpcChartsRequestVolumeRetrieve(params, client)
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get response time chart data
|
|
73
|
+
*
|
|
74
|
+
* @method GET
|
|
75
|
+
* @path /cfg/grpc/charts/response-time/
|
|
76
|
+
*/
|
|
77
|
+
export function useGrpcChartsResponseTimeRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ResponseTimeChart>> {
|
|
78
|
+
return useSWR<ResponseTimeChart>(
|
|
79
|
+
params ? ['cfg-grpc-charts-response-time', params] : 'cfg-grpc-charts-response-time',
|
|
80
|
+
() => Fetchers.getGrpcChartsResponseTimeRetrieve(params, client)
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get server lifecycle events
|
|
87
|
+
*
|
|
88
|
+
* @method GET
|
|
89
|
+
* @path /cfg/grpc/charts/server-lifecycle/
|
|
90
|
+
*/
|
|
91
|
+
export function useGrpcChartsServerLifecycleRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ServerLifecycleChart>> {
|
|
92
|
+
return useSWR<ServerLifecycleChart>(
|
|
93
|
+
params ? ['cfg-grpc-charts-server-lifecycle', params] : 'cfg-grpc-charts-server-lifecycle',
|
|
94
|
+
() => Fetchers.getGrpcChartsServerLifecycleRetrieve(params, client)
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get server uptime chart data
|
|
101
|
+
*
|
|
102
|
+
* @method GET
|
|
103
|
+
* @path /cfg/grpc/charts/server-uptime/
|
|
104
|
+
*/
|
|
105
|
+
export function useGrpcChartsServerUptimeRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ServerUptimeChart>> {
|
|
106
|
+
return useSWR<ServerUptimeChart>(
|
|
107
|
+
params ? ['cfg-grpc-charts-server-uptime', params] : 'cfg-grpc-charts-server-uptime',
|
|
108
|
+
() => Fetchers.getGrpcChartsServerUptimeRetrieve(params, client)
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get service activity chart data
|
|
115
|
+
*
|
|
116
|
+
* @method GET
|
|
117
|
+
* @path /cfg/grpc/charts/service-activity/
|
|
118
|
+
*/
|
|
119
|
+
export function useGrpcChartsServiceActivityRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ServiceActivityChart>> {
|
|
120
|
+
return useSWR<ServiceActivityChart>(
|
|
121
|
+
params ? ['cfg-grpc-charts-service-activity', params] : 'cfg-grpc-charts-service-activity',
|
|
122
|
+
() => Fetchers.getGrpcChartsServiceActivityRetrieve(params, client)
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Configuration
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__grpc__grpc_configuration'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { GRPCConfig } from '../schemas/GRPCConfig.schema'
|
|
22
|
+
import type { GRPCServerInfo } from '../schemas/GRPCServerInfo.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get gRPC configuration
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/grpc/config/config/
|
|
29
|
+
*/
|
|
30
|
+
export function useGrpcConfigConfigRetrieve(client?: API): ReturnType<typeof useSWR<GRPCConfig>> {
|
|
31
|
+
return useSWR<GRPCConfig>(
|
|
32
|
+
'cfg-grpc-config-config',
|
|
33
|
+
() => Fetchers.getGrpcConfigConfigRetrieve(client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get server information
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/grpc/config/server-info/
|
|
43
|
+
*/
|
|
44
|
+
export function useGrpcConfigServerInfoRetrieve(client?: API): ReturnType<typeof useSWR<GRPCServerInfo>> {
|
|
45
|
+
return useSWR<GRPCServerInfo>(
|
|
46
|
+
'cfg-grpc-config-server-info',
|
|
47
|
+
() => Fetchers.getGrpcConfigServerInfoRetrieve(client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
@@ -18,10 +18,10 @@ import useSWR from 'swr'
|
|
|
18
18
|
import { useSWRConfig } from 'swr'
|
|
19
19
|
import * as Fetchers from '../fetchers/cfg__grpc__grpc_monitoring'
|
|
20
20
|
import type { API } from '../../index'
|
|
21
|
-
import type {
|
|
21
|
+
import type { GRPCHealthCheck } from '../schemas/GRPCHealthCheck.schema'
|
|
22
|
+
import type { GRPCOverviewStats } from '../schemas/GRPCOverviewStats.schema'
|
|
22
23
|
import type { MethodList } from '../schemas/MethodList.schema'
|
|
23
|
-
import type {
|
|
24
|
-
import type { RecentRequests } from '../schemas/RecentRequests.schema'
|
|
24
|
+
import type { RecentRequest } from '../schemas/RecentRequest.schema'
|
|
25
25
|
import type { ServiceList } from '../schemas/ServiceList.schema'
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -30,8 +30,8 @@ import type { ServiceList } from '../schemas/ServiceList.schema'
|
|
|
30
30
|
* @method GET
|
|
31
31
|
* @path /cfg/grpc/monitor/health/
|
|
32
32
|
*/
|
|
33
|
-
export function useGrpcMonitorHealthRetrieve(client?: API): ReturnType<typeof useSWR<
|
|
34
|
-
return useSWR<
|
|
33
|
+
export function useGrpcMonitorHealthRetrieve(client?: API): ReturnType<typeof useSWR<GRPCHealthCheck>> {
|
|
34
|
+
return useSWR<GRPCHealthCheck>(
|
|
35
35
|
'cfg-grpc-monitor-health',
|
|
36
36
|
() => Fetchers.getGrpcMonitorHealthRetrieve(client)
|
|
37
37
|
)
|
|
@@ -58,8 +58,8 @@ export function useGrpcMonitorMethodsRetrieve(params?: { hours?: number; service
|
|
|
58
58
|
* @method GET
|
|
59
59
|
* @path /cfg/grpc/monitor/overview/
|
|
60
60
|
*/
|
|
61
|
-
export function useGrpcMonitorOverviewRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<
|
|
62
|
-
return useSWR<
|
|
61
|
+
export function useGrpcMonitorOverviewRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<GRPCOverviewStats>> {
|
|
62
|
+
return useSWR<GRPCOverviewStats>(
|
|
63
63
|
params ? ['cfg-grpc-monitor-overview', params] : 'cfg-grpc-monitor-overview',
|
|
64
64
|
() => Fetchers.getGrpcMonitorOverviewRetrieve(params, client)
|
|
65
65
|
)
|
|
@@ -72,8 +72,8 @@ export function useGrpcMonitorOverviewRetrieve(params?: { hours?: number }, clie
|
|
|
72
72
|
* @method GET
|
|
73
73
|
* @path /cfg/grpc/monitor/requests/
|
|
74
74
|
*/
|
|
75
|
-
export function useGrpcMonitorRequestsRetrieve(params?: {
|
|
76
|
-
return useSWR<
|
|
75
|
+
export function useGrpcMonitorRequestsRetrieve(params?: { method?: string; service?: string; status?: string }, client?: API): ReturnType<typeof useSWR<RecentRequest>> {
|
|
76
|
+
return useSWR<RecentRequest>(
|
|
77
77
|
params ? ['cfg-grpc-monitor-request', params] : 'cfg-grpc-monitor-request',
|
|
78
78
|
() => Fetchers.getGrpcMonitorRequestsRetrieve(params, client)
|
|
79
79
|
)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Services
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__grpc__grpc_services'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { ServiceDetail } from '../schemas/ServiceDetail.schema'
|
|
22
|
+
import type { ServiceMethods } from '../schemas/ServiceMethods.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List all services
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/grpc/services/
|
|
29
|
+
*/
|
|
30
|
+
export function useGrpcServicesList(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
31
|
+
return useSWR<any>(
|
|
32
|
+
params ? ['cfg-grpc-services', params] : 'cfg-grpc-services',
|
|
33
|
+
() => Fetchers.getGrpcServicesList(params, client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get service details
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/grpc/services/{id}/
|
|
43
|
+
*/
|
|
44
|
+
export function useGrpcServicesRetrieve(id: string, pk: string, client?: API): ReturnType<typeof useSWR<ServiceDetail>> {
|
|
45
|
+
return useSWR<ServiceDetail>(
|
|
46
|
+
['cfg-grpc-service', id],
|
|
47
|
+
() => Fetchers.getGrpcServicesRetrieve(id, pk, client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get service methods
|
|
54
|
+
*
|
|
55
|
+
* @method GET
|
|
56
|
+
* @path /cfg/grpc/services/{id}/methods/
|
|
57
|
+
*/
|
|
58
|
+
export function useGrpcServicesMethodsRetrieve(id: string, pk: string, client?: API): ReturnType<typeof useSWR<ServiceMethods>> {
|
|
59
|
+
return useSWR<ServiceMethods>(
|
|
60
|
+
['cfg-grpc-services-method', id],
|
|
61
|
+
() => Fetchers.getGrpcServicesMethodsRetrieve(id, pk, client)
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Testing
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__grpc__grpc_testing'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { GRPCCallRequestRequest } from '../schemas/GRPCCallRequestRequest.schema'
|
|
22
|
+
import type { GRPCCallResponse } from '../schemas/GRPCCallResponse.schema'
|
|
23
|
+
import type { GRPCExamplesList } from '../schemas/GRPCExamplesList.schema'
|
|
24
|
+
import type { GRPCTestLog } from '../schemas/GRPCTestLog.schema'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Call gRPC method
|
|
28
|
+
*
|
|
29
|
+
* @method POST
|
|
30
|
+
* @path /cfg/grpc/test/call/
|
|
31
|
+
*/
|
|
32
|
+
export function useCreateGrpcTestCallCreate() {
|
|
33
|
+
const { mutate } = useSWRConfig()
|
|
34
|
+
|
|
35
|
+
return async (data: GRPCCallRequestRequest, client?: API): Promise<GRPCCallResponse> => {
|
|
36
|
+
const result = await Fetchers.createGrpcTestCallCreate(data, client)
|
|
37
|
+
// Revalidate related queries
|
|
38
|
+
mutate('cfg-grpc-test-call')
|
|
39
|
+
return result
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get example payloads
|
|
46
|
+
*
|
|
47
|
+
* @method GET
|
|
48
|
+
* @path /cfg/grpc/test/examples/
|
|
49
|
+
*/
|
|
50
|
+
export function useGrpcTestExamplesRetrieve(params?: { method?: string; service?: string }, client?: API): ReturnType<typeof useSWR<GRPCExamplesList>> {
|
|
51
|
+
return useSWR<GRPCExamplesList>(
|
|
52
|
+
params ? ['cfg-grpc-test-example', params] : 'cfg-grpc-test-example',
|
|
53
|
+
() => Fetchers.getGrpcTestExamplesRetrieve(params, client)
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get test logs
|
|
60
|
+
*
|
|
61
|
+
* @method GET
|
|
62
|
+
* @path /cfg/grpc/test/logs/
|
|
63
|
+
*/
|
|
64
|
+
export function useGrpcTestLogsRetrieve(params?: { method?: string; service?: string; status?: string }, client?: API): ReturnType<typeof useSWR<GRPCTestLog>> {
|
|
65
|
+
return useSWR<GRPCTestLog>(
|
|
66
|
+
params ? ['cfg-grpc-test-log', params] : 'cfg-grpc-test-log',
|
|
67
|
+
() => Fetchers.getGrpcTestLogsRetrieve(params, client)
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
@@ -33,6 +33,7 @@ export * from './cfg__dashboard__dashboard_api_zones'
|
|
|
33
33
|
export * from './cfg__dashboard__dashboard_activity'
|
|
34
34
|
export * from './cfg__dashboard__dashboard_charts'
|
|
35
35
|
export * from './cfg__dashboard__dashboard_commands'
|
|
36
|
+
export * from './cfg__dashboard__dashboard_config'
|
|
36
37
|
export * from './cfg__dashboard__dashboard_overview'
|
|
37
38
|
export * from './cfg__dashboard__dashboard_statistics'
|
|
38
39
|
export * from './cfg__dashboard__dashboard_system'
|
|
@@ -52,7 +53,11 @@ export * from './cfg__accounts__user_profile'
|
|
|
52
53
|
export * from './cfg__accounts'
|
|
53
54
|
export * from './cfg__centrifugo'
|
|
54
55
|
export * from './cfg__endpoints'
|
|
56
|
+
export * from './cfg__grpc__grpc_charts'
|
|
57
|
+
export * from './cfg__grpc__grpc_configuration'
|
|
55
58
|
export * from './cfg__grpc__grpc_monitoring'
|
|
59
|
+
export * from './cfg__grpc__grpc_services'
|
|
60
|
+
export * from './cfg__grpc__grpc_testing'
|
|
56
61
|
export * from './cfg__health'
|
|
57
62
|
export * from './cfg__knowbase'
|
|
58
63
|
export * from './cfg__leads'
|
|
@@ -12,8 +12,8 @@ import { z } from 'zod'
|
|
|
12
12
|
export const CentrifugoClientInfoSchema = z.object({
|
|
13
13
|
user: z.string(),
|
|
14
14
|
client: z.string(),
|
|
15
|
-
conn_info: z.string().nullable().optional(),
|
|
16
|
-
chan_info: z.string().nullable().optional(),
|
|
15
|
+
conn_info: z.record(z.string(), z.any()).nullable().optional(),
|
|
16
|
+
chan_info: z.record(z.string(), z.any()).nullable().optional(),
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoConfig
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Centrifugo configuration.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Centrifugo configuration.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoConfigSchema = z.object({
|
|
13
|
+
enabled: z.boolean().nullable().optional(),
|
|
14
|
+
api_url: z.string().nullable().optional(),
|
|
15
|
+
api_key: z.string().nullable().optional(),
|
|
16
|
+
token_hmac_secret_key: z.string().nullable().optional(),
|
|
17
|
+
timeout: z.int().nullable().optional(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type CentrifugoConfig = z.infer<typeof CentrifugoConfigSchema>
|
|
@@ -12,9 +12,9 @@ import { CentrifugoStreamPositionSchema } from './CentrifugoStreamPosition.schem
|
|
|
12
12
|
*/
|
|
13
13
|
export const CentrifugoHistoryRequestRequestSchema = z.object({
|
|
14
14
|
channel: z.string(),
|
|
15
|
-
limit: z.
|
|
15
|
+
limit: z.int().nullable().optional(),
|
|
16
16
|
since: CentrifugoStreamPositionSchema.optional(),
|
|
17
|
-
reverse: z.
|
|
17
|
+
reverse: z.boolean().nullable().optional(),
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Zod schema for
|
|
2
|
+
* Zod schema for CentrifugoOverviewStats
|
|
3
3
|
*
|
|
4
4
|
* This schema provides runtime validation and type inference.
|
|
5
5
|
* * Overview statistics for Centrifugo publishes.
|
|
@@ -9,7 +9,7 @@ import { z } from 'zod'
|
|
|
9
9
|
/**
|
|
10
10
|
* Overview statistics for Centrifugo publishes.
|
|
11
11
|
*/
|
|
12
|
-
export const
|
|
12
|
+
export const CentrifugoOverviewStatsSchema = z.object({
|
|
13
13
|
total: z.int(),
|
|
14
14
|
successful: z.int(),
|
|
15
15
|
failed: z.int(),
|
|
@@ -23,4 +23,4 @@ export const OverviewStatsSchema = z.object({
|
|
|
23
23
|
/**
|
|
24
24
|
* Infer TypeScript type from Zod schema
|
|
25
25
|
*/
|
|
26
|
-
export type
|
|
26
|
+
export type CentrifugoOverviewStats = z.infer<typeof CentrifugoOverviewStatsSchema>
|
|
@@ -14,7 +14,7 @@ export const CentrifugoPublicationSchema = z.object({
|
|
|
14
14
|
data: z.record(z.string(), z.any()),
|
|
15
15
|
info: CentrifugoClientInfoSchema.optional(),
|
|
16
16
|
offset: z.int(),
|
|
17
|
-
tags: z.string().nullable().optional(),
|
|
17
|
+
tags: z.record(z.string(), z.any()).nullable().optional(),
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConfigData
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Serializer for complete config data endpoint.
|
|
6
|
+
|
|
7
|
+
Returns both DjangoConfig and Django settings with validation info.
|
|
8
|
+
* */
|
|
9
|
+
import { z } from 'zod'
|
|
10
|
+
import { ConfigValidationSchema } from './ConfigValidation.schema'
|
|
11
|
+
import { DjangoConfigSchema } from './DjangoConfig.schema'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Serializer for complete config data endpoint.
|
|
15
|
+
|
|
16
|
+
Returns both DjangoConfig and Django settings with validation info.
|
|
17
|
+
*/
|
|
18
|
+
export const ConfigDataSchema = z.object({
|
|
19
|
+
django_config: DjangoConfigSchema,
|
|
20
|
+
django_settings: z.record(z.string(), z.any()),
|
|
21
|
+
_validation: ConfigValidationSchema,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Infer TypeScript type from Zod schema
|
|
26
|
+
*/
|
|
27
|
+
export type ConfigData = z.infer<typeof ConfigDataSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConfigMeta
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Config metadata.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Config metadata.
|
|
11
|
+
*/
|
|
12
|
+
export const ConfigMetaSchema = z.object({
|
|
13
|
+
config_class: z.string(),
|
|
14
|
+
secret_key_configured: z.boolean(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type ConfigMeta = z.infer<typeof ConfigMetaSchema>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConfigValidation
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Validation result for config serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Validation result for config serializer.
|
|
11
|
+
*/
|
|
12
|
+
export const ConfigValidationSchema = z.object({
|
|
13
|
+
status: z.string(),
|
|
14
|
+
missing_in_serializer: z.array(z.string()),
|
|
15
|
+
extra_in_serializer: z.array(z.string()),
|
|
16
|
+
type_mismatches: z.array(z.record(z.string(), z.any())),
|
|
17
|
+
total_config_fields: z.int(),
|
|
18
|
+
total_serializer_fields: z.int(),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Infer TypeScript type from Zod schema
|
|
23
|
+
*/
|
|
24
|
+
export type ConfigValidation = z.infer<typeof ConfigValidationSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for DRFConfig
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Django REST Framework configuration.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Django REST Framework configuration.
|
|
11
|
+
*/
|
|
12
|
+
export const DRFConfigSchema = z.object({
|
|
13
|
+
default_pagination_class: z.string().nullable().optional(),
|
|
14
|
+
page_size: z.int().nullable().optional(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type DRFConfig = z.infer<typeof DRFConfigSchema>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for DashboardCharts
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Combined dashboard charts data.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { ErrorDistributionChartSerializerSchema } from './ErrorDistributionChartSerializer.schema'
|
|
9
|
+
import { RequestVolumeChartSerializerSchema } from './RequestVolumeChartSerializer.schema'
|
|
10
|
+
import { ResponseTimeChartSerializerSchema } from './ResponseTimeChartSerializer.schema'
|
|
11
|
+
import { ServerUptimeChartSerializerSchema } from './ServerUptimeChartSerializer.schema'
|
|
12
|
+
import { ServiceActivityChartSerializerSchema } from './ServiceActivityChartSerializer.schema'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Combined dashboard charts data.
|
|
16
|
+
*/
|
|
17
|
+
export const DashboardChartsSchema = z.object({
|
|
18
|
+
server_uptime: ServerUptimeChartSerializerSchema,
|
|
19
|
+
request_volume: RequestVolumeChartSerializerSchema,
|
|
20
|
+
response_time: ResponseTimeChartSerializerSchema,
|
|
21
|
+
service_activity: ServiceActivityChartSerializerSchema,
|
|
22
|
+
error_distribution: ErrorDistributionChartSerializerSchema,
|
|
23
|
+
period_hours: z.int(),
|
|
24
|
+
generated_at: z.string(),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Infer TypeScript type from Zod schema
|
|
29
|
+
*/
|
|
30
|
+
export type DashboardCharts = z.infer<typeof DashboardChartsSchema>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for DatabaseConfig
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Database configuration.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Database configuration.
|
|
11
|
+
*/
|
|
12
|
+
export const DatabaseConfigSchema = z.object({
|
|
13
|
+
engine: z.string(),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
user: z.string().nullable().optional(),
|
|
16
|
+
password: z.string().nullable().optional(),
|
|
17
|
+
host: z.string().nullable().optional(),
|
|
18
|
+
port: z.int().nullable().optional(),
|
|
19
|
+
connect_timeout: z.int().nullable().optional(),
|
|
20
|
+
sslmode: z.string().nullable().optional(),
|
|
21
|
+
options: z.record(z.string(), z.any()).nullable().optional(),
|
|
22
|
+
apps: z.array(z.string()).nullable().optional(),
|
|
23
|
+
operations: z.array(z.string()).nullable().optional(),
|
|
24
|
+
migrate_to: z.string().nullable().optional(),
|
|
25
|
+
routing_description: z.string().nullable().optional(),
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Infer TypeScript type from Zod schema
|
|
30
|
+
*/
|
|
31
|
+
export type DatabaseConfig = z.infer<typeof DatabaseConfigSchema>
|