@qodalis/cli-server-jobs 2.0.0-beta.3

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/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@qodalis/cli-server-jobs",
3
+ "version": "2.0.0-beta.3",
4
+ "description": "Background job management",
5
+ "author": "Qodalis Solutions",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/qodalis-solutions/web-cli"
10
+ },
11
+ "homepage": "https://qodalis.com",
12
+ "keywords": [
13
+ "cli",
14
+ "qodalis",
15
+ "terminal",
16
+ "jobs"
17
+ ],
18
+ "umd": "./umd/index.global.js",
19
+ "unpkg": "./umd/index.global.js",
20
+ "dependencies": {
21
+ "@qodalis/cli-core": "2.0.0-beta.3"
22
+ },
23
+ "sideEffects": false,
24
+ "main": "./public-api.js",
25
+ "module": "./public-api.mjs",
26
+ "types": "./public-api.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./public-api.d.ts",
30
+ "import": "./public-api.mjs",
31
+ "require": "./public-api.js"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,112 @@
1
+ import { ICliCommandProcessor, ICliCommandAuthor, CliProcessorMetadata, CliProcessCommand, ICliExecutionContext, ICliCompletionProvider, ICliServiceProvider, ICliCompletionContext, ICliModule } from '@qodalis/cli-core';
2
+
3
+ declare class CliJobsCommandProcessor implements ICliCommandProcessor {
4
+ command: string;
5
+ extendsProcessor: boolean;
6
+ description: string;
7
+ author: ICliCommandAuthor;
8
+ metadata: CliProcessorMetadata;
9
+ processors?: ICliCommandProcessor[];
10
+ processCommand(_cmd: CliProcessCommand, _context: ICliExecutionContext): Promise<void>;
11
+ private handleList;
12
+ private handleInfo;
13
+ private handleAction;
14
+ private handleHistory;
15
+ private handleLogs;
16
+ private handleEdit;
17
+ private handleWatch;
18
+ }
19
+
20
+ /**
21
+ * Provides tab-completion for job names when typing
22
+ * `server jobs <subcommand> <name>`.
23
+ *
24
+ * Priority 50 — checked before command and parameter completion so that
25
+ * job names are suggested instead of treating the value position as
26
+ * a sub-command or flag.
27
+ */
28
+ declare class CliJobNameCompletionProvider implements ICliCompletionProvider {
29
+ priority: number;
30
+ private services;
31
+ setServices(services: ICliServiceProvider): void;
32
+ getCompletions(context: ICliCompletionContext): Promise<string[]>;
33
+ }
34
+
35
+ interface JobDto {
36
+ id: string;
37
+ name: string;
38
+ description: string;
39
+ group?: string;
40
+ status: 'active' | 'paused' | 'stopped';
41
+ schedule?: string;
42
+ interval?: number;
43
+ maxRetries: number;
44
+ timeout?: number;
45
+ overlapPolicy: string;
46
+ currentExecutionId?: string;
47
+ nextRunAt?: string;
48
+ lastRunAt?: string;
49
+ lastRunStatus?: string;
50
+ lastRunDuration?: number;
51
+ }
52
+ interface JobExecutionDto {
53
+ id: string;
54
+ jobId: string;
55
+ jobName: string;
56
+ status: 'running' | 'completed' | 'failed' | 'cancelled' | 'timed_out';
57
+ startedAt: string;
58
+ completedAt?: string;
59
+ duration?: number;
60
+ error?: string;
61
+ retryAttempt: number;
62
+ logCount?: number;
63
+ logs?: JobLogEntryDto[];
64
+ }
65
+ interface JobLogEntryDto {
66
+ timestamp: string;
67
+ level: 'debug' | 'info' | 'warning' | 'error';
68
+ message: string;
69
+ }
70
+ interface JobHistoryResponse {
71
+ items: JobExecutionDto[];
72
+ total: number;
73
+ limit: number;
74
+ offset: number;
75
+ }
76
+ interface UpdateJobRequest {
77
+ description?: string;
78
+ group?: string;
79
+ schedule?: string;
80
+ interval?: string;
81
+ maxRetries?: number;
82
+ timeout?: string;
83
+ overlapPolicy?: string;
84
+ }
85
+
86
+ declare class CliJobsService {
87
+ private baseUrl;
88
+ private headers;
89
+ constructor(baseUrl: string, headers?: Record<string, string>);
90
+ private request;
91
+ listJobs(): Promise<JobDto[]>;
92
+ getJob(id: string): Promise<JobDto>;
93
+ triggerJob(id: string): Promise<void>;
94
+ pauseJob(id: string): Promise<void>;
95
+ resumeJob(id: string): Promise<void>;
96
+ stopJob(id: string): Promise<void>;
97
+ cancelJob(id: string): Promise<void>;
98
+ updateJob(id: string, request: UpdateJobRequest): Promise<void>;
99
+ getHistory(id: string, opts?: {
100
+ limit?: number;
101
+ offset?: number;
102
+ status?: string;
103
+ }): Promise<JobHistoryResponse>;
104
+ getExecution(jobId: string, execId: string): Promise<JobExecutionDto>;
105
+ }
106
+
107
+ declare const LIBRARY_VERSION = "2.0.0-beta.3";
108
+ declare const API_VERSION = 2;
109
+
110
+ declare const jobsModule: ICliModule;
111
+
112
+ export { API_VERSION, CliJobNameCompletionProvider, CliJobsCommandProcessor, CliJobsService, type JobDto, type JobExecutionDto, type JobHistoryResponse, type JobLogEntryDto, LIBRARY_VERSION, type UpdateJobRequest, jobsModule };
@@ -0,0 +1,112 @@
1
+ import { ICliCommandProcessor, ICliCommandAuthor, CliProcessorMetadata, CliProcessCommand, ICliExecutionContext, ICliCompletionProvider, ICliServiceProvider, ICliCompletionContext, ICliModule } from '@qodalis/cli-core';
2
+
3
+ declare class CliJobsCommandProcessor implements ICliCommandProcessor {
4
+ command: string;
5
+ extendsProcessor: boolean;
6
+ description: string;
7
+ author: ICliCommandAuthor;
8
+ metadata: CliProcessorMetadata;
9
+ processors?: ICliCommandProcessor[];
10
+ processCommand(_cmd: CliProcessCommand, _context: ICliExecutionContext): Promise<void>;
11
+ private handleList;
12
+ private handleInfo;
13
+ private handleAction;
14
+ private handleHistory;
15
+ private handleLogs;
16
+ private handleEdit;
17
+ private handleWatch;
18
+ }
19
+
20
+ /**
21
+ * Provides tab-completion for job names when typing
22
+ * `server jobs <subcommand> <name>`.
23
+ *
24
+ * Priority 50 — checked before command and parameter completion so that
25
+ * job names are suggested instead of treating the value position as
26
+ * a sub-command or flag.
27
+ */
28
+ declare class CliJobNameCompletionProvider implements ICliCompletionProvider {
29
+ priority: number;
30
+ private services;
31
+ setServices(services: ICliServiceProvider): void;
32
+ getCompletions(context: ICliCompletionContext): Promise<string[]>;
33
+ }
34
+
35
+ interface JobDto {
36
+ id: string;
37
+ name: string;
38
+ description: string;
39
+ group?: string;
40
+ status: 'active' | 'paused' | 'stopped';
41
+ schedule?: string;
42
+ interval?: number;
43
+ maxRetries: number;
44
+ timeout?: number;
45
+ overlapPolicy: string;
46
+ currentExecutionId?: string;
47
+ nextRunAt?: string;
48
+ lastRunAt?: string;
49
+ lastRunStatus?: string;
50
+ lastRunDuration?: number;
51
+ }
52
+ interface JobExecutionDto {
53
+ id: string;
54
+ jobId: string;
55
+ jobName: string;
56
+ status: 'running' | 'completed' | 'failed' | 'cancelled' | 'timed_out';
57
+ startedAt: string;
58
+ completedAt?: string;
59
+ duration?: number;
60
+ error?: string;
61
+ retryAttempt: number;
62
+ logCount?: number;
63
+ logs?: JobLogEntryDto[];
64
+ }
65
+ interface JobLogEntryDto {
66
+ timestamp: string;
67
+ level: 'debug' | 'info' | 'warning' | 'error';
68
+ message: string;
69
+ }
70
+ interface JobHistoryResponse {
71
+ items: JobExecutionDto[];
72
+ total: number;
73
+ limit: number;
74
+ offset: number;
75
+ }
76
+ interface UpdateJobRequest {
77
+ description?: string;
78
+ group?: string;
79
+ schedule?: string;
80
+ interval?: string;
81
+ maxRetries?: number;
82
+ timeout?: string;
83
+ overlapPolicy?: string;
84
+ }
85
+
86
+ declare class CliJobsService {
87
+ private baseUrl;
88
+ private headers;
89
+ constructor(baseUrl: string, headers?: Record<string, string>);
90
+ private request;
91
+ listJobs(): Promise<JobDto[]>;
92
+ getJob(id: string): Promise<JobDto>;
93
+ triggerJob(id: string): Promise<void>;
94
+ pauseJob(id: string): Promise<void>;
95
+ resumeJob(id: string): Promise<void>;
96
+ stopJob(id: string): Promise<void>;
97
+ cancelJob(id: string): Promise<void>;
98
+ updateJob(id: string, request: UpdateJobRequest): Promise<void>;
99
+ getHistory(id: string, opts?: {
100
+ limit?: number;
101
+ offset?: number;
102
+ status?: string;
103
+ }): Promise<JobHistoryResponse>;
104
+ getExecution(jobId: string, execId: string): Promise<JobExecutionDto>;
105
+ }
106
+
107
+ declare const LIBRARY_VERSION = "2.0.0-beta.3";
108
+ declare const API_VERSION = 2;
109
+
110
+ declare const jobsModule: ICliModule;
111
+
112
+ export { API_VERSION, CliJobNameCompletionProvider, CliJobsCommandProcessor, CliJobsService, type JobDto, type JobExecutionDto, type JobHistoryResponse, type JobLogEntryDto, LIBRARY_VERSION, type UpdateJobRequest, jobsModule };