@qodalis/cli-server-node 1.0.0-beta.4 → 1.0.0-beta.5
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/README.md +145 -23
- 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 +4 -1
- package/dist/src/abstractions/index.js.map +1 -1
- package/dist/src/controllers/cli-controller.d.ts +6 -0
- package/dist/src/controllers/cli-controller.d.ts.map +1 -1
- package/dist/src/controllers/cli-controller.js +71 -1
- package/dist/src/controllers/cli-controller.js.map +1 -1
- package/dist/src/controllers/cli-version-controller.d.ts +4 -0
- package/dist/src/controllers/cli-version-controller.d.ts.map +1 -1
- package/dist/src/controllers/cli-version-controller.js +11 -3
- package/dist/src/controllers/cli-version-controller.js.map +1 -1
- package/dist/src/controllers/filesystem-controller.d.ts.map +1 -1
- package/dist/src/controllers/filesystem-controller.js +51 -7
- package/dist/src/controllers/filesystem-controller.js.map +1 -1
- package/dist/src/create-cli-server.d.ts +31 -4
- package/dist/src/create-cli-server.d.ts.map +1 -1
- package/dist/src/create-cli-server.js +18 -11
- package/dist/src/create-cli-server.js.map +1 -1
- package/dist/src/extensions/cli-builder.d.ts +19 -1
- package/dist/src/extensions/cli-builder.d.ts.map +1 -1
- package/dist/src/extensions/cli-builder.js +26 -0
- package/dist/src/extensions/cli-builder.js.map +1 -1
- package/dist/src/filesystem/filesystem-options.d.ts +1 -0
- package/dist/src/filesystem/filesystem-options.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/cli-server-command-descriptor.d.ts +2 -1
- package/dist/src/models/cli-server-command-descriptor.d.ts.map +1 -1
- package/dist/src/models/cli-server-output.d.ts +1 -22
- package/dist/src/models/cli-server-output.d.ts.map +1 -1
- package/dist/src/models/cli-server-response.d.ts +1 -5
- package/dist/src/models/cli-server-response.d.ts.map +1 -1
- package/dist/src/processors/cli-base64-command-processor.d.ts +1 -0
- package/dist/src/processors/cli-base64-command-processor.d.ts.map +1 -1
- package/dist/src/processors/cli-base64-command-processor.js +3 -0
- package/dist/src/processors/cli-base64-command-processor.js.map +1 -1
- package/dist/src/processors/cli-echo-command-processor.d.ts +1 -0
- package/dist/src/processors/cli-echo-command-processor.d.ts.map +1 -1
- package/dist/src/processors/cli-echo-command-processor.js +1 -0
- package/dist/src/processors/cli-echo-command-processor.js.map +1 -1
- package/dist/src/processors/cli-hash-command-processor.d.ts +1 -0
- package/dist/src/processors/cli-hash-command-processor.d.ts.map +1 -1
- package/dist/src/processors/cli-hash-command-processor.js +1 -0
- package/dist/src/processors/cli-hash-command-processor.js.map +1 -1
- package/dist/src/processors/cli-http-command-processor.d.ts +1 -0
- package/dist/src/processors/cli-http-command-processor.d.ts.map +1 -1
- package/dist/src/processors/cli-http-command-processor.js +85 -6
- package/dist/src/processors/cli-http-command-processor.js.map +1 -1
- package/dist/src/processors/cli-status-command-processor.d.ts +1 -0
- package/dist/src/processors/cli-status-command-processor.d.ts.map +1 -1
- package/dist/src/processors/cli-status-command-processor.js +1 -0
- package/dist/src/processors/cli-status-command-processor.js.map +1 -1
- package/dist/src/processors/cli-system-command-processor.d.ts +1 -0
- package/dist/src/processors/cli-system-command-processor.d.ts.map +1 -1
- package/dist/src/processors/cli-system-command-processor.js +1 -0
- package/dist/src/processors/cli-system-command-processor.js.map +1 -1
- package/dist/src/server.js +8 -6
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/cli-command-executor-service.d.ts +24 -3
- package/dist/src/services/cli-command-executor-service.d.ts.map +1 -1
- package/dist/src/services/cli-command-executor-service.js +35 -3
- package/dist/src/services/cli-command-executor-service.js.map +1 -1
- package/dist/src/services/cli-command-registry.d.ts +11 -0
- package/dist/src/services/cli-command-registry.d.ts.map +1 -1
- package/dist/src/services/cli-command-registry.js +5 -0
- package/dist/src/services/cli-command-registry.js.map +1 -1
- package/dist/src/services/cli-event-socket-manager.d.ts +6 -0
- package/dist/src/services/cli-event-socket-manager.d.ts.map +1 -1
- package/dist/src/services/cli-event-socket-manager.js +16 -2
- package/dist/src/services/cli-event-socket-manager.js.map +1 -1
- package/dist/src/services/cli-log-socket-manager.d.ts +2 -0
- package/dist/src/services/cli-log-socket-manager.d.ts.map +1 -1
- package/dist/src/services/cli-log-socket-manager.js +7 -0
- package/dist/src/services/cli-log-socket-manager.js.map +1 -1
- package/dist/src/services/cli-response-builder.d.ts +9 -0
- package/dist/src/services/cli-response-builder.d.ts.map +1 -1
- package/dist/src/services/cli-response-builder.js +1 -0
- package/dist/src/services/cli-response-builder.js.map +1 -1
- package/dist/src/services/cli-shell-session-manager.d.ts +11 -0
- package/dist/src/services/cli-shell-session-manager.d.ts.map +1 -1
- package/dist/src/services/cli-shell-session-manager.js +36 -5
- package/dist/src/services/cli-shell-session-manager.js.map +1 -1
- package/dist/src/utils/logger.d.ts +11 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +13 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/package.json +12 -3
- package/dist/src/controllers/cli-controller-v2.d.ts +0 -4
- package/dist/src/controllers/cli-controller-v2.d.ts.map +0 -1
- package/dist/src/controllers/cli-controller-v2.js +0 -46
- package/dist/src/controllers/cli-controller-v2.js.map +0 -1
package/README.md
CHANGED
|
@@ -297,21 +297,7 @@ Every processor receives a `CliProcessCommand` with the parsed command input:
|
|
|
297
297
|
| `rawCommand` | `string` | Original unprocessed input |
|
|
298
298
|
| `data` | `any` | Arbitrary data payload from the client |
|
|
299
299
|
|
|
300
|
-
## API
|
|
301
|
-
|
|
302
|
-
Processors declare which API version they target. The default is version 1.
|
|
303
|
-
|
|
304
|
-
```typescript
|
|
305
|
-
class DashboardProcessor extends CliCommandProcessor {
|
|
306
|
-
command = 'dashboard';
|
|
307
|
-
description = 'Server dashboard (v2 only)';
|
|
308
|
-
apiVersion = 2;
|
|
309
|
-
|
|
310
|
-
async handleAsync(command: CliProcessCommand): Promise<string> {
|
|
311
|
-
return 'Dashboard data...';
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
```
|
|
300
|
+
## API Endpoints
|
|
315
301
|
|
|
316
302
|
The server exposes versioned endpoints:
|
|
317
303
|
|
|
@@ -321,12 +307,7 @@ The server exposes versioned endpoints:
|
|
|
321
307
|
| GET | `/api/v1/cli/version` | V1 server version |
|
|
322
308
|
| GET | `/api/v1/cli/commands` | V1 commands (all processors) |
|
|
323
309
|
| POST | `/api/v1/cli/execute` | V1 execute |
|
|
324
|
-
|
|
|
325
|
-
| GET | `/api/v2/cli/commands` | V2 commands (only `apiVersion >= 2`) |
|
|
326
|
-
| POST | `/api/v2/cli/execute` | V2 execute |
|
|
327
|
-
| WS | `/ws/cli/events` | WebSocket events (also `/ws/v1/cli/events`, `/ws/v2/cli/events`) |
|
|
328
|
-
|
|
329
|
-
The Qodalis CLI client auto-negotiates the highest mutually supported version via the `/api/cli/versions` discovery endpoint.
|
|
310
|
+
| WS | `/ws/cli/events` | WebSocket events (also `/ws/v1/cli/events`) |
|
|
330
311
|
|
|
331
312
|
## Processor Base Class Reference
|
|
332
313
|
|
|
@@ -342,7 +323,6 @@ The Qodalis CLI client auto-negotiates the highest mutually supported version vi
|
|
|
342
323
|
| `allowUnlistedCommands` | `boolean` | `undefined` | Accept sub-commands not in `processors` |
|
|
343
324
|
| `valueRequired` | `boolean` | `undefined` | Require a positional value |
|
|
344
325
|
| `version` | `string` | `'1.0.0'` | Processor version string |
|
|
345
|
-
| `apiVersion` | `number` | `1` | Target API version |
|
|
346
326
|
| `author` | `ICliCommandAuthor` | default author | Author metadata (name, email) |
|
|
347
327
|
|
|
348
328
|
## Server Options
|
|
@@ -492,6 +472,149 @@ class MyProvider implements IFileStorageProvider {
|
|
|
492
472
|
builder.setFileStorageProvider(new MyProvider());
|
|
493
473
|
```
|
|
494
474
|
|
|
475
|
+
## Data Explorer
|
|
476
|
+
|
|
477
|
+
The Data Explorer plugin provides interactive, full-screen REPL access to data sources. It exposes a provider-based API where each data source type (SQL, MongoDB, etc.) is a separate plugin implementing `IDataExplorerProvider`.
|
|
478
|
+
|
|
479
|
+
### API Endpoints
|
|
480
|
+
|
|
481
|
+
| Method | Path | Description |
|
|
482
|
+
|--------|------|-------------|
|
|
483
|
+
| GET | `/api/qcli/data-explorer/sources` | List registered data sources with metadata |
|
|
484
|
+
| POST | `/api/qcli/data-explorer/execute` | Execute a query against a named source |
|
|
485
|
+
|
|
486
|
+
### SQL Provider
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
import { SqlDataExplorerProvider } from '@qodalis/cli-server-plugin-data-explorer-sql';
|
|
490
|
+
import { DataExplorerLanguage, DataExplorerOutputFormat } from '@qodalis/cli-server-abstractions';
|
|
491
|
+
|
|
492
|
+
const { app } = createCliServer({
|
|
493
|
+
configure: (builder) => {
|
|
494
|
+
builder.addDataExplorerProvider(
|
|
495
|
+
new SqlDataExplorerProvider({ type: 'sqlite', filename: './data.db' }),
|
|
496
|
+
{
|
|
497
|
+
name: 'my-database',
|
|
498
|
+
description: 'Application database',
|
|
499
|
+
language: DataExplorerLanguage.Sql,
|
|
500
|
+
defaultOutputFormat: DataExplorerOutputFormat.Table,
|
|
501
|
+
timeout: 30000,
|
|
502
|
+
maxRows: 1000,
|
|
503
|
+
templates: [
|
|
504
|
+
{
|
|
505
|
+
name: 'list_tables',
|
|
506
|
+
query: "SELECT name FROM sqlite_master WHERE type='table'",
|
|
507
|
+
description: 'List all tables',
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
},
|
|
511
|
+
);
|
|
512
|
+
},
|
|
513
|
+
});
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### MongoDB Provider
|
|
517
|
+
|
|
518
|
+
```typescript
|
|
519
|
+
import { MongoDataExplorerProvider } from '@qodalis/cli-server-plugin-data-explorer-mongo';
|
|
520
|
+
|
|
521
|
+
builder.addDataExplorerProvider(
|
|
522
|
+
new MongoDataExplorerProvider({
|
|
523
|
+
connectionString: 'mongodb://localhost:27017',
|
|
524
|
+
database: 'myapp',
|
|
525
|
+
}),
|
|
526
|
+
{
|
|
527
|
+
name: 'mongo-primary',
|
|
528
|
+
description: 'Primary MongoDB database',
|
|
529
|
+
language: DataExplorerLanguage.Json,
|
|
530
|
+
defaultOutputFormat: DataExplorerOutputFormat.Json,
|
|
531
|
+
templates: [
|
|
532
|
+
{ name: 'show_collections', query: 'show collections', description: 'List all collections' },
|
|
533
|
+
{ name: 'find_users', query: 'db.users.find({})', description: 'Find all users' },
|
|
534
|
+
],
|
|
535
|
+
},
|
|
536
|
+
);
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
**Supported MongoDB operations:** `db.collection.find({...})`, `findOne`, `aggregate([...])`, `insertOne`, `insertMany`, `updateOne`, `updateMany`, `deleteOne`, `deleteMany`, `countDocuments`, `distinct`. Convenience commands: `show collections`, `show dbs`.
|
|
540
|
+
|
|
541
|
+
### Custom Provider
|
|
542
|
+
|
|
543
|
+
Implement `IDataExplorerProvider` to add your own data source:
|
|
544
|
+
|
|
545
|
+
```typescript
|
|
546
|
+
import { IDataExplorerProvider, DataExplorerExecutionContext, DataExplorerResult } from '@qodalis/cli-server-abstractions';
|
|
547
|
+
|
|
548
|
+
class MyProvider implements IDataExplorerProvider {
|
|
549
|
+
async executeAsync(context: DataExplorerExecutionContext): Promise<DataExplorerResult> {
|
|
550
|
+
// context.query — the user's query string
|
|
551
|
+
// context.parameters — key-value parameters
|
|
552
|
+
// context.options — provider options (name, language, etc.)
|
|
553
|
+
return {
|
|
554
|
+
success: true,
|
|
555
|
+
source: context.options.name,
|
|
556
|
+
language: context.options.language,
|
|
557
|
+
defaultOutputFormat: context.options.defaultOutputFormat,
|
|
558
|
+
executionTime: 0,
|
|
559
|
+
columns: ['id', 'name'], // null for document-oriented results
|
|
560
|
+
rows: [[1, 'Alice'], [2, 'Bob']], // objects when columns is null
|
|
561
|
+
rowCount: 2,
|
|
562
|
+
truncated: false,
|
|
563
|
+
error: null,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
builder.addDataExplorerProvider(new MyProvider(), { name: 'custom', ... });
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
The same provider class can be registered multiple times with different configurations (e.g., two databases with different names).
|
|
572
|
+
|
|
573
|
+
## AWS Cloud Services
|
|
574
|
+
|
|
575
|
+
The AWS plugin adds commands for managing AWS resources (S3, EC2, Lambda, CloudWatch, SNS, SQS, IAM, DynamoDB, ECS) directly from the CLI. It uses AWS SDK v3 and supports the full credential chain.
|
|
576
|
+
|
|
577
|
+
```typescript
|
|
578
|
+
import { AwsModule } from '@qodalis/cli-server-plugin-aws';
|
|
579
|
+
|
|
580
|
+
const { app } = createCliServer({
|
|
581
|
+
configure: (builder) => {
|
|
582
|
+
builder.addModule(new AwsModule());
|
|
583
|
+
},
|
|
584
|
+
});
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Authentication
|
|
588
|
+
|
|
589
|
+
The plugin resolves credentials in this order:
|
|
590
|
+
|
|
591
|
+
1. **CLI configure**: `aws configure set --key <KEY> --secret <SECRET> --region <REGION>`
|
|
592
|
+
2. **Environment variables**: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`
|
|
593
|
+
3. **AWS profiles**: `aws configure set --profile <name>`
|
|
594
|
+
4. **IAM roles**: Automatic on EC2/ECS/Lambda
|
|
595
|
+
|
|
596
|
+
Verify connectivity with `aws status`.
|
|
597
|
+
|
|
598
|
+
### Available Commands
|
|
599
|
+
|
|
600
|
+
| Service | Commands |
|
|
601
|
+
|---------|----------|
|
|
602
|
+
| **configure** | `aws configure set`, `aws configure get`, `aws configure profiles` |
|
|
603
|
+
| **status** | `aws status` — STS GetCallerIdentity connectivity check |
|
|
604
|
+
| **S3** | `aws s3 ls`, `aws s3 cp`, `aws s3 rm`, `aws s3 mb`, `aws s3 rb`, `aws s3 presign` |
|
|
605
|
+
| **EC2** | `aws ec2 list`, `aws ec2 describe`, `aws ec2 start`, `aws ec2 stop`, `aws ec2 reboot`, `aws ec2 sg list` |
|
|
606
|
+
| **Lambda** | `aws lambda list`, `aws lambda invoke`, `aws lambda logs` |
|
|
607
|
+
| **CloudWatch** | `aws cloudwatch alarms`, `aws cloudwatch logs`, `aws cloudwatch metrics` |
|
|
608
|
+
| **SNS** | `aws sns topics`, `aws sns publish`, `aws sns subscriptions` |
|
|
609
|
+
| **SQS** | `aws sqs list`, `aws sqs send`, `aws sqs receive`, `aws sqs purge` |
|
|
610
|
+
| **IAM** | `aws iam users`, `aws iam roles`, `aws iam policies` |
|
|
611
|
+
| **DynamoDB** | `aws dynamodb tables`, `aws dynamodb describe`, `aws dynamodb scan`, `aws dynamodb query` |
|
|
612
|
+
| **ECS** | `aws ecs clusters`, `aws ecs services`, `aws ecs tasks` |
|
|
613
|
+
|
|
614
|
+
All commands support `--region` (`-r`) for region override and `--output` (`-o`) for format selection (`table`, `json`, `text`). Destructive commands support `--dry-run`.
|
|
615
|
+
|
|
616
|
+
See [`plugins/aws/README.md`](plugins/aws/README.md) for the full command reference.
|
|
617
|
+
|
|
495
618
|
## Built-in Processors
|
|
496
619
|
|
|
497
620
|
These processors ship with the library and are included in the standalone server:
|
|
@@ -558,7 +681,6 @@ src/
|
|
|
558
681
|
cli-event-socket-manager.ts # WebSocket event broadcasting
|
|
559
682
|
controllers/
|
|
560
683
|
cli-controller.ts # V1 REST API (/api/v1/cli)
|
|
561
|
-
cli-controller-v2.ts # V2 REST API (/api/v2/cli)
|
|
562
684
|
cli-version-controller.ts # Version discovery (/api/cli/versions)
|
|
563
685
|
extensions/
|
|
564
686
|
cli-builder.ts # Fluent registration API (addProcessor, addModule)
|
|
@@ -1,2 +1,2 @@
|
|
|
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';
|
|
1
|
+
export { ICliCommandAuthor, CliCommandAuthor, DefaultLibraryAuthor, CliProcessCommand, ICliCommandParameterDescriptor, CliCommandParameterDescriptor, ICliCommandProcessor, CliCommandProcessor, ICliModule, CliModule, ICliJob, ICliJobExecutionContext, ICliJobLogger, CliJobOptions, JobOverlapPolicy, ICliJobStorageProvider, JobExecution, JobExecutionStatus, JobState, JobStatus, JobLogEntry, JobLogLevel, CliStructuredOutput, CliStructuredResponse, IDataExplorerProvider, DataExplorerProviderOptions, DataExplorerLanguage, DataExplorerOutputFormat, DataExplorerTemplate, DataExplorerParameterDescriptor, DataExplorerExecutionContext, DataExplorerResult, DataExplorerExecuteRequest, DataExplorerSourceInfo, ICliProcessorFilter, ICliStreamCommandProcessor, isStreamCapable, } 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,EACT,OAAO,EACP,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,
|
|
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,EACX,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,GAClB,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CliModule = exports.CliCommandProcessor = exports.CliCommandParameterDescriptor = exports.DefaultLibraryAuthor = exports.CliCommandAuthor = void 0;
|
|
3
|
+
exports.isStreamCapable = exports.DataExplorerOutputFormat = exports.DataExplorerLanguage = exports.CliModule = exports.CliCommandProcessor = exports.CliCommandParameterDescriptor = exports.DefaultLibraryAuthor = exports.CliCommandAuthor = void 0;
|
|
4
4
|
var cli_server_abstractions_1 = require("@qodalis/cli-server-abstractions");
|
|
5
5
|
Object.defineProperty(exports, "CliCommandAuthor", { enumerable: true, get: function () { return cli_server_abstractions_1.CliCommandAuthor; } });
|
|
6
6
|
Object.defineProperty(exports, "DefaultLibraryAuthor", { enumerable: true, get: function () { return cli_server_abstractions_1.DefaultLibraryAuthor; } });
|
|
7
7
|
Object.defineProperty(exports, "CliCommandParameterDescriptor", { enumerable: true, get: function () { return cli_server_abstractions_1.CliCommandParameterDescriptor; } });
|
|
8
8
|
Object.defineProperty(exports, "CliCommandProcessor", { enumerable: true, get: function () { return cli_server_abstractions_1.CliCommandProcessor; } });
|
|
9
9
|
Object.defineProperty(exports, "CliModule", { enumerable: true, get: function () { return cli_server_abstractions_1.CliModule; } });
|
|
10
|
+
Object.defineProperty(exports, "DataExplorerLanguage", { enumerable: true, get: function () { return cli_server_abstractions_1.DataExplorerLanguage; } });
|
|
11
|
+
Object.defineProperty(exports, "DataExplorerOutputFormat", { enumerable: true, get: function () { return cli_server_abstractions_1.DataExplorerOutputFormat; } });
|
|
12
|
+
Object.defineProperty(exports, "isStreamCapable", { enumerable: true, get: function () { return cli_server_abstractions_1.isStreamCapable; } });
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,4EAsC0C;AApCtC,2HAAA,gBAAgB,OAAA;AAChB,+HAAA,oBAAoB,OAAA;AAGpB,wIAAA,6BAA6B,OAAA;AAE7B,8HAAA,mBAAmB,OAAA;AAEnB,oHAAA,SAAS,OAAA;AAiBT,+HAAA,oBAAoB,OAAA;AACpB,mIAAA,wBAAwB,OAAA;AASxB,0HAAA,eAAe,OAAA"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
2
|
import { ICliCommandRegistry, ICliCommandExecutorService } from '../services';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an Express router for the v1 CLI API with version, capabilities, commands, and execute endpoints.
|
|
5
|
+
* @param registry - Command registry to list available processors.
|
|
6
|
+
* @param executor - Service that dispatches commands to processors.
|
|
7
|
+
* @returns Configured Express router.
|
|
8
|
+
*/
|
|
3
9
|
export declare function createCliController(registry: ICliCommandRegistry, executor: ICliCommandExecutorService): Router;
|
|
4
10
|
//# sourceMappingURL=cli-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/cli-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/cli-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAM9E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,0BAA0B,GACrC,MAAM,CA+GR"}
|
|
@@ -36,7 +36,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.createCliController = createCliController;
|
|
37
37
|
const express_1 = require("express");
|
|
38
38
|
const os = __importStar(require("os"));
|
|
39
|
+
const abstractions_1 = require("../abstractions");
|
|
40
|
+
const logger_1 = require("../utils/logger");
|
|
41
|
+
const logger = (0, logger_1.createLogger)('CliController');
|
|
39
42
|
const SERVER_VERSION = '1.0.0';
|
|
43
|
+
/**
|
|
44
|
+
* Creates an Express router for the v1 CLI API with version, capabilities, commands, and execute endpoints.
|
|
45
|
+
* @param registry - Command registry to list available processors.
|
|
46
|
+
* @param executor - Service that dispatches commands to processors.
|
|
47
|
+
* @returns Configured Express router.
|
|
48
|
+
*/
|
|
40
49
|
function createCliController(registry, executor) {
|
|
41
50
|
const router = (0, express_1.Router)();
|
|
42
51
|
router.get('/version', (_req, res) => {
|
|
@@ -57,6 +66,7 @@ function createCliController(registry, executor) {
|
|
|
57
66
|
os: detectedOs,
|
|
58
67
|
shellPath,
|
|
59
68
|
version: SERVER_VERSION,
|
|
69
|
+
streaming: true,
|
|
60
70
|
});
|
|
61
71
|
});
|
|
62
72
|
router.get('/commands', (_req, res) => {
|
|
@@ -65,11 +75,71 @@ function createCliController(registry, executor) {
|
|
|
65
75
|
});
|
|
66
76
|
router.post('/execute', async (req, res) => {
|
|
67
77
|
const command = req.body;
|
|
68
|
-
|
|
78
|
+
logger.debug('Executing command: %s', command.command);
|
|
79
|
+
const abortController = new AbortController();
|
|
80
|
+
req.on('close', () => abortController.abort());
|
|
81
|
+
const response = await executor.executeAsync(command, abortController.signal);
|
|
69
82
|
res.json(response);
|
|
70
83
|
});
|
|
84
|
+
router.post('/execute/stream', async (req, res) => {
|
|
85
|
+
const command = req.body;
|
|
86
|
+
logger.debug('Stream executing command: %s', command.command);
|
|
87
|
+
const abortController = new AbortController();
|
|
88
|
+
req.on('close', () => abortController.abort());
|
|
89
|
+
const signal = abortController.signal;
|
|
90
|
+
// SSE headers
|
|
91
|
+
res.setHeader('Content-Type', 'text/event-stream');
|
|
92
|
+
res.setHeader('Cache-Control', 'no-cache');
|
|
93
|
+
res.setHeader('Connection', 'keep-alive');
|
|
94
|
+
res.setHeader('X-Accel-Buffering', 'no');
|
|
95
|
+
res.flushHeaders();
|
|
96
|
+
const emit = (output) => {
|
|
97
|
+
res.write(`event: output\ndata: ${JSON.stringify(output)}\n\n`);
|
|
98
|
+
};
|
|
99
|
+
try {
|
|
100
|
+
const processor = registry.findProcessor(command.command, command.chainCommands?.length ? command.chainCommands : undefined);
|
|
101
|
+
if (!processor) {
|
|
102
|
+
res.write(`event: error\ndata: ${JSON.stringify({ message: `Unknown command: ${command.command}` })}\n\n`);
|
|
103
|
+
res.end();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (executor.isBlocked(processor)) {
|
|
107
|
+
res.write(`event: error\ndata: ${JSON.stringify({ message: `Command '${command.command}' is currently disabled.` })}\n\n`);
|
|
108
|
+
res.end();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
let exitCode;
|
|
112
|
+
if ((0, abstractions_1.isStreamCapable)(processor)) {
|
|
113
|
+
exitCode = await processor.handleStreamAsync(command, emit, signal);
|
|
114
|
+
}
|
|
115
|
+
else if (processor.handleStructuredAsync) {
|
|
116
|
+
const response = await processor.handleStructuredAsync(command, signal);
|
|
117
|
+
for (const output of response.outputs) {
|
|
118
|
+
emit(output);
|
|
119
|
+
}
|
|
120
|
+
exitCode = response.exitCode;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const result = await processor.handleAsync(command, signal);
|
|
124
|
+
emit({ type: 'text', value: result });
|
|
125
|
+
exitCode = 0;
|
|
126
|
+
}
|
|
127
|
+
res.write(`event: done\ndata: ${JSON.stringify({ exitCode })}\n\n`);
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
if (signal.aborted) {
|
|
131
|
+
logger.debug('Stream cancelled for command: %s', command.command);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
logger.error('Stream execution failed: %s - %s', command.command, err.message ?? err);
|
|
135
|
+
res.write(`event: error\ndata: ${JSON.stringify({ message: `Error executing command: ${err.message ?? err}` })}\n\n`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
res.end();
|
|
139
|
+
});
|
|
71
140
|
return router;
|
|
72
141
|
}
|
|
142
|
+
/** Maps an {@link ICliCommandProcessor} to its serializable DTO representation. */
|
|
73
143
|
function mapToDescriptor(processor) {
|
|
74
144
|
const descriptor = {
|
|
75
145
|
command: processor.command,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-controller.js","sourceRoot":"","sources":["../../../src/controllers/cli-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cli-controller.js","sourceRoot":"","sources":["../../../src/controllers/cli-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,kDAkHC;AAlID,qCAA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O,EAAE,SAAS,CAAC,OAAO;QAC1B,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,OAAO,EAAE,SAAS,CAAC,OAAO;KAC7B,CAAC;IAEF,IAAI,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAC/B,UAAU,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAC5C,CAAC,CAAC,EAA0C,EAAE,CAAC,CAAC;YAC5C,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,YAAY,EAAE,CAAC,CAAC,YAAY;SAC/B,CAAC,CACL,CAAC;IACN,CAAC;IAED,IAAI,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAC/B,UAAU,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an Express router for API version discovery and server capabilities.
|
|
4
|
+
* @returns Router with `/versions` and `/capabilities` endpoints.
|
|
5
|
+
*/
|
|
2
6
|
export declare function createCliVersionController(): Router;
|
|
3
7
|
//# sourceMappingURL=cli-version-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-version-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/cli-version-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAMjC,wBAAgB,0BAA0B,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"cli-version-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/cli-version-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAMjC;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAqCnD"}
|
|
@@ -37,15 +37,22 @@ exports.createCliVersionController = createCliVersionController;
|
|
|
37
37
|
const express_1 = require("express");
|
|
38
38
|
const os = __importStar(require("os"));
|
|
39
39
|
const SERVER_VERSION = '2.0.0';
|
|
40
|
+
/**
|
|
41
|
+
* Creates an Express router for API version discovery and server capabilities.
|
|
42
|
+
* @returns Router with `/versions` and `/capabilities` endpoints.
|
|
43
|
+
*/
|
|
40
44
|
function createCliVersionController() {
|
|
41
45
|
const router = (0, express_1.Router)();
|
|
42
|
-
router.get('/
|
|
46
|
+
router.get('/versions', (_req, res) => {
|
|
43
47
|
res.json({
|
|
44
|
-
supportedVersions: [1
|
|
45
|
-
preferredVersion:
|
|
48
|
+
supportedVersions: [1],
|
|
49
|
+
preferredVersion: 1,
|
|
46
50
|
serverVersion: SERVER_VERSION,
|
|
47
51
|
});
|
|
48
52
|
});
|
|
53
|
+
router.get('/version', (_req, res) => {
|
|
54
|
+
res.redirect(301, 'versions');
|
|
55
|
+
});
|
|
49
56
|
router.get('/capabilities', (_req, res) => {
|
|
50
57
|
const detectedOs = os.platform() === 'win32'
|
|
51
58
|
? 'win32'
|
|
@@ -61,6 +68,7 @@ function createCliVersionController() {
|
|
|
61
68
|
os: detectedOs,
|
|
62
69
|
shellPath,
|
|
63
70
|
version: SERVER_VERSION,
|
|
71
|
+
streaming: true,
|
|
64
72
|
});
|
|
65
73
|
});
|
|
66
74
|
return router;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-version-controller.js","sourceRoot":"","sources":["../../../src/controllers/cli-version-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cli-version-controller.js","sourceRoot":"","sources":["../../../src/controllers/cli-version-controller.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EAAE,cAAc;YACvB,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/filesystem-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AAEpD,OAAO,EACH,oBAAoB,EAMvB,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"filesystem-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/filesystem-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AAEpD,OAAO,EACH,oBAAoB,EAMvB,MAAM,uCAAuC,CAAC;AAsB/C;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAmK7E"}
|
|
@@ -7,6 +7,8 @@ exports.createFilesystemRouter = createFilesystemRouter;
|
|
|
7
7
|
const express_1 = require("express");
|
|
8
8
|
const multer_1 = __importDefault(require("multer"));
|
|
9
9
|
const cli_server_plugin_filesystem_1 = require("@qodalis/cli-server-plugin-filesystem");
|
|
10
|
+
const logger_1 = require("../utils/logger");
|
|
11
|
+
const logger = (0, logger_1.createLogger)('FileSystem');
|
|
10
12
|
/**
|
|
11
13
|
* Maps provider errors to appropriate HTTP status codes and sends a JSON error response.
|
|
12
14
|
*/
|
|
@@ -34,10 +36,10 @@ function handleError(err, res) {
|
|
|
34
36
|
function createFilesystemRouter(provider) {
|
|
35
37
|
const router = (0, express_1.Router)();
|
|
36
38
|
const upload = (0, multer_1.default)({ storage: multer_1.default.memoryStorage() });
|
|
37
|
-
// ------------------------------------------------------------------ ls
|
|
38
39
|
router.get('/ls', async (req, res) => {
|
|
39
40
|
try {
|
|
40
41
|
const dirPath = req.query.path;
|
|
42
|
+
logger.debug('ls path=%s', dirPath);
|
|
41
43
|
if (!dirPath) {
|
|
42
44
|
res.status(400).json({ error: 'Missing required query parameter: path' });
|
|
43
45
|
return;
|
|
@@ -46,13 +48,19 @@ function createFilesystemRouter(provider) {
|
|
|
46
48
|
res.json({ entries });
|
|
47
49
|
}
|
|
48
50
|
catch (err) {
|
|
51
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
52
|
+
logger.warn('Failed to ls: %s', err.message ?? err);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
logger.error('Failed to ls: %s', err.message ?? err);
|
|
56
|
+
}
|
|
49
57
|
handleError(err, res);
|
|
50
58
|
}
|
|
51
59
|
});
|
|
52
|
-
// ----------------------------------------------------------------- cat
|
|
53
60
|
router.get('/cat', async (req, res) => {
|
|
54
61
|
try {
|
|
55
62
|
const filePath = req.query.path;
|
|
63
|
+
logger.debug('cat path=%s', filePath);
|
|
56
64
|
if (!filePath) {
|
|
57
65
|
res.status(400).json({ error: 'Missing required query parameter: path' });
|
|
58
66
|
return;
|
|
@@ -61,13 +69,19 @@ function createFilesystemRouter(provider) {
|
|
|
61
69
|
res.json({ content });
|
|
62
70
|
}
|
|
63
71
|
catch (err) {
|
|
72
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
73
|
+
logger.warn('Failed to cat: %s', err.message ?? err);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
logger.error('Failed to cat: %s', err.message ?? err);
|
|
77
|
+
}
|
|
64
78
|
handleError(err, res);
|
|
65
79
|
}
|
|
66
80
|
});
|
|
67
|
-
// ---------------------------------------------------------------- stat
|
|
68
81
|
router.get('/stat', async (req, res) => {
|
|
69
82
|
try {
|
|
70
83
|
const filePath = req.query.path;
|
|
84
|
+
logger.debug('stat path=%s', filePath);
|
|
71
85
|
if (!filePath) {
|
|
72
86
|
res.status(400).json({ error: 'Missing required query parameter: path' });
|
|
73
87
|
return;
|
|
@@ -76,13 +90,19 @@ function createFilesystemRouter(provider) {
|
|
|
76
90
|
res.json(fileStat);
|
|
77
91
|
}
|
|
78
92
|
catch (err) {
|
|
93
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
94
|
+
logger.warn('Failed to stat: %s', err.message ?? err);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
logger.error('Failed to stat: %s', err.message ?? err);
|
|
98
|
+
}
|
|
79
99
|
handleError(err, res);
|
|
80
100
|
}
|
|
81
101
|
});
|
|
82
|
-
// ------------------------------------------------------------ download
|
|
83
102
|
router.get('/download', async (req, res) => {
|
|
84
103
|
try {
|
|
85
104
|
const filePath = req.query.path;
|
|
105
|
+
logger.debug('download path=%s', filePath);
|
|
86
106
|
if (!filePath) {
|
|
87
107
|
res.status(400).json({ error: 'Missing required query parameter: path' });
|
|
88
108
|
return;
|
|
@@ -94,13 +114,19 @@ function createFilesystemRouter(provider) {
|
|
|
94
114
|
stream.pipe(res);
|
|
95
115
|
}
|
|
96
116
|
catch (err) {
|
|
117
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
118
|
+
logger.warn('Failed to download: %s', err.message ?? err);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
logger.error('Failed to download: %s', err.message ?? err);
|
|
122
|
+
}
|
|
97
123
|
handleError(err, res);
|
|
98
124
|
}
|
|
99
125
|
});
|
|
100
|
-
// -------------------------------------------------------------- upload
|
|
101
126
|
router.post('/upload', upload.single('file'), async (req, res) => {
|
|
102
127
|
try {
|
|
103
128
|
const targetPath = req.body?.path;
|
|
129
|
+
logger.debug('upload path=%s', targetPath);
|
|
104
130
|
if (!targetPath) {
|
|
105
131
|
res.status(400).json({ error: 'Missing required field: path' });
|
|
106
132
|
return;
|
|
@@ -113,13 +139,19 @@ function createFilesystemRouter(provider) {
|
|
|
113
139
|
res.json({ path: targetPath, size: req.file.size });
|
|
114
140
|
}
|
|
115
141
|
catch (err) {
|
|
142
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
143
|
+
logger.warn('Failed to upload: %s', err.message ?? err);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
logger.error('Failed to upload: %s', err.message ?? err);
|
|
147
|
+
}
|
|
116
148
|
handleError(err, res);
|
|
117
149
|
}
|
|
118
150
|
});
|
|
119
|
-
// --------------------------------------------------------------- mkdir
|
|
120
151
|
router.post('/mkdir', async (req, res) => {
|
|
121
152
|
try {
|
|
122
153
|
const dirPath = req.body?.path;
|
|
154
|
+
logger.debug('mkdir path=%s', dirPath);
|
|
123
155
|
if (!dirPath) {
|
|
124
156
|
res.status(400).json({ error: 'Missing required field: path' });
|
|
125
157
|
return;
|
|
@@ -128,13 +160,19 @@ function createFilesystemRouter(provider) {
|
|
|
128
160
|
res.json({ path: dirPath });
|
|
129
161
|
}
|
|
130
162
|
catch (err) {
|
|
163
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
164
|
+
logger.warn('Failed to mkdir: %s', err.message ?? err);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
logger.error('Failed to mkdir: %s', err.message ?? err);
|
|
168
|
+
}
|
|
131
169
|
handleError(err, res);
|
|
132
170
|
}
|
|
133
171
|
});
|
|
134
|
-
// ----------------------------------------------------------------- rm
|
|
135
172
|
router.delete('/rm', async (req, res) => {
|
|
136
173
|
try {
|
|
137
174
|
const targetPath = req.query.path;
|
|
175
|
+
logger.debug('rm path=%s', targetPath);
|
|
138
176
|
if (!targetPath) {
|
|
139
177
|
res.status(400).json({ error: 'Missing required query parameter: path' });
|
|
140
178
|
return;
|
|
@@ -143,6 +181,12 @@ function createFilesystemRouter(provider) {
|
|
|
143
181
|
res.json({ deleted: targetPath });
|
|
144
182
|
}
|
|
145
183
|
catch (err) {
|
|
184
|
+
if (err instanceof cli_server_plugin_filesystem_1.PermissionDeniedError) {
|
|
185
|
+
logger.warn('Failed to rm: %s', err.message ?? err);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
logger.error('Failed to rm: %s', err.message ?? err);
|
|
189
|
+
}
|
|
146
190
|
handleError(err, res);
|
|
147
191
|
}
|
|
148
192
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-controller.js","sourceRoot":"","sources":["../../../src/controllers/filesystem-controller.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"filesystem-controller.js","sourceRoot":"","sources":["../../../src/controllers/filesystem-controller.ts"],"names":[],"mappings":";;;;;AAmCA,wDAmKC;AAtMD,qCAAoD;AACpD,oDAA4B;AAC5B,wFAO+C;AAC/C,4CAA+C;AAE/C,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,YAAY,CAAC,CAAC;AAE1C;;GAEG;AACH,SAAS,WAAW,CAAC,GAAY,EAAE,GAAa;IAC5C,IAAI,GAAG,YAAY,gDAAiB,EAAE,CAAC;QACnC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,GAAG,YAAY,oDAAqB,EAAE,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,GAAG,YAAY,iDAAkB,IAAI,GAAG,YAAY,gDAAiB,EAAE,CAAC;QAC/E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,GAAG,YAAY,8CAAe,EAAE,CAAC;QACxC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC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