@loopstack/remote-file-explorer-module 0.23.0 → 0.24.0
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/controllers/remote-file-explorer.controller.d.ts +7 -9
- package/dist/controllers/remote-file-explorer.controller.d.ts.map +1 -1
- package/dist/controllers/remote-file-explorer.controller.js +15 -32
- package/dist/controllers/remote-file-explorer.controller.js.map +1 -1
- package/dist/remote-file-explorer.module.d.ts +5 -0
- package/dist/remote-file-explorer.module.d.ts.map +1 -1
- package/dist/remote-file-explorer.module.js +10 -6
- package/dist/remote-file-explorer.module.js.map +1 -1
- package/package.json +3 -4
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { RemoteClient } from '@loopstack/remote-client';
|
|
1
|
+
import { CurrentUserInterface } from '@loopstack/common';
|
|
2
|
+
import { EnvironmentService, RemoteClient } from '@loopstack/remote-client';
|
|
4
3
|
export declare class RemoteFileExplorerController {
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readFile(workspaceId: string, filePath: string, user: CurrentUserInterface): Promise<import("@loopstack/remote-client").FileReadResponse>;
|
|
4
|
+
private readonly remote;
|
|
5
|
+
private readonly env;
|
|
6
|
+
constructor(remote: RemoteClient, env: EnvironmentService);
|
|
7
|
+
getFileTree(workspaceId: string, basePath: string | undefined, _user: CurrentUserInterface): Promise<unknown>;
|
|
8
|
+
readFile(workspaceId: string, filePath: string, _user: CurrentUserInterface): Promise<import("@loopstack/remote-client").FileReadResponse>;
|
|
11
9
|
}
|
|
12
10
|
//# sourceMappingURL=remote-file-explorer.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-file-explorer.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/remote-file-explorer.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-file-explorer.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/remote-file-explorer.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE5E,qBAEa,4BAA4B;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBADH,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,kBAAkB;IAIpC,WAAW,CACO,WAAW,EAAE,MAAM,EAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,oBAAoB,GACzC,OAAO,CAAC,OAAO,CAAC;IAMb,QAAQ,CACU,WAAW,EAAE,MAAM,EAC1B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,oBAAoB;CAK7C"}
|
|
@@ -10,39 +10,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
-
import { Controller, Get,
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { CurrentUser, WorkspaceEntity } from '@loopstack/common';
|
|
17
|
-
import { RemoteClient } from '@loopstack/remote-client';
|
|
13
|
+
import { Controller, Get, Param, Query, UsePipes, ValidationPipe } from '@nestjs/common';
|
|
14
|
+
import { CurrentUser } from '@loopstack/common';
|
|
15
|
+
import { EnvironmentService, RemoteClient } from '@loopstack/remote-client';
|
|
18
16
|
let RemoteFileExplorerController = class RemoteFileExplorerController {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
17
|
+
remote;
|
|
18
|
+
env;
|
|
19
|
+
constructor(remote, env) {
|
|
20
|
+
this.remote = remote;
|
|
21
|
+
this.env = env;
|
|
24
22
|
}
|
|
25
|
-
async
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
relations: ['environments'],
|
|
29
|
-
});
|
|
30
|
-
if (!workspace) {
|
|
31
|
-
throw new NotFoundException(`Workspace with ID ${workspaceId} not found`);
|
|
32
|
-
}
|
|
33
|
-
const environment = workspace.environments?.find((e) => !!e.agentUrl);
|
|
34
|
-
if (!environment?.agentUrl) {
|
|
35
|
-
throw new NotFoundException(`No remote environment configured for workspace ${workspaceId}`);
|
|
36
|
-
}
|
|
37
|
-
return environment.agentUrl;
|
|
23
|
+
async getFileTree(workspaceId, basePath, _user) {
|
|
24
|
+
const agentUrl = await this.env.getAgentUrlForWorkspace(workspaceId);
|
|
25
|
+
return this.remote.getFileTree(agentUrl, basePath ?? './src');
|
|
38
26
|
}
|
|
39
|
-
async
|
|
40
|
-
const agentUrl = await this.
|
|
41
|
-
return this.
|
|
42
|
-
}
|
|
43
|
-
async readFile(workspaceId, filePath, user) {
|
|
44
|
-
const agentUrl = await this.getAgentUrl(workspaceId, user.userId);
|
|
45
|
-
return this.remoteAgentClient.readFile(agentUrl, filePath);
|
|
27
|
+
async readFile(workspaceId, filePath, _user) {
|
|
28
|
+
const agentUrl = await this.env.getAgentUrlForWorkspace(workspaceId);
|
|
29
|
+
return this.remote.readFile(agentUrl, filePath);
|
|
46
30
|
}
|
|
47
31
|
};
|
|
48
32
|
__decorate([
|
|
@@ -66,9 +50,8 @@ __decorate([
|
|
|
66
50
|
RemoteFileExplorerController = __decorate([
|
|
67
51
|
UsePipes(new ValidationPipe({ transform: true, whitelist: true, forbidNonWhitelisted: true })),
|
|
68
52
|
Controller('api/v1/workspaces/:workspaceId/files'),
|
|
69
|
-
__param(1, InjectRepository(WorkspaceEntity)),
|
|
70
53
|
__metadata("design:paramtypes", [RemoteClient,
|
|
71
|
-
|
|
54
|
+
EnvironmentService])
|
|
72
55
|
], RemoteFileExplorerController);
|
|
73
56
|
export { RemoteFileExplorerController };
|
|
74
57
|
//# sourceMappingURL=remote-file-explorer.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-file-explorer.controller.js","sourceRoot":"","sources":["../../src/controllers/remote-file-explorer.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"remote-file-explorer.controller.js","sourceRoot":"","sources":["../../src/controllers/remote-file-explorer.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAwB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIrE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAEpB;IACA;IAFnB,YACmB,MAAoB,EACpB,GAAuB;QADvB,WAAM,GAAN,MAAM,CAAc;QACpB,QAAG,GAAH,GAAG,CAAoB;IACvC,CAAC;IAGE,AAAN,KAAK,CAAC,WAAW,CACO,WAAmB,EAC1B,QAA4B,EAC5B,KAA2B;QAE1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,IAAI,OAAO,CAAC,CAAC;IAChE,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CACU,WAAmB,EAC1B,QAAgB,EAChB,KAA2B;QAE1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AAlBO;IADL,GAAG,CAAC,MAAM,CAAC;IAET,WAAA,KAAK,CAAC,aAAa,CAAC,CAAA;IACpB,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,WAAW,EAAE,CAAA;;;;+DAIf;AAGK;IADL,GAAG,CAAC,MAAM,CAAC;IAET,WAAA,KAAK,CAAC,aAAa,CAAC,CAAA;IACpB,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,WAAW,EAAE,CAAA;;;;4DAIf;AAxBU,4BAA4B;IAFxC,QAAQ,CAAC,IAAI,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9F,UAAU,CAAC,sCAAsC,CAAC;qCAGtB,YAAY;QACf,kBAAkB;GAH/B,4BAA4B,CAyBxC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { type DynamicModule } from '@nestjs/common';
|
|
1
2
|
export declare class RemoteFileExplorerModule {
|
|
3
|
+
static forFeature(config?: {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
environments?: string[];
|
|
6
|
+
}): DynamicModule;
|
|
2
7
|
}
|
|
3
8
|
//# sourceMappingURL=remote-file-explorer.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-file-explorer.module.d.ts","sourceRoot":"","sources":["../src/remote-file-explorer.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-file-explorer.module.d.ts","sourceRoot":"","sources":["../src/remote-file-explorer.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAI5D,qBAGa,wBAAwB;IACnC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,aAAa;CAM1F"}
|
|
@@ -4,16 +4,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var RemoteFileExplorerModule_1;
|
|
7
8
|
import { Module } from '@nestjs/common';
|
|
8
|
-
import {
|
|
9
|
-
import { WorkspaceEntity } from '@loopstack/common';
|
|
10
|
-
import { RemoteClientModule } from '@loopstack/remote-client';
|
|
9
|
+
import { registerFeature } from '@loopstack/common';
|
|
11
10
|
import { RemoteFileExplorerController } from './controllers/index.js';
|
|
12
|
-
let RemoteFileExplorerModule = class RemoteFileExplorerModule {
|
|
11
|
+
let RemoteFileExplorerModule = RemoteFileExplorerModule_1 = class RemoteFileExplorerModule {
|
|
12
|
+
static forFeature(config) {
|
|
13
|
+
return {
|
|
14
|
+
module: RemoteFileExplorerModule_1,
|
|
15
|
+
providers: [registerFeature('fileExplorer', config)],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
13
18
|
};
|
|
14
|
-
RemoteFileExplorerModule = __decorate([
|
|
19
|
+
RemoteFileExplorerModule = RemoteFileExplorerModule_1 = __decorate([
|
|
15
20
|
Module({
|
|
16
|
-
imports: [RemoteClientModule, TypeOrmModule.forFeature([WorkspaceEntity])],
|
|
17
21
|
controllers: [RemoteFileExplorerController],
|
|
18
22
|
})
|
|
19
23
|
], RemoteFileExplorerModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-file-explorer.module.js","sourceRoot":"","sources":["../src/remote-file-explorer.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-file-explorer.module.js","sourceRoot":"","sources":["../src/remote-file-explorer.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAsB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAK/D,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IACnC,MAAM,CAAC,UAAU,CAAC,MAAuD;QACvE,OAAO;YACL,MAAM,EAAE,0BAAwB;YAChC,SAAS,EAAE,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;SACrD,CAAC;IACJ,CAAC;CACF,CAAA;AAPY,wBAAwB;IAHpC,MAAM,CAAC;QACN,WAAW,EAAE,CAAC,4BAA4B,CAAC;KAC5C,CAAC;GACW,wBAAwB,CAOpC"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"remote-agent",
|
|
9
9
|
"workflow"
|
|
10
10
|
],
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.24.0",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "Jakob Klippel",
|
|
@@ -31,9 +31,8 @@
|
|
|
31
31
|
"watch": "nest build --watch"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@loopstack/common": "^0.
|
|
35
|
-
"@loopstack/
|
|
36
|
-
"@loopstack/remote-client": "^0.24.0",
|
|
34
|
+
"@loopstack/common": "^0.32.0",
|
|
35
|
+
"@loopstack/remote-client": "^0.25.0",
|
|
37
36
|
"@nestjs/common": "^11.1.19",
|
|
38
37
|
"@nestjs/typeorm": "^11.0.1",
|
|
39
38
|
"typeorm": "^0.3.28"
|