@djangocfg/api 1.2.17 → 1.2.19
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 +2841 -1242
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2704 -432
- package/dist/index.d.ts +2704 -432
- package/dist/index.mjs +2717 -1130
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard.ts +89 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_monitoring.ts +122 -0
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +9 -7
- package/src/cfg/generated/_utils/fetchers/index.ts +2 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +77 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_monitoring.ts +110 -0
- package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +9 -7
- package/src/cfg/generated/_utils/hooks/index.ts +2 -0
- package/src/cfg/generated/_utils/schemas/DashboardOverview.schema.ts +16 -8
- package/src/cfg/generated/_utils/schemas/MethodList.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/MethodStatsSerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/RecentRequests.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/ServiceList.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ServiceStatsSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/TaskLogOverview.schema.ts +43 -0
- package/src/cfg/generated/_utils/schemas/TaskLogTimeline.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/TaskLogTimelineItem.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/TasksByQueue.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/TasksByStatus.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/index.ts +10 -0
- package/src/cfg/generated/cfg__dashboard/client.ts +48 -0
- package/src/cfg/generated/cfg__dashboard/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard/models.ts +0 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +179 -9
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/client.ts +129 -0
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/models.ts +124 -0
- package/src/cfg/generated/cfg__support/client.ts +30 -12
- package/src/cfg/generated/cfg__tasks/client.ts +38 -31
- package/src/cfg/generated/cfg__tasks/models.ts +82 -0
- package/src/cfg/generated/client.ts +6 -0
- package/src/cfg/generated/index.ts +10 -0
- package/src/cfg/generated/schema.ts +1292 -121
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "DjangoCFG",
|
|
6
6
|
"url": "https://djangocfg.com"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@types/node": "^22.15.3",
|
|
69
69
|
"@types/react": "19.2.2",
|
|
70
70
|
"@types/react-dom": "19.2.1",
|
|
71
|
-
"@djangocfg/typescript-config": "^1.2.
|
|
71
|
+
"@djangocfg/typescript-config": "^1.2.19",
|
|
72
72
|
"react": "^19.1.0",
|
|
73
73
|
"react-dom": "^19.1.0",
|
|
74
74
|
"tsup": "^8.5.0",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Dashboard
|
|
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 { getAPIInstance } from '../../api-instance'
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* API operation
|
|
36
|
+
*
|
|
37
|
+
* @method GET
|
|
38
|
+
* @path /cfg/dashboard/api/django_q2/
|
|
39
|
+
*/
|
|
40
|
+
export async function getDashboardApiDjangoQ2Retrieve( client?: any
|
|
41
|
+
): Promise<any> {
|
|
42
|
+
const api = client || getAPIInstance()
|
|
43
|
+
const response = await api.cfg_dashboard.apiDjangoQ2Retrieve()
|
|
44
|
+
return response
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* API operation
|
|
50
|
+
*
|
|
51
|
+
* @method GET
|
|
52
|
+
* @path /cfg/dashboard/api/django_q2/schedules/
|
|
53
|
+
*/
|
|
54
|
+
export async function getDashboardApiDjangoQ2SchedulesRetrieve( client?: any
|
|
55
|
+
): Promise<any> {
|
|
56
|
+
const api = client || getAPIInstance()
|
|
57
|
+
const response = await api.cfg_dashboard.apiDjangoQ2SchedulesRetrieve()
|
|
58
|
+
return response
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* API operation
|
|
64
|
+
*
|
|
65
|
+
* @method GET
|
|
66
|
+
* @path /cfg/dashboard/api/django_q2/status/
|
|
67
|
+
*/
|
|
68
|
+
export async function getDashboardApiDjangoQ2StatusRetrieve( client?: any
|
|
69
|
+
): Promise<any> {
|
|
70
|
+
const api = client || getAPIInstance()
|
|
71
|
+
const response = await api.cfg_dashboard.apiDjangoQ2StatusRetrieve()
|
|
72
|
+
return response
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* API operation
|
|
78
|
+
*
|
|
79
|
+
* @method GET
|
|
80
|
+
* @path /cfg/dashboard/api/django_q2/tasks/
|
|
81
|
+
*/
|
|
82
|
+
export async function getDashboardApiDjangoQ2TasksRetrieve( client?: any
|
|
83
|
+
): Promise<any> {
|
|
84
|
+
const api = client || getAPIInstance()
|
|
85
|
+
const response = await api.cfg_dashboard.apiDjangoQ2TasksRetrieve()
|
|
86
|
+
return response
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Grpc Monitoring
|
|
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 { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.schema'
|
|
33
|
+
import { MethodListSchema, type MethodList } from '../schemas/MethodList.schema'
|
|
34
|
+
import { OverviewStatsSchema, type OverviewStats } from '../schemas/OverviewStats.schema'
|
|
35
|
+
import { RecentRequestsSchema, type RecentRequests } from '../schemas/RecentRequests.schema'
|
|
36
|
+
import { ServiceListSchema, type ServiceList } from '../schemas/ServiceList.schema'
|
|
37
|
+
import { getAPIInstance } from '../../api-instance'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get gRPC health status
|
|
41
|
+
*
|
|
42
|
+
* @method GET
|
|
43
|
+
* @path /cfg/grpc/monitor/health/
|
|
44
|
+
*/
|
|
45
|
+
export async function getGrpcMonitorHealthRetrieve( client?: any
|
|
46
|
+
): Promise<HealthCheck> {
|
|
47
|
+
const api = client || getAPIInstance()
|
|
48
|
+
const response = await api.cfg_grpc_monitoring.grpcMonitorHealthRetrieve()
|
|
49
|
+
return HealthCheckSchema.parse(response)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get method statistics
|
|
55
|
+
*
|
|
56
|
+
* @method GET
|
|
57
|
+
* @path /cfg/grpc/monitor/methods/
|
|
58
|
+
*/
|
|
59
|
+
export async function getGrpcMonitorMethodsRetrieve( params?: { hours?: number; service?: string }, client?: any
|
|
60
|
+
): Promise<MethodList> {
|
|
61
|
+
const api = client || getAPIInstance()
|
|
62
|
+
const response = await api.cfg_grpc_monitoring.grpcMonitorMethodsRetrieve(params?.hours, params?.service)
|
|
63
|
+
return MethodListSchema.parse(response)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get overview statistics
|
|
69
|
+
*
|
|
70
|
+
* @method GET
|
|
71
|
+
* @path /cfg/grpc/monitor/overview/
|
|
72
|
+
*/
|
|
73
|
+
export async function getGrpcMonitorOverviewRetrieve( params?: { hours?: number }, client?: any
|
|
74
|
+
): Promise<OverviewStats> {
|
|
75
|
+
const api = client || getAPIInstance()
|
|
76
|
+
const response = await api.cfg_grpc_monitoring.grpcMonitorOverviewRetrieve(params?.hours)
|
|
77
|
+
return OverviewStatsSchema.parse(response)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Get recent requests
|
|
83
|
+
*
|
|
84
|
+
* @method GET
|
|
85
|
+
* @path /cfg/grpc/monitor/requests/
|
|
86
|
+
*/
|
|
87
|
+
export async function getGrpcMonitorRequestsRetrieve( params?: { count?: number; method?: string; offset?: number; service?: string; status?: string }, client?: any
|
|
88
|
+
): Promise<RecentRequests> {
|
|
89
|
+
const api = client || getAPIInstance()
|
|
90
|
+
const response = await api.cfg_grpc_monitoring.grpcMonitorRequestsRetrieve(params?.count, params?.method, params?.offset, params?.service, params?.status)
|
|
91
|
+
return RecentRequestsSchema.parse(response)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get service statistics
|
|
97
|
+
*
|
|
98
|
+
* @method GET
|
|
99
|
+
* @path /cfg/grpc/monitor/services/
|
|
100
|
+
*/
|
|
101
|
+
export async function getGrpcMonitorServicesRetrieve( params?: { hours?: number }, client?: any
|
|
102
|
+
): Promise<ServiceList> {
|
|
103
|
+
const api = client || getAPIInstance()
|
|
104
|
+
const response = await api.cfg_grpc_monitoring.grpcMonitorServicesRetrieve(params?.hours)
|
|
105
|
+
return ServiceListSchema.parse(response)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get request timeline
|
|
111
|
+
*
|
|
112
|
+
* @method GET
|
|
113
|
+
* @path /cfg/grpc/monitor/timeline/
|
|
114
|
+
*/
|
|
115
|
+
export async function getGrpcMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any
|
|
116
|
+
): Promise<any> {
|
|
117
|
+
const api = client || getAPIInstance()
|
|
118
|
+
const response = await api.cfg_grpc_monitoring.grpcMonitorTimelineRetrieve(params?.hours, params?.interval)
|
|
119
|
+
return response
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
import { PaginatedTaskLogListListSchema, type PaginatedTaskLogListList } from '../schemas/PaginatedTaskLogListList.schema'
|
|
33
33
|
import { TaskLogSchema, type TaskLog } from '../schemas/TaskLog.schema'
|
|
34
34
|
import { TaskLogDetailSchema, type TaskLogDetail } from '../schemas/TaskLogDetail.schema'
|
|
35
|
+
import { TaskLogOverviewSchema, type TaskLogOverview } from '../schemas/TaskLogOverview.schema'
|
|
35
36
|
import { TaskLogStatsSchema, type TaskLogStats } from '../schemas/TaskLogStats.schema'
|
|
37
|
+
import { TaskLogTimelineSchema, type TaskLogTimeline } from '../schemas/TaskLogTimeline.schema'
|
|
36
38
|
import { getAPIInstance } from '../../api-instance'
|
|
37
39
|
|
|
38
40
|
/**
|
|
@@ -78,21 +80,21 @@ export async function getTasksLogsRelatedRetrieve( id: number, client?: any
|
|
|
78
80
|
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
|
-
*
|
|
83
|
+
* Task System Overview
|
|
82
84
|
*
|
|
83
85
|
* @method GET
|
|
84
86
|
* @path /cfg/tasks/logs/overview/
|
|
85
87
|
*/
|
|
86
88
|
export async function getTasksLogsOverviewRetrieve( client?: any
|
|
87
|
-
): Promise<
|
|
89
|
+
): Promise<TaskLogOverview> {
|
|
88
90
|
const api = client || getAPIInstance()
|
|
89
91
|
const response = await api.cfg_tasks.logsOverviewRetrieve()
|
|
90
|
-
return
|
|
92
|
+
return TaskLogOverviewSchema.parse(response)
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
|
|
94
96
|
/**
|
|
95
|
-
*
|
|
97
|
+
* Task Execution Statistics
|
|
96
98
|
*
|
|
97
99
|
* @method GET
|
|
98
100
|
* @path /cfg/tasks/logs/stats/
|
|
@@ -106,16 +108,16 @@ export async function getTasksLogsStatsRetrieve( client?: any
|
|
|
106
108
|
|
|
107
109
|
|
|
108
110
|
/**
|
|
109
|
-
*
|
|
111
|
+
* Task Execution Timeline
|
|
110
112
|
*
|
|
111
113
|
* @method GET
|
|
112
114
|
* @path /cfg/tasks/logs/timeline/
|
|
113
115
|
*/
|
|
114
116
|
export async function getTasksLogsTimelineRetrieve( client?: any
|
|
115
|
-
): Promise<
|
|
117
|
+
): Promise<TaskLogTimeline> {
|
|
116
118
|
const api = client || getAPIInstance()
|
|
117
119
|
const response = await api.cfg_tasks.logsTimelineRetrieve()
|
|
118
|
-
return
|
|
120
|
+
return TaskLogTimelineSchema.parse(response)
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
|
|
@@ -32,6 +32,7 @@ export * from './cfg__centrifugo'
|
|
|
32
32
|
export * from './cfg__centrifugo__centrifugo_admin_api'
|
|
33
33
|
export * from './cfg__centrifugo__centrifugo_monitoring'
|
|
34
34
|
export * from './cfg__centrifugo__centrifugo_testing'
|
|
35
|
+
export * from './cfg__dashboard'
|
|
35
36
|
export * from './cfg__dashboard__dashboard_activity'
|
|
36
37
|
export * from './cfg__dashboard__dashboard_api_zones'
|
|
37
38
|
export * from './cfg__dashboard__dashboard_charts'
|
|
@@ -40,6 +41,7 @@ export * from './cfg__dashboard__dashboard_overview'
|
|
|
40
41
|
export * from './cfg__dashboard__dashboard_statistics'
|
|
41
42
|
export * from './cfg__dashboard__dashboard_system'
|
|
42
43
|
export * from './cfg__endpoints'
|
|
44
|
+
export * from './cfg__grpc__grpc_monitoring'
|
|
43
45
|
export * from './cfg__health'
|
|
44
46
|
export * from './cfg__knowbase'
|
|
45
47
|
export * from './cfg__leads'
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard
|
|
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__dashboard'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* API operation
|
|
24
|
+
*
|
|
25
|
+
* @method GET
|
|
26
|
+
* @path /cfg/dashboard/api/django_q2/
|
|
27
|
+
*/
|
|
28
|
+
export function useDashboardApiDjangoQ2Retrieve(client?: API): ReturnType<typeof useSWR<any>> {
|
|
29
|
+
return useSWR<any>(
|
|
30
|
+
'cfg-dashboard-api-django-q2',
|
|
31
|
+
() => Fetchers.getDashboardApiDjangoQ2Retrieve(client)
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* API operation
|
|
38
|
+
*
|
|
39
|
+
* @method GET
|
|
40
|
+
* @path /cfg/dashboard/api/django_q2/schedules/
|
|
41
|
+
*/
|
|
42
|
+
export function useDashboardApiDjangoQ2SchedulesRetrieve(client?: API): ReturnType<typeof useSWR<any>> {
|
|
43
|
+
return useSWR<any>(
|
|
44
|
+
'cfg-dashboard-api-django-q2-schedule',
|
|
45
|
+
() => Fetchers.getDashboardApiDjangoQ2SchedulesRetrieve(client)
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* API operation
|
|
52
|
+
*
|
|
53
|
+
* @method GET
|
|
54
|
+
* @path /cfg/dashboard/api/django_q2/status/
|
|
55
|
+
*/
|
|
56
|
+
export function useDashboardApiDjangoQ2StatusRetrieve(client?: API): ReturnType<typeof useSWR<any>> {
|
|
57
|
+
return useSWR<any>(
|
|
58
|
+
'cfg-dashboard-api-django-q2-statu',
|
|
59
|
+
() => Fetchers.getDashboardApiDjangoQ2StatusRetrieve(client)
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* API operation
|
|
66
|
+
*
|
|
67
|
+
* @method GET
|
|
68
|
+
* @path /cfg/dashboard/api/django_q2/tasks/
|
|
69
|
+
*/
|
|
70
|
+
export function useDashboardApiDjangoQ2TasksRetrieve(client?: API): ReturnType<typeof useSWR<any>> {
|
|
71
|
+
return useSWR<any>(
|
|
72
|
+
'cfg-dashboard-api-django-q2-task',
|
|
73
|
+
() => Fetchers.getDashboardApiDjangoQ2TasksRetrieve(client)
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Monitoring
|
|
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_monitoring'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { HealthCheck } from '../schemas/HealthCheck.schema'
|
|
22
|
+
import type { MethodList } from '../schemas/MethodList.schema'
|
|
23
|
+
import type { OverviewStats } from '../schemas/OverviewStats.schema'
|
|
24
|
+
import type { RecentRequests } from '../schemas/RecentRequests.schema'
|
|
25
|
+
import type { ServiceList } from '../schemas/ServiceList.schema'
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get gRPC health status
|
|
29
|
+
*
|
|
30
|
+
* @method GET
|
|
31
|
+
* @path /cfg/grpc/monitor/health/
|
|
32
|
+
*/
|
|
33
|
+
export function useGrpcMonitorHealthRetrieve(client?: API): ReturnType<typeof useSWR<HealthCheck>> {
|
|
34
|
+
return useSWR<HealthCheck>(
|
|
35
|
+
'cfg-grpc-monitor-health',
|
|
36
|
+
() => Fetchers.getGrpcMonitorHealthRetrieve(client)
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get method statistics
|
|
43
|
+
*
|
|
44
|
+
* @method GET
|
|
45
|
+
* @path /cfg/grpc/monitor/methods/
|
|
46
|
+
*/
|
|
47
|
+
export function useGrpcMonitorMethodsRetrieve(params?: { hours?: number; service?: string }, client?: API): ReturnType<typeof useSWR<MethodList>> {
|
|
48
|
+
return useSWR<MethodList>(
|
|
49
|
+
params ? ['cfg-grpc-monitor-method', params] : 'cfg-grpc-monitor-method',
|
|
50
|
+
() => Fetchers.getGrpcMonitorMethodsRetrieve(params, client)
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get overview statistics
|
|
57
|
+
*
|
|
58
|
+
* @method GET
|
|
59
|
+
* @path /cfg/grpc/monitor/overview/
|
|
60
|
+
*/
|
|
61
|
+
export function useGrpcMonitorOverviewRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<OverviewStats>> {
|
|
62
|
+
return useSWR<OverviewStats>(
|
|
63
|
+
params ? ['cfg-grpc-monitor-overview', params] : 'cfg-grpc-monitor-overview',
|
|
64
|
+
() => Fetchers.getGrpcMonitorOverviewRetrieve(params, client)
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get recent requests
|
|
71
|
+
*
|
|
72
|
+
* @method GET
|
|
73
|
+
* @path /cfg/grpc/monitor/requests/
|
|
74
|
+
*/
|
|
75
|
+
export function useGrpcMonitorRequestsRetrieve(params?: { count?: number; method?: string; offset?: number; service?: string; status?: string }, client?: API): ReturnType<typeof useSWR<RecentRequests>> {
|
|
76
|
+
return useSWR<RecentRequests>(
|
|
77
|
+
params ? ['cfg-grpc-monitor-request', params] : 'cfg-grpc-monitor-request',
|
|
78
|
+
() => Fetchers.getGrpcMonitorRequestsRetrieve(params, client)
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get service statistics
|
|
85
|
+
*
|
|
86
|
+
* @method GET
|
|
87
|
+
* @path /cfg/grpc/monitor/services/
|
|
88
|
+
*/
|
|
89
|
+
export function useGrpcMonitorServicesRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ServiceList>> {
|
|
90
|
+
return useSWR<ServiceList>(
|
|
91
|
+
params ? ['cfg-grpc-monitor-service', params] : 'cfg-grpc-monitor-service',
|
|
92
|
+
() => Fetchers.getGrpcMonitorServicesRetrieve(params, client)
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get request timeline
|
|
99
|
+
*
|
|
100
|
+
* @method GET
|
|
101
|
+
* @path /cfg/grpc/monitor/timeline/
|
|
102
|
+
*/
|
|
103
|
+
export function useGrpcMonitorTimelineRetrieve(params?: { hours?: number; interval?: string }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
104
|
+
return useSWR<any>(
|
|
105
|
+
params ? ['cfg-grpc-monitor-timeline', params] : 'cfg-grpc-monitor-timeline',
|
|
106
|
+
() => Fetchers.getGrpcMonitorTimelineRetrieve(params, client)
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
@@ -21,7 +21,9 @@ import type { API } from '../../index'
|
|
|
21
21
|
import type { PaginatedTaskLogListList } from '../schemas/PaginatedTaskLogListList.schema'
|
|
22
22
|
import type { TaskLog } from '../schemas/TaskLog.schema'
|
|
23
23
|
import type { TaskLogDetail } from '../schemas/TaskLogDetail.schema'
|
|
24
|
+
import type { TaskLogOverview } from '../schemas/TaskLogOverview.schema'
|
|
24
25
|
import type { TaskLogStats } from '../schemas/TaskLogStats.schema'
|
|
26
|
+
import type { TaskLogTimeline } from '../schemas/TaskLogTimeline.schema'
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* API operation
|
|
@@ -66,13 +68,13 @@ export function useTasksLogsRelatedRetrieve(id: number, client?: API): ReturnTyp
|
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
/**
|
|
69
|
-
*
|
|
71
|
+
* Task System Overview
|
|
70
72
|
*
|
|
71
73
|
* @method GET
|
|
72
74
|
* @path /cfg/tasks/logs/overview/
|
|
73
75
|
*/
|
|
74
|
-
export function useTasksLogsOverviewRetrieve(client?: API): ReturnType<typeof useSWR<
|
|
75
|
-
return useSWR<
|
|
76
|
+
export function useTasksLogsOverviewRetrieve(client?: API): ReturnType<typeof useSWR<TaskLogOverview>> {
|
|
77
|
+
return useSWR<TaskLogOverview>(
|
|
76
78
|
'cfg-tasks-logs-overview',
|
|
77
79
|
() => Fetchers.getTasksLogsOverviewRetrieve(client)
|
|
78
80
|
)
|
|
@@ -80,7 +82,7 @@ export function useTasksLogsOverviewRetrieve(client?: API): ReturnType<typeof us
|
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
/**
|
|
83
|
-
*
|
|
85
|
+
* Task Execution Statistics
|
|
84
86
|
*
|
|
85
87
|
* @method GET
|
|
86
88
|
* @path /cfg/tasks/logs/stats/
|
|
@@ -94,13 +96,13 @@ export function useTasksLogsStatsRetrieve(client?: API): ReturnType<typeof useSW
|
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
/**
|
|
97
|
-
*
|
|
99
|
+
* Task Execution Timeline
|
|
98
100
|
*
|
|
99
101
|
* @method GET
|
|
100
102
|
* @path /cfg/tasks/logs/timeline/
|
|
101
103
|
*/
|
|
102
|
-
export function useTasksLogsTimelineRetrieve(client?: API): ReturnType<typeof useSWR<
|
|
103
|
-
return useSWR<
|
|
104
|
+
export function useTasksLogsTimelineRetrieve(client?: API): ReturnType<typeof useSWR<TaskLogTimeline>> {
|
|
105
|
+
return useSWR<TaskLogTimeline>(
|
|
104
106
|
'cfg-tasks-logs-timeline',
|
|
105
107
|
() => Fetchers.getTasksLogsTimelineRetrieve(client)
|
|
106
108
|
)
|
|
@@ -44,7 +44,9 @@ export * from './cfg__newsletter__testing'
|
|
|
44
44
|
export * from './cfg__accounts__user_profile'
|
|
45
45
|
export * from './cfg__accounts'
|
|
46
46
|
export * from './cfg__centrifugo'
|
|
47
|
+
export * from './cfg__dashboard'
|
|
47
48
|
export * from './cfg__endpoints'
|
|
49
|
+
export * from './cfg__grpc__grpc_monitoring'
|
|
48
50
|
export * from './cfg__health'
|
|
49
51
|
export * from './cfg__knowbase'
|
|
50
52
|
export * from './cfg__leads'
|
|
@@ -3,21 +3,29 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This schema provides runtime validation and type inference.
|
|
5
5
|
* * Main serializer for dashboard overview endpoint.
|
|
6
|
-
Uses
|
|
6
|
+
Uses typed serializers for proper OpenAPI schema generation.
|
|
7
7
|
* */
|
|
8
8
|
import { z } from 'zod'
|
|
9
|
+
import { ActivityEntrySchema } from './ActivityEntry.schema'
|
|
10
|
+
import { AppStatisticsSchema } from './AppStatistics.schema'
|
|
11
|
+
import { QuickActionSchema } from './QuickAction.schema'
|
|
12
|
+
import { StatCardSchema } from './StatCard.schema'
|
|
13
|
+
import { SystemHealthSchema } from './SystemHealth.schema'
|
|
14
|
+
import { SystemMetricsSchema } from './SystemMetrics.schema'
|
|
15
|
+
import { UserStatisticsSchema } from './UserStatistics.schema'
|
|
9
16
|
|
|
10
17
|
/**
|
|
11
18
|
* Main serializer for dashboard overview endpoint.
|
|
12
|
-
Uses
|
|
19
|
+
Uses typed serializers for proper OpenAPI schema generation.
|
|
13
20
|
*/
|
|
14
21
|
export const DashboardOverviewSchema = z.object({
|
|
15
|
-
stat_cards: z.array(
|
|
16
|
-
system_health:
|
|
17
|
-
quick_actions: z.array(
|
|
18
|
-
recent_activity: z.array(
|
|
19
|
-
system_metrics:
|
|
20
|
-
user_statistics:
|
|
22
|
+
stat_cards: z.array(StatCardSchema),
|
|
23
|
+
system_health: SystemHealthSchema,
|
|
24
|
+
quick_actions: z.array(QuickActionSchema),
|
|
25
|
+
recent_activity: z.array(ActivityEntrySchema),
|
|
26
|
+
system_metrics: SystemMetricsSchema,
|
|
27
|
+
user_statistics: UserStatisticsSchema,
|
|
28
|
+
app_statistics: z.array(AppStatisticsSchema).optional(),
|
|
21
29
|
timestamp: z.string(),
|
|
22
30
|
})
|
|
23
31
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for MethodList
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * List of gRPC methods with statistics.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { MethodStatsSerializerSchema } from './MethodStatsSerializer.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List of gRPC methods with statistics.
|
|
12
|
+
*/
|
|
13
|
+
export const MethodListSchema = z.object({
|
|
14
|
+
methods: z.array(MethodStatsSerializerSchema),
|
|
15
|
+
total_methods: z.int(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type MethodList = z.infer<typeof MethodListSchema>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for MethodStatsSerializer
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Statistics for a single gRPC method.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Statistics for a single gRPC method.
|
|
11
|
+
*/
|
|
12
|
+
export const MethodStatsSerializerSchema = z.object({
|
|
13
|
+
method_name: z.string(),
|
|
14
|
+
service_name: z.string(),
|
|
15
|
+
total: z.int(),
|
|
16
|
+
successful: z.int(),
|
|
17
|
+
errors: z.int(),
|
|
18
|
+
avg_duration_ms: z.number(),
|
|
19
|
+
last_activity_at: z.string().nullable(),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Infer TypeScript type from Zod schema
|
|
24
|
+
*/
|
|
25
|
+
export type MethodStatsSerializer = z.infer<typeof MethodStatsSerializerSchema>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for RecentRequests
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Recent gRPC requests list.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Recent gRPC requests list.
|
|
11
|
+
*/
|
|
12
|
+
export const RecentRequestsSchema = z.object({
|
|
13
|
+
requests: z.array(z.record(z.string(), z.any())),
|
|
14
|
+
count: z.int(),
|
|
15
|
+
total_available: z.int(),
|
|
16
|
+
offset: z.int().optional(),
|
|
17
|
+
has_more: z.boolean().optional(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type RecentRequests = z.infer<typeof RecentRequestsSchema>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ServiceList
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * List of gRPC services with statistics.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { ServiceStatsSerializerSchema } from './ServiceStatsSerializer.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List of gRPC services with statistics.
|
|
12
|
+
*/
|
|
13
|
+
export const ServiceListSchema = z.object({
|
|
14
|
+
services: z.array(ServiceStatsSerializerSchema),
|
|
15
|
+
total_services: z.int(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type ServiceList = z.infer<typeof ServiceListSchema>
|