@djangocfg/api 1.2.19 → 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.
Files changed (81) hide show
  1. package/dist/index.cjs +11725 -9819
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +5458 -3234
  4. package/dist/index.d.ts +5458 -3234
  5. package/dist/index.mjs +11738 -9858
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_jobs.ts +105 -0
  9. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_monitoring.ts +77 -0
  10. package/src/cfg/generated/_utils/fetchers/{cfg__dashboard.ts → cfg__rq__rq_queues.ts} +21 -20
  11. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_registries.ts +132 -0
  12. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_schedules.ts +92 -0
  13. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_testing.ts +120 -0
  14. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_workers.ts +62 -0
  15. package/src/cfg/generated/_utils/fetchers/index.ts +7 -2
  16. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_jobs.ts +106 -0
  17. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_monitoring.ts +65 -0
  18. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_queues.ts +82 -0
  19. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_registries.ts +132 -0
  20. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_schedules.ts +89 -0
  21. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_testing.ts +124 -0
  22. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_workers.ts +50 -0
  23. package/src/cfg/generated/_utils/hooks/index.ts +7 -2
  24. package/src/cfg/generated/_utils/schemas/JobActionResponse.schema.ts +26 -0
  25. package/src/cfg/generated/_utils/schemas/JobDetail.schema.ts +40 -0
  26. package/src/cfg/generated/_utils/schemas/JobList.schema.ts +28 -0
  27. package/src/cfg/generated/_utils/schemas/QueueDetail.schema.ts +34 -0
  28. package/src/cfg/generated/_utils/schemas/QueueStats.schema.ts +31 -0
  29. package/src/cfg/generated/_utils/schemas/RQConfig.schema.ts +29 -0
  30. package/src/cfg/generated/_utils/schemas/RunDemoRequestRequest.schema.ts +24 -0
  31. package/src/cfg/generated/_utils/schemas/ScheduleActionResponse.schema.ts +22 -0
  32. package/src/cfg/generated/_utils/schemas/ScheduleCreateRequest.schema.ts +39 -0
  33. package/src/cfg/generated/_utils/schemas/ScheduledJob.schema.ts +32 -0
  34. package/src/cfg/generated/_utils/schemas/StressTestRequestRequest.schema.ts +23 -0
  35. package/src/cfg/generated/_utils/schemas/TestScenario.schema.ts +25 -0
  36. package/src/cfg/generated/_utils/schemas/TestingActionResponse.schema.ts +23 -0
  37. package/src/cfg/generated/_utils/schemas/Worker.schema.ts +31 -0
  38. package/src/cfg/generated/_utils/schemas/WorkerStats.schema.ts +31 -0
  39. package/src/cfg/generated/_utils/schemas/index.ts +15 -10
  40. package/src/cfg/generated/cfg__rq__rq_jobs/client.ts +76 -0
  41. package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +62 -0
  42. package/src/cfg/generated/cfg__rq__rq_monitoring/client.ts +45 -0
  43. package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +39 -0
  44. package/src/cfg/generated/cfg__rq__rq_queues/client.ts +78 -0
  45. package/src/cfg/generated/cfg__rq__rq_queues/index.ts +2 -0
  46. package/src/cfg/generated/cfg__rq__rq_queues/models.ts +33 -0
  47. package/src/cfg/generated/cfg__rq__rq_registries/client.ts +161 -0
  48. package/src/cfg/generated/cfg__rq__rq_registries/index.ts +2 -0
  49. package/src/cfg/generated/cfg__rq__rq_registries/models.ts +17 -0
  50. package/src/cfg/generated/cfg__rq__rq_schedules/client.ts +91 -0
  51. package/src/cfg/generated/cfg__rq__rq_schedules/index.ts +2 -0
  52. package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +84 -0
  53. package/src/cfg/generated/cfg__rq__rq_testing/client.ts +96 -0
  54. package/src/cfg/generated/cfg__rq__rq_testing/index.ts +2 -0
  55. package/src/cfg/generated/cfg__rq__rq_testing/models.ts +68 -0
  56. package/src/cfg/generated/cfg__rq__rq_workers/client.ts +46 -0
  57. package/src/cfg/generated/cfg__rq__rq_workers/index.ts +2 -0
  58. package/src/cfg/generated/cfg__rq__rq_workers/models.ts +52 -0
  59. package/src/cfg/generated/client.ts +21 -6
  60. package/src/cfg/generated/enums.ts +36 -60
  61. package/src/cfg/generated/index.ts +35 -10
  62. package/src/cfg/generated/schema.ts +6156 -5033
  63. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +0 -123
  64. package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +0 -77
  65. package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +0 -111
  66. package/src/cfg/generated/_utils/schemas/PaginatedTaskLogListList.schema.ts +0 -24
  67. package/src/cfg/generated/_utils/schemas/TaskLog.schema.ts +0 -42
  68. package/src/cfg/generated/_utils/schemas/TaskLogDetail.schema.ts +0 -50
  69. package/src/cfg/generated/_utils/schemas/TaskLogList.schema.ts +0 -35
  70. package/src/cfg/generated/_utils/schemas/TaskLogOverview.schema.ts +0 -43
  71. package/src/cfg/generated/_utils/schemas/TaskLogStats.schema.ts +0 -30
  72. package/src/cfg/generated/_utils/schemas/TaskLogTimeline.schema.ts +0 -28
  73. package/src/cfg/generated/_utils/schemas/TaskLogTimelineItem.schema.ts +0 -28
  74. package/src/cfg/generated/_utils/schemas/TasksByQueue.schema.ts +0 -24
  75. package/src/cfg/generated/_utils/schemas/TasksByStatus.schema.ts +0 -24
  76. package/src/cfg/generated/cfg__dashboard/client.ts +0 -48
  77. package/src/cfg/generated/cfg__dashboard/models.ts +0 -0
  78. package/src/cfg/generated/cfg__tasks/client.ts +0 -104
  79. package/src/cfg/generated/cfg__tasks/models.ts +0 -285
  80. /package/src/cfg/generated/{cfg__dashboard → cfg__rq__rq_jobs}/index.ts +0 -0
  81. /package/src/cfg/generated/{cfg__tasks → cfg__rq__rq_monitoring}/index.ts +0 -0
