@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
|
@@ -11,83 +11,86 @@ export class CfgTasks {
|
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
async apiClearCreate(data: Models.APIResponseRequest): Promise<Models.APIResponse> {
|
|
18
|
-
const response = await this.client.request('POST', "/cfg/tasks/api/clear/", { body: data });
|
|
19
|
-
return response;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Clear all tasks from all Dramatiq queues.
|
|
24
|
-
*/
|
|
25
|
-
async apiClearQueuesCreate(data: Models.APIResponseRequest): Promise<Models.APIResponse> {
|
|
26
|
-
const response = await this.client.request('POST', "/cfg/tasks/api/clear-queues/", { body: data });
|
|
27
|
-
return response;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Purge all failed tasks from queues.
|
|
32
|
-
*/
|
|
33
|
-
async apiPurgeFailedCreate(data: Models.APIResponseRequest): Promise<Models.APIResponse> {
|
|
34
|
-
const response = await this.client.request('POST', "/cfg/tasks/api/purge-failed/", { body: data });
|
|
35
|
-
return response;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Manage queue operations (clear, purge, etc.).
|
|
40
|
-
*/
|
|
41
|
-
async apiQueuesManageCreate(data: Models.QueueActionRequest): Promise<Models.QueueAction> {
|
|
42
|
-
const response = await this.client.request('POST', "/cfg/tasks/api/queues/manage/", { body: data });
|
|
43
|
-
return response;
|
|
44
|
-
}
|
|
14
|
+
async logsList(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): Promise<Models.PaginatedTaskLogListList>;
|
|
15
|
+
async logsList(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 }): Promise<Models.PaginatedTaskLogListList>;
|
|
45
16
|
|
|
46
17
|
/**
|
|
47
|
-
*
|
|
18
|
+
* ViewSet for TaskLog monitoring. Provides read-only access to task
|
|
19
|
+
* execution logs with filtering, searching, and statistics. Endpoints: GET
|
|
20
|
+
* /api/tasks/logs/ - List all task logs GET /api/tasks/logs/{id}/ - Get
|
|
21
|
+
* task log details GET /api/tasks/logs/stats/ - Get aggregated statistics
|
|
22
|
+
* GET /api/tasks/logs/timeline/ - Get task execution timeline GET
|
|
23
|
+
* /api/tasks/logs/overview/ - Get summary overview
|
|
48
24
|
*/
|
|
49
|
-
async
|
|
50
|
-
const
|
|
25
|
+
async logsList(...args: any[]): Promise<Models.PaginatedTaskLogListList> {
|
|
26
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
27
|
+
|
|
28
|
+
let params;
|
|
29
|
+
if (isParamsObject) {
|
|
30
|
+
params = args[0];
|
|
31
|
+
} else {
|
|
32
|
+
params = { created_after: args[0], created_before: args[1], duration_max: args[2], duration_min: args[3], end_time: args[4], enqueue_after: args[5], enqueue_before: args[6], finish_after: args[7], finish_before: args[8], has_error: args[9], is_completed: args[10], is_failed: args[11], is_successful: args[12], job_id: args[13], job_retries_max: args[14], job_retries_min: args[15], ordering: args[16], page: args[17], page_size: args[18], queue_name: args[19], queue_name_in: args[20], search: args[21], start_after: args[22], start_before: args[23], start_time: args[24], status: args[25], status_in: args[26], success: args[27], task: args[28], task_name: args[29], task_name_exact: args[30], worker: args[31], worker_id: args[32] };
|
|
33
|
+
}
|
|
34
|
+
const response = await this.client.request('GET', "/cfg/tasks/logs/", { params });
|
|
51
35
|
return response;
|
|
52
36
|
}
|
|
53
37
|
|
|
54
38
|
/**
|
|
55
|
-
*
|
|
39
|
+
* ViewSet for TaskLog monitoring. Provides read-only access to task
|
|
40
|
+
* execution logs with filtering, searching, and statistics. Endpoints: GET
|
|
41
|
+
* /api/tasks/logs/ - List all task logs GET /api/tasks/logs/{id}/ - Get
|
|
42
|
+
* task log details GET /api/tasks/logs/stats/ - Get aggregated statistics
|
|
43
|
+
* GET /api/tasks/logs/timeline/ - Get task execution timeline GET
|
|
44
|
+
* /api/tasks/logs/overview/ - Get summary overview
|
|
56
45
|
*/
|
|
57
|
-
async
|
|
58
|
-
const response = await this.client.request('
|
|
46
|
+
async logsRetrieve(id: number): Promise<Models.TaskLogDetail> {
|
|
47
|
+
const response = await this.client.request('GET', `/cfg/tasks/logs/${id}/`);
|
|
59
48
|
return response;
|
|
60
49
|
}
|
|
61
50
|
|
|
62
51
|
/**
|
|
63
|
-
* Get
|
|
52
|
+
* Get related task logs (same job_id or task_name). Returns tasks that
|
|
53
|
+
* share the same job_id or are retries of the same task.
|
|
64
54
|
*/
|
|
65
|
-
async
|
|
66
|
-
const response = await this.client.request('GET',
|
|
55
|
+
async logsRelatedRetrieve(id: number): Promise<Models.TaskLog> {
|
|
56
|
+
const response = await this.client.request('GET', `/cfg/tasks/logs/${id}/related/`);
|
|
67
57
|
return response;
|
|
68
58
|
}
|
|
69
59
|
|
|
70
60
|
/**
|
|
71
|
-
* Get task
|
|
61
|
+
* Get summary overview of task system. Returns: { "total_tasks": 1500,
|
|
62
|
+
* "active_queues": ["default", "high", "knowledge"], "recent_failures": 5,
|
|
63
|
+
* "tasks_by_queue": { "default": 800, "high": 500, "knowledge": 200 },
|
|
64
|
+
* "tasks_by_status": { "completed": 1450, "failed": 45, "in_progress": 5 }
|
|
65
|
+
* }
|
|
72
66
|
*/
|
|
73
|
-
async
|
|
74
|
-
const response = await this.client.request('GET', "/cfg/tasks/
|
|
67
|
+
async logsOverviewRetrieve(): Promise<Models.TaskLog> {
|
|
68
|
+
const response = await this.client.request('GET', "/cfg/tasks/logs/overview/");
|
|
75
69
|
return response;
|
|
76
70
|
}
|
|
77
71
|
|
|
78
72
|
/**
|
|
79
|
-
* Get
|
|
73
|
+
* Get aggregated task statistics. Query Parameters: period_hours (int):
|
|
74
|
+
* Statistics period in hours (default: 24) task_name (str): Filter by
|
|
75
|
+
* specific task name Returns: { "total": 150, "successful": 145, "failed":
|
|
76
|
+
* 5, "in_progress": 2, "success_rate": 96.67, "avg_duration_ms": 1250,
|
|
77
|
+
* "avg_duration_seconds": 1.25, "period_hours": 24 }
|
|
80
78
|
*/
|
|
81
|
-
async
|
|
82
|
-
const response = await this.client.request('GET', "/cfg/tasks/
|
|
79
|
+
async logsStatsRetrieve(): Promise<Models.TaskLogStats> {
|
|
80
|
+
const response = await this.client.request('GET', "/cfg/tasks/logs/stats/");
|
|
83
81
|
return response;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
/**
|
|
87
|
-
*
|
|
85
|
+
* Get task execution timeline grouped by time intervals. Query Parameters:
|
|
86
|
+
* period_hours (int): Timeline period in hours (default: 24) interval
|
|
87
|
+
* (str): Grouping interval - 'hour', 'day' (default: 'hour') task_name
|
|
88
|
+
* (str): Filter by specific task name Returns: [ { "timestamp":
|
|
89
|
+
* "2025-10-30T10:00:00Z", "total": 15, "successful": 14, "failed": 1,
|
|
90
|
+
* "avg_duration_ms": 1200 }, ... ]
|
|
88
91
|
*/
|
|
89
|
-
async
|
|
90
|
-
const response = await this.client.request('
|
|
92
|
+
async logsTimelineRetrieve(): Promise<Models.TaskLog> {
|
|
93
|
+
const response = await this.client.request('GET', "/cfg/tasks/logs/timeline/");
|
|
91
94
|
return response;
|
|
92
95
|
}
|
|
93
96
|
|
|
@@ -1,140 +1,203 @@
|
|
|
1
1
|
import * as Enums from "../enums";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Standard API response serializer.
|
|
5
|
-
*
|
|
6
|
-
* Request model (no read-only fields).
|
|
7
|
-
*/
|
|
8
|
-
export interface APIResponseRequest {
|
|
9
|
-
/** Operation success status */
|
|
10
|
-
success: boolean;
|
|
11
|
-
/** Success message */
|
|
12
|
-
message?: string;
|
|
13
|
-
/** Error message */
|
|
14
|
-
error?: string;
|
|
15
|
-
/** Response data */
|
|
16
|
-
data?: Record<string, any>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Standard API response serializer.
|
|
21
4
|
*
|
|
22
5
|
* Response model (includes read-only fields).
|
|
23
6
|
*/
|
|
24
|
-
export interface
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
* `clear` - clear
|
|
44
|
-
* `clear_all` - clear_all
|
|
45
|
-
* `purge` - purge
|
|
46
|
-
* `purge_failed` - purge_failed
|
|
47
|
-
* `flush` - flush */
|
|
48
|
-
action: Enums.QueueActionRequestAction;
|
|
49
|
-
/** Specific queues to target (empty = all queues) */
|
|
50
|
-
queue_names?: Array<string>;
|
|
7
|
+
export interface PaginatedTaskLogListList {
|
|
8
|
+
/** Total number of items across all pages */
|
|
9
|
+
count: number;
|
|
10
|
+
/** Current page number (1-based) */
|
|
11
|
+
page: number;
|
|
12
|
+
/** Total number of pages */
|
|
13
|
+
pages: number;
|
|
14
|
+
/** Number of items per page */
|
|
15
|
+
page_size: number;
|
|
16
|
+
/** Whether there is a next page */
|
|
17
|
+
has_next: boolean;
|
|
18
|
+
/** Whether there is a previous page */
|
|
19
|
+
has_previous: boolean;
|
|
20
|
+
/** Next page number (null if no next page) */
|
|
21
|
+
next_page?: number | null;
|
|
22
|
+
/** Previous page number (null if no previous page) */
|
|
23
|
+
previous_page?: number | null;
|
|
24
|
+
/** Array of items for current page */
|
|
25
|
+
results: Array<TaskLogList>;
|
|
51
26
|
}
|
|
52
27
|
|
|
53
28
|
/**
|
|
54
|
-
*
|
|
29
|
+
* Detailed TaskLog serializer. Includes all fields including args, kwargs,
|
|
30
|
+
* result, error messages. Combines ReArq Job + JobResult data.
|
|
55
31
|
*
|
|
56
32
|
* Response model (includes read-only fields).
|
|
57
33
|
*/
|
|
58
|
-
export interface
|
|
59
|
-
|
|
34
|
+
export interface TaskLogDetail {
|
|
35
|
+
id: number;
|
|
36
|
+
/** Unique job identifier from ReArq */
|
|
37
|
+
job_id: string;
|
|
38
|
+
/** Name of the task function */
|
|
39
|
+
task_name: string;
|
|
40
|
+
/** Queue where task was executed */
|
|
41
|
+
queue_name: string;
|
|
42
|
+
/** Current task status
|
|
60
43
|
|
|
61
|
-
* `
|
|
62
|
-
* `
|
|
63
|
-
* `
|
|
64
|
-
* `
|
|
65
|
-
* `
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
* `deferred` - Deferred
|
|
45
|
+
* `queued` - Queued
|
|
46
|
+
* `in_progress` - In Progress
|
|
47
|
+
* `success` - Success
|
|
48
|
+
* `failed` - Failed
|
|
49
|
+
* `expired` - Expired
|
|
50
|
+
* `canceled` - Canceled */
|
|
51
|
+
status: Enums.TaskLogDetailStatus;
|
|
52
|
+
status_display: string;
|
|
53
|
+
/** Whether task completed successfully (null = not finished) */
|
|
54
|
+
success: boolean | null;
|
|
55
|
+
/** Positional arguments passed to task */
|
|
56
|
+
args: string;
|
|
57
|
+
/** Keyword arguments passed to task */
|
|
58
|
+
kwargs: string;
|
|
59
|
+
/** Task result (JSON string) */
|
|
60
|
+
result: string | null;
|
|
61
|
+
/** Error message if task failed */
|
|
62
|
+
error_message: string | null;
|
|
63
|
+
/** Task execution duration in milliseconds */
|
|
64
|
+
duration_ms: number | null;
|
|
65
|
+
/** Convert duration from ms to seconds. */
|
|
66
|
+
duration_seconds: number;
|
|
67
|
+
/** Maximum number of retries allowed (from task definition) */
|
|
68
|
+
job_retry: number;
|
|
69
|
+
/** Number of retries performed so far */
|
|
70
|
+
job_retries: number;
|
|
71
|
+
/** Seconds to wait before retry */
|
|
72
|
+
job_retry_after: number;
|
|
73
|
+
/** ID of worker that processed the task */
|
|
74
|
+
worker_id: string | null;
|
|
75
|
+
/** When job was enqueued to ReArq (from Job.enqueue_time) */
|
|
76
|
+
enqueue_time: string;
|
|
77
|
+
/** When job will expire (from Job.expire_time) */
|
|
78
|
+
expire_time: string | null;
|
|
79
|
+
/** When task execution started (from JobResult.start_time) */
|
|
80
|
+
start_time: string | null;
|
|
81
|
+
/** When task execution finished (from JobResult.finish_time) */
|
|
82
|
+
finish_time: string | null;
|
|
83
|
+
/** When TaskLog record was created in Django DB */
|
|
84
|
+
created_at: string;
|
|
85
|
+
/** When TaskLog record was last updated */
|
|
86
|
+
updated_at: string;
|
|
87
|
+
/** User who triggered the task (if applicable) */
|
|
88
|
+
user: number | null;
|
|
89
|
+
/** Get user display name. */
|
|
90
|
+
user_display: string;
|
|
69
91
|
}
|
|
70
92
|
|
|
71
93
|
/**
|
|
72
|
-
*
|
|
94
|
+
* Basic TaskLog serializer. Used for list views with essential fields only.
|
|
95
|
+
* Includes computed properties matching ReArq response format.
|
|
73
96
|
*
|
|
74
97
|
* Response model (includes read-only fields).
|
|
75
98
|
*/
|
|
76
|
-
export interface
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/** Error message if any */
|
|
86
|
-
error?: string;
|
|
87
|
-
}
|
|
99
|
+
export interface TaskLog {
|
|
100
|
+
id: number;
|
|
101
|
+
/** Unique job identifier from ReArq */
|
|
102
|
+
job_id: string;
|
|
103
|
+
/** Name of the task function */
|
|
104
|
+
task_name: string;
|
|
105
|
+
/** Queue where task was executed */
|
|
106
|
+
queue_name: string;
|
|
107
|
+
/** Current task status
|
|
88
108
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
|
|
109
|
+
* `deferred` - Deferred
|
|
110
|
+
* `queued` - Queued
|
|
111
|
+
* `in_progress` - In Progress
|
|
112
|
+
* `success` - Success
|
|
113
|
+
* `failed` - Failed
|
|
114
|
+
* `expired` - Expired
|
|
115
|
+
* `canceled` - Canceled */
|
|
116
|
+
status: Enums.TaskLogStatus;
|
|
117
|
+
/** Whether task completed successfully (null = not finished) */
|
|
118
|
+
success: boolean | null;
|
|
119
|
+
/** Task execution duration in milliseconds */
|
|
120
|
+
duration_ms: number | null;
|
|
121
|
+
/** Convert duration from ms to seconds. */
|
|
122
|
+
duration_seconds: number;
|
|
123
|
+
/** Maximum number of retries allowed (from task definition) */
|
|
124
|
+
job_retry: number;
|
|
125
|
+
/** Number of retries performed so far */
|
|
126
|
+
job_retries: number;
|
|
127
|
+
/** When job was enqueued to ReArq (from Job.enqueue_time) */
|
|
128
|
+
enqueue_time: string;
|
|
129
|
+
/** When job will expire (from Job.expire_time) */
|
|
130
|
+
expire_time: string | null;
|
|
131
|
+
/** When task execution started (from JobResult.start_time) */
|
|
132
|
+
start_time: string | null;
|
|
133
|
+
/** When task execution finished (from JobResult.finish_time) */
|
|
134
|
+
finish_time: string | null;
|
|
135
|
+
is_completed: boolean;
|
|
136
|
+
is_successful: boolean;
|
|
137
|
+
is_failed: boolean;
|
|
103
138
|
}
|
|
104
139
|
|
|
105
140
|
/**
|
|
106
|
-
*
|
|
141
|
+
* Statistics serializer for task metrics. Not tied to a model - used for
|
|
142
|
+
* aggregated data.
|
|
107
143
|
*
|
|
108
|
-
*
|
|
144
|
+
* Response model (includes read-only fields).
|
|
109
145
|
*/
|
|
110
|
-
export interface
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/** Number of
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
|
|
146
|
+
export interface TaskLogStats {
|
|
147
|
+
/** Total number of task executions */
|
|
148
|
+
total: number;
|
|
149
|
+
/** Number of successful executions */
|
|
150
|
+
successful: number;
|
|
151
|
+
/** Number of failed executions */
|
|
152
|
+
failed: number;
|
|
153
|
+
/** Number of tasks currently running */
|
|
154
|
+
in_progress: number;
|
|
155
|
+
/** Success rate percentage */
|
|
156
|
+
success_rate: number;
|
|
157
|
+
/** Average duration in milliseconds */
|
|
158
|
+
avg_duration_ms: number;
|
|
159
|
+
/** Average duration in seconds */
|
|
160
|
+
avg_duration_seconds: number;
|
|
161
|
+
/** Statistics period in hours */
|
|
162
|
+
period_hours?: number;
|
|
121
163
|
}
|
|
122
164
|
|
|
123
165
|
/**
|
|
124
|
-
*
|
|
166
|
+
* Compact serializer for list views. Minimal fields for performance, matching
|
|
167
|
+
* ReArq Job list format.
|
|
125
168
|
*
|
|
126
169
|
* Response model (includes read-only fields).
|
|
127
170
|
*/
|
|
128
|
-
export interface
|
|
129
|
-
|
|
171
|
+
export interface TaskLogList {
|
|
172
|
+
id: number;
|
|
173
|
+
/** Unique job identifier from ReArq */
|
|
174
|
+
job_id: string;
|
|
175
|
+
/** Name of the task function */
|
|
176
|
+
task_name: string;
|
|
177
|
+
/** Queue where task was executed */
|
|
178
|
+
queue_name: string;
|
|
179
|
+
/** Current task status
|
|
130
180
|
|
|
131
|
-
* `
|
|
132
|
-
* `
|
|
133
|
-
* `
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
181
|
+
* `deferred` - Deferred
|
|
182
|
+
* `queued` - Queued
|
|
183
|
+
* `in_progress` - In Progress
|
|
184
|
+
* `success` - Success
|
|
185
|
+
* `failed` - Failed
|
|
186
|
+
* `expired` - Expired
|
|
187
|
+
* `canceled` - Canceled */
|
|
188
|
+
status: Enums.TaskLogListStatus;
|
|
189
|
+
status_display: string;
|
|
190
|
+
/** Whether task completed successfully (null = not finished) */
|
|
191
|
+
success: boolean | null;
|
|
192
|
+
/** Number of retries performed so far */
|
|
193
|
+
job_retries: number;
|
|
194
|
+
/** Task execution duration in milliseconds */
|
|
195
|
+
duration_ms: number | null;
|
|
196
|
+
/** When job was enqueued to ReArq (from Job.enqueue_time) */
|
|
197
|
+
enqueue_time: string;
|
|
198
|
+
/** When task execution started (from JobResult.start_time) */
|
|
199
|
+
start_time: string | null;
|
|
200
|
+
/** When task execution finished (from JobResult.finish_time) */
|
|
201
|
+
finish_time: string | null;
|
|
139
202
|
}
|
|
140
203
|
|
|
@@ -387,38 +387,6 @@ export enum PaymentListStatus {
|
|
|
387
387
|
CANCELLED = "cancelled",
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
/**
|
|
391
|
-
* Action to perform on queues
|
|
392
|
-
* * `clear` - clear
|
|
393
|
-
* * `clear_all` - clear_all
|
|
394
|
-
* * `purge` - purge
|
|
395
|
-
* * `purge_failed` - purge_failed
|
|
396
|
-
* * `flush` - flush
|
|
397
|
-
*/
|
|
398
|
-
export enum QueueActionAction {
|
|
399
|
-
CLEAR = "clear",
|
|
400
|
-
CLEAR_ALL = "clear_all",
|
|
401
|
-
PURGE = "purge",
|
|
402
|
-
PURGE_FAILED = "purge_failed",
|
|
403
|
-
FLUSH = "flush",
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Action to perform on queues
|
|
408
|
-
* * `clear` - clear
|
|
409
|
-
* * `clear_all` - clear_all
|
|
410
|
-
* * `purge` - purge
|
|
411
|
-
* * `purge_failed` - purge_failed
|
|
412
|
-
* * `flush` - flush
|
|
413
|
-
*/
|
|
414
|
-
export enum QueueActionRequestAction {
|
|
415
|
-
CLEAR = "clear",
|
|
416
|
-
CLEAR_ALL = "clear_all",
|
|
417
|
-
PURGE = "purge",
|
|
418
|
-
PURGE_FAILED = "purge_failed",
|
|
419
|
-
FLUSH = "flush",
|
|
420
|
-
}
|
|
421
|
-
|
|
422
390
|
/**
|
|
423
391
|
* Button color theme
|
|
424
392
|
* * `primary` - primary
|
|
@@ -475,6 +443,66 @@ export enum SystemHealthItemStatus {
|
|
|
475
443
|
UNKNOWN = "unknown",
|
|
476
444
|
}
|
|
477
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Current task status
|
|
448
|
+
* * `deferred` - Deferred
|
|
449
|
+
* * `queued` - Queued
|
|
450
|
+
* * `in_progress` - In Progress
|
|
451
|
+
* * `success` - Success
|
|
452
|
+
* * `failed` - Failed
|
|
453
|
+
* * `expired` - Expired
|
|
454
|
+
* * `canceled` - Canceled
|
|
455
|
+
*/
|
|
456
|
+
export enum TaskLogStatus {
|
|
457
|
+
DEFERRED = "deferred",
|
|
458
|
+
QUEUED = "queued",
|
|
459
|
+
IN_PROGRESS = "in_progress",
|
|
460
|
+
SUCCESS = "success",
|
|
461
|
+
FAILED = "failed",
|
|
462
|
+
EXPIRED = "expired",
|
|
463
|
+
CANCELED = "canceled",
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Current task status
|
|
468
|
+
* * `deferred` - Deferred
|
|
469
|
+
* * `queued` - Queued
|
|
470
|
+
* * `in_progress` - In Progress
|
|
471
|
+
* * `success` - Success
|
|
472
|
+
* * `failed` - Failed
|
|
473
|
+
* * `expired` - Expired
|
|
474
|
+
* * `canceled` - Canceled
|
|
475
|
+
*/
|
|
476
|
+
export enum TaskLogDetailStatus {
|
|
477
|
+
DEFERRED = "deferred",
|
|
478
|
+
QUEUED = "queued",
|
|
479
|
+
IN_PROGRESS = "in_progress",
|
|
480
|
+
SUCCESS = "success",
|
|
481
|
+
FAILED = "failed",
|
|
482
|
+
EXPIRED = "expired",
|
|
483
|
+
CANCELED = "canceled",
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Current task status
|
|
488
|
+
* * `deferred` - Deferred
|
|
489
|
+
* * `queued` - Queued
|
|
490
|
+
* * `in_progress` - In Progress
|
|
491
|
+
* * `success` - Success
|
|
492
|
+
* * `failed` - Failed
|
|
493
|
+
* * `expired` - Expired
|
|
494
|
+
* * `canceled` - Canceled
|
|
495
|
+
*/
|
|
496
|
+
export enum TaskLogListStatus {
|
|
497
|
+
DEFERRED = "deferred",
|
|
498
|
+
QUEUED = "queued",
|
|
499
|
+
IN_PROGRESS = "in_progress",
|
|
500
|
+
SUCCESS = "success",
|
|
501
|
+
FAILED = "failed",
|
|
502
|
+
EXPIRED = "expired",
|
|
503
|
+
CANCELED = "canceled",
|
|
504
|
+
}
|
|
505
|
+
|
|
478
506
|
/**
|
|
479
507
|
* * `open` - Open
|
|
480
508
|
* * `waiting_for_user` - Waiting for User
|
|
@@ -525,27 +553,3 @@ export enum TransactionTransactionType {
|
|
|
525
553
|
ADJUSTMENT = "adjustment",
|
|
526
554
|
}
|
|
527
555
|
|
|
528
|
-
/**
|
|
529
|
-
* Action to perform on workers
|
|
530
|
-
* * `start` - start
|
|
531
|
-
* * `stop` - stop
|
|
532
|
-
* * `restart` - restart
|
|
533
|
-
*/
|
|
534
|
-
export enum WorkerActionAction {
|
|
535
|
-
START = "start",
|
|
536
|
-
STOP = "stop",
|
|
537
|
-
RESTART = "restart",
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Action to perform on workers
|
|
542
|
-
* * `start` - start
|
|
543
|
-
* * `stop` - stop
|
|
544
|
-
* * `restart` - restart
|
|
545
|
-
*/
|
|
546
|
-
export enum WorkerActionRequestAction {
|
|
547
|
-
START = "start",
|
|
548
|
-
STOP = "stop",
|
|
549
|
-
RESTART = "restart",
|
|
550
|
-
}
|
|
551
|
-
|