@qodalis/cli-server-abstractions 1.0.0-beta.12
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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/cli-command-author.d.ts +16 -0
- package/dist/cli-command-author.d.ts.map +1 -0
- package/dist/cli-command-author.js +16 -0
- package/dist/cli-command-author.js.map +1 -0
- package/dist/cli-command-parameter-descriptor.d.ts +34 -0
- package/dist/cli-command-parameter-descriptor.d.ts.map +1 -0
- package/dist/cli-command-parameter-descriptor.js +30 -0
- package/dist/cli-command-parameter-descriptor.js.map +1 -0
- package/dist/cli-command-processor.d.ts +67 -0
- package/dist/cli-command-processor.d.ts.map +1 -0
- package/dist/cli-command-processor.js +20 -0
- package/dist/cli-command-processor.js.map +1 -0
- package/dist/cli-module.d.ts +28 -0
- package/dist/cli-module.d.ts.map +1 -0
- package/dist/cli-module.js +12 -0
- package/dist/cli-module.js.map +1 -0
- package/dist/cli-paging.d.ts +35 -0
- package/dist/cli-paging.d.ts.map +1 -0
- package/dist/cli-paging.js +47 -0
- package/dist/cli-paging.js.map +1 -0
- package/dist/cli-process-command.d.ts +23 -0
- package/dist/cli-process-command.d.ts.map +1 -0
- package/dist/cli-process-command.js +3 -0
- package/dist/cli-process-command.js.map +1 -0
- package/dist/cli-processor-filter.d.ts +14 -0
- package/dist/cli-processor-filter.d.ts.map +1 -0
- package/dist/cli-processor-filter.js +3 -0
- package/dist/cli-processor-filter.js.map +1 -0
- package/dist/cli-stream-command-processor.d.ts +27 -0
- package/dist/cli-stream-command-processor.d.ts.map +1 -0
- package/dist/cli-stream-command-processor.js +13 -0
- package/dist/cli-stream-command-processor.js.map +1 -0
- package/dist/cli-structured-response.d.ts +56 -0
- package/dist/cli-structured-response.d.ts.map +1 -0
- package/dist/cli-structured-response.js +3 -0
- package/dist/cli-structured-response.js.map +1 -0
- package/dist/data-explorer-provider.d.ts +17 -0
- package/dist/data-explorer-provider.d.ts.map +1 -0
- package/dist/data-explorer-provider.js +3 -0
- package/dist/data-explorer-provider.js.map +1 -0
- package/dist/data-explorer-types.d.ts +143 -0
- package/dist/data-explorer-types.d.ts.map +1 -0
- package/dist/data-explorer-types.js +22 -0
- package/dist/data-explorer-types.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/cli-job-execution-context.d.ts +7 -0
- package/dist/jobs/cli-job-execution-context.d.ts.map +1 -0
- package/dist/jobs/cli-job-execution-context.js +3 -0
- package/dist/jobs/cli-job-execution-context.js.map +1 -0
- package/dist/jobs/cli-job-logger.d.ts +12 -0
- package/dist/jobs/cli-job-logger.d.ts.map +1 -0
- package/dist/jobs/cli-job-logger.js +3 -0
- package/dist/jobs/cli-job-logger.js.map +1 -0
- package/dist/jobs/cli-job-options.d.ts +30 -0
- package/dist/jobs/cli-job-options.d.ts.map +1 -0
- package/dist/jobs/cli-job-options.js +3 -0
- package/dist/jobs/cli-job-options.js.map +1 -0
- package/dist/jobs/cli-job-storage-provider.d.ts +30 -0
- package/dist/jobs/cli-job-storage-provider.d.ts.map +1 -0
- package/dist/jobs/cli-job-storage-provider.js +3 -0
- package/dist/jobs/cli-job-storage-provider.js.map +1 -0
- package/dist/jobs/cli-job.d.ts +11 -0
- package/dist/jobs/cli-job.d.ts.map +1 -0
- package/dist/jobs/cli-job.js +3 -0
- package/dist/jobs/cli-job.js.map +1 -0
- package/dist/jobs/index.d.ts +9 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +3 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/job-execution.d.ts +27 -0
- package/dist/jobs/job-execution.d.ts.map +1 -0
- package/dist/jobs/job-execution.js +3 -0
- package/dist/jobs/job-execution.js.map +1 -0
- package/dist/jobs/job-state.d.ts +12 -0
- package/dist/jobs/job-state.d.ts.map +1 -0
- package/dist/jobs/job-state.js +3 -0
- package/dist/jobs/job-state.js.map +1 -0
- package/dist/jobs/log-entry.d.ts +12 -0
- package/dist/jobs/log-entry.d.ts.map +1 -0
- package/dist/jobs/log-entry.js +3 -0
- package/dist/jobs/log-entry.js.map +1 -0
- package/dist/shell-words.d.ts +31 -0
- package/dist/shell-words.d.ts.map +1 -0
- package/dist/shell-words.js +98 -0
- package/dist/shell-words.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-structured-response.d.ts","sourceRoot":"","sources":["../src/cli-structured-response.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,GACjF;IACI,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAG,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC;AAEvE,6GAA6G;AAC7G,MAAM,WAAW,qBAAqB;IAClC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-structured-response.js","sourceRoot":"","sources":["../src/cli-structured-response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataExplorerExecutionContext, DataExplorerResult, DataExplorerSchemaResult, DataExplorerProviderOptions } from './data-explorer-types';
|
|
2
|
+
/** Provider that executes queries against a specific data source (e.g. SQL database, MongoDB). */
|
|
3
|
+
export interface IDataExplorerProvider {
|
|
4
|
+
/**
|
|
5
|
+
* Executes a query against the data source.
|
|
6
|
+
* @param context - Execution context containing the query, parameters, and options.
|
|
7
|
+
* @returns Query results including rows, columns, and execution metadata.
|
|
8
|
+
*/
|
|
9
|
+
executeAsync(context: DataExplorerExecutionContext): Promise<DataExplorerResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves schema information (tables, columns) from the data source.
|
|
12
|
+
* @param options - Provider options identifying the data source.
|
|
13
|
+
* @returns Schema metadata for the data source.
|
|
14
|
+
*/
|
|
15
|
+
getSchemaAsync?(options: DataExplorerProviderOptions): Promise<DataExplorerSchemaResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=data-explorer-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-explorer-provider.d.ts","sourceRoot":"","sources":["../src/data-explorer-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEhJ,kGAAkG;AAClG,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjF;;;;OAIG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC5F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-explorer-provider.js","sourceRoot":"","sources":["../src/data-explorer-provider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/** Query language supported by a data explorer provider. */
|
|
2
|
+
export declare enum DataExplorerLanguage {
|
|
3
|
+
Sql = "sql",
|
|
4
|
+
Json = "json",
|
|
5
|
+
Shell = "shell",
|
|
6
|
+
Graphql = "graphql",
|
|
7
|
+
Redis = "redis",
|
|
8
|
+
Elasticsearch = "elasticsearch"
|
|
9
|
+
}
|
|
10
|
+
/** Output format for data explorer query results. */
|
|
11
|
+
export declare enum DataExplorerOutputFormat {
|
|
12
|
+
Table = "table",
|
|
13
|
+
Json = "json",
|
|
14
|
+
Csv = "csv",
|
|
15
|
+
Raw = "raw"
|
|
16
|
+
}
|
|
17
|
+
/** Predefined query template for a data explorer provider. */
|
|
18
|
+
export interface DataExplorerTemplate {
|
|
19
|
+
/** Template display name. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Query string, optionally with parameter placeholders. */
|
|
22
|
+
query: string;
|
|
23
|
+
/** Human-readable description of what this template does. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Default parameter values for this template. */
|
|
26
|
+
parameters?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/** Describes a parameter accepted by a data explorer provider. */
|
|
29
|
+
export interface DataExplorerParameterDescriptor {
|
|
30
|
+
/** Parameter name. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Human-readable description. */
|
|
33
|
+
description?: string;
|
|
34
|
+
/** Whether the parameter must be provided. */
|
|
35
|
+
required?: boolean;
|
|
36
|
+
/** Default value when omitted. */
|
|
37
|
+
defaultValue?: unknown;
|
|
38
|
+
}
|
|
39
|
+
/** Configuration options that define a data explorer provider's identity and capabilities. */
|
|
40
|
+
export interface DataExplorerProviderOptions {
|
|
41
|
+
/** Unique provider name (e.g. "postgres", "mongodb"). */
|
|
42
|
+
name: string;
|
|
43
|
+
/** Human-readable description of the data source. */
|
|
44
|
+
description: string;
|
|
45
|
+
/** Query language used by this provider. */
|
|
46
|
+
language: DataExplorerLanguage;
|
|
47
|
+
/** Default output format for query results. */
|
|
48
|
+
defaultOutputFormat: DataExplorerOutputFormat;
|
|
49
|
+
/** Parameters accepted by this provider. */
|
|
50
|
+
parameters?: DataExplorerParameterDescriptor[];
|
|
51
|
+
/** Predefined query templates. */
|
|
52
|
+
templates?: DataExplorerTemplate[];
|
|
53
|
+
/** Query execution timeout in milliseconds. */
|
|
54
|
+
timeout?: number;
|
|
55
|
+
/** Maximum number of rows to return per query. */
|
|
56
|
+
maxRows?: number;
|
|
57
|
+
}
|
|
58
|
+
/** Context passed to a data explorer provider when executing a query. */
|
|
59
|
+
export interface DataExplorerExecutionContext {
|
|
60
|
+
/** Query string to execute. */
|
|
61
|
+
query: string;
|
|
62
|
+
/** Parameter values for the query. */
|
|
63
|
+
parameters: Record<string, unknown>;
|
|
64
|
+
/** Provider configuration options. */
|
|
65
|
+
options: DataExplorerProviderOptions;
|
|
66
|
+
/** Abort signal for cancellation. */
|
|
67
|
+
signal?: AbortSignal;
|
|
68
|
+
}
|
|
69
|
+
/** Result of a data explorer query execution. */
|
|
70
|
+
export interface DataExplorerResult {
|
|
71
|
+
/** Whether the query executed without errors. */
|
|
72
|
+
success: boolean;
|
|
73
|
+
/** Provider source name that produced this result. */
|
|
74
|
+
source: string;
|
|
75
|
+
/** Query language used. */
|
|
76
|
+
language: DataExplorerLanguage;
|
|
77
|
+
/** Output format of the result data. */
|
|
78
|
+
defaultOutputFormat: DataExplorerOutputFormat;
|
|
79
|
+
/** Query execution time in milliseconds. */
|
|
80
|
+
executionTime: number;
|
|
81
|
+
/** Column names, or null if not applicable. */
|
|
82
|
+
columns: string[] | null;
|
|
83
|
+
/** Result rows as arrays or objects. */
|
|
84
|
+
rows: unknown[][] | Record<string, unknown>[];
|
|
85
|
+
/** Total number of rows returned. */
|
|
86
|
+
rowCount: number;
|
|
87
|
+
/** Whether the result was truncated due to maxRows. */
|
|
88
|
+
truncated: boolean;
|
|
89
|
+
/** Error message if the query failed, otherwise null. */
|
|
90
|
+
error: string | null;
|
|
91
|
+
}
|
|
92
|
+
/** Request payload for executing a data explorer query. */
|
|
93
|
+
export interface DataExplorerExecuteRequest {
|
|
94
|
+
/** Target data source name. */
|
|
95
|
+
source: string;
|
|
96
|
+
/** Query string to execute. */
|
|
97
|
+
query: string;
|
|
98
|
+
/** Optional parameter values. */
|
|
99
|
+
parameters?: Record<string, unknown>;
|
|
100
|
+
}
|
|
101
|
+
/** Metadata about a registered data explorer source. */
|
|
102
|
+
export interface DataExplorerSourceInfo {
|
|
103
|
+
/** Source name. */
|
|
104
|
+
name: string;
|
|
105
|
+
/** Human-readable description. */
|
|
106
|
+
description: string;
|
|
107
|
+
/** Query language used by this source. */
|
|
108
|
+
language: DataExplorerLanguage;
|
|
109
|
+
/** Default output format. */
|
|
110
|
+
defaultOutputFormat: DataExplorerOutputFormat;
|
|
111
|
+
/** Available query templates. */
|
|
112
|
+
templates: DataExplorerTemplate[];
|
|
113
|
+
/** Accepted parameters. */
|
|
114
|
+
parameters: DataExplorerParameterDescriptor[];
|
|
115
|
+
}
|
|
116
|
+
/** Describes a single column within a data explorer schema table. */
|
|
117
|
+
export interface DataExplorerSchemaColumn {
|
|
118
|
+
/** Column name. */
|
|
119
|
+
name: string;
|
|
120
|
+
/** Data type (e.g. "varchar", "integer"). */
|
|
121
|
+
type: string;
|
|
122
|
+
/** Whether the column allows null values. */
|
|
123
|
+
nullable: boolean;
|
|
124
|
+
/** Whether the column is a primary key. */
|
|
125
|
+
primaryKey: boolean;
|
|
126
|
+
}
|
|
127
|
+
/** Describes a table or collection in a data explorer schema. */
|
|
128
|
+
export interface DataExplorerSchemaTable {
|
|
129
|
+
/** Table or collection name. */
|
|
130
|
+
name: string;
|
|
131
|
+
/** Object type (e.g. "table", "view", "collection"). */
|
|
132
|
+
type: string;
|
|
133
|
+
/** Columns within this table. */
|
|
134
|
+
columns: DataExplorerSchemaColumn[];
|
|
135
|
+
}
|
|
136
|
+
/** Schema introspection result from a data explorer provider. */
|
|
137
|
+
export interface DataExplorerSchemaResult {
|
|
138
|
+
/** Provider source name. */
|
|
139
|
+
source: string;
|
|
140
|
+
/** Tables and their column definitions. */
|
|
141
|
+
tables: DataExplorerSchemaTable[];
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=data-explorer-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-explorer-types.d.ts","sourceRoot":"","sources":["../src/data-explorer-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataExplorerOutputFormat = exports.DataExplorerLanguage = void 0;
|
|
4
|
+
/** Query language supported by a data explorer provider. */
|
|
5
|
+
var DataExplorerLanguage;
|
|
6
|
+
(function (DataExplorerLanguage) {
|
|
7
|
+
DataExplorerLanguage["Sql"] = "sql";
|
|
8
|
+
DataExplorerLanguage["Json"] = "json";
|
|
9
|
+
DataExplorerLanguage["Shell"] = "shell";
|
|
10
|
+
DataExplorerLanguage["Graphql"] = "graphql";
|
|
11
|
+
DataExplorerLanguage["Redis"] = "redis";
|
|
12
|
+
DataExplorerLanguage["Elasticsearch"] = "elasticsearch";
|
|
13
|
+
})(DataExplorerLanguage || (exports.DataExplorerLanguage = DataExplorerLanguage = {}));
|
|
14
|
+
/** Output format for data explorer query results. */
|
|
15
|
+
var DataExplorerOutputFormat;
|
|
16
|
+
(function (DataExplorerOutputFormat) {
|
|
17
|
+
DataExplorerOutputFormat["Table"] = "table";
|
|
18
|
+
DataExplorerOutputFormat["Json"] = "json";
|
|
19
|
+
DataExplorerOutputFormat["Csv"] = "csv";
|
|
20
|
+
DataExplorerOutputFormat["Raw"] = "raw";
|
|
21
|
+
})(DataExplorerOutputFormat || (exports.DataExplorerOutputFormat = DataExplorerOutputFormat = {}));
|
|
22
|
+
//# sourceMappingURL=data-explorer-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-explorer-types.js","sourceRoot":"","sources":["../src/data-explorer-types.ts"],"names":[],"mappings":";;;AAAA,4DAA4D;AAC5D,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC5B,mCAAW,CAAA;IACX,qCAAa,CAAA;IACb,uCAAe,CAAA;IACf,2CAAmB,CAAA;IACnB,uCAAe,CAAA;IACf,uDAA+B,CAAA;AACnC,CAAC,EAPW,oBAAoB,oCAApB,oBAAoB,QAO/B;AAED,qDAAqD;AACrD,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,2CAAe,CAAA;IACf,yCAAa,CAAA;IACb,uCAAW,CAAA;IACX,uCAAW,CAAA;AACf,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ICliCommandAuthor, CliCommandAuthor, DefaultLibraryAuthor } from './cli-command-author';
|
|
2
|
+
export { CliProcessCommand } from './cli-process-command';
|
|
3
|
+
export { splitShellWords, joinShellWords, getPositionals, getPositionalText, quoteShellWord } from './shell-words';
|
|
4
|
+
export { ICliCommandParameterDescriptor, CliCommandParameterDescriptor } from './cli-command-parameter-descriptor';
|
|
5
|
+
export { ICliCommandProcessor, CliCommandProcessor } from './cli-command-processor';
|
|
6
|
+
export { ICliModule, CliModule } from './cli-module';
|
|
7
|
+
export { CliStructuredOutput, CliStructuredResponse, CliTablePage } from './cli-structured-response';
|
|
8
|
+
export { CliPageRequest, CliPaging, DEFAULT_TAKE, MAX_TAKE } from './cli-paging';
|
|
9
|
+
export { ICliJob, ICliJobExecutionContext, ICliJobLogger, CliJobOptions, JobOverlapPolicy, ICliJobStorageProvider, JobExecution, JobExecutionStatus, JobState, JobStatus, JobLogEntry, JobLogLevel, } from './jobs';
|
|
10
|
+
export { DataExplorerLanguage, DataExplorerOutputFormat, DataExplorerTemplate, DataExplorerParameterDescriptor, DataExplorerProviderOptions, DataExplorerExecutionContext, DataExplorerResult, DataExplorerExecuteRequest, DataExplorerSourceInfo, DataExplorerSchemaColumn, DataExplorerSchemaTable, DataExplorerSchemaResult, } from './data-explorer-types';
|
|
11
|
+
export { IDataExplorerProvider } from './data-explorer-provider';
|
|
12
|
+
export { ICliProcessorFilter } from './cli-processor-filter';
|
|
13
|
+
export { ICliStreamCommandProcessor, isStreamCapable } from './cli-stream-command-processor';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EACH,OAAO,EACP,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,GACd,MAAM,QAAQ,CAAC;AAChB,OAAO,EACH,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStreamCapable = exports.DataExplorerOutputFormat = exports.DataExplorerLanguage = exports.MAX_TAKE = exports.DEFAULT_TAKE = exports.CliPaging = exports.CliModule = exports.CliCommandProcessor = exports.CliCommandParameterDescriptor = exports.quoteShellWord = exports.getPositionalText = exports.getPositionals = exports.joinShellWords = exports.splitShellWords = exports.DefaultLibraryAuthor = exports.CliCommandAuthor = void 0;
|
|
4
|
+
var cli_command_author_1 = require("./cli-command-author");
|
|
5
|
+
Object.defineProperty(exports, "CliCommandAuthor", { enumerable: true, get: function () { return cli_command_author_1.CliCommandAuthor; } });
|
|
6
|
+
Object.defineProperty(exports, "DefaultLibraryAuthor", { enumerable: true, get: function () { return cli_command_author_1.DefaultLibraryAuthor; } });
|
|
7
|
+
var shell_words_1 = require("./shell-words");
|
|
8
|
+
Object.defineProperty(exports, "splitShellWords", { enumerable: true, get: function () { return shell_words_1.splitShellWords; } });
|
|
9
|
+
Object.defineProperty(exports, "joinShellWords", { enumerable: true, get: function () { return shell_words_1.joinShellWords; } });
|
|
10
|
+
Object.defineProperty(exports, "getPositionals", { enumerable: true, get: function () { return shell_words_1.getPositionals; } });
|
|
11
|
+
Object.defineProperty(exports, "getPositionalText", { enumerable: true, get: function () { return shell_words_1.getPositionalText; } });
|
|
12
|
+
Object.defineProperty(exports, "quoteShellWord", { enumerable: true, get: function () { return shell_words_1.quoteShellWord; } });
|
|
13
|
+
var cli_command_parameter_descriptor_1 = require("./cli-command-parameter-descriptor");
|
|
14
|
+
Object.defineProperty(exports, "CliCommandParameterDescriptor", { enumerable: true, get: function () { return cli_command_parameter_descriptor_1.CliCommandParameterDescriptor; } });
|
|
15
|
+
var cli_command_processor_1 = require("./cli-command-processor");
|
|
16
|
+
Object.defineProperty(exports, "CliCommandProcessor", { enumerable: true, get: function () { return cli_command_processor_1.CliCommandProcessor; } });
|
|
17
|
+
var cli_module_1 = require("./cli-module");
|
|
18
|
+
Object.defineProperty(exports, "CliModule", { enumerable: true, get: function () { return cli_module_1.CliModule; } });
|
|
19
|
+
var cli_paging_1 = require("./cli-paging");
|
|
20
|
+
Object.defineProperty(exports, "CliPaging", { enumerable: true, get: function () { return cli_paging_1.CliPaging; } });
|
|
21
|
+
Object.defineProperty(exports, "DEFAULT_TAKE", { enumerable: true, get: function () { return cli_paging_1.DEFAULT_TAKE; } });
|
|
22
|
+
Object.defineProperty(exports, "MAX_TAKE", { enumerable: true, get: function () { return cli_paging_1.MAX_TAKE; } });
|
|
23
|
+
var data_explorer_types_1 = require("./data-explorer-types");
|
|
24
|
+
Object.defineProperty(exports, "DataExplorerLanguage", { enumerable: true, get: function () { return data_explorer_types_1.DataExplorerLanguage; } });
|
|
25
|
+
Object.defineProperty(exports, "DataExplorerOutputFormat", { enumerable: true, get: function () { return data_explorer_types_1.DataExplorerOutputFormat; } });
|
|
26
|
+
var cli_stream_command_processor_1 = require("./cli-stream-command-processor");
|
|
27
|
+
Object.defineProperty(exports, "isStreamCapable", { enumerable: true, get: function () { return cli_stream_command_processor_1.isStreamCapable; } });
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiG;AAArE,sHAAA,gBAAgB,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AAElE,6CAAmH;AAA1G,8GAAA,eAAe,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AAAE,6GAAA,cAAc,OAAA;AAC3F,uFAAmH;AAA1E,iJAAA,6BAA6B,OAAA;AACtE,iEAAoF;AAArD,4HAAA,mBAAmB,OAAA;AAClD,2CAAqD;AAAhC,uGAAA,SAAS,OAAA;AAE9B,2CAAiF;AAAxD,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAe1D,6DAa+B;AAZ3B,2HAAA,oBAAoB,OAAA;AACpB,+HAAA,wBAAwB,OAAA;AAc5B,+EAA6F;AAAxD,+HAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICliJobLogger } from './cli-job-logger';
|
|
2
|
+
/** Context passed to a job during execution, providing access to logging. */
|
|
3
|
+
export interface ICliJobExecutionContext {
|
|
4
|
+
/** Logger for recording job progress and diagnostics. */
|
|
5
|
+
logger: ICliJobLogger;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=cli-job-execution-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-execution-context.d.ts","sourceRoot":"","sources":["../../src/jobs/cli-job-execution-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACpC,yDAAyD;IACzD,MAAM,EAAE,aAAa,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-execution-context.js","sourceRoot":"","sources":["../../src/jobs/cli-job-execution-context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Logger interface for recording messages during job execution. */
|
|
2
|
+
export interface ICliJobLogger {
|
|
3
|
+
/** Logs a debug-level message. */
|
|
4
|
+
debug(message: string): void;
|
|
5
|
+
/** Logs an informational message. */
|
|
6
|
+
info(message: string): void;
|
|
7
|
+
/** Logs a warning message. */
|
|
8
|
+
warning(message: string): void;
|
|
9
|
+
/** Logs an error message. */
|
|
10
|
+
error(message: string): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=cli-job-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-logger.d.ts","sourceRoot":"","sources":["../../src/jobs/cli-job-logger.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC1B,kCAAkC;IAClC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,qCAAqC;IACrC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8BAA8B;IAC9B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,6BAA6B;IAC7B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-logger.js","sourceRoot":"","sources":["../../src/jobs/cli-job-logger.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Behavior when a job's timer fires while the previous execution is still running. */
|
|
2
|
+
export type JobOverlapPolicy = 'skip' | 'queue' | 'cancel';
|
|
3
|
+
/** Retry backoff strategy for failed job executions. */
|
|
4
|
+
export type JobRetryStrategy = 'fixed' | 'linear' | 'exponential';
|
|
5
|
+
/** Configuration options for a scheduled or on-demand CLI job. */
|
|
6
|
+
export interface CliJobOptions {
|
|
7
|
+
/** Display name for the job. Defaults to class name. */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Description of what the job does. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Optional grouping key (e.g., "maintenance"). */
|
|
12
|
+
group?: string;
|
|
13
|
+
/** Cron expression for scheduling. Mutually exclusive with `interval`. */
|
|
14
|
+
schedule?: string;
|
|
15
|
+
/** Simple interval string: "30s", "5m", "1h", "1d". Mutually exclusive with `schedule`. */
|
|
16
|
+
interval?: string;
|
|
17
|
+
/** Whether the job starts in active state. Default true. */
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
/** Number of retries on failure. Default 1. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** Delay before first retry (e.g., "5s", "1m"). Default "5s". */
|
|
22
|
+
retryDelay?: string;
|
|
23
|
+
/** Retry backoff strategy: 'fixed' (constant delay), 'linear' (delay * attempt), 'exponential' (delay * 2^attempt). Default 'exponential'. */
|
|
24
|
+
retryStrategy?: JobRetryStrategy;
|
|
25
|
+
/** Maximum execution time before cancellation (e.g., "5m"). */
|
|
26
|
+
timeout?: string;
|
|
27
|
+
/** Behavior when timer fires while job is already running. Default 'skip'. */
|
|
28
|
+
overlapPolicy?: JobOverlapPolicy;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=cli-job-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-options.d.ts","sourceRoot":"","sources":["../../src/jobs/cli-job-options.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,CAAC;AAElE,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8IAA8I;IAC9I,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,gBAAgB,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-options.js","sourceRoot":"","sources":["../../src/jobs/cli-job-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JobExecution, JobExecutionStatus } from './job-execution';
|
|
2
|
+
import { JobState } from './job-state';
|
|
3
|
+
/** Persistence provider for job execution records and job state. */
|
|
4
|
+
export interface ICliJobStorageProvider {
|
|
5
|
+
/** Persists or updates a job execution record. */
|
|
6
|
+
saveExecution(execution: JobExecution): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves paginated execution records for a job.
|
|
9
|
+
* @param jobId - Job identifier.
|
|
10
|
+
* @param options - Pagination and filter options.
|
|
11
|
+
* @returns Paginated result with items and total count.
|
|
12
|
+
*/
|
|
13
|
+
getExecutions(jobId: string, options?: {
|
|
14
|
+
limit?: number;
|
|
15
|
+
offset?: number;
|
|
16
|
+
status?: JobExecutionStatus;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
items: JobExecution[];
|
|
19
|
+
total: number;
|
|
20
|
+
}>;
|
|
21
|
+
/** Retrieves a single execution record by ID, or null if not found. */
|
|
22
|
+
getExecution(executionId: string): Promise<JobExecution | null>;
|
|
23
|
+
/** Persists the current state (active/paused/stopped) for a job. */
|
|
24
|
+
saveJobState(jobId: string, state: JobState): Promise<void>;
|
|
25
|
+
/** Retrieves the persisted state for a job, or null if none exists. */
|
|
26
|
+
getJobState(jobId: string): Promise<JobState | null>;
|
|
27
|
+
/** Retrieves all persisted job states keyed by job ID. */
|
|
28
|
+
getAllJobStates(): Promise<Map<string, JobState>>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=cli-job-storage-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-storage-provider.d.ts","sourceRoot":"","sources":["../../src/jobs/cli-job-storage-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACnC,kDAAkD;IAClD,aAAa,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;;;OAKG;IACH,aAAa,CACT,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,kBAAkB,CAAA;KAAE,GAC3E,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,uEAAuE;IACvE,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAChE,oEAAoE;IACpE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,uEAAuE;IACvE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACrD,0DAA0D;IAC1D,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job-storage-provider.js","sourceRoot":"","sources":["../../src/jobs/cli-job-storage-provider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICliJobExecutionContext } from './cli-job-execution-context';
|
|
2
|
+
/** A scheduled or on-demand background job. */
|
|
3
|
+
export interface ICliJob {
|
|
4
|
+
/**
|
|
5
|
+
* Executes the job's work.
|
|
6
|
+
* @param context - Execution context providing a logger.
|
|
7
|
+
* @param signal - Abort signal for cancellation and timeout.
|
|
8
|
+
*/
|
|
9
|
+
executeAsync(context: ICliJobExecutionContext, signal: AbortSignal): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=cli-job.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job.d.ts","sourceRoot":"","sources":["../../src/jobs/cli-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,+CAA+C;AAC/C,MAAM,WAAW,OAAO;IACpB;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-job.js","sourceRoot":"","sources":["../../src/jobs/cli-job.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ICliJob } from './cli-job';
|
|
2
|
+
export { ICliJobExecutionContext } from './cli-job-execution-context';
|
|
3
|
+
export { ICliJobLogger } from './cli-job-logger';
|
|
4
|
+
export { CliJobOptions, JobOverlapPolicy } from './cli-job-options';
|
|
5
|
+
export { ICliJobStorageProvider } from './cli-job-storage-provider';
|
|
6
|
+
export { JobExecution, JobExecutionStatus } from './job-execution';
|
|
7
|
+
export { JobState, JobStatus } from './job-state';
|
|
8
|
+
export { JobLogEntry, JobLogLevel } from './log-entry';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JobLogEntry } from './log-entry';
|
|
2
|
+
/** Possible terminal and in-progress states of a job execution. */
|
|
3
|
+
export type JobExecutionStatus = 'running' | 'completed' | 'failed' | 'cancelled' | 'timed_out';
|
|
4
|
+
/** Record of a single job execution attempt. */
|
|
5
|
+
export interface JobExecution {
|
|
6
|
+
/** Unique execution identifier. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Identifier of the job that was executed. */
|
|
9
|
+
jobId: string;
|
|
10
|
+
/** Display name of the job. */
|
|
11
|
+
jobName: string;
|
|
12
|
+
/** Current execution status. */
|
|
13
|
+
status: JobExecutionStatus;
|
|
14
|
+
/** ISO 8601 timestamp when execution started. */
|
|
15
|
+
startedAt: string;
|
|
16
|
+
/** ISO 8601 timestamp when execution completed (if finished). */
|
|
17
|
+
completedAt?: string;
|
|
18
|
+
/** Execution duration in milliseconds. */
|
|
19
|
+
duration?: number;
|
|
20
|
+
/** Error message if the execution failed. */
|
|
21
|
+
error?: string;
|
|
22
|
+
/** Log entries recorded during execution. */
|
|
23
|
+
logs: JobLogEntry[];
|
|
24
|
+
/** Zero-based retry attempt number. */
|
|
25
|
+
retryAttempt: number;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=job-execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-execution.d.ts","sourceRoot":"","sources":["../../src/jobs/job-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,mEAAmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;AAEhG,gDAAgD;AAChD,MAAM,WAAW,YAAY;IACzB,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-execution.js","sourceRoot":"","sources":["../../src/jobs/job-execution.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Lifecycle status of a registered job. */
|
|
2
|
+
export type JobStatus = 'active' | 'paused' | 'stopped';
|
|
3
|
+
/** Persisted state snapshot for a registered job. */
|
|
4
|
+
export interface JobState {
|
|
5
|
+
/** Current lifecycle status. */
|
|
6
|
+
status: JobStatus;
|
|
7
|
+
/** ISO 8601 timestamp of the last execution, if any. */
|
|
8
|
+
lastRunAt?: string;
|
|
9
|
+
/** ISO 8601 timestamp when the state was last modified. */
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=job-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-state.d.ts","sourceRoot":"","sources":["../../src/jobs/job-state.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACrB,gCAAgC;IAChC,MAAM,EAAE,SAAS,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-state.js","sourceRoot":"","sources":["../../src/jobs/job-state.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Severity levels for job log entries. */
|
|
2
|
+
export type JobLogLevel = 'debug' | 'info' | 'warning' | 'error';
|
|
3
|
+
/** A single log entry recorded during job execution. */
|
|
4
|
+
export interface JobLogEntry {
|
|
5
|
+
/** ISO 8601 timestamp when the entry was created. */
|
|
6
|
+
timestamp: string;
|
|
7
|
+
/** Severity level. */
|
|
8
|
+
level: JobLogLevel;
|
|
9
|
+
/** Log message content. */
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=log-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-entry.d.ts","sourceRoot":"","sources":["../../src/jobs/log-entry.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE,wDAAwD;AACxD,MAAM,WAAW,WAAW;IACxB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,KAAK,EAAE,WAAW,CAAC;IACnB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-entry.js","sourceRoot":"","sources":["../../src/jobs/log-entry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CliProcessCommand } from './cli-process-command';
|
|
2
|
+
/**
|
|
3
|
+
* Splits text into words like a shell, as the browser CLI does: whitespace
|
|
4
|
+
* separates words, quotes are removed (`"a b"` is one word `a b`), a backslash
|
|
5
|
+
* outside quotes escapes the next character (`my\ file` -> `my file`), and
|
|
6
|
+
* inside double quotes `\"` and `\\` are escapes. Single quotes keep their
|
|
7
|
+
* content as is. A quote without a closing one is text.
|
|
8
|
+
*/
|
|
9
|
+
export declare function splitShellWords(text: string): string[];
|
|
10
|
+
/**
|
|
11
|
+
* The arguments as a shell's echo prints them, as the browser CLI's own
|
|
12
|
+
* `echo` does: quotes removed, the words joined by one space, spacing inside
|
|
13
|
+
* quotes kept (`"a" "b"` -> `a b`). A quote without a closing one is text.
|
|
14
|
+
*/
|
|
15
|
+
export declare function joinShellWords(text: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* The positional arguments of a command, unquoted: `command.positionals` as the
|
|
18
|
+
* browser sends it, or, from clients that do not send it, `command.value`
|
|
19
|
+
* split with the same shell rules.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getPositionals(command: Pick<CliProcessCommand, 'positionals' | 'value'>): string[];
|
|
22
|
+
/** The positional arguments joined by one space (`base64 encode "a b"` -> `a b`); empty when there are none. */
|
|
23
|
+
export declare function getPositionalText(command: Pick<CliProcessCommand, 'positionals' | 'value'>): string;
|
|
24
|
+
/**
|
|
25
|
+
* Quotes a word for a command line so `splitShellWords` (and the browser CLI's
|
|
26
|
+
* parser) reads it back unchanged: as is when it has no spaces, quotes or
|
|
27
|
+
* special characters; in double quotes when it has no `"`; in single quotes
|
|
28
|
+
* when it has no `'`; otherwise in double quotes with `\"` and `\\` escapes.
|
|
29
|
+
*/
|
|
30
|
+
export declare function quoteShellWord(value: string): string;
|
|
31
|
+
//# sourceMappingURL=shell-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-words.d.ts","sourceRoot":"","sources":["../src/shell-words.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAe1D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BtD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,MAAM,EAAE,CAGlG;AAED,gHAAgH;AAChH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,MAAM,CAEnG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD"}
|