@@ -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'
@@ -54,5 +53,11 @@ export * from './cfg__newsletter__newsletters'
54
53
  export * from './cfg__newsletter__subscriptions'
55
54
  export * from './cfg__newsletter__testing'
56
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'
57
63
  export * from './cfg__support'
58
- export * from './cfg__tasks'
@@ -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
+
@@ -0,0 +1,132 @@
1
+ /**
2
+ * SWR Hooks for RQ Registries
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_registries'
20
+ import type { API } from '../../index'
21
+ import type { JobActionResponse } from '../schemas/JobActionResponse.schema'
22
+
23
+ /**
24
+ * List deferred jobs
25
+ *
26
+ * @method GET
27
+ * @path /cfg/rq/jobs/registries/deferred/
28
+ */
29
+ export function useRqJobsRegistriesDeferredList(params?: { queue?: string }, client?: API): ReturnType<typeof useSWR<any>> {
30
+ return useSWR<any>(
31
+ params ? ['cfg-rq-jobs-registries-deferred', params] : 'cfg-rq-jobs-registries-deferred',
32
+ () => Fetchers.getRqJobsRegistriesDeferredList(params, client)
33
+ )
34
+ }
35
+
36
+
37
+ /**
38
+ * List failed jobs
39
+ *
40
+ * @method GET
41
+ * @path /cfg/rq/jobs/registries/failed/
42
+ */
43
+ export function useRqJobsRegistriesFailedList(params?: { queue?: string }, client?: API): ReturnType<typeof useSWR<any>> {
44
+ return useSWR<any>(
45
+ params ? ['cfg-rq-jobs-registries-failed', params] : 'cfg-rq-jobs-registries-failed',
46
+ () => Fetchers.getRqJobsRegistriesFailedList(params, client)
47
+ )
48
+ }
49
+
50
+
51
+ /**
52
+ * Clear failed jobs registry
53
+ *
54
+ * @method POST
55
+ * @path /cfg/rq/jobs/registries/failed/clear/
56
+ */
57
+ export function useCreateRqJobsRegistriesFailedClearCreate() {
58
+ const { mutate } = useSWRConfig()
59
+
60
+ return async (params: { queue: string }, client?: API): Promise<JobActionResponse> => {
61
+ const result = await Fetchers.createRqJobsRegistriesFailedClearCreate(params, client)
62
+ // Revalidate related queries
63
+ mutate('cfg-rq-jobs-registries-failed-clear')
64
+ return result
65
+ }
66
+ }
67
+
68
+
69
+ /**
70
+ * Requeue all failed jobs
71
+ *
72
+ * @method POST
73
+ * @path /cfg/rq/jobs/registries/failed/requeue-all/
74
+ */
75
+ export function useCreateRqJobsRegistriesFailedRequeueAllCreate() {
76
+ const { mutate } = useSWRConfig()
77
+
78
+ return async (params: { queue: string }, client?: API): Promise<JobActionResponse> => {
79
+ const result = await Fetchers.createRqJobsRegistriesFailedRequeueAllCreate(params, client)
80
+ // Revalidate related queries
81
+ mutate('cfg-rq-jobs-registries-failed-requeue-all')
82
+ return result
83
+ }
84
+ }
85
+
86
+
87
+ /**
88
+ * List finished jobs
89
+ *
90
+ * @method GET
91
+ * @path /cfg/rq/jobs/registries/finished/
92
+ */
93
+ export function useRqJobsRegistriesFinishedList(params?: { queue?: string }, client?: API): ReturnType<typeof useSWR<any>> {
94
+ return useSWR<any>(
95
+ params ? ['cfg-rq-jobs-registries-finished', params] : 'cfg-rq-jobs-registries-finished',
96
+ () => Fetchers.getRqJobsRegistriesFinishedList(params, client)
97
+ )
98
+ }
99
+
100
+
101
+ /**
102
+ * Clear finished jobs registry
103
+ *
104
+ * @method POST
105
+ * @path /cfg/rq/jobs/registries/finished/clear/
106
+ */
107
+ export function useCreateRqJobsRegistriesFinishedClearCreate() {
108
+ const { mutate } = useSWRConfig()
109
+
110
+ return async (params: { queue: string }, client?: API): Promise<JobActionResponse> => {
111
+ const result = await Fetchers.createRqJobsRegistriesFinishedClearCreate(params, client)
112
+ // Revalidate related queries
113
+ mutate('cfg-rq-jobs-registries-finished-clear')
114
+ return result
115
+ }
116
+ }
117
+
118
+
119
+ /**
120
+ * List started jobs
121
+ *
122
+ * @method GET
123
+ * @path /cfg/rq/jobs/registries/started/
124
+ */
125
+ export function useRqJobsRegistriesStartedList(params?: { queue?: string }, client?: API): ReturnType<typeof useSWR<any>> {
126
+ return useSWR<any>(
127
+ params ? ['cfg-rq-jobs-registries-started', params] : 'cfg-rq-jobs-registries-started',
128
+ () => Fetchers.getRqJobsRegistriesStartedList(params, client)
129
+ )
130
+ }
131
+
132
+
@@ -0,0 +1,89 @@
1
+ /**
2
+ * SWR Hooks for RQ Schedules
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_schedules'
20
+ import type { API } from '../../index'
21
+ import type { ScheduleActionResponse } from '../schemas/ScheduleActionResponse.schema'
22
+ import type { ScheduleCreateRequest } from '../schemas/ScheduleCreateRequest.schema'
23
+ import type { ScheduledJob } from '../schemas/ScheduledJob.schema'
24
+
25
+ /**
26
+ * List scheduled jobs
27
+ *
28
+ * @method GET
29
+ * @path /cfg/rq/schedules/
30
+ */
31
+ export function useRqSchedulesList(params?: { queue?: string }, client?: API): ReturnType<typeof useSWR<any>> {
32
+ return useSWR<any>(
33
+ params ? ['cfg-rq-schedules', params] : 'cfg-rq-schedules',
34
+ () => Fetchers.getRqSchedulesList(params, client)
35
+ )
36
+ }
37
+
38
+
39
+ /**
40
+ * Create scheduled job
41
+ *
42
+ * @method POST
43
+ * @path /cfg/rq/schedules/
44
+ */
45
+ export function useCreateRqSchedulesCreate() {
46
+ const { mutate } = useSWRConfig()
47
+
48
+ return async (data: ScheduleCreateRequest, client?: API): Promise<ScheduleActionResponse> => {
49
+ const result = await Fetchers.createRqSchedulesCreate(data, client)
50
+ // Revalidate related queries
51
+ mutate('cfg-rq-schedules')
52
+ return result
53
+ }
54
+ }
55
+
56
+
57
+ /**
58
+ * Get scheduled job details
59
+ *
60
+ * @method GET
61
+ * @path /cfg/rq/schedules/{id}/
62
+ */
63
+ export function useRqSchedulesRetrieve(id: string, pk: string, params?: { queue?: string }, client?: API): ReturnType<typeof useSWR<ScheduledJob>> {
64
+ return useSWR<ScheduledJob>(
65
+ ['cfg-rq-schedule', id],
66
+ () => Fetchers.getRqSchedulesRetrieve(id, pk, params, client)
67
+ )
68
+ }
69
+
70
+
71
+ /**
72
+ * Cancel scheduled job
73
+ *
74
+ * @method DELETE
75
+ * @path /cfg/rq/schedules/{id}/
76
+ */
77
+ export function useDeleteRqSchedulesDestroy() {
78
+ const { mutate } = useSWRConfig()
79
+
80
+ return async (id: string, pk: string, params?: { queue?: string }, client?: API): Promise<ScheduleActionResponse> => {
81
+ const result = await Fetchers.deleteRqSchedulesDestroy(id, pk, params, client)
82
+ // Revalidate related queries
83
+ mutate('cfg-rq-schedules')
84
+ mutate('cfg-rq-schedule')
85
+ return result
86
+ }
87
+ }
88
+
89
+
@@ -0,0 +1,124 @@
1
+ /**
2
+ * SWR Hooks for RQ 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__rq__rq_testing'
20
+ import type { API } from '../../index'
21
+ import type { RunDemoRequestRequest } from '../schemas/RunDemoRequestRequest.schema'
22
+ import type { StressTestRequestRequest } from '../schemas/StressTestRequestRequest.schema'
23
+ import type { TestingActionResponse } from '../schemas/TestingActionResponse.schema'
24
+
25
+ /**
26
+ * List test scenarios
27
+ *
28
+ * @method GET
29
+ * @path /cfg/rq/testing/
30
+ */
31
+ export function useRqTestingList(client?: API): ReturnType<typeof useSWR<any>> {
32
+ return useSWR<any>(
33
+ 'cfg-rq-testing',
34
+ () => Fetchers.getRqTestingList(client)
35
+ )
36
+ }
37
+
38
+
39
+ /**
40
+ * Cleanup test jobs
41
+ *
42
+ * @method DELETE
43
+ * @path /cfg/rq/testing/cleanup/
44
+ */
45
+ export function useDeleteRqTestingCleanupDestroy() {
46
+ const { mutate } = useSWRConfig()
47
+
48
+ return async (params?: { delete_demo_jobs_only?: boolean; queue?: string; registries?: string }, client?: API): Promise<TestingActionResponse> => {
49
+ const result = await Fetchers.deleteRqTestingCleanupDestroy(params, client)
50
+ // Revalidate related queries
51
+ mutate('cfg-rq-testing-cleanup')
52
+ return result
53
+ }
54
+ }
55
+
56
+
57
+ /**
58
+ * Get test results
59
+ *
60
+ * @method GET
61
+ * @path /cfg/rq/testing/results/
62
+ */
63
+ export function useRqTestingResultsRetrieve(params?: { queue?: string; scenario?: string }, client?: API): ReturnType<typeof useSWR<any>> {
64
+ return useSWR<any>(
65
+ params ? ['cfg-rq-testing-result', params] : 'cfg-rq-testing-result',
66
+ () => Fetchers.getRqTestingResultsRetrieve(params, client)
67
+ )
68
+ }
69
+
70
+
71
+ /**
72
+ * Run demo task
73
+ *
74
+ * @method POST
75
+ * @path /cfg/rq/testing/run-demo/
76
+ */
77
+ export function useCreateRqTestingRunDemoCreate() {
78
+ const { mutate } = useSWRConfig()
79
+
80
+ return async (data: RunDemoRequestRequest, client?: API): Promise<TestingActionResponse> => {
81
+ const result = await Fetchers.createRqTestingRunDemoCreate(data, client)
82
+ // Revalidate related queries
83
+ mutate('cfg-rq-testing-run-demo')
84
+ return result
85
+ }
86
+ }
87
+
88
+
89
+ /**
90
+ * Schedule demo tasks
91
+ *
92
+ * @method POST
93
+ * @path /cfg/rq/testing/schedule-demo/
94
+ */
95
+ export function useCreateRqTestingScheduleDemoCreate() {
96
+ const { mutate } = useSWRConfig()
97
+
98
+ return async (data: any, client?: API): Promise<TestingActionResponse> => {
99
+ const result = await Fetchers.createRqTestingScheduleDemoCreate(data, client)
100
+ // Revalidate related queries
101
+ mutate('cfg-rq-testing-schedule-demo')
102
+ return result
103
+ }
104
+ }
105
+
106
+
107
+ /**
108
+ * Stress test
109
+ *
110
+ * @method POST
111
+ * @path /cfg/rq/testing/stress-test/
112
+ */
113
+ export function useCreateRqTestingStressTestCreate() {
114
+ const { mutate } = useSWRConfig()
115
+
116
+ return async (data: StressTestRequestRequest, client?: API): Promise<TestingActionResponse> => {
117
+ const result = await Fetchers.createRqTestingStressTestCreate(data, client)
118
+ // Revalidate related queries
119
+ mutate('cfg-rq-testing-stress-test')
120
+ return result
121
+ }
122
+ }
123
+
124
+
@@ -0,0 +1,50 @@
1
+ /**
2
+ * SWR Hooks for RQ Workers
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_workers'
20
+ import type { API } from '../../index'
21
+ import type { WorkerStats } from '../schemas/WorkerStats.schema'
22
+
23
+ /**
24
+ * List all workers
25
+ *
26
+ * @method GET
27
+ * @path /cfg/rq/workers/
28
+ */
29
+ export function useRqWorkersList(params?: { queue?: string; state?: string }, client?: API): ReturnType<typeof useSWR<any>> {
30
+ return useSWR<any>(
31
+ params ? ['cfg-rq-workers', params] : 'cfg-rq-workers',
32
+ () => Fetchers.getRqWorkersList(params, client)
33
+ )
34
+ }
35
+
36
+
37
+ /**
38
+ * Get worker statistics
39
+ *
40
+ * @method GET
41
+ * @path /cfg/rq/workers/stats/
42
+ */
43
+ export function useRqWorkersStatsRetrieve(client?: API): ReturnType<typeof useSWR<WorkerStats>> {
44
+ return useSWR<WorkerStats>(
45
+ 'cfg-rq-workers-stat',
46
+ () => Fetchers.getRqWorkersStatsRetrieve(client)
47
+ )
48
+ }
49
+
50
+
@@ -39,12 +39,18 @@ export * from './cfg__dashboard__dashboard_system'
39
39
  export * from './cfg__leads__lead_submission'
40
40
  export * from './cfg__newsletter__logs'
41
41
  export * from './cfg__newsletter__newsletters'
42
+ export * from './cfg__rq__rq_jobs'
43
+ export * from './cfg__rq__rq_monitoring'
44
+ export * from './cfg__rq__rq_queues'
45
+ export * from './cfg__rq__rq_registries'
46
+ export * from './cfg__rq__rq_schedules'
47
+ export * from './cfg__rq__rq_testing'
48
+ export * from './cfg__rq__rq_workers'
42
49
  export * from './cfg__newsletter__subscriptions'
43
50
  export * from './cfg__newsletter__testing'
44
51
  export * from './cfg__accounts__user_profile'
45
52
  export * from './cfg__accounts'
46
53
  export * from './cfg__centrifugo'
47
- export * from './cfg__dashboard'
48
54
  export * from './cfg__endpoints'
49
55
  export * from './cfg__grpc__grpc_monitoring'
50
56
  export * from './cfg__health'
@@ -53,4 +59,3 @@ export * from './cfg__leads'
53
59
  export * from './cfg__newsletter'
54
60
  export * from './cfg__payments'
55
61
  export * from './cfg__support'
56
- export * from './cfg__tasks'