@djangocfg/api 1.2.18 → 1.2.20
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 +13762 -11037
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5828 -2659
- package/dist/index.d.ts +5828 -2659
- package/dist/index.mjs +11188 -8496
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_monitoring.ts +122 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_jobs.ts +105 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_monitoring.ts +77 -0
- package/src/cfg/generated/_utils/fetchers/{cfg__dashboard.ts → cfg__rq__rq_queues.ts} +21 -20
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_registries.ts +132 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_schedules.ts +92 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_testing.ts +120 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_workers.ts +62 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +8 -2
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_monitoring.ts +110 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_jobs.ts +106 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_monitoring.ts +65 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_queues.ts +82 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_registries.ts +132 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_schedules.ts +89 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_testing.ts +124 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_workers.ts +50 -0
- package/src/cfg/generated/_utils/hooks/index.ts +8 -2
- package/src/cfg/generated/_utils/schemas/JobActionResponse.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/JobDetail.schema.ts +40 -0
- package/src/cfg/generated/_utils/schemas/JobList.schema.ts +28 -0
- 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/QueueDetail.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/QueueStats.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/RQConfig.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/RecentRequests.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/RunDemoRequestRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ScheduleActionResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ScheduleCreateRequest.schema.ts +39 -0
- package/src/cfg/generated/_utils/schemas/ScheduledJob.schema.ts +32 -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/StressTestRequestRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/TestScenario.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/TestingActionResponse.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/Worker.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/WorkerStats.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/index.ts +20 -10
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/client.ts +129 -0
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/models.ts +124 -0
- package/src/cfg/generated/cfg__rq__rq_jobs/client.ts +76 -0
- package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +62 -0
- package/src/cfg/generated/cfg__rq__rq_monitoring/client.ts +45 -0
- package/src/cfg/generated/cfg__rq__rq_monitoring/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +39 -0
- package/src/cfg/generated/cfg__rq__rq_queues/client.ts +78 -0
- package/src/cfg/generated/cfg__rq__rq_queues/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_queues/models.ts +33 -0
- package/src/cfg/generated/cfg__rq__rq_registries/client.ts +161 -0
- package/src/cfg/generated/cfg__rq__rq_registries/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_registries/models.ts +17 -0
- package/src/cfg/generated/cfg__rq__rq_schedules/client.ts +91 -0
- package/src/cfg/generated/cfg__rq__rq_schedules/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +84 -0
- package/src/cfg/generated/cfg__rq__rq_testing/client.ts +96 -0
- package/src/cfg/generated/cfg__rq__rq_testing/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_testing/models.ts +68 -0
- package/src/cfg/generated/cfg__rq__rq_workers/client.ts +46 -0
- package/src/cfg/generated/cfg__rq__rq_workers/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_workers/models.ts +52 -0
- package/src/cfg/generated/client.ts +24 -6
- package/src/cfg/generated/enums.ts +36 -60
- package/src/cfg/generated/index.ts +40 -10
- package/src/cfg/generated/schema.ts +6391 -4704
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +0 -123
- package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +0 -77
- package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +0 -111
- package/src/cfg/generated/_utils/schemas/PaginatedTaskLogListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/TaskLog.schema.ts +0 -42
- package/src/cfg/generated/_utils/schemas/TaskLogDetail.schema.ts +0 -50
- package/src/cfg/generated/_utils/schemas/TaskLogList.schema.ts +0 -35
- package/src/cfg/generated/_utils/schemas/TaskLogOverview.schema.ts +0 -43
- package/src/cfg/generated/_utils/schemas/TaskLogStats.schema.ts +0 -30
- package/src/cfg/generated/_utils/schemas/TaskLogTimeline.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/TaskLogTimelineItem.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/TasksByQueue.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/TasksByStatus.schema.ts +0 -24
- package/src/cfg/generated/cfg__dashboard/client.ts +0 -48
- package/src/cfg/generated/cfg__dashboard/models.ts +0 -0
- package/src/cfg/generated/cfg__tasks/client.ts +0 -104
- package/src/cfg/generated/cfg__tasks/models.ts +0 -285
- /package/src/cfg/generated/{cfg__dashboard → cfg__grpc__grpc_monitoring}/index.ts +0 -0
- /package/src/cfg/generated/{cfg__tasks → cfg__rq__rq_jobs}/index.ts +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for RQ Testing
|
|
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 { RunDemoRequestRequestSchema, type RunDemoRequestRequest } from '../schemas/RunDemoRequestRequest.schema'
|
|
33
|
+
import { StressTestRequestRequestSchema, type StressTestRequestRequest } from '../schemas/StressTestRequestRequest.schema'
|
|
34
|
+
import { TestingActionResponseSchema, type TestingActionResponse } from '../schemas/TestingActionResponse.schema'
|
|
35
|
+
import { getAPIInstance } from '../../api-instance'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List test scenarios
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/rq/testing/
|
|
42
|
+
*/
|
|
43
|
+
export async function getRqTestingList( client?: any
|
|
44
|
+
): Promise<any> {
|
|
45
|
+
const api = client || getAPIInstance()
|
|
46
|
+
const response = await api.cfg_rq_testing.list()
|
|
47
|
+
return response
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Cleanup test jobs
|
|
53
|
+
*
|
|
54
|
+
* @method DELETE
|
|
55
|
+
* @path /cfg/rq/testing/cleanup/
|
|
56
|
+
*/
|
|
57
|
+
export async function deleteRqTestingCleanupDestroy( params?: { delete_demo_jobs_only?: boolean; queue?: string; registries?: string }, client?: any
|
|
58
|
+
): Promise<TestingActionResponse> {
|
|
59
|
+
const api = client || getAPIInstance()
|
|
60
|
+
const response = await api.cfg_rq_testing.cleanupDestroy(params?.delete_demo_jobs_only, params?.queue, params?.registries)
|
|
61
|
+
return TestingActionResponseSchema.parse(response)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get test results
|
|
67
|
+
*
|
|
68
|
+
* @method GET
|
|
69
|
+
* @path /cfg/rq/testing/results/
|
|
70
|
+
*/
|
|
71
|
+
export async function getRqTestingResultsRetrieve( params?: { queue?: string; scenario?: string }, client?: any
|
|
72
|
+
): Promise<any> {
|
|
73
|
+
const api = client || getAPIInstance()
|
|
74
|
+
const response = await api.cfg_rq_testing.resultsRetrieve(params?.queue, params?.scenario)
|
|
75
|
+
return response
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Run demo task
|
|
81
|
+
*
|
|
82
|
+
* @method POST
|
|
83
|
+
* @path /cfg/rq/testing/run-demo/
|
|
84
|
+
*/
|
|
85
|
+
export async function createRqTestingRunDemoCreate( data: RunDemoRequestRequest, client?: any
|
|
86
|
+
): Promise<TestingActionResponse> {
|
|
87
|
+
const api = client || getAPIInstance()
|
|
88
|
+
const response = await api.cfg_rq_testing.runDemoCreate(data)
|
|
89
|
+
return TestingActionResponseSchema.parse(response)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Schedule demo tasks
|
|
95
|
+
*
|
|
96
|
+
* @method POST
|
|
97
|
+
* @path /cfg/rq/testing/schedule-demo/
|
|
98
|
+
*/
|
|
99
|
+
export async function createRqTestingScheduleDemoCreate( data: any, client?: any
|
|
100
|
+
): Promise<TestingActionResponse> {
|
|
101
|
+
const api = client || getAPIInstance()
|
|
102
|
+
const response = await api.cfg_rq_testing.scheduleDemoCreate(data)
|
|
103
|
+
return TestingActionResponseSchema.parse(response)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Stress test
|
|
109
|
+
*
|
|
110
|
+
* @method POST
|
|
111
|
+
* @path /cfg/rq/testing/stress-test/
|
|
112
|
+
*/
|
|
113
|
+
export async function createRqTestingStressTestCreate( data: StressTestRequestRequest, client?: any
|
|
114
|
+
): Promise<TestingActionResponse> {
|
|
115
|
+
const api = client || getAPIInstance()
|
|
116
|
+
const response = await api.cfg_rq_testing.stressTestCreate(data)
|
|
117
|
+
return TestingActionResponseSchema.parse(response)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for RQ Workers
|
|
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 { WorkerStatsSchema, type WorkerStats } from '../schemas/WorkerStats.schema'
|
|
33
|
+
import { getAPIInstance } from '../../api-instance'
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List all workers
|
|
37
|
+
*
|
|
38
|
+
* @method GET
|
|
39
|
+
* @path /cfg/rq/workers/
|
|
40
|
+
*/
|
|
41
|
+
export async function getRqWorkersList( params?: { queue?: string; state?: string }, client?: any
|
|
42
|
+
): Promise<any> {
|
|
43
|
+
const api = client || getAPIInstance()
|
|
44
|
+
const response = await api.cfg_rq_workers.list(params?.queue, params?.state)
|
|
45
|
+
return response
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get worker statistics
|
|
51
|
+
*
|
|
52
|
+
* @method GET
|
|
53
|
+
* @path /cfg/rq/workers/stats/
|
|
54
|
+
*/
|
|
55
|
+
export async function getRqWorkersStatsRetrieve( client?: any
|
|
56
|
+
): Promise<WorkerStats> {
|
|
57
|
+
const api = client || getAPIInstance()
|
|
58
|
+
const response = await api.cfg_rq_workers.statsRetrieve()
|
|
59
|
+
return WorkerStatsSchema.parse(response)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
@@ -32,7 +32,6 @@ 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'
|
|
36
35
|
export * from './cfg__dashboard__dashboard_activity'
|
|
37
36
|
export * from './cfg__dashboard__dashboard_api_zones'
|
|
38
37
|
export * from './cfg__dashboard__dashboard_charts'
|
|
@@ -41,6 +40,7 @@ export * from './cfg__dashboard__dashboard_overview'
|
|
|
41
40
|
export * from './cfg__dashboard__dashboard_statistics'
|
|
42
41
|
export * from './cfg__dashboard__dashboard_system'
|
|
43
42
|
export * from './cfg__endpoints'
|
|
43
|
+
export * from './cfg__grpc__grpc_monitoring'
|
|
44
44
|
export * from './cfg__health'
|
|
45
45
|
export * from './cfg__knowbase'
|
|
46
46
|
export * from './cfg__leads'
|
|
@@ -53,5 +53,11 @@ export * from './cfg__newsletter__newsletters'
|
|
|
53
53
|
export * from './cfg__newsletter__subscriptions'
|
|
54
54
|
export * from './cfg__newsletter__testing'
|
|
55
55
|
export * from './cfg__payments'
|
|
56
|
+
export * from './cfg__rq__rq_jobs'
|
|
57
|
+
export * from './cfg__rq__rq_monitoring'
|
|
58
|
+
export * from './cfg__rq__rq_queues'
|
|
59
|
+
export * from './cfg__rq__rq_registries'
|
|
60
|
+
export * from './cfg__rq__rq_schedules'
|
|
61
|
+
export * from './cfg__rq__rq_testing'
|
|
62
|
+
export * from './cfg__rq__rq_workers'
|
|
56
63
|
export * from './cfg__support'
|
|
57
|
-
export * from './cfg__tasks'
|
|
@@ -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
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for RQ Jobs
|
|
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__rq__rq_jobs'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { JobActionResponse } from '../schemas/JobActionResponse.schema'
|
|
22
|
+
import type { JobDetail } from '../schemas/JobDetail.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List all jobs
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/rq/jobs/
|
|
29
|
+
*/
|
|
30
|
+
export function useRqJobsList(params?: { queue?: string; status?: string }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
31
|
+
return useSWR<any>(
|
|
32
|
+
params ? ['cfg-rq-jobs', params] : 'cfg-rq-jobs',
|
|
33
|
+
() => Fetchers.getRqJobsList(params, client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get job details
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/rq/jobs/{id}/
|
|
43
|
+
*/
|
|
44
|
+
export function useRqJobsRetrieve(id: string, client?: API): ReturnType<typeof useSWR<JobDetail>> {
|
|
45
|
+
return useSWR<JobDetail>(
|
|
46
|
+
['cfg-rq-job', id],
|
|
47
|
+
() => Fetchers.getRqJobsRetrieve(id, client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Delete job
|
|
54
|
+
*
|
|
55
|
+
* @method DELETE
|
|
56
|
+
* @path /cfg/rq/jobs/{id}/
|
|
57
|
+
*/
|
|
58
|
+
export function useDeleteRqJobsDestroy() {
|
|
59
|
+
const { mutate } = useSWRConfig()
|
|
60
|
+
|
|
61
|
+
return async (id: string, client?: API): Promise<JobActionResponse> => {
|
|
62
|
+
const result = await Fetchers.deleteRqJobsDestroy(id, client)
|
|
63
|
+
// Revalidate related queries
|
|
64
|
+
mutate('cfg-rq-jobs')
|
|
65
|
+
mutate('cfg-rq-job')
|
|
66
|
+
return result
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Cancel job
|
|
73
|
+
*
|
|
74
|
+
* @method POST
|
|
75
|
+
* @path /cfg/rq/jobs/{id}/cancel/
|
|
76
|
+
*/
|
|
77
|
+
export function useCreateRqJobsCancelCreate() {
|
|
78
|
+
const { mutate } = useSWRConfig()
|
|
79
|
+
|
|
80
|
+
return async (id: string, client?: API): Promise<JobActionResponse> => {
|
|
81
|
+
const result = await Fetchers.createRqJobsCancelCreate(id, client)
|
|
82
|
+
// Revalidate related queries
|
|
83
|
+
mutate('cfg-rq-jobs-cancel')
|
|
84
|
+
return result
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Requeue job
|
|
91
|
+
*
|
|
92
|
+
* @method POST
|
|
93
|
+
* @path /cfg/rq/jobs/{id}/requeue/
|
|
94
|
+
*/
|
|
95
|
+
export function useCreateRqJobsRequeueCreate() {
|
|
96
|
+
const { mutate } = useSWRConfig()
|
|
97
|
+
|
|
98
|
+
return async (id: string, client?: API): Promise<JobActionResponse> => {
|
|
99
|
+
const result = await Fetchers.createRqJobsRequeueCreate(id, client)
|
|
100
|
+
// Revalidate related queries
|
|
101
|
+
mutate('cfg-rq-jobs-requeue')
|
|
102
|
+
return result
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for RQ 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__rq__rq_monitoring'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { HealthCheck } from '../schemas/HealthCheck.schema'
|
|
22
|
+
import type { RQConfig } from '../schemas/RQConfig.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get RQ configuration
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/rq/monitor/config/
|
|
29
|
+
*/
|
|
30
|
+
export function useRqMonitorConfigRetrieve(client?: API): ReturnType<typeof useSWR<RQConfig>> {
|
|
31
|
+
return useSWR<RQConfig>(
|
|
32
|
+
'cfg-rq-monitor-config',
|
|
33
|
+
() => Fetchers.getRqMonitorConfigRetrieve(client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Health check
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/rq/monitor/health/
|
|
43
|
+
*/
|
|
44
|
+
export function useRqMonitorHealthRetrieve(client?: API): ReturnType<typeof useSWR<HealthCheck>> {
|
|
45
|
+
return useSWR<HealthCheck>(
|
|
46
|
+
'cfg-rq-monitor-health',
|
|
47
|
+
() => Fetchers.getRqMonitorHealthRetrieve(client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Prometheus metrics
|
|
54
|
+
*
|
|
55
|
+
* @method GET
|
|
56
|
+
* @path /cfg/rq/monitor/metrics/
|
|
57
|
+
*/
|
|
58
|
+
export function useRqMonitorMetricsRetrieve(client?: API): ReturnType<typeof useSWR<any>> {
|
|
59
|
+
return useSWR<any>(
|
|
60
|
+
'cfg-rq-monitor-metric',
|
|
61
|
+
() => Fetchers.getRqMonitorMetricsRetrieve(client)
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for RQ Queues
|
|
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__rq__rq_queues'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { QueueDetail } from '../schemas/QueueDetail.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* List all queues
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/rq/queues/
|
|
28
|
+
*/
|
|
29
|
+
export function useRqQueuesList(params?: { name?: string }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
30
|
+
return useSWR<any>(
|
|
31
|
+
params ? ['cfg-rq-queues', params] : 'cfg-rq-queues',
|
|
32
|
+
() => Fetchers.getRqQueuesList(params, client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get queue details
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/rq/queues/{id}/
|
|
42
|
+
*/
|
|
43
|
+
export function useRqQueuesRetrieve(id: string, client?: API): ReturnType<typeof useSWR<QueueDetail>> {
|
|
44
|
+
return useSWR<QueueDetail>(
|
|
45
|
+
['cfg-rq-queue', id],
|
|
46
|
+
() => Fetchers.getRqQueuesRetrieve(id, client)
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Empty queue
|
|
53
|
+
*
|
|
54
|
+
* @method POST
|
|
55
|
+
* @path /cfg/rq/queues/{id}/empty/
|
|
56
|
+
*/
|
|
57
|
+
export function useCreateRqQueuesEmptyCreate() {
|
|
58
|
+
const { mutate } = useSWRConfig()
|
|
59
|
+
|
|
60
|
+
return async (id: string, client?: API): Promise<any> => {
|
|
61
|
+
const result = await Fetchers.createRqQueuesEmptyCreate(id, client)
|
|
62
|
+
// Revalidate related queries
|
|
63
|
+
mutate('cfg-rq-queues-empty')
|
|
64
|
+
return result
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get queue jobs
|
|
71
|
+
*
|
|
72
|
+
* @method GET
|
|
73
|
+
* @path /cfg/rq/queues/{id}/jobs/
|
|
74
|
+
*/
|
|
75
|
+
export function useRqQueuesJobsRetrieve(id: string, params?: { limit?: number; offset?: number }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
76
|
+
return useSWR<any>(
|
|
77
|
+
['cfg-rq-queues-job', id],
|
|
78
|
+
() => Fetchers.getRqQueuesJobsRetrieve(id, params, client)
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|