@djangocfg/api 1.2.15 → 1.2.16
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 +2478 -3259
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1332 -1955
- package/dist/index.d.ts +1332 -1955
- package/dist/index.mjs +2461 -3222
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/contexts/index.ts +0 -4
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +36 -96
- package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +38 -122
- package/src/cfg/generated/_utils/schemas/PaginatedTaskLogListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/TaskLog.schema.ts +42 -0
- package/src/cfg/generated/_utils/schemas/TaskLogDetail.schema.ts +50 -0
- package/src/cfg/generated/_utils/schemas/TaskLogList.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/TaskLogStats.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/index.ts +5 -8
- package/src/cfg/generated/cfg__tasks/client.ts +52 -49
- package/src/cfg/generated/cfg__tasks/models.ts +169 -106
- package/src/cfg/generated/enums.ts +60 -56
- package/src/cfg/generated/schema.ts +859 -552
- package/src/index.ts +0 -3
- package/src/cfg/contexts/TasksContext.tsx +0 -242
- package/src/cfg/generated/_utils/schemas/APIResponse.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/APIResponseRequest.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/QueueAction.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/QueueActionRequest.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/QueueStatus.schema.ts +0 -23
- package/src/cfg/generated/_utils/schemas/TaskStatistics.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/WorkerAction.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/WorkerActionRequest.schema.ts +0 -22
- package/src/cfg/services_deprecated/README.md +0 -53
- package/src/cfg/services_deprecated/auth/AuthService.ts +0 -165
- package/src/cfg/services_deprecated/auth/index.ts +0 -7
- package/src/cfg/services_deprecated/index.ts +0 -31
- package/src/cfg/services_deprecated/leads/LeadsService.ts +0 -133
- package/src/cfg/services_deprecated/leads/index.ts +0 -7
- package/src/cfg/services_deprecated/newsletter/BulkEmailService.ts +0 -35
- package/src/cfg/services_deprecated/newsletter/CampaignsService.ts +0 -138
- package/src/cfg/services_deprecated/newsletter/NewsletterService.ts +0 -79
- package/src/cfg/services_deprecated/newsletter/NewslettersListService.ts +0 -48
- package/src/cfg/services_deprecated/newsletter/index.ts +0 -10
- package/src/cfg/services_deprecated/payments/ApiKeysService.ts +0 -101
- package/src/cfg/services_deprecated/payments/DashboardService.ts +0 -112
- package/src/cfg/services_deprecated/payments/PaymentsService.ts +0 -159
- package/src/cfg/services_deprecated/payments/SubscriptionsService.ts +0 -101
- package/src/cfg/services_deprecated/payments/index.ts +0 -10
- package/src/cfg/services_deprecated/support/SupportService.ts +0 -142
- package/src/cfg/services_deprecated/support/index.ts +0 -7
- package/src/cfg/services_deprecated/tasks/TasksService.ts +0 -170
- package/src/cfg/services_deprecated/tasks/index.ts +0 -7
- package/src/cfg/services_deprecated/webhooks/WebhooksService.ts +0 -66
- package/src/cfg/services_deprecated/webhooks/index.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.16",
|
|
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.16",
|
|
72
72
|
"react": "^19.1.0",
|
|
73
73
|
"react-dom": "^19.1.0",
|
|
74
74
|
"tsup": "^8.5.0",
|
|
@@ -45,7 +45,3 @@ export * from './payments';
|
|
|
45
45
|
|
|
46
46
|
// Knowbase (Chat, Documents, Sessions)
|
|
47
47
|
export * from './knowbase';
|
|
48
|
-
|
|
49
|
-
// Tasks (Dramatiq Task Management)
|
|
50
|
-
export { TasksProvider, useTasks } from './TasksContext';
|
|
51
|
-
export type { TasksContextValue, TasksProviderProps } from './TasksContext';
|
|
@@ -29,97 +29,37 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import { QueueStatusSchema, type QueueStatus } from '../schemas/QueueStatus.schema'
|
|
37
|
-
import { TaskStatisticsSchema, type TaskStatistics } from '../schemas/TaskStatistics.schema'
|
|
38
|
-
import { WorkerActionSchema, type WorkerAction } from '../schemas/WorkerAction.schema'
|
|
39
|
-
import { WorkerActionRequestSchema, type WorkerActionRequest } from '../schemas/WorkerActionRequest.schema'
|
|
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 { TaskLogStatsSchema, type TaskLogStats } from '../schemas/TaskLogStats.schema'
|
|
40
36
|
import { getAPIInstance } from '../../api-instance'
|
|
41
37
|
|
|
42
|
-
/**
|
|
43
|
-
* API operation
|
|
44
|
-
*
|
|
45
|
-
* @method POST
|
|
46
|
-
* @path /cfg/tasks/api/clear/
|
|
47
|
-
*/
|
|
48
|
-
export async function createTasksApiClearCreate( data: APIResponseRequest, client?: any
|
|
49
|
-
): Promise<APIResponse> {
|
|
50
|
-
const api = client || getAPIInstance()
|
|
51
|
-
const response = await api.cfg_tasks.apiClearCreate(data)
|
|
52
|
-
return APIResponseSchema.parse(response)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* API operation
|
|
58
|
-
*
|
|
59
|
-
* @method POST
|
|
60
|
-
* @path /cfg/tasks/api/clear-queues/
|
|
61
|
-
*/
|
|
62
|
-
export async function createTasksApiClearQueuesCreate( data: APIResponseRequest, client?: any
|
|
63
|
-
): Promise<APIResponse> {
|
|
64
|
-
const api = client || getAPIInstance()
|
|
65
|
-
const response = await api.cfg_tasks.apiClearQueuesCreate(data)
|
|
66
|
-
return APIResponseSchema.parse(response)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* API operation
|
|
72
|
-
*
|
|
73
|
-
* @method POST
|
|
74
|
-
* @path /cfg/tasks/api/purge-failed/
|
|
75
|
-
*/
|
|
76
|
-
export async function createTasksApiPurgeFailedCreate( data: APIResponseRequest, client?: any
|
|
77
|
-
): Promise<APIResponse> {
|
|
78
|
-
const api = client || getAPIInstance()
|
|
79
|
-
const response = await api.cfg_tasks.apiPurgeFailedCreate(data)
|
|
80
|
-
return APIResponseSchema.parse(response)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* API operation
|
|
86
|
-
*
|
|
87
|
-
* @method POST
|
|
88
|
-
* @path /cfg/tasks/api/queues/manage/
|
|
89
|
-
*/
|
|
90
|
-
export async function createTasksApiQueuesManageCreate( data: QueueActionRequest, client?: any
|
|
91
|
-
): Promise<QueueAction> {
|
|
92
|
-
const api = client || getAPIInstance()
|
|
93
|
-
const response = await api.cfg_tasks.apiQueuesManageCreate(data)
|
|
94
|
-
return QueueActionSchema.parse(response)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
38
|
/**
|
|
99
39
|
* API operation
|
|
100
40
|
*
|
|
101
41
|
* @method GET
|
|
102
|
-
* @path /cfg/tasks/
|
|
42
|
+
* @path /cfg/tasks/logs/
|
|
103
43
|
*/
|
|
104
|
-
export async function
|
|
105
|
-
): Promise<
|
|
44
|
+
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
|
|
45
|
+
): Promise<PaginatedTaskLogListList> {
|
|
106
46
|
const api = client || getAPIInstance()
|
|
107
|
-
const response = await api.cfg_tasks.
|
|
108
|
-
return
|
|
47
|
+
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)
|
|
48
|
+
return PaginatedTaskLogListListSchema.parse(response)
|
|
109
49
|
}
|
|
110
50
|
|
|
111
51
|
|
|
112
52
|
/**
|
|
113
53
|
* API operation
|
|
114
54
|
*
|
|
115
|
-
* @method
|
|
116
|
-
* @path /cfg/tasks/
|
|
55
|
+
* @method GET
|
|
56
|
+
* @path /cfg/tasks/logs/{id}/
|
|
117
57
|
*/
|
|
118
|
-
export async function
|
|
119
|
-
): Promise<
|
|
58
|
+
export async function getTasksLogsRetrieve( id: number, client?: any
|
|
59
|
+
): Promise<TaskLogDetail> {
|
|
120
60
|
const api = client || getAPIInstance()
|
|
121
|
-
const response = await api.cfg_tasks.
|
|
122
|
-
return
|
|
61
|
+
const response = await api.cfg_tasks.logsRetrieve(id)
|
|
62
|
+
return TaskLogDetailSchema.parse(response)
|
|
123
63
|
}
|
|
124
64
|
|
|
125
65
|
|
|
@@ -127,13 +67,13 @@ export async function createTasksApiSimulateCreate( data: APIResponseRequest,
|
|
|
127
67
|
* API operation
|
|
128
68
|
*
|
|
129
69
|
* @method GET
|
|
130
|
-
* @path /cfg/tasks/
|
|
70
|
+
* @path /cfg/tasks/logs/{id}/related/
|
|
131
71
|
*/
|
|
132
|
-
export async function
|
|
133
|
-
): Promise<
|
|
72
|
+
export async function getTasksLogsRelatedRetrieve( id: number, client?: any
|
|
73
|
+
): Promise<TaskLog> {
|
|
134
74
|
const api = client || getAPIInstance()
|
|
135
|
-
const response = await api.cfg_tasks.
|
|
136
|
-
return
|
|
75
|
+
const response = await api.cfg_tasks.logsRelatedRetrieve(id)
|
|
76
|
+
return TaskLogSchema.parse(response)
|
|
137
77
|
}
|
|
138
78
|
|
|
139
79
|
|
|
@@ -141,13 +81,13 @@ export async function getTasksApiTasksListRetrieve( client?: any
|
|
|
141
81
|
* API operation
|
|
142
82
|
*
|
|
143
83
|
* @method GET
|
|
144
|
-
* @path /cfg/tasks/
|
|
84
|
+
* @path /cfg/tasks/logs/overview/
|
|
145
85
|
*/
|
|
146
|
-
export async function
|
|
147
|
-
): Promise<
|
|
86
|
+
export async function getTasksLogsOverviewRetrieve( client?: any
|
|
87
|
+
): Promise<TaskLog> {
|
|
148
88
|
const api = client || getAPIInstance()
|
|
149
|
-
const response = await api.cfg_tasks.
|
|
150
|
-
return
|
|
89
|
+
const response = await api.cfg_tasks.logsOverviewRetrieve()
|
|
90
|
+
return TaskLogSchema.parse(response)
|
|
151
91
|
}
|
|
152
92
|
|
|
153
93
|
|
|
@@ -155,27 +95,27 @@ export async function getTasksApiTasksStatsRetrieve( client?: any
|
|
|
155
95
|
* API operation
|
|
156
96
|
*
|
|
157
97
|
* @method GET
|
|
158
|
-
* @path /cfg/tasks/
|
|
98
|
+
* @path /cfg/tasks/logs/stats/
|
|
159
99
|
*/
|
|
160
|
-
export async function
|
|
161
|
-
): Promise<
|
|
100
|
+
export async function getTasksLogsStatsRetrieve( client?: any
|
|
101
|
+
): Promise<TaskLogStats> {
|
|
162
102
|
const api = client || getAPIInstance()
|
|
163
|
-
const response = await api.cfg_tasks.
|
|
164
|
-
return
|
|
103
|
+
const response = await api.cfg_tasks.logsStatsRetrieve()
|
|
104
|
+
return TaskLogStatsSchema.parse(response)
|
|
165
105
|
}
|
|
166
106
|
|
|
167
107
|
|
|
168
108
|
/**
|
|
169
109
|
* API operation
|
|
170
110
|
*
|
|
171
|
-
* @method
|
|
172
|
-
* @path /cfg/tasks/
|
|
111
|
+
* @method GET
|
|
112
|
+
* @path /cfg/tasks/logs/timeline/
|
|
173
113
|
*/
|
|
174
|
-
export async function
|
|
175
|
-
): Promise<
|
|
114
|
+
export async function getTasksLogsTimelineRetrieve( client?: any
|
|
115
|
+
): Promise<TaskLog> {
|
|
176
116
|
const api = client || getAPIInstance()
|
|
177
|
-
const response = await api.cfg_tasks.
|
|
178
|
-
return
|
|
117
|
+
const response = await api.cfg_tasks.logsTimelineRetrieve()
|
|
118
|
+
return TaskLogSchema.parse(response)
|
|
179
119
|
}
|
|
180
120
|
|
|
181
121
|
|
|
@@ -18,97 +18,21 @@ import useSWR from 'swr'
|
|
|
18
18
|
import { useSWRConfig } from 'swr'
|
|
19
19
|
import * as Fetchers from '../fetchers/cfg__tasks'
|
|
20
20
|
import type { API } from '../../index'
|
|
21
|
-
import type {
|
|
22
|
-
import type {
|
|
23
|
-
import type {
|
|
24
|
-
import type {
|
|
25
|
-
import type { QueueStatus } from '../schemas/QueueStatus.schema'
|
|
26
|
-
import type { TaskStatistics } from '../schemas/TaskStatistics.schema'
|
|
27
|
-
import type { WorkerAction } from '../schemas/WorkerAction.schema'
|
|
28
|
-
import type { WorkerActionRequest } from '../schemas/WorkerActionRequest.schema'
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* API operation
|
|
32
|
-
*
|
|
33
|
-
* @method POST
|
|
34
|
-
* @path /cfg/tasks/api/clear/
|
|
35
|
-
*/
|
|
36
|
-
export function useCreateTasksApiClearCreate() {
|
|
37
|
-
const { mutate } = useSWRConfig()
|
|
38
|
-
|
|
39
|
-
return async (data: APIResponseRequest, client?: API): Promise<APIResponse> => {
|
|
40
|
-
const result = await Fetchers.createTasksApiClearCreate(data, client)
|
|
41
|
-
// Revalidate related queries
|
|
42
|
-
mutate('cfg-tasks-api-clear')
|
|
43
|
-
return result
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* API operation
|
|
50
|
-
*
|
|
51
|
-
* @method POST
|
|
52
|
-
* @path /cfg/tasks/api/clear-queues/
|
|
53
|
-
*/
|
|
54
|
-
export function useCreateTasksApiClearQueuesCreate() {
|
|
55
|
-
const { mutate } = useSWRConfig()
|
|
56
|
-
|
|
57
|
-
return async (data: APIResponseRequest, client?: API): Promise<APIResponse> => {
|
|
58
|
-
const result = await Fetchers.createTasksApiClearQueuesCreate(data, client)
|
|
59
|
-
// Revalidate related queries
|
|
60
|
-
mutate('cfg-tasks-api-clear-queues')
|
|
61
|
-
return result
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* API operation
|
|
68
|
-
*
|
|
69
|
-
* @method POST
|
|
70
|
-
* @path /cfg/tasks/api/purge-failed/
|
|
71
|
-
*/
|
|
72
|
-
export function useCreateTasksApiPurgeFailedCreate() {
|
|
73
|
-
const { mutate } = useSWRConfig()
|
|
74
|
-
|
|
75
|
-
return async (data: APIResponseRequest, client?: API): Promise<APIResponse> => {
|
|
76
|
-
const result = await Fetchers.createTasksApiPurgeFailedCreate(data, client)
|
|
77
|
-
// Revalidate related queries
|
|
78
|
-
mutate('cfg-tasks-api-purge-failed')
|
|
79
|
-
return result
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* API operation
|
|
86
|
-
*
|
|
87
|
-
* @method POST
|
|
88
|
-
* @path /cfg/tasks/api/queues/manage/
|
|
89
|
-
*/
|
|
90
|
-
export function useCreateTasksApiQueuesManageCreate() {
|
|
91
|
-
const { mutate } = useSWRConfig()
|
|
92
|
-
|
|
93
|
-
return async (data: QueueActionRequest, client?: API): Promise<QueueAction> => {
|
|
94
|
-
const result = await Fetchers.createTasksApiQueuesManageCreate(data, client)
|
|
95
|
-
// Revalidate related queries
|
|
96
|
-
mutate('cfg-tasks-api-queues-manage')
|
|
97
|
-
return result
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
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 { TaskLogStats } from '../schemas/TaskLogStats.schema'
|
|
101
25
|
|
|
102
26
|
/**
|
|
103
27
|
* API operation
|
|
104
28
|
*
|
|
105
29
|
* @method GET
|
|
106
|
-
* @path /cfg/tasks/
|
|
30
|
+
* @path /cfg/tasks/logs/
|
|
107
31
|
*/
|
|
108
|
-
export function
|
|
109
|
-
return useSWR<
|
|
110
|
-
'cfg-tasks-
|
|
111
|
-
() => Fetchers.
|
|
32
|
+
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>> {
|
|
33
|
+
return useSWR<PaginatedTaskLogListList>(
|
|
34
|
+
params ? ['cfg-tasks-logs', params] : 'cfg-tasks-logs',
|
|
35
|
+
() => Fetchers.getTasksLogsList(params, client)
|
|
112
36
|
)
|
|
113
37
|
}
|
|
114
38
|
|
|
@@ -116,18 +40,14 @@ export function useTasksApiQueuesStatusRetrieve(client?: API): ReturnType<typeof
|
|
|
116
40
|
/**
|
|
117
41
|
* API operation
|
|
118
42
|
*
|
|
119
|
-
* @method
|
|
120
|
-
* @path /cfg/tasks/
|
|
43
|
+
* @method GET
|
|
44
|
+
* @path /cfg/tasks/logs/{id}/
|
|
121
45
|
*/
|
|
122
|
-
export function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// Revalidate related queries
|
|
128
|
-
mutate('cfg-tasks-api-simulate')
|
|
129
|
-
return result
|
|
130
|
-
}
|
|
46
|
+
export function useTasksLogsRetrieve(id: number, client?: API): ReturnType<typeof useSWR<TaskLogDetail>> {
|
|
47
|
+
return useSWR<TaskLogDetail>(
|
|
48
|
+
['cfg-tasks-log', id],
|
|
49
|
+
() => Fetchers.getTasksLogsRetrieve(id, client)
|
|
50
|
+
)
|
|
131
51
|
}
|
|
132
52
|
|
|
133
53
|
|
|
@@ -135,12 +55,12 @@ export function useCreateTasksApiSimulateCreate() {
|
|
|
135
55
|
* API operation
|
|
136
56
|
*
|
|
137
57
|
* @method GET
|
|
138
|
-
* @path /cfg/tasks/
|
|
58
|
+
* @path /cfg/tasks/logs/{id}/related/
|
|
139
59
|
*/
|
|
140
|
-
export function
|
|
141
|
-
return useSWR<
|
|
142
|
-
'cfg-tasks-
|
|
143
|
-
() => Fetchers.
|
|
60
|
+
export function useTasksLogsRelatedRetrieve(id: number, client?: API): ReturnType<typeof useSWR<TaskLog>> {
|
|
61
|
+
return useSWR<TaskLog>(
|
|
62
|
+
['cfg-tasks-logs-related', id],
|
|
63
|
+
() => Fetchers.getTasksLogsRelatedRetrieve(id, client)
|
|
144
64
|
)
|
|
145
65
|
}
|
|
146
66
|
|
|
@@ -149,12 +69,12 @@ export function useTasksApiTasksListRetrieve(client?: API): ReturnType<typeof us
|
|
|
149
69
|
* API operation
|
|
150
70
|
*
|
|
151
71
|
* @method GET
|
|
152
|
-
* @path /cfg/tasks/
|
|
72
|
+
* @path /cfg/tasks/logs/overview/
|
|
153
73
|
*/
|
|
154
|
-
export function
|
|
155
|
-
return useSWR<
|
|
156
|
-
'cfg-tasks-
|
|
157
|
-
() => Fetchers.
|
|
74
|
+
export function useTasksLogsOverviewRetrieve(client?: API): ReturnType<typeof useSWR<TaskLog>> {
|
|
75
|
+
return useSWR<TaskLog>(
|
|
76
|
+
'cfg-tasks-logs-overview',
|
|
77
|
+
() => Fetchers.getTasksLogsOverviewRetrieve(client)
|
|
158
78
|
)
|
|
159
79
|
}
|
|
160
80
|
|
|
@@ -163,12 +83,12 @@ export function useTasksApiTasksStatsRetrieve(client?: API): ReturnType<typeof u
|
|
|
163
83
|
* API operation
|
|
164
84
|
*
|
|
165
85
|
* @method GET
|
|
166
|
-
* @path /cfg/tasks/
|
|
86
|
+
* @path /cfg/tasks/logs/stats/
|
|
167
87
|
*/
|
|
168
|
-
export function
|
|
169
|
-
return useSWR<
|
|
170
|
-
'cfg-tasks-
|
|
171
|
-
() => Fetchers.
|
|
88
|
+
export function useTasksLogsStatsRetrieve(client?: API): ReturnType<typeof useSWR<TaskLogStats>> {
|
|
89
|
+
return useSWR<TaskLogStats>(
|
|
90
|
+
'cfg-tasks-logs-stat',
|
|
91
|
+
() => Fetchers.getTasksLogsStatsRetrieve(client)
|
|
172
92
|
)
|
|
173
93
|
}
|
|
174
94
|
|
|
@@ -176,18 +96,14 @@ export function useTasksApiWorkersListRetrieve(client?: API): ReturnType<typeof
|
|
|
176
96
|
/**
|
|
177
97
|
* API operation
|
|
178
98
|
*
|
|
179
|
-
* @method
|
|
180
|
-
* @path /cfg/tasks/
|
|
99
|
+
* @method GET
|
|
100
|
+
* @path /cfg/tasks/logs/timeline/
|
|
181
101
|
*/
|
|
182
|
-
export function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// Revalidate related queries
|
|
188
|
-
mutate('cfg-tasks-api-workers-manage')
|
|
189
|
-
return result
|
|
190
|
-
}
|
|
102
|
+
export function useTasksLogsTimelineRetrieve(client?: API): ReturnType<typeof useSWR<TaskLog>> {
|
|
103
|
+
return useSWR<TaskLog>(
|
|
104
|
+
'cfg-tasks-logs-timeline',
|
|
105
|
+
() => Fetchers.getTasksLogsTimelineRetrieve(client)
|
|
106
|
+
)
|
|
191
107
|
}
|
|
192
108
|
|
|
193
109
|
|
|
@@ -0,0 +1,24 @@
|
|
|
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>
|
|
@@ -0,0 +1,42 @@
|
|
|
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>
|
|
@@ -0,0 +1,50 @@
|
|
|
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>
|
|
@@ -0,0 +1,35 @@
|
|
|
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>
|
|
@@ -0,0 +1,30 @@
|
|
|
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>
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
export * from './APIResponse.schema'
|
|
20
|
-
export * from './APIResponseRequest.schema'
|
|
21
19
|
export * from './APIZone.schema'
|
|
22
20
|
export * from './APIZonesSummary.schema'
|
|
23
21
|
export * from './ActivityEntry.schema'
|
|
@@ -133,6 +131,7 @@ export * from './PaginatedNewsletterSubscriptionList.schema'
|
|
|
133
131
|
export * from './PaginatedPaymentListList.schema'
|
|
134
132
|
export * from './PaginatedPublicCategoryList.schema'
|
|
135
133
|
export * from './PaginatedPublicDocumentListList.schema'
|
|
134
|
+
export * from './PaginatedTaskLogListList.schema'
|
|
136
135
|
export * from './PaginatedTicketList.schema'
|
|
137
136
|
export * from './PatchedArchiveItemChunkRequest.schema'
|
|
138
137
|
export * from './PatchedArchiveItemRequest.schema'
|
|
@@ -153,9 +152,6 @@ export * from './PublicDocument.schema'
|
|
|
153
152
|
export * from './PublicDocumentList.schema'
|
|
154
153
|
export * from './PublishTestRequestRequest.schema'
|
|
155
154
|
export * from './PublishTestResponse.schema'
|
|
156
|
-
export * from './QueueAction.schema'
|
|
157
|
-
export * from './QueueActionRequest.schema'
|
|
158
|
-
export * from './QueueStatus.schema'
|
|
159
155
|
export * from './QuickAction.schema'
|
|
160
156
|
export * from './QuickHealth.schema'
|
|
161
157
|
export * from './RecentPublishes.schema'
|
|
@@ -170,7 +166,10 @@ export * from './SuccessResponse.schema'
|
|
|
170
166
|
export * from './SystemHealth.schema'
|
|
171
167
|
export * from './SystemHealthItem.schema'
|
|
172
168
|
export * from './SystemMetrics.schema'
|
|
173
|
-
export * from './
|
|
169
|
+
export * from './TaskLog.schema'
|
|
170
|
+
export * from './TaskLogDetail.schema'
|
|
171
|
+
export * from './TaskLogList.schema'
|
|
172
|
+
export * from './TaskLogStats.schema'
|
|
174
173
|
export * from './TestEmailRequest.schema'
|
|
175
174
|
export * from './Ticket.schema'
|
|
176
175
|
export * from './TicketRequest.schema'
|
|
@@ -186,5 +185,3 @@ export * from './UserProfileUpdateRequest.schema'
|
|
|
186
185
|
export * from './UserStatistics.schema'
|
|
187
186
|
export * from './VectorizationResult.schema'
|
|
188
187
|
export * from './VectorizationStatistics.schema'
|
|
189
|
-
export * from './WorkerAction.schema'
|
|
190
|
-
export * from './WorkerActionRequest.schema'
|