@djangocfg/api 1.2.19 → 1.2.21

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 (82) hide show
  1. package/dist/index.cjs +11846 -9936
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +5466 -3236
  4. package/dist/index.d.ts +5466 -3236
  5. package/dist/index.mjs +11859 -9975
  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__dashboard__dashboard_overview/models.ts +3 -1
  41. package/src/cfg/generated/cfg__rq__rq_jobs/client.ts +76 -0
  42. package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +62 -0
  43. package/src/cfg/generated/cfg__rq__rq_monitoring/client.ts +45 -0
  44. package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +39 -0
  45. package/src/cfg/generated/cfg__rq__rq_queues/client.ts +78 -0
  46. package/src/cfg/generated/cfg__rq__rq_queues/index.ts +2 -0
  47. package/src/cfg/generated/cfg__rq__rq_queues/models.ts +33 -0
  48. package/src/cfg/generated/cfg__rq__rq_registries/client.ts +161 -0
  49. package/src/cfg/generated/cfg__rq__rq_registries/index.ts +2 -0
  50. package/src/cfg/generated/cfg__rq__rq_registries/models.ts +17 -0
  51. package/src/cfg/generated/cfg__rq__rq_schedules/client.ts +91 -0
  52. package/src/cfg/generated/cfg__rq__rq_schedules/index.ts +2 -0
  53. package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +84 -0
  54. package/src/cfg/generated/cfg__rq__rq_testing/client.ts +96 -0
  55. package/src/cfg/generated/cfg__rq__rq_testing/index.ts +2 -0
  56. package/src/cfg/generated/cfg__rq__rq_testing/models.ts +68 -0
  57. package/src/cfg/generated/cfg__rq__rq_workers/client.ts +46 -0
  58. package/src/cfg/generated/cfg__rq__rq_workers/index.ts +2 -0
  59. package/src/cfg/generated/cfg__rq__rq_workers/models.ts +52 -0
  60. package/src/cfg/generated/client.ts +21 -6
  61. package/src/cfg/generated/enums.ts +40 -60
  62. package/src/cfg/generated/index.ts +35 -10
  63. package/src/cfg/generated/schema.ts +6160 -5035
  64. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +0 -123
  65. package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +0 -77
  66. package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +0 -111
  67. package/src/cfg/generated/_utils/schemas/PaginatedTaskLogListList.schema.ts +0 -24
  68. package/src/cfg/generated/_utils/schemas/TaskLog.schema.ts +0 -42
  69. package/src/cfg/generated/_utils/schemas/TaskLogDetail.schema.ts +0 -50
  70. package/src/cfg/generated/_utils/schemas/TaskLogList.schema.ts +0 -35
  71. package/src/cfg/generated/_utils/schemas/TaskLogOverview.schema.ts +0 -43
  72. package/src/cfg/generated/_utils/schemas/TaskLogStats.schema.ts +0 -30
  73. package/src/cfg/generated/_utils/schemas/TaskLogTimeline.schema.ts +0 -28
  74. package/src/cfg/generated/_utils/schemas/TaskLogTimelineItem.schema.ts +0 -28
  75. package/src/cfg/generated/_utils/schemas/TasksByQueue.schema.ts +0 -24
  76. package/src/cfg/generated/_utils/schemas/TasksByStatus.schema.ts +0 -24
  77. package/src/cfg/generated/cfg__dashboard/client.ts +0 -48
  78. package/src/cfg/generated/cfg__dashboard/models.ts +0 -0
  79. package/src/cfg/generated/cfg__tasks/client.ts +0 -104
  80. package/src/cfg/generated/cfg__tasks/models.ts +0 -285
  81. /package/src/cfg/generated/{cfg__dashboard → cfg__rq__rq_jobs}/index.ts +0 -0
  82. /package/src/cfg/generated/{cfg__tasks → cfg__rq__rq_monitoring}/index.ts +0 -0
