@qodalis/cli-server-node 1.0.0-beta.2 → 1.0.0-beta.4
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/src/abstractions/index.d.ts +1 -1
- package/dist/src/abstractions/index.d.ts.map +1 -1
- package/dist/src/abstractions/index.js.map +1 -1
- package/dist/src/create-cli-server.d.ts +3 -2
- package/dist/src/create-cli-server.d.ts.map +1 -1
- package/dist/src/create-cli-server.js +8 -7
- package/dist/src/create-cli-server.js.map +1 -1
- package/dist/src/extensions/cli-builder.d.ts +2 -0
- package/dist/src/extensions/cli-builder.d.ts.map +1 -1
- package/dist/src/extensions/cli-builder.js +5 -0
- package/dist/src/extensions/cli-builder.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/processors/index.d.ts +0 -1
- package/dist/src/processors/index.d.ts.map +1 -1
- package/dist/src/processors/index.js +1 -3
- package/dist/src/processors/index.js.map +1 -1
- package/dist/src/server.js +4 -6
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/cli-event-socket-manager.d.ts +16 -0
- package/dist/src/services/cli-event-socket-manager.d.ts.map +1 -1
- package/dist/src/services/cli-event-socket-manager.js +47 -5
- package/dist/src/services/cli-event-socket-manager.js.map +1 -1
- package/dist/src/services/cli-log-socket-manager.d.ts +51 -0
- package/dist/src/services/cli-log-socket-manager.d.ts.map +1 -0
- package/dist/src/services/cli-log-socket-manager.js +178 -0
- package/dist/src/services/cli-log-socket-manager.js.map +1 -0
- package/dist/src/services/index.d.ts +2 -1
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +3 -1
- package/dist/src/services/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/src/processors/cli-uuid-command-processor.d.ts +0 -10
- package/dist/src/processors/cli-uuid-command-processor.d.ts.map +0 -1
- package/dist/src/processors/cli-uuid-command-processor.js +0 -27
- package/dist/src/processors/cli-uuid-command-processor.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ICliCommandAuthor, CliCommandAuthor, DefaultLibraryAuthor, CliProcessCommand, ICliCommandParameterDescriptor, CliCommandParameterDescriptor, ICliCommandProcessor, CliCommandProcessor, ICliModule, CliModule, } from '@qodalis/cli-server-abstractions';
|
|
1
|
+
export { ICliCommandAuthor, CliCommandAuthor, DefaultLibraryAuthor, CliProcessCommand, ICliCommandParameterDescriptor, CliCommandParameterDescriptor, ICliCommandProcessor, CliCommandProcessor, ICliModule, CliModule, ICliJob, ICliJobExecutionContext, ICliJobLogger, CliJobOptions, JobOverlapPolicy, ICliJobStorageProvider, JobExecution, JobExecutionStatus, JobState, JobStatus, JobLogEntry, JobLogLevel, } from '@qodalis/cli-server-abstractions';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,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,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstractions/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstractions/index.ts"],"names":[],"mappings":";;;AAAA,4EAuB0C;AArBtC,2HAAA,gBAAgB,OAAA;AAChB,+HAAA,oBAAoB,OAAA;AAGpB,wIAAA,6BAA6B,OAAA;AAE7B,8HAAA,mBAAmB,OAAA;AAEnB,oHAAA,SAAS,OAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
2
|
import cors from 'cors';
|
|
3
|
-
import { CliCommandRegistry, CliEventSocketManager } from './services';
|
|
3
|
+
import { CliCommandRegistry, CliEventSocketManager, CliLogSocketManager } from './services';
|
|
4
4
|
import { CliBuilder } from './extensions';
|
|
5
5
|
export interface CliServerOptions {
|
|
6
|
-
/** Base path for CLI routes. Defaults to '/api/
|
|
6
|
+
/** Base path for CLI routes. Defaults to '/api/qcli'. */
|
|
7
7
|
basePath?: string;
|
|
8
8
|
/** CORS configuration. Pass `true` for permissive, `false` to disable, or a cors options object. */
|
|
9
9
|
cors?: boolean | cors.CorsOptions;
|
|
@@ -21,5 +21,6 @@ export declare function createCliServer(options?: CliServerOptions): {
|
|
|
21
21
|
registry: CliCommandRegistry;
|
|
22
22
|
builder: CliBuilder;
|
|
23
23
|
eventSocketManager: CliEventSocketManager;
|
|
24
|
+
logSocketManager: CliLogSocketManager;
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=create-cli-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cli-server.d.ts","sourceRoot":"","sources":["../../src/create-cli-server.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAA6B,qBAAqB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"create-cli-server.d.ts","sourceRoot":"","sources":["../../src/create-cli-server.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAA6B,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACvH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,MAAM,WAAW,gBAAgB;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oGAAoG;IACpG,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;IAClC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG;IAC7D,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC;IACpB,kBAAkB,EAAE,qBAAqB,CAAC;IAC1C,gBAAgB,EAAE,mBAAmB,CAAC;CACzC,CAgDA"}
|
|
@@ -20,7 +20,7 @@ const cli_server_plugin_filesystem_1 = require("@qodalis/cli-server-plugin-files
|
|
|
20
20
|
* Express app, use `createCliController` directly instead.
|
|
21
21
|
*/
|
|
22
22
|
function createCliServer(options = {}) {
|
|
23
|
-
const { basePath = '/api/
|
|
23
|
+
const { basePath = '/api/qcli', cors: corsOption = true, configure } = options;
|
|
24
24
|
const app = (0, express_1.default)();
|
|
25
25
|
if (corsOption !== false) {
|
|
26
26
|
app.use((0, cors_1.default)(corsOption === true ? undefined : corsOption));
|
|
@@ -33,13 +33,13 @@ function createCliServer(options = {}) {
|
|
|
33
33
|
}
|
|
34
34
|
const executor = new services_1.CliCommandExecutorService(registry);
|
|
35
35
|
// Version discovery endpoint
|
|
36
|
-
app.use('/api/
|
|
36
|
+
app.use('/api/qcli', (0, cli_version_controller_1.createCliVersionController)());
|
|
37
37
|
// API v1 routes
|
|
38
|
-
app.use('/api/v1/
|
|
38
|
+
app.use('/api/v1/qcli', (0, cli_controller_1.createCliController)(registry, executor));
|
|
39
39
|
// API v2 routes
|
|
40
|
-
app.use('/api/v2/
|
|
40
|
+
app.use('/api/v2/qcli', (0, cli_controller_v2_1.createCliControllerV2)(registry, executor));
|
|
41
41
|
// Custom basePath fallback (when user overrides the default)
|
|
42
|
-
if (basePath !== '/api/v1/
|
|
42
|
+
if (basePath !== '/api/v1/qcli' && basePath !== '/api/v2/qcli') {
|
|
43
43
|
app.use(basePath, (0, cli_controller_1.createCliController)(registry, executor));
|
|
44
44
|
}
|
|
45
45
|
// Filesystem API — provider-based
|
|
@@ -49,9 +49,10 @@ function createCliServer(options = {}) {
|
|
|
49
49
|
fsProvider = new cli_server_plugin_filesystem_1.OsFileStorageProvider(builder.fileSystemOptions);
|
|
50
50
|
}
|
|
51
51
|
if (fsProvider) {
|
|
52
|
-
app.use('/api/
|
|
52
|
+
app.use('/api/qcli/fs', (0, filesystem_controller_1.createFilesystemRouter)(fsProvider));
|
|
53
53
|
}
|
|
54
54
|
const eventSocketManager = new services_1.CliEventSocketManager();
|
|
55
|
-
|
|
55
|
+
const logSocketManager = new services_1.CliLogSocketManager();
|
|
56
|
+
return { app, registry, builder, eventSocketManager, logSocketManager };
|
|
56
57
|
}
|
|
57
58
|
//# sourceMappingURL=create-cli-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cli-server.js","sourceRoot":"","sources":["../../src/create-cli-server.ts"],"names":[],"mappings":";;;;;AAyBA,
|
|
1
|
+
{"version":3,"file":"create-cli-server.js","sourceRoot":"","sources":["../../src/create-cli-server.ts"],"names":[],"mappings":";;;;;AAyBA,0CAsDC;AA/ED,sDAA2C;AA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KAAK,cAAc,EAAE,CAAC;QAC7D,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAA,oCAAmB,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,kCAAkC;IAClC,IAAI,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAC7C,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC3C,8EAA8E;QAC9E,UAAU,GAAG,IAAI,oDAAqB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,UAAU,EAAE,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,IAAA,8CAAsB,EAAC,UAAU,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAI,gCAAqB,EAAE,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAI,8BAAmB,EAAE,CAAC;IAEnD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -4,11 +4,13 @@ import { IFileStorageProvider } from '@qodalis/cli-server-plugin-filesystem';
|
|
|
4
4
|
import { CliCommandRegistry } from '../services';
|
|
5
5
|
export declare class CliBuilder {
|
|
6
6
|
private readonly _registry;
|
|
7
|
+
private readonly _modules;
|
|
7
8
|
private _fileSystemOptions?;
|
|
8
9
|
private _fileStorageProvider?;
|
|
9
10
|
constructor(registry: CliCommandRegistry);
|
|
10
11
|
addProcessor(processor: ICliCommandProcessor): CliBuilder;
|
|
11
12
|
addModule(module: ICliModule): CliBuilder;
|
|
13
|
+
get modules(): ReadonlyArray<ICliModule>;
|
|
12
14
|
addFileSystem(options: FileSystemOptions): CliBuilder;
|
|
13
15
|
get registry(): CliCommandRegistry;
|
|
14
16
|
setFileStorageProvider(provider: IFileStorageProvider): CliBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-builder.d.ts","sourceRoot":"","sources":["../../../src/extensions/cli-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,kBAAkB,CAAC,CAAoB;IAC/C,OAAO,CAAC,oBAAoB,CAAC,CAAuB;gBAExC,QAAQ,EAAE,kBAAkB;IAIxC,YAAY,CAAC,SAAS,EAAE,oBAAoB,GAAG,UAAU;IAKzD,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;
|
|
1
|
+
{"version":3,"file":"cli-builder.d.ts","sourceRoot":"","sources":["../../../src/extensions/cli-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,kBAAkB,CAAC,CAAoB;IAC/C,OAAO,CAAC,oBAAoB,CAAC,CAAuB;gBAExC,QAAQ,EAAE,kBAAkB;IAIxC,YAAY,CAAC,SAAS,EAAE,oBAAoB,GAAG,UAAU;IAKzD,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;IAQzC,IAAI,OAAO,IAAI,aAAa,CAAC,UAAU,CAAC,CAEvC;IAED,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU;IAKrD,IAAI,QAAQ,IAAI,kBAAkB,CAEjC;IAED,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,UAAU;IAKlE,IAAI,iBAAiB,IAAI,iBAAiB,GAAG,SAAS,CAErD;IAED,IAAI,mBAAmB,IAAI,oBAAoB,GAAG,SAAS,CAE1D;CACJ"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CliBuilder = void 0;
|
|
4
4
|
class CliBuilder {
|
|
5
5
|
_registry;
|
|
6
|
+
_modules = [];
|
|
6
7
|
_fileSystemOptions;
|
|
7
8
|
_fileStorageProvider;
|
|
8
9
|
constructor(registry) {
|
|
@@ -13,11 +14,15 @@ class CliBuilder {
|
|
|
13
14
|
return this;
|
|
14
15
|
}
|
|
15
16
|
addModule(module) {
|
|
17
|
+
this._modules.push(module);
|
|
16
18
|
for (const processor of module.processors) {
|
|
17
19
|
this._registry.register(processor);
|
|
18
20
|
}
|
|
19
21
|
return this;
|
|
20
22
|
}
|
|
23
|
+
get modules() {
|
|
24
|
+
return this._modules;
|
|
25
|
+
}
|
|
21
26
|
addFileSystem(options) {
|
|
22
27
|
this._fileSystemOptions = options;
|
|
23
28
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-builder.js","sourceRoot":"","sources":["../../../src/extensions/cli-builder.ts"],"names":[],"mappings":";;;AAKA,MAAa,UAAU;IACF,SAAS,CAAqB;
|
|
1
|
+
{"version":3,"file":"cli-builder.js","sourceRoot":"","sources":["../../../src/extensions/cli-builder.ts"],"names":[],"mappings":";;;AAKA,MAAa,UAAU;IACF,SAAS,CAAqB;IAC9B,QAAQ,GAAiB,EAAE,CAAC;IACrC,kBAAkB,CAAqB;IACvC,oBAAoB,CAAwB;IAEpD,YAAY,QAA4B;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED,YAAY,CAAC,SAA+B;QACxC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,MAAkB;QACxB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,aAAa,CAAC,OAA0B;QACpC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;QAClC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,sBAAsB,CAAC,QAA8B;QACjD,IAAI,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QACrC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,iBAAiB;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,IAAI,mBAAmB;QACnB,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;CACJ;AAhDD,gCAgDC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { ICliCommandAuthor, CliCommandAuthor, DefaultLibraryAuthor, CliProcessCommand, ICliCommandParameterDescriptor, CliCommandParameterDescriptor, ICliCommandProcessor, CliCommandProcessor, ICliModule, CliModule, } from './abstractions';
|
|
2
2
|
export { CliServerOutput, CliServerResponse, CliServerCommandDescriptor, CliServerCommandParameterDescriptorDto, } from './models';
|
|
3
|
-
export { ICliCommandRegistry, CliCommandRegistry, ICliResponseBuilder, CliResponseBuilder, ICliCommandExecutorService, CliCommandExecutorService, CliEventSocketManager, CliShellSessionManager, } from './services';
|
|
3
|
+
export { ICliCommandRegistry, CliCommandRegistry, ICliResponseBuilder, CliResponseBuilder, ICliCommandExecutorService, CliCommandExecutorService, CliEventSocketManager, CliShellSessionManager, CliLogSocketManager, } from './services';
|
|
4
4
|
export { createCliController } from './controllers/cli-controller';
|
|
5
5
|
export { createCliControllerV2 } from './controllers/cli-controller-v2';
|
|
6
6
|
export { createCliVersionController } from './controllers/cli-version-controller';
|
|
7
7
|
export { createFilesystemRouter } from './controllers/filesystem-controller';
|
|
8
8
|
export { CliBuilder } from './extensions';
|
|
9
|
+
export { CliJobsBuilder, CliJobScheduler, CliJobExecutionContext, CliJobLogger, InMemoryJobStorageProvider, JobDto, JobError, parseInterval, createCliJobsController, } from '@qodalis/cli-server-plugin-jobs';
|
|
9
10
|
export { FileSystemOptions, FileSystemPathValidator } from './filesystem';
|
|
10
11
|
export { IFileStorageProvider, FileEntry, FileStat, InMemoryFileStorageProvider, OsFileStorageProvider, OsProviderOptions, FileSystemModule, FileNotFoundError, PermissionDeniedError, FileExistsError, NotADirectoryError, IsADirectoryError, } from '@qodalis/cli-server-plugin-filesystem';
|
|
11
12
|
export { JsonFileStorageProvider, JsonFileProviderOptions } from '@qodalis/cli-server-plugin-filesystem-json';
|
|
@@ -17,6 +18,5 @@ export { CliSystemCommandProcessor } from './processors/cli-system-command-proce
|
|
|
17
18
|
export { CliHttpCommandProcessor } from './processors/cli-http-command-processor';
|
|
18
19
|
export { CliHashCommandProcessor } from './processors/cli-hash-command-processor';
|
|
19
20
|
export { CliBase64CommandProcessor } from './processors/cli-base64-command-processor';
|
|
20
|
-
export { CliUuidCommandProcessor } from './processors/cli-uuid-command-processor';
|
|
21
21
|
export { createCliServer, CliServerOptions } from './create-cli-server';
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,SAAS,GACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,sCAAsC,GACzC,MAAM,UAAU,CAAC;AAGlB,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,SAAS,GACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,sCAAsC,GACzC,MAAM,UAAU,CAAC;AAGlB,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAG7E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EACH,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,0BAA0B,EAC1B,MAAM,EACN,QAAQ,EACR,aAAa,EACb,uBAAuB,GAC1B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EACH,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,GACpB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAG9G,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGhH,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAGpG,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCliServer = exports.
|
|
3
|
+
exports.createCliServer = exports.CliBase64CommandProcessor = exports.CliHashCommandProcessor = exports.CliHttpCommandProcessor = exports.CliSystemCommandProcessor = exports.CliStatusCommandProcessor = exports.CliEchoCommandProcessor = exports.S3FileStorageProvider = exports.SqliteFileStorageProvider = exports.JsonFileStorageProvider = exports.IsADirectoryError = exports.NotADirectoryError = exports.FileExistsError = exports.PermissionDeniedError = exports.FileNotFoundError = exports.FileSystemModule = exports.OsFileStorageProvider = exports.InMemoryFileStorageProvider = exports.FileSystemPathValidator = exports.createCliJobsController = exports.parseInterval = exports.JobError = exports.InMemoryJobStorageProvider = exports.CliJobLogger = exports.CliJobExecutionContext = exports.CliJobScheduler = exports.CliJobsBuilder = exports.CliBuilder = exports.createFilesystemRouter = exports.createCliVersionController = exports.createCliControllerV2 = exports.createCliController = exports.CliLogSocketManager = exports.CliShellSessionManager = exports.CliEventSocketManager = exports.CliCommandExecutorService = exports.CliResponseBuilder = exports.CliCommandRegistry = exports.CliModule = exports.CliCommandProcessor = exports.CliCommandParameterDescriptor = exports.DefaultLibraryAuthor = exports.CliCommandAuthor = void 0;
|
|
4
4
|
// Abstractions
|
|
5
5
|
var abstractions_1 = require("./abstractions");
|
|
6
6
|
Object.defineProperty(exports, "CliCommandAuthor", { enumerable: true, get: function () { return abstractions_1.CliCommandAuthor; } });
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "CliResponseBuilder", { enumerable: true, get: fu
|
|
|
15
15
|
Object.defineProperty(exports, "CliCommandExecutorService", { enumerable: true, get: function () { return services_1.CliCommandExecutorService; } });
|
|
16
16
|
Object.defineProperty(exports, "CliEventSocketManager", { enumerable: true, get: function () { return services_1.CliEventSocketManager; } });
|
|
17
17
|
Object.defineProperty(exports, "CliShellSessionManager", { enumerable: true, get: function () { return services_1.CliShellSessionManager; } });
|
|
18
|
+
Object.defineProperty(exports, "CliLogSocketManager", { enumerable: true, get: function () { return services_1.CliLogSocketManager; } });
|
|
18
19
|
// Controllers
|
|
19
20
|
var cli_controller_1 = require("./controllers/cli-controller");
|
|
20
21
|
Object.defineProperty(exports, "createCliController", { enumerable: true, get: function () { return cli_controller_1.createCliController; } });
|
|
@@ -27,6 +28,16 @@ Object.defineProperty(exports, "createFilesystemRouter", { enumerable: true, get
|
|
|
27
28
|
// Extensions
|
|
28
29
|
var extensions_1 = require("./extensions");
|
|
29
30
|
Object.defineProperty(exports, "CliBuilder", { enumerable: true, get: function () { return extensions_1.CliBuilder; } });
|
|
31
|
+
// Jobs plugin (re-export for backward compatibility)
|
|
32
|
+
var cli_server_plugin_jobs_1 = require("@qodalis/cli-server-plugin-jobs");
|
|
33
|
+
Object.defineProperty(exports, "CliJobsBuilder", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.CliJobsBuilder; } });
|
|
34
|
+
Object.defineProperty(exports, "CliJobScheduler", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.CliJobScheduler; } });
|
|
35
|
+
Object.defineProperty(exports, "CliJobExecutionContext", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.CliJobExecutionContext; } });
|
|
36
|
+
Object.defineProperty(exports, "CliJobLogger", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.CliJobLogger; } });
|
|
37
|
+
Object.defineProperty(exports, "InMemoryJobStorageProvider", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.InMemoryJobStorageProvider; } });
|
|
38
|
+
Object.defineProperty(exports, "JobError", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.JobError; } });
|
|
39
|
+
Object.defineProperty(exports, "parseInterval", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.parseInterval; } });
|
|
40
|
+
Object.defineProperty(exports, "createCliJobsController", { enumerable: true, get: function () { return cli_server_plugin_jobs_1.createCliJobsController; } });
|
|
30
41
|
// Filesystem (legacy)
|
|
31
42
|
var filesystem_1 = require("./filesystem");
|
|
32
43
|
Object.defineProperty(exports, "FileSystemPathValidator", { enumerable: true, get: function () { return filesystem_1.FileSystemPathValidator; } });
|
|
@@ -62,8 +73,6 @@ var cli_hash_command_processor_1 = require("./processors/cli-hash-command-proces
|
|
|
62
73
|
Object.defineProperty(exports, "CliHashCommandProcessor", { enumerable: true, get: function () { return cli_hash_command_processor_1.CliHashCommandProcessor; } });
|
|
63
74
|
var cli_base64_command_processor_1 = require("./processors/cli-base64-command-processor");
|
|
64
75
|
Object.defineProperty(exports, "CliBase64CommandProcessor", { enumerable: true, get: function () { return cli_base64_command_processor_1.CliBase64CommandProcessor; } });
|
|
65
|
-
var cli_uuid_command_processor_1 = require("./processors/cli-uuid-command-processor");
|
|
66
|
-
Object.defineProperty(exports, "CliUuidCommandProcessor", { enumerable: true, get: function () { return cli_uuid_command_processor_1.CliUuidCommandProcessor; } });
|
|
67
76
|
// Server factory
|
|
68
77
|
var create_cli_server_1 = require("./create-cli-server");
|
|
69
78
|
Object.defineProperty(exports, "createCliServer", { enumerable: true, get: function () { return create_cli_server_1.createCliServer; } });
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,eAAe;AACf,+CAWwB;AATpB,gHAAA,gBAAgB,OAAA;AAChB,oHAAA,oBAAoB,OAAA;AAGpB,6HAAA,6BAA6B,OAAA;AAE7B,mHAAA,mBAAmB,OAAA;AAEnB,yGAAA,SAAS,OAAA;AAWb,WAAW;AACX,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,eAAe;AACf,+CAWwB;AATpB,gHAAA,gBAAgB,OAAA;AAChB,oHAAA,oBAAoB,OAAA;AAGpB,6HAAA,6BAA6B,OAAA;AAE7B,mHAAA,mBAAmB,OAAA;AAEnB,yGAAA,SAAS,OAAA;AAWb,WAAW;AACX,uCAUoB;AARhB,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAElB,qHAAA,yBAAyB,OAAA;AACzB,iHAAA,qBAAqB,OAAA;AACrB,kHAAA,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;AAChC,0FAAsF;AAA7E,yIAAA,yBAAyB,OAAA;AAElC,iBAAiB;AACjB,yDAAwE;AAA/D,oHAAA,eAAe,OAAA"}
|
|
@@ -4,5 +4,4 @@ export { CliSystemCommandProcessor } from './cli-system-command-processor';
|
|
|
4
4
|
export { CliHttpCommandProcessor } from './cli-http-command-processor';
|
|
5
5
|
export { CliHashCommandProcessor } from './cli-hash-command-processor';
|
|
6
6
|
export { CliBase64CommandProcessor } from './cli-base64-command-processor';
|
|
7
|
-
export { CliUuidCommandProcessor } from './cli-uuid-command-processor';
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/processors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/processors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CliBase64CommandProcessor = exports.CliHashCommandProcessor = exports.CliHttpCommandProcessor = exports.CliSystemCommandProcessor = exports.CliStatusCommandProcessor = exports.CliEchoCommandProcessor = void 0;
|
|
4
4
|
var cli_echo_command_processor_1 = require("./cli-echo-command-processor");
|
|
5
5
|
Object.defineProperty(exports, "CliEchoCommandProcessor", { enumerable: true, get: function () { return cli_echo_command_processor_1.CliEchoCommandProcessor; } });
|
|
6
6
|
var cli_status_command_processor_1 = require("./cli-status-command-processor");
|
|
@@ -13,6 +13,4 @@ var cli_hash_command_processor_1 = require("./cli-hash-command-processor");
|
|
|
13
13
|
Object.defineProperty(exports, "CliHashCommandProcessor", { enumerable: true, get: function () { return cli_hash_command_processor_1.CliHashCommandProcessor; } });
|
|
14
14
|
var cli_base64_command_processor_1 = require("./cli-base64-command-processor");
|
|
15
15
|
Object.defineProperty(exports, "CliBase64CommandProcessor", { enumerable: true, get: function () { return cli_base64_command_processor_1.CliBase64CommandProcessor; } });
|
|
16
|
-
var cli_uuid_command_processor_1 = require("./cli-uuid-command-processor");
|
|
17
|
-
Object.defineProperty(exports, "CliUuidCommandProcessor", { enumerable: true, get: function () { return cli_uuid_command_processor_1.CliUuidCommandProcessor; } });
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/processors/index.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/processors/index.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA"}
|
package/dist/src/server.js
CHANGED
|
@@ -8,7 +8,6 @@ const cli_system_command_processor_1 = require("./processors/cli-system-command-
|
|
|
8
8
|
const cli_http_command_processor_1 = require("./processors/cli-http-command-processor");
|
|
9
9
|
const cli_hash_command_processor_1 = require("./processors/cli-hash-command-processor");
|
|
10
10
|
const cli_base64_command_processor_1 = require("./processors/cli-base64-command-processor");
|
|
11
|
-
const cli_uuid_command_processor_1 = require("./processors/cli-uuid-command-processor");
|
|
12
11
|
const cli_server_plugin_weather_1 = require("@qodalis/cli-server-plugin-weather");
|
|
13
12
|
const port = process.env.PORT ?? 8047;
|
|
14
13
|
const { app, eventSocketManager } = (0, create_cli_server_1.createCliServer)({
|
|
@@ -20,16 +19,15 @@ const { app, eventSocketManager } = (0, create_cli_server_1.createCliServer)({
|
|
|
20
19
|
.addProcessor(new cli_http_command_processor_1.CliHttpCommandProcessor())
|
|
21
20
|
.addProcessor(new cli_hash_command_processor_1.CliHashCommandProcessor())
|
|
22
21
|
.addProcessor(new cli_base64_command_processor_1.CliBase64CommandProcessor())
|
|
23
|
-
.addProcessor(new cli_uuid_command_processor_1.CliUuidCommandProcessor())
|
|
24
22
|
.addModule(new cli_server_plugin_weather_1.WeatherModule());
|
|
25
23
|
},
|
|
26
24
|
});
|
|
27
25
|
const server = app.listen(port, () => {
|
|
28
26
|
console.log(`CLI server (Node.js) listening on http://localhost:${port}`);
|
|
29
|
-
console.log(` Commands: http://localhost:${port}/api/v1/
|
|
30
|
-
console.log(` Execute: http://localhost:${port}/api/v1/
|
|
31
|
-
console.log(` Capabilities: http://localhost:${port}/api/v1/
|
|
32
|
-
console.log(` Events: ws://localhost:${port}/ws/v1/
|
|
27
|
+
console.log(` Commands: http://localhost:${port}/api/v1/qcli/commands`);
|
|
28
|
+
console.log(` Execute: http://localhost:${port}/api/v1/qcli/execute`);
|
|
29
|
+
console.log(` Capabilities: http://localhost:${port}/api/v1/qcli/capabilities`);
|
|
30
|
+
console.log(` Events: ws://localhost:${port}/ws/v1/qcli/events`);
|
|
33
31
|
});
|
|
34
32
|
eventSocketManager.attach(server);
|
|
35
33
|
process.on('SIGINT', async () => {
|
package/dist/src/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";;;AAEA,2DAAsD;AACtD,wFAAkF;AAClF,4FAAsF;AACtF,4FAAsF;AACtF,wFAAkF;AAClF,wFAAkF;AAClF,4FAAsF;AACtF,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";;;AAEA,2DAAsD;AACtD,wFAAkF;AAClF,4FAAsF;AACtF,4FAAsF;AACtF,wFAAkF;AAClF,wFAAkF;AAClF,4FAAsF;AACtF,kFAAmE;AAEnE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;AAEtC,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,IAAA,mCAAe,EAAC;IAChD,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;QACnB,OAAO;aACF,YAAY,CAAC,IAAI,oDAAuB,EAAE,CAAC;aAC3C,YAAY,CAAC,IAAI,wDAAyB,EAAE,CAAC;aAC7C,YAAY,CAAC,IAAI,wDAAyB,EAAE,CAAC;aAC7C,YAAY,CAAC,IAAI,oDAAuB,EAAE,CAAC;aAC3C,YAA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
|
+
connectedAt: string;
|
|
5
|
+
remoteAddress: string;
|
|
6
|
+
type: 'events';
|
|
7
|
+
}
|
|
2
8
|
export declare class CliEventSocketManager {
|
|
3
9
|
private _wss;
|
|
4
10
|
private readonly _clients;
|
|
11
|
+
private readonly _clientMeta;
|
|
5
12
|
private readonly _shellManager;
|
|
13
|
+
private _nextClientId;
|
|
6
14
|
private static readonly EVENT_PATHS;
|
|
7
15
|
private static readonly SHELL_PATHS;
|
|
8
16
|
/**
|
|
@@ -10,10 +18,18 @@ export declare class CliEventSocketManager {
|
|
|
10
18
|
* event and shell paths.
|
|
11
19
|
*/
|
|
12
20
|
attach(server: Server): void;
|
|
21
|
+
/**
|
|
22
|
+
* Broadcast an arbitrary message to all connected event clients.
|
|
23
|
+
*/
|
|
24
|
+
broadcastMessage(message: Record<string, unknown>): void;
|
|
13
25
|
/**
|
|
14
26
|
* Broadcast a disconnect event to all connected clients and close sockets.
|
|
15
27
|
*/
|
|
16
28
|
broadcastDisconnect(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Return information about all currently connected event clients.
|
|
31
|
+
*/
|
|
32
|
+
getClients(): CliWebSocketClientInfo[];
|
|
17
33
|
dispose(): void;
|
|
18
34
|
}
|
|
19
35
|
//# sourceMappingURL=cli-event-socket-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-event-socket-manager.d.ts","sourceRoot":"","sources":["../../../src/services/cli-event-socket-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-event-socket-manager.d.ts","sourceRoot":"","sources":["../../../src/services/cli-event-socket-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAmB,MAAM,MAAM,CAAC;AAIpD,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;CAClB;AAQD,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,IAAI,CAAgC;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IACjD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqC;IACjE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAGhC;IAEH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAGhC;IAEH;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAwD5B;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IASxD;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB1C;;OAEG;IACH,UAAU,IAAI,sBAAsB,EAAE;IAkBtC,OAAO,IAAI,IAAI;CAQlB"}
|
|
@@ -7,14 +7,16 @@ const cli_shell_session_manager_1 = require("./cli-shell-session-manager");
|
|
|
7
7
|
class CliEventSocketManager {
|
|
8
8
|
_wss = null;
|
|
9
9
|
_clients = new Set();
|
|
10
|
+
_clientMeta = new Map();
|
|
10
11
|
_shellManager = new cli_shell_session_manager_1.CliShellSessionManager();
|
|
12
|
+
_nextClientId = 1;
|
|
11
13
|
static EVENT_PATHS = new Set([
|
|
12
|
-
'/ws/v1/
|
|
13
|
-
'/ws/
|
|
14
|
+
'/ws/v1/qcli/events',
|
|
15
|
+
'/ws/qcli/events',
|
|
14
16
|
]);
|
|
15
17
|
static SHELL_PATHS = new Set([
|
|
16
|
-
'/ws/v1/
|
|
17
|
-
'/ws/
|
|
18
|
+
'/ws/v1/qcli/shell',
|
|
19
|
+
'/ws/qcli/shell',
|
|
18
20
|
]);
|
|
19
21
|
/**
|
|
20
22
|
* Attach to an HTTP server and listen for WebSocket upgrades on
|
|
@@ -50,17 +52,35 @@ class CliEventSocketManager {
|
|
|
50
52
|
}
|
|
51
53
|
// Not our path — let other handlers deal with it
|
|
52
54
|
});
|
|
53
|
-
this._wss.on('connection', (ws) => {
|
|
55
|
+
this._wss.on('connection', (ws, request) => {
|
|
54
56
|
this._clients.add(ws);
|
|
57
|
+
this._clientMeta.set(ws, {
|
|
58
|
+
id: `evt-${this._nextClientId++}`,
|
|
59
|
+
connectedAt: new Date(),
|
|
60
|
+
remoteAddress: request.socket.remoteAddress ?? 'unknown',
|
|
61
|
+
});
|
|
55
62
|
ws.send(JSON.stringify({ type: 'connected' }));
|
|
56
63
|
ws.on('close', () => {
|
|
57
64
|
this._clients.delete(ws);
|
|
65
|
+
this._clientMeta.delete(ws);
|
|
58
66
|
});
|
|
59
67
|
ws.on('error', () => {
|
|
60
68
|
this._clients.delete(ws);
|
|
69
|
+
this._clientMeta.delete(ws);
|
|
61
70
|
});
|
|
62
71
|
});
|
|
63
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Broadcast an arbitrary message to all connected event clients.
|
|
75
|
+
*/
|
|
76
|
+
broadcastMessage(message) {
|
|
77
|
+
const data = JSON.stringify(message);
|
|
78
|
+
for (const ws of this._clients) {
|
|
79
|
+
if (ws.readyState === ws_1.WebSocket.OPEN) {
|
|
80
|
+
ws.send(data);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
64
84
|
/**
|
|
65
85
|
* Broadcast a disconnect event to all connected clients and close sockets.
|
|
66
86
|
*/
|
|
@@ -79,12 +99,34 @@ class CliEventSocketManager {
|
|
|
79
99
|
}
|
|
80
100
|
await Promise.all(promises);
|
|
81
101
|
this._clients.clear();
|
|
102
|
+
this._clientMeta.clear();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Return information about all currently connected event clients.
|
|
106
|
+
*/
|
|
107
|
+
getClients() {
|
|
108
|
+
const result = [];
|
|
109
|
+
for (const ws of this._clients) {
|
|
110
|
+
if (ws.readyState === ws_1.WebSocket.OPEN) {
|
|
111
|
+
const meta = this._clientMeta.get(ws);
|
|
112
|
+
if (meta) {
|
|
113
|
+
result.push({
|
|
114
|
+
id: meta.id,
|
|
115
|
+
connectedAt: meta.connectedAt.toISOString(),
|
|
116
|
+
remoteAddress: meta.remoteAddress,
|
|
117
|
+
type: 'events',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
82
123
|
}
|
|
83
124
|
dispose() {
|
|
84
125
|
for (const ws of this._clients) {
|
|
85
126
|
ws.terminate();
|
|
86
127
|
}
|
|
87
128
|
this._clients.clear();
|
|
129
|
+
this._clientMeta.clear();
|
|
88
130
|
this._wss?.close();
|
|
89
131
|
}
|
|
90
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-event-socket-manager.js","sourceRoot":"","sources":["../../../src/services/cli-event-socket-manager.ts"],"names":[],"mappings":";;;AAAA,2BAAgD;AAEhD,6BAA0B;AAC1B,2EAAqE;
|
|
1
|
+
{"version":3,"file":"cli-event-socket-manager.js","sourceRoot":"","sources":["../../../src/services/cli-event-socket-manager.ts"],"names":[],"mappings":";;;AAAA,2BAAgD;AAEhD,6BAA0B;AAC1B,2EAAqE;AAerE,MAAa,qBAAqB;IACtB,IAAI,GAA2B,IAAI,CAAC;IAC3B,QAAQ,GAAG,IAAI,GAAG,EAAa,CAAC;IAChC,WAAW,GAAG,IAAI,GAAG,EAA0B,CAAC;IAChD,aAAa,GAAG,IAAI,kDAAsB,EAAE,CAAC;IACtD,aAAa,GAAG,CAAC,CAAC;IAElB,MAAM,CAAU,WAAW,GAAG,IAAI,GAAG,CAAC;QAC1C,oBAAoB;QACpB,iBAAiB;KACpB,CAAC,CAAC;IAEK,MAAM,CAAU,WAAW,GAAG,IAAI,GAAG,CAAC;QAC1C,mBAAmB;QACnB,gBAAgB;KACnB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AAK,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,UAAU;QACN,MAAM,MAAM,GAA6B,EAAE,CAAC;QAC5C,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7B,IAAI,EAAE,CAAC,UAAU,KAAK,cAAS,CAAC,IAAI,EAAE,CAAC;gBACnC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACtC,IAAI,IAAI,EAAE,CAAC;oBACP,MAAM,CAAC,IAAI,CAAC;wBACR,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;wBAC3C,aAAa,EAAE,IAAI,CAAC,aAAa;wBACjC,IAAI,EAAE,QAAQ;qBACjB,CAAC,CAAC;gBACP,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,OAAO;QACH,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7B,EAAE,CAAC,SAAS,EAAE,CAAC;QACnB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACvB,CAAC;;AA/IL,sDAgJC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Server } from 'http';
|
|
2
|
+
export interface CliLogWebSocketClientInfo {
|
|
3
|
+
id: string;
|
|
4
|
+
connectedAt: string;
|
|
5
|
+
remoteAddress: string;
|
|
6
|
+
levelFilter: string | null;
|
|
7
|
+
type: 'logs';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Manages WebSocket connections for streaming log messages to clients.
|
|
11
|
+
*
|
|
12
|
+
* Parity with CliLogSocketManager in the .NET and Python servers.
|
|
13
|
+
* Handles `/ws/v1/qcli/logs` and `/ws/qcli/logs` upgrade paths.
|
|
14
|
+
*/
|
|
15
|
+
export declare class CliLogSocketManager {
|
|
16
|
+
private _wss;
|
|
17
|
+
private readonly _clients;
|
|
18
|
+
private _nextClientId;
|
|
19
|
+
private static readonly LOG_PATHS;
|
|
20
|
+
/**
|
|
21
|
+
* Check whether a log at `logLevel` passes the `filterLevel` gate.
|
|
22
|
+
*/
|
|
23
|
+
static shouldSendLog(filterLevel: string | null, logLevel: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Format a log message as a JSON string matching the cross-server schema.
|
|
26
|
+
*/
|
|
27
|
+
static formatLogMessage(level: string, message: string, category?: string | null): string;
|
|
28
|
+
/**
|
|
29
|
+
* Attach to an HTTP server and handle WebSocket upgrades on log paths.
|
|
30
|
+
*
|
|
31
|
+
* If you already have a `CliEventSocketManager` attached, call this
|
|
32
|
+
* method on the same `server` — Node's `upgrade` event supports
|
|
33
|
+
* multiple listeners, and each manager only handles its own paths.
|
|
34
|
+
*/
|
|
35
|
+
attach(server: Server): void;
|
|
36
|
+
/**
|
|
37
|
+
* Broadcast a log message to all connected clients whose filter allows it.
|
|
38
|
+
*/
|
|
39
|
+
broadcastLog(level: string, message: string, category?: string | null): void;
|
|
40
|
+
/**
|
|
41
|
+
* Send a disconnect message to all clients and close connections.
|
|
42
|
+
*/
|
|
43
|
+
broadcastDisconnect(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Return information about all currently connected log clients.
|
|
46
|
+
*/
|
|
47
|
+
getClients(): CliLogWebSocketClientInfo[];
|
|
48
|
+
dispose(): void;
|
|
49
|
+
private _handleConnection;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=cli-log-socket-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-log-socket-manager.d.ts","sourceRoot":"","sources":["../../../src/services/cli-log-socket-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAmB,MAAM,MAAM,CAAC;AAGpD,MAAM,WAAW,yBAAyB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CAChB;AAsCD;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,IAAI,CAAgC;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAG9B;IAEH;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO;IAY3E;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAUzF;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAgB5B;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAsB5E;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB1C;;OAEG;IACH,UAAU,IAAI,yBAAyB,EAAE;IAgBzC,OAAO,IAAI,IAAI;IAQf,OAAO,CAAC,iBAAiB;CAsB5B"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CliLogSocketManager = void 0;
|
|
4
|
+
const ws_1 = require("ws");
|
|
5
|
+
const url_1 = require("url");
|
|
6
|
+
/**
|
|
7
|
+
* Level ordering from lowest to highest severity.
|
|
8
|
+
* Matches the Python/C# implementations.
|
|
9
|
+
*/
|
|
10
|
+
const LEVEL_ORDER = {
|
|
11
|
+
verbose: 0,
|
|
12
|
+
debug: 1,
|
|
13
|
+
information: 2,
|
|
14
|
+
warning: 3,
|
|
15
|
+
error: 4,
|
|
16
|
+
fatal: 5,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Maps short/uppercase log levels (used by LogRingBuffer) to the
|
|
20
|
+
* standard level names used across all three servers.
|
|
21
|
+
*/
|
|
22
|
+
const LEVEL_ALIASES = {
|
|
23
|
+
info: 'information',
|
|
24
|
+
warn: 'warning',
|
|
25
|
+
err: 'error',
|
|
26
|
+
};
|
|
27
|
+
function normalizeLevel(level) {
|
|
28
|
+
const lower = level.toLowerCase();
|
|
29
|
+
return LEVEL_ALIASES[lower] ?? lower;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Manages WebSocket connections for streaming log messages to clients.
|
|
33
|
+
*
|
|
34
|
+
* Parity with CliLogSocketManager in the .NET and Python servers.
|
|
35
|
+
* Handles `/ws/v1/qcli/logs` and `/ws/qcli/logs` upgrade paths.
|
|
36
|
+
*/
|
|
37
|
+
class CliLogSocketManager {
|
|
38
|
+
_wss = null;
|
|
39
|
+
_clients = new Map();
|
|
40
|
+
_nextClientId = 1;
|
|
41
|
+
static LOG_PATHS = new Set([
|
|
42
|
+
'/ws/v1/qcli/logs',
|
|
43
|
+
'/ws/qcli/logs',
|
|
44
|
+
]);
|
|
45
|
+
/**
|
|
46
|
+
* Check whether a log at `logLevel` passes the `filterLevel` gate.
|
|
47
|
+
*/
|
|
48
|
+
static shouldSendLog(filterLevel, logLevel) {
|
|
49
|
+
if (!filterLevel)
|
|
50
|
+
return true;
|
|
51
|
+
const filterOrd = LEVEL_ORDER[normalizeLevel(filterLevel)];
|
|
52
|
+
const logOrd = LEVEL_ORDER[normalizeLevel(logLevel)];
|
|
53
|
+
// Unknown levels always pass
|
|
54
|
+
if (filterOrd === undefined || logOrd === undefined)
|
|
55
|
+
return true;
|
|
56
|
+
return logOrd >= filterOrd;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Format a log message as a JSON string matching the cross-server schema.
|
|
60
|
+
*/
|
|
61
|
+
static formatLogMessage(level, message, category) {
|
|
62
|
+
return JSON.stringify({
|
|
63
|
+
type: 'log',
|
|
64
|
+
timestamp: new Date().toISOString(),
|
|
65
|
+
level: normalizeLevel(level),
|
|
66
|
+
message,
|
|
67
|
+
category: category ?? null,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Attach to an HTTP server and handle WebSocket upgrades on log paths.
|
|
72
|
+
*
|
|
73
|
+
* If you already have a `CliEventSocketManager` attached, call this
|
|
74
|
+
* method on the same `server` — Node's `upgrade` event supports
|
|
75
|
+
* multiple listeners, and each manager only handles its own paths.
|
|
76
|
+
*/
|
|
77
|
+
attach(server) {
|
|
78
|
+
this._wss = new ws_1.WebSocketServer({ noServer: true });
|
|
79
|
+
server.on('upgrade', (request, socket, head) => {
|
|
80
|
+
const parsed = new url_1.URL(request.url ?? '', 'http://localhost');
|
|
81
|
+
const pathname = parsed.pathname;
|
|
82
|
+
if (!CliLogSocketManager.LOG_PATHS.has(pathname))
|
|
83
|
+
return;
|
|
84
|
+
this._wss.handleUpgrade(request, socket, head, (ws) => {
|
|
85
|
+
const levelFilter = parsed.searchParams.get('level') || null;
|
|
86
|
+
this._handleConnection(ws, request, levelFilter);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Broadcast a log message to all connected clients whose filter allows it.
|
|
92
|
+
*/
|
|
93
|
+
broadcastLog(level, message, category) {
|
|
94
|
+
if (this._clients.size === 0)
|
|
95
|
+
return;
|
|
96
|
+
let formatted = null;
|
|
97
|
+
for (const entry of this._clients.values()) {
|
|
98
|
+
if (entry.ws.readyState !== ws_1.WebSocket.OPEN)
|
|
99
|
+
continue;
|
|
100
|
+
if (!CliLogSocketManager.shouldSendLog(entry.levelFilter, level))
|
|
101
|
+
continue;
|
|
102
|
+
// Lazy-format only when there's at least one recipient
|
|
103
|
+
if (!formatted) {
|
|
104
|
+
formatted = CliLogSocketManager.formatLogMessage(level, message, category);
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
entry.ws.send(formatted);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
// ignore send errors; cleanup happens on close/error events
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Send a disconnect message to all clients and close connections.
|
|
116
|
+
*/
|
|
117
|
+
async broadcastDisconnect() {
|
|
118
|
+
const disconnectMsg = JSON.stringify({ type: 'disconnect' });
|
|
119
|
+
const promises = [];
|
|
120
|
+
for (const entry of this._clients.values()) {
|
|
121
|
+
if (entry.ws.readyState === ws_1.WebSocket.OPEN) {
|
|
122
|
+
promises.push(new Promise((resolve) => {
|
|
123
|
+
entry.ws.send(disconnectMsg, () => {
|
|
124
|
+
entry.ws.close(1000, 'Server shutting down');
|
|
125
|
+
resolve();
|
|
126
|
+
});
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
await Promise.all(promises);
|
|
131
|
+
this._clients.clear();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Return information about all currently connected log clients.
|
|
135
|
+
*/
|
|
136
|
+
getClients() {
|
|
137
|
+
const result = [];
|
|
138
|
+
for (const entry of this._clients.values()) {
|
|
139
|
+
if (entry.ws.readyState === ws_1.WebSocket.OPEN) {
|
|
140
|
+
result.push({
|
|
141
|
+
id: entry.id,
|
|
142
|
+
connectedAt: entry.connectedAt.toISOString(),
|
|
143
|
+
remoteAddress: entry.remoteAddress,
|
|
144
|
+
levelFilter: entry.levelFilter,
|
|
145
|
+
type: 'logs',
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
dispose() {
|
|
152
|
+
for (const entry of this._clients.values()) {
|
|
153
|
+
entry.ws.terminate();
|
|
154
|
+
}
|
|
155
|
+
this._clients.clear();
|
|
156
|
+
this._wss?.close();
|
|
157
|
+
}
|
|
158
|
+
_handleConnection(ws, request, levelFilter) {
|
|
159
|
+
const id = `log-${this._nextClientId++}`;
|
|
160
|
+
const entry = {
|
|
161
|
+
id,
|
|
162
|
+
ws,
|
|
163
|
+
connectedAt: new Date(),
|
|
164
|
+
remoteAddress: request.socket.remoteAddress ?? 'unknown',
|
|
165
|
+
levelFilter,
|
|
166
|
+
};
|
|
167
|
+
this._clients.set(id, entry);
|
|
168
|
+
ws.send(JSON.stringify({ type: 'connected' }));
|
|
169
|
+
ws.on('close', () => {
|
|
170
|
+
this._clients.delete(id);
|
|
171
|
+
});
|
|
172
|
+
ws.on('error', () => {
|
|
173
|
+
this._clients.delete(id);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.CliLogSocketManager = CliLogSocketManager;
|
|
178
|
+
//# sourceMappingURL=cli-log-socket-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-log-socket-manager.js","sourceRoot":"","sources":["../../../src/services/cli-log-socket-manager.ts"],"names":[],"mappings":";;;AAAA,2BAAgD;AAEhD,6BAA0B;AAkB1B;;;GAGG;AACH,MAAM,WAAW,GAA2B;IACxC,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACX,CAAC;AAEF;;;GAGG;AACH,MAAM,aAAa,GAA2B;IAC1C,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,OAAO;CACf,CAAC;AAEF,SAAS,cAAc,CAA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1,7 @@
|
|
|
1
1
|
export { ICliCommandRegistry, CliCommandRegistry } from './cli-command-registry';
|
|
2
2
|
export { ICliResponseBuilder, CliResponseBuilder } from './cli-response-builder';
|
|
3
3
|
export { ICliCommandExecutorService, CliCommandExecutorService } from './cli-command-executor-service';
|
|
4
|
-
export { CliEventSocketManager } from './cli-event-socket-manager';
|
|
4
|
+
export { CliEventSocketManager, CliWebSocketClientInfo } from './cli-event-socket-manager';
|
|
5
5
|
export { CliShellSessionManager } from './cli-shell-session-manager';
|
|
6
|
+
export { CliLogSocketManager, CliLogWebSocketClientInfo } from './cli-log-socket-manager';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CliShellSessionManager = exports.CliEventSocketManager = exports.CliCommandExecutorService = exports.CliResponseBuilder = exports.CliCommandRegistry = void 0;
|
|
3
|
+
exports.CliLogSocketManager = exports.CliShellSessionManager = exports.CliEventSocketManager = exports.CliCommandExecutorService = exports.CliResponseBuilder = exports.CliCommandRegistry = void 0;
|
|
4
4
|
var cli_command_registry_1 = require("./cli-command-registry");
|
|
5
5
|
Object.defineProperty(exports, "CliCommandRegistry", { enumerable: true, get: function () { return cli_command_registry_1.CliCommandRegistry; } });
|
|
6
6
|
var cli_response_builder_1 = require("./cli-response-builder");
|
|
@@ -11,4 +11,6 @@ var cli_event_socket_manager_1 = require("./cli-event-socket-manager");
|
|
|
11
11
|
Object.defineProperty(exports, "CliEventSocketManager", { enumerable: true, get: function () { return cli_event_socket_manager_1.CliEventSocketManager; } });
|
|
12
12
|
var cli_shell_session_manager_1 = require("./cli-shell-session-manager");
|
|
13
13
|
Object.defineProperty(exports, "CliShellSessionManager", { enumerable: true, get: function () { return cli_shell_session_manager_1.CliShellSessionManager; } });
|
|
14
|
+
var cli_log_socket_manager_1 = require("./cli-log-socket-manager");
|
|
15
|
+
Object.defineProperty(exports, "CliLogSocketManager", { enumerable: true, get: function () { return cli_log_socket_manager_1.CliLogSocketManager; } });
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,+DAAiF;AAAnD,0HAAA,kBAAkB,OAAA;AAChD,+DAAiF;AAAnD,0HAAA,kBAAkB,OAAA;AAChD,+EAAuG;AAAlE,yIAAA,yBAAyB,OAAA;AAC9D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,+DAAiF;AAAnD,0HAAA,kBAAkB,OAAA;AAChD,+DAAiF;AAAnD,0HAAA,kBAAkB,OAAA;AAChD,+EAAuG;AAAlE,yIAAA,yBAAyB,OAAA;AAC9D,uEAA2F;AAAlF,iIAAA,qBAAqB,OAAA;AAC9B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,mEAA0F;AAAjF,6HAAA,mBAAmB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qodalis/cli-server-node",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.4",
|
|
4
4
|
"description": "Node.js CLI server for Qodalis CLI ecosystem — use as a library in existing Express apps or run standalone",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@qodalis/cli-server-abstractions": "file:packages/abstractions",
|
|
41
41
|
"@qodalis/cli-server-plugin-filesystem": "file:plugins/filesystem",
|
|
42
|
+
"@qodalis/cli-server-plugin-jobs": "file:plugins/jobs",
|
|
42
43
|
"cors": "^2.8.5",
|
|
43
44
|
"express": "^4.21.0",
|
|
44
45
|
"multer": "^2.1.0",
|
|
@@ -47,8 +48,8 @@
|
|
|
47
48
|
},
|
|
48
49
|
"optionalDependencies": {
|
|
49
50
|
"@qodalis/cli-server-plugin-filesystem-json": "file:plugins/filesystem-json",
|
|
50
|
-
"@qodalis/cli-server-plugin-filesystem-sqlite": "file:plugins/filesystem-sqlite",
|
|
51
51
|
"@qodalis/cli-server-plugin-filesystem-s3": "file:plugins/filesystem-s3",
|
|
52
|
+
"@qodalis/cli-server-plugin-filesystem-sqlite": "file:plugins/filesystem-sqlite",
|
|
52
53
|
"better-sqlite3": "^11.0.0"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CliCommandProcessor } from '../abstractions/cli-command-processor';
|
|
2
|
-
import { CliCommandParameterDescriptor } from '../abstractions/cli-command-parameter-descriptor';
|
|
3
|
-
import { CliProcessCommand } from '../abstractions/cli-process-command';
|
|
4
|
-
export declare class CliUuidCommandProcessor extends CliCommandProcessor {
|
|
5
|
-
command: string;
|
|
6
|
-
description: string;
|
|
7
|
-
parameters: CliCommandParameterDescriptor[];
|
|
8
|
-
handleAsync(command: CliProcessCommand): Promise<string>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=cli-uuid-command-processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-uuid-command-processor.d.ts","sourceRoot":"","sources":["../../../src/processors/cli-uuid-command-processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,qBAAa,uBAAwB,SAAQ,mBAAmB;IAC5D,OAAO,SAAU;IACjB,WAAW,SAA4B;IACvC,UAAU,kCAER;IAEI,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;CAUjE"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CliUuidCommandProcessor = void 0;
|
|
7
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
-
const cli_command_processor_1 = require("../abstractions/cli-command-processor");
|
|
9
|
-
const cli_command_parameter_descriptor_1 = require("../abstractions/cli-command-parameter-descriptor");
|
|
10
|
-
class CliUuidCommandProcessor extends cli_command_processor_1.CliCommandProcessor {
|
|
11
|
-
command = 'uuid';
|
|
12
|
-
description = 'Generates random UUIDs';
|
|
13
|
-
parameters = [
|
|
14
|
-
new cli_command_parameter_descriptor_1.CliCommandParameterDescriptor('count', 'Number of UUIDs to generate (max 50)', false, 'number', ['-n'], '1'),
|
|
15
|
-
];
|
|
16
|
-
async handleAsync(command) {
|
|
17
|
-
let count = parseInt(command.args?.count ?? '1', 10);
|
|
18
|
-
count = Math.max(1, Math.min(count, 50));
|
|
19
|
-
const uuids = [];
|
|
20
|
-
for (let i = 0; i < count; i++) {
|
|
21
|
-
uuids.push(crypto_1.default.randomUUID());
|
|
22
|
-
}
|
|
23
|
-
return uuids.join('\n');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.CliUuidCommandProcessor = CliUuidCommandProcessor;
|
|
27
|
-
//# sourceMappingURL=cli-uuid-command-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-uuid-command-processor.js","sourceRoot":"","sources":["../../../src/processors/cli-uuid-command-processor.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,iFAA4E;AAC5E,uGAAiG;AAGjG,MAAa,uBAAwB,SAAQ,2CAAmB;IAC5D,OAAO,GAAG,MAAM,CAAC;IACjB,WAAW,GAAG,wBAAwB,CAAC;IACvC,UAAU,GAAG;QACT,IAAI,gEAA6B,CAAC,OAAO,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC;KACnH,CAAC;IAEF,KAAK,CAAC,WAAW,CAAC,OAA0B;QACxC,IAAI,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAe,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/D,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAEzC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,gBAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CACJ;AAjBD,0DAiBC"}
|