@@ -1,123 +0,0 @@
1
- /**
2
- * Typed fetchers for Tasks
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 { PaginatedTaskLogListListSchema, type PaginatedTaskLogListList } from '../schemas/PaginatedTaskLogListList.schema'
33
- import { TaskLogSchema, type TaskLog } from '../schemas/TaskLog.schema'
34
- import { TaskLogDetailSchema, type TaskLogDetail } from '../schemas/TaskLogDetail.schema'
35
- import { TaskLogOverviewSchema, type TaskLogOverview } from '../schemas/TaskLogOverview.schema'
36
- import { TaskLogStatsSchema, type TaskLogStats } from '../schemas/TaskLogStats.schema'
37
- import { TaskLogTimelineSchema, type TaskLogTimeline } from '../schemas/TaskLogTimeline.schema'
38
- import { getAPIInstance } from '../../api-instance'
39
-
40
- /**
41
- * API operation
42
- *
43
- * @method GET
44
- * @path /cfg/tasks/logs/
45
- */
46
- export async function getTasksLogsList( params?: { created_after?: string; created_before?: string; duration_max?: number; duration_min?: number; end_time?: string; enqueue_after?: string; enqueue_before?: string; finish_after?: string; finish_before?: string; has_error?: boolean; is_completed?: boolean; is_failed?: boolean; is_successful?: boolean; job_id?: string; job_retries_max?: number; job_retries_min?: number; ordering?: string; page?: number; page_size?: number; queue_name?: string; queue_name_in?: any[]; search?: string; start_after?: string; start_before?: string; start_time?: string; status?: string; status_in?: any[]; success?: boolean; task?: string; task_name?: string; task_name_exact?: string; worker?: string; worker_id?: string }, client?: any
47
- ): Promise<PaginatedTaskLogListList> {
48
- const api = client || getAPIInstance()
49
- const response = await api.cfg_tasks.logsList(params?.created_after, params?.created_before, params?.duration_max, params?.duration_min, params?.end_time, params?.enqueue_after, params?.enqueue_before, params?.finish_after, params?.finish_before, params?.has_error, params?.is_completed, params?.is_failed, params?.is_successful, params?.job_id, params?.job_retries_max, params?.job_retries_min, params?.ordering, params?.page, params?.page_size, params?.queue_name, params?.queue_name_in, params?.search, params?.start_after, params?.start_before, params?.start_time, params?.status, params?.status_in, params?.success, params?.task, params?.task_name, params?.task_name_exact, params?.worker, params?.worker_id)
50
- return PaginatedTaskLogListListSchema.parse(response)
51
- }
52
-
53
-
54
- /**
55
- * API operation
56
- *
57
- * @method GET
58
- * @path /cfg/tasks/logs/{id}/
59
- */
60
- export async function getTasksLogsRetrieve( id: number, client?: any
61
- ): Promise<TaskLogDetail> {
62
- const api = client || getAPIInstance()
63
- const response = await api.cfg_tasks.logsRetrieve(id)
64
- return TaskLogDetailSchema.parse(response)
65
- }
66
-
67
-
68
- /**
69
- * API operation
70
- *
71
- * @method GET
72
- * @path /cfg/tasks/logs/{id}/related/
73
- */
74
- export async function getTasksLogsRelatedRetrieve( id: number, client?: any
75
- ): Promise<TaskLog> {
76
- const api = client || getAPIInstance()
77
- const response = await api.cfg_tasks.logsRelatedRetrieve(id)
78
- return TaskLogSchema.parse(response)
79
- }
80
-
81
-
82
- /**
83
- * Task System Overview
84
- *
85
- * @method GET
86
- * @path /cfg/tasks/logs/overview/
87
- */
88
- export async function getTasksLogsOverviewRetrieve( client?: any
89
- ): Promise<TaskLogOverview> {
90
- const api = client || getAPIInstance()
91
- const response = await api.cfg_tasks.logsOverviewRetrieve()
92
- return TaskLogOverviewSchema.parse(response)
93
- }
94
-
95
-
96
- /**
97
- * Task Execution Statistics
98
- *
99
- * @method GET
100
- * @path /cfg/tasks/logs/stats/
101
- */
102
- export async function getTasksLogsStatsRetrieve( client?: any
103
- ): Promise<TaskLogStats> {
104
- const api = client || getAPIInstance()
105
- const response = await api.cfg_tasks.logsStatsRetrieve()
106
- return TaskLogStatsSchema.parse(response)
107
- }
108
-
109
-
110
- /**
111
- * Task Execution Timeline
112
- *
113
- * @method GET
114
- * @path /cfg/tasks/logs/timeline/
115
- */
116
- export async function getTasksLogsTimelineRetrieve( client?: any
117
- ): Promise<TaskLogTimeline> {
118
- const api = client || getAPIInstance()
119
- const response = await api.cfg_tasks.logsTimelineRetrieve()
120
- return TaskLogTimelineSchema.parse(response)
121
- }
122
-
123
-
@@ -1,77 +0,0 @@
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
-
@@ -1,111 +0,0 @@
1
- /**
2
- * SWR Hooks for Tasks
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__tasks'
20
- import type { API } from '../../index'
21
- import type { PaginatedTaskLogListList } from '../schemas/PaginatedTaskLogListList.schema'
22
- import type { TaskLog } from '../schemas/TaskLog.schema'
23
- import type { TaskLogDetail } from '../schemas/TaskLogDetail.schema'
24
- import type { TaskLogOverview } from '../schemas/TaskLogOverview.schema'
25
- import type { TaskLogStats } from '../schemas/TaskLogStats.schema'
26
- import type { TaskLogTimeline } from '../schemas/TaskLogTimeline.schema'
27
-
28
- /**
29
- * API operation
30
- *
31
- * @method GET
32
- * @path /cfg/tasks/logs/
33
- */
34
- export function useTasksLogsList(params?: { created_after?: string; created_before?: string; duration_max?: number; duration_min?: number; end_time?: string; enqueue_after?: string; enqueue_before?: string; finish_after?: string; finish_before?: string; has_error?: boolean; is_completed?: boolean; is_failed?: boolean; is_successful?: boolean; job_id?: string; job_retries_max?: number; job_retries_min?: number; ordering?: string; page?: number; page_size?: number; queue_name?: string; queue_name_in?: any[]; search?: string; start_after?: string; start_before?: string; start_time?: string; status?: string; status_in?: any[]; success?: boolean; task?: string; task_name?: string; task_name_exact?: string; worker?: string; worker_id?: string }, client?: API): ReturnType<typeof useSWR<PaginatedTaskLogListList>> {
35
- return useSWR<PaginatedTaskLogListList>(
36
- params ? ['cfg-tasks-logs', params] : 'cfg-tasks-logs',
37
- () => Fetchers.getTasksLogsList(params, client)
38
- )
39
- }
40
-
41
-
42
- /**
43
- * API operation
44
- *
45
- * @method GET
46
- * @path /cfg/tasks/logs/{id}/
47
- */
48
- export function useTasksLogsRetrieve(id: number, client?: API): ReturnType<typeof useSWR<TaskLogDetail>> {
49
- return useSWR<TaskLogDetail>(
50
- ['cfg-tasks-log', id],
51
- () => Fetchers.getTasksLogsRetrieve(id, client)
52
- )
53
- }
54
-
55
-
56
- /**
57
- * API operation
58
- *
59
- * @method GET
60
- * @path /cfg/tasks/logs/{id}/related/
61
- */
62
- export function useTasksLogsRelatedRetrieve(id: number, client?: API): ReturnType<typeof useSWR<TaskLog>> {
63
- return useSWR<TaskLog>(
64
- ['cfg-tasks-logs-related', id],
65
- () => Fetchers.getTasksLogsRelatedRetrieve(id, client)
66
- )
67
- }
68
-
69
-
70
- /**
71
- * Task System Overview
72
- *
73
- * @method GET
74
- * @path /cfg/tasks/logs/overview/
75
- */
76
- export function useTasksLogsOverviewRetrieve(client?: API): ReturnType<typeof useSWR<TaskLogOverview>> {
77
- return useSWR<TaskLogOverview>(
78
- 'cfg-tasks-logs-overview',
79
- () => Fetchers.getTasksLogsOverviewRetrieve(client)
80
- )
81
- }
82
-
83
-
84
- /**
85
- * Task Execution Statistics
86
- *
87
- * @method GET
88
- * @path /cfg/tasks/logs/stats/
89
- */
90
- export function useTasksLogsStatsRetrieve(client?: API): ReturnType<typeof useSWR<TaskLogStats>> {
91
- return useSWR<TaskLogStats>(
92
- 'cfg-tasks-logs-stat',
93
- () => Fetchers.getTasksLogsStatsRetrieve(client)
94
- )
95
- }
96
-
97
-
98
- /**
99
- * Task Execution Timeline
100
- *
101
- * @method GET
102
- * @path /cfg/tasks/logs/timeline/
103
- */
104
- export function useTasksLogsTimelineRetrieve(client?: API): ReturnType<typeof useSWR<TaskLogTimeline>> {
105
- return useSWR<TaskLogTimeline>(
106
- 'cfg-tasks-logs-timeline',
107
- () => Fetchers.getTasksLogsTimelineRetrieve(client)
108
- )
109
- }
110
-
111
-
@@ -1,24 +0,0 @@
1
- /**
2
- * Zod schema for PaginatedTaskLogListList
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * */
6
- import { z } from 'zod'
7
- import { TaskLogListSchema } from './TaskLogList.schema'
8
-
9
- export const PaginatedTaskLogListListSchema = z.object({
10
- count: z.int(),
11
- page: z.int(),
12
- pages: z.int(),
13
- page_size: z.int(),
14
- has_next: z.boolean(),
15
- has_previous: z.boolean(),
16
- next_page: z.int().nullable().optional(),
17
- previous_page: z.int().nullable().optional(),
18
- results: z.array(TaskLogListSchema),
19
- })
20
-
21
- /**
22
- * Infer TypeScript type from Zod schema
23
- */
24
- export type PaginatedTaskLogListList = z.infer<typeof PaginatedTaskLogListListSchema>
@@ -1,42 +0,0 @@
1
- /**
2
- * Zod schema for TaskLog
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Basic TaskLog serializer.
6
-
7
- Used for list views with essential fields only.
8
- Includes computed properties matching ReArq response format.
9
- * */
10
- import { z } from 'zod'
11
- import * as Enums from '../../enums'
12
-
13
- /**
14
- * Basic TaskLog serializer.
15
-
16
- Used for list views with essential fields only.
17
- Includes computed properties matching ReArq response format.
18
- */
19
- export const TaskLogSchema = z.object({
20
- id: z.int(),
21
- job_id: z.string(),
22
- task_name: z.string(),
23
- queue_name: z.string(),
24
- status: z.nativeEnum(Enums.TaskLogStatus),
25
- success: z.boolean().nullable(),
26
- duration_ms: z.int().nullable(),
27
- duration_seconds: z.number(),
28
- job_retry: z.int(),
29
- job_retries: z.int(),
30
- enqueue_time: z.iso.datetime(),
31
- expire_time: z.iso.datetime().nullable(),
32
- start_time: z.iso.datetime().nullable(),
33
- finish_time: z.iso.datetime().nullable(),
34
- is_completed: z.boolean(),
35
- is_successful: z.boolean(),
36
- is_failed: z.boolean(),
37
- })
38
-
39
- /**
40
- * Infer TypeScript type from Zod schema
41
- */
42
- export type TaskLog = z.infer<typeof TaskLogSchema>
@@ -1,50 +0,0 @@
1
- /**
2
- * Zod schema for TaskLogDetail
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Detailed TaskLog serializer.
6
-
7
- Includes all fields including args, kwargs, result, error messages.
8
- Combines ReArq Job + JobResult data.
9
- * */
10
- import { z } from 'zod'
11
- import * as Enums from '../../enums'
12
-
13
- /**
14
- * Detailed TaskLog serializer.
15
-
16
- Includes all fields including args, kwargs, result, error messages.
17
- Combines ReArq Job + JobResult data.
18
- */
19
- export const TaskLogDetailSchema = z.object({
20
- id: z.int(),
21
- job_id: z.string(),
22
- task_name: z.string(),
23
- queue_name: z.string(),
24
- status: z.nativeEnum(Enums.TaskLogDetailStatus),
25
- status_display: z.string(),
26
- success: z.boolean().nullable(),
27
- args: z.string(),
28
- kwargs: z.string(),
29
- result: z.string().nullable(),
30
- error_message: z.string().nullable(),
31
- duration_ms: z.int().nullable(),
32
- duration_seconds: z.number(),
33
- job_retry: z.int(),
34
- job_retries: z.int(),
35
- job_retry_after: z.int(),
36
- worker_id: z.string().nullable(),
37
- enqueue_time: z.iso.datetime(),
38
- expire_time: z.iso.datetime().nullable(),
39
- start_time: z.iso.datetime().nullable(),
40
- finish_time: z.iso.datetime().nullable(),
41
- created_at: z.iso.datetime(),
42
- updated_at: z.iso.datetime(),
43
- user: z.int().nullable(),
44
- user_display: z.string(),
45
- })
46
-
47
- /**
48
- * Infer TypeScript type from Zod schema
49
- */
50
- export type TaskLogDetail = z.infer<typeof TaskLogDetailSchema>
@@ -1,35 +0,0 @@
1
- /**
2
- * Zod schema for TaskLogList
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Compact serializer for list views.
6
-
7
- Minimal fields for performance, matching ReArq Job list format.
8
- * */
9
- import { z } from 'zod'
10
- import * as Enums from '../../enums'
11
-
12
- /**
13
- * Compact serializer for list views.
14
-
15
- Minimal fields for performance, matching ReArq Job list format.
16
- */
17
- export const TaskLogListSchema = z.object({
18
- id: z.int(),
19
- job_id: z.string(),
20
- task_name: z.string(),
21
- queue_name: z.string(),
22
- status: z.nativeEnum(Enums.TaskLogListStatus),
23
- status_display: z.string(),
24
- success: z.boolean().nullable(),
25
- job_retries: z.int(),
26
- duration_ms: z.int().nullable(),
27
- enqueue_time: z.iso.datetime(),
28
- start_time: z.iso.datetime().nullable(),
29
- finish_time: z.iso.datetime().nullable(),
30
- })
31
-
32
- /**
33
- * Infer TypeScript type from Zod schema
34
- */
35
- export type TaskLogList = z.infer<typeof TaskLogListSchema>
@@ -1,43 +0,0 @@
1
- /**
2
- * Zod schema for TaskLogOverview
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Overview of task system with proper structure.
6
-
7
- Provides high-level statistics about the entire task system:
8
- - Total tasks count (all-time)
9
- - Active queues list
10
- - Recent failures (last 24h)
11
- - Tasks distribution by queue (as array)
12
- - Tasks distribution by status (as array)
13
-
14
- Used by /cfg/tasks/logs/overview/ endpoint.
15
- * */
16
- import { z } from 'zod'
17
- import { TasksByQueueSchema } from './TasksByQueue.schema'
18
- import { TasksByStatusSchema } from './TasksByStatus.schema'
19
-
20
- /**
21
- * Overview of task system with proper structure.
22
-
23
- Provides high-level statistics about the entire task system:
24
- - Total tasks count (all-time)
25
- - Active queues list
26
- - Recent failures (last 24h)
27
- - Tasks distribution by queue (as array)
28
- - Tasks distribution by status (as array)
29
-
30
- Used by /cfg/tasks/logs/overview/ endpoint.
31
- */
32
- export const TaskLogOverviewSchema = z.object({
33
- total_tasks: z.int(),
34
- active_queues: z.array(z.string()),
35
- recent_failures: z.int(),
36
- tasks_by_queue: z.array(TasksByQueueSchema),
37
- tasks_by_status: z.array(TasksByStatusSchema),
38
- })
39
-
40
- /**
41
- * Infer TypeScript type from Zod schema
42
- */
43
- export type TaskLogOverview = z.infer<typeof TaskLogOverviewSchema>
@@ -1,30 +0,0 @@
1
- /**
2
- * Zod schema for TaskLogStats
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Statistics serializer for task metrics.
6
-
7
- Not tied to a model - used for aggregated data.
8
- * */
9
- import { z } from 'zod'
10
-
11
- /**
12
- * Statistics serializer for task metrics.
13
-
14
- Not tied to a model - used for aggregated data.
15
- */
16
- export const TaskLogStatsSchema = z.object({
17
- total: z.int(),
18
- successful: z.int(),
19
- failed: z.int(),
20
- in_progress: z.int(),
21
- success_rate: z.number(),
22
- avg_duration_ms: z.int(),
23
- avg_duration_seconds: z.number(),
24
- period_hours: z.int().optional(),
25
- })
26
-
27
- /**
28
- * Infer TypeScript type from Zod schema
29
- */
30
- export type TaskLogStats = z.infer<typeof TaskLogStatsSchema>
@@ -1,28 +0,0 @@
1
- /**
2
- * Zod schema for TaskLogTimeline
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Timeline response wrapper.
6
-
7
- Returns timeline data as array of time-bucketed statistics.
8
- Used by /cfg/tasks/logs/timeline/ endpoint.
9
- * */
10
- import { z } from 'zod'
11
- import { TaskLogTimelineItemSchema } from './TaskLogTimelineItem.schema'
12
-
13
- /**
14
- * Timeline response wrapper.
15
-
16
- Returns timeline data as array of time-bucketed statistics.
17
- Used by /cfg/tasks/logs/timeline/ endpoint.
18
- */
19
- export const TaskLogTimelineSchema = z.object({
20
- period_hours: z.int(),
21
- interval: z.string(),
22
- data: z.array(TaskLogTimelineItemSchema),
23
- })
24
-
25
- /**
26
- * Infer TypeScript type from Zod schema
27
- */
28
- export type TaskLogTimeline = z.infer<typeof TaskLogTimelineSchema>
@@ -1,28 +0,0 @@
1
- /**
2
- * Zod schema for TaskLogTimelineItem
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Single timeline data point.
6
-
7
- Represents aggregated task statistics for a specific time period.
8
- * */
9
- import { z } from 'zod'
10
-
11
- /**
12
- * Single timeline data point.
13
-
14
- Represents aggregated task statistics for a specific time period.
15
- */
16
- export const TaskLogTimelineItemSchema = z.object({
17
- timestamp: z.iso.datetime(),
18
- total: z.int(),
19
- successful: z.int(),
20
- failed: z.int(),
21
- in_progress: z.int().optional(),
22
- avg_duration_ms: z.number().optional(),
23
- })
24
-
25
- /**
26
- * Infer TypeScript type from Zod schema
27
- */
28
- export type TaskLogTimelineItem = z.infer<typeof TaskLogTimelineItemSchema>
@@ -1,24 +0,0 @@
1
- /**
2
- * Zod schema for TasksByQueue
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Tasks count by queue.
6
-
7
- Used in overview endpoint for tasks_by_queue list.
8
- * */
9
- import { z } from 'zod'
10
-
11
- /**
12
- * Tasks count by queue.
13
-
14
- Used in overview endpoint for tasks_by_queue list.
15
- */
16
- export const TasksByQueueSchema = z.object({
17
- queue_name: z.string(),
18
- count: z.int(),
19
- })
20
-
21
- /**
22
- * Infer TypeScript type from Zod schema
23
- */
24
- export type TasksByQueue = z.infer<typeof TasksByQueueSchema>
@@ -1,24 +0,0 @@
1
- /**
2
- * Zod schema for TasksByStatus
3
- *
4
- * This schema provides runtime validation and type inference.
5
- * * Tasks count by status.
6
-
7
- Used in overview endpoint for tasks_by_status list.
8
- * */
9
- import { z } from 'zod'
10
-
11
- /**
12
- * Tasks count by status.
13
-
14
- Used in overview endpoint for tasks_by_status list.
15
- */
16
- export const TasksByStatusSchema = z.object({
17
- status: z.string(),
18
- count: z.int(),
19
- })
20
-
21
- /**
22
- * Infer TypeScript type from Zod schema
23
- */
24
- export type TasksByStatus = z.infer<typeof TasksByStatusSchema>