@loopstack/remote-file-explorer-module 0.24.4 → 0.25.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/README.md
CHANGED
|
@@ -46,11 +46,11 @@ RemoteFileExplorerModule.forFeature({ enabled: true, environments: ['production'
|
|
|
46
46
|
|
|
47
47
|
## Quick Start
|
|
48
48
|
|
|
49
|
-
Once imported, the controller is available at `/api/v1/workspaces/:workspaceId/files`. No additional setup is required beyond having `RemoteClientModule` registered.
|
|
49
|
+
Once imported, the controller is available at `/api/v1/workspaces/:workspaceId/remote-files`. No additional setup is required beyond having `RemoteClientModule` registered.
|
|
50
50
|
|
|
51
51
|
```http
|
|
52
|
-
GET /api/v1/workspaces/:workspaceId/files/tree?path=src
|
|
53
|
-
GET /api/v1/workspaces/:workspaceId/files/read?path=src/index.ts
|
|
52
|
+
GET /api/v1/workspaces/:workspaceId/remote-files/tree?path=src
|
|
53
|
+
GET /api/v1/workspaces/:workspaceId/remote-files/read?path=src/index.ts
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Both endpoints require an authenticated user (resolved via `@CurrentUser()`).
|
|
@@ -60,7 +60,7 @@ Both endpoints require an authenticated user (resolved via `@CurrentUser()`).
|
|
|
60
60
|
```
|
|
61
61
|
Frontend (Studio)
|
|
62
62
|
|
|
|
63
|
-
| GET /api/v1/workspaces/:workspaceId/files/tree?path=src
|
|
63
|
+
| GET /api/v1/workspaces/:workspaceId/remote-files/tree?path=src
|
|
64
64
|
v
|
|
65
65
|
RemoteFileExplorerController
|
|
66
66
|
|
|
|
@@ -78,21 +78,21 @@ Response -> Frontend
|
|
|
78
78
|
|
|
79
79
|
The controller has two endpoints:
|
|
80
80
|
|
|
81
|
-
1. **`GET tree`** -- calls `RemoteClient.getFileTree()`.
|
|
81
|
+
1. **`GET tree`** -- calls `RemoteClient.getFileTree()`. Walks the workspace root when no `path` query param is provided.
|
|
82
82
|
2. **`GET read`** -- calls `RemoteClient.readFile()`. Requires a `path` query param.
|
|
83
83
|
|
|
84
84
|
Both endpoints resolve the workspace's agent URL via `EnvironmentService.getAgentUrlForWorkspace()` before proxying.
|
|
85
85
|
|
|
86
86
|
## Endpoints Reference
|
|
87
87
|
|
|
88
|
-
### GET `/api/v1/workspaces/:workspaceId/files/tree`
|
|
88
|
+
### GET `/api/v1/workspaces/:workspaceId/remote-files/tree`
|
|
89
89
|
|
|
90
90
|
Returns the directory tree for the given path.
|
|
91
91
|
|
|
92
|
-
| Parameter | In | Type | Required | Description
|
|
93
|
-
| ------------- | ----- | -------- | -------- |
|
|
94
|
-
| `workspaceId` | path | `string` | yes | The workspace ID
|
|
95
|
-
| `path` | query | `string` | no | Base path to list (defaults to
|
|
92
|
+
| Parameter | In | Type | Required | Description |
|
|
93
|
+
| ------------- | ----- | -------- | -------- | -------------------------------------------------- |
|
|
94
|
+
| `workspaceId` | path | `string` | yes | The workspace ID |
|
|
95
|
+
| `path` | query | `string` | no | Base path to list (defaults to the workspace root) |
|
|
96
96
|
|
|
97
97
|
**Response:** `FileTreeNode[]`
|
|
98
98
|
|
|
@@ -106,7 +106,7 @@ interface FileTreeNode {
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
### GET `/api/v1/workspaces/:workspaceId/files/read`
|
|
109
|
+
### GET `/api/v1/workspaces/:workspaceId/remote-files/read`
|
|
110
110
|
|
|
111
111
|
Returns the content of a single file.
|
|
112
112
|
|
|
@@ -22,7 +22,7 @@ let RemoteFileExplorerController = class RemoteFileExplorerController {
|
|
|
22
22
|
}
|
|
23
23
|
async getFileTree(workspaceId, basePath, _user) {
|
|
24
24
|
const agentUrl = await this.env.getAgentUrlForWorkspace(workspaceId);
|
|
25
|
-
return this.remote.getFileTree(agentUrl, basePath
|
|
25
|
+
return this.remote.getFileTree(agentUrl, basePath);
|
|
26
26
|
}
|
|
27
27
|
async readFile(workspaceId, filePath, _user) {
|
|
28
28
|
const agentUrl = await this.env.getAgentUrlForWorkspace(workspaceId);
|
|
@@ -49,7 +49,7 @@ __decorate([
|
|
|
49
49
|
], RemoteFileExplorerController.prototype, "readFile", null);
|
|
50
50
|
RemoteFileExplorerController = __decorate([
|
|
51
51
|
UsePipes(new ValidationPipe({ transform: true, whitelist: true, forbidNonWhitelisted: true })),
|
|
52
|
-
Controller('api/v1/workspaces/:workspaceId/files'),
|
|
52
|
+
Controller('api/v1/workspaces/:workspaceId/remote-files'),
|
|
53
53
|
__metadata("design:paramtypes", [RemoteClient,
|
|
54
54
|
EnvironmentService])
|
|
55
55
|
], RemoteFileExplorerController);
|
|
@@ -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,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,
|
|
1
|
+
{"version":3,"file":"remote-file-explorer.controller.js","sourceRoot":"","sources":["../../src/controllers/remote-file-explorer.controller.ts"],"names":[],"mappings":";;;;;;;;;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BU,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,6CAA6C,CAAC;qCAG7B,YAAY;QACf,kBAAkB;GAH/B,4BAA4B,CAyBxC"}
|
|
@@ -12,7 +12,7 @@ let RemoteFileExplorerModule = RemoteFileExplorerModule_1 = class RemoteFileExpl
|
|
|
12
12
|
static forFeature(config) {
|
|
13
13
|
return {
|
|
14
14
|
module: RemoteFileExplorerModule_1,
|
|
15
|
-
providers: [registerFeature('
|
|
15
|
+
providers: [registerFeature('remoteFileExplorer', config)],
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,oBAAoB,EAAE,MAAM,CAAC,CAAC;SAC3D,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.25.0",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "Jakob Klippel",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"watch": "nest build --watch"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@loopstack/common": "^0.
|
|
35
|
-
"@loopstack/remote-client": "^0.
|
|
34
|
+
"@loopstack/common": "^0.36.0",
|
|
35
|
+
"@loopstack/remote-client": "^0.26.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@nestjs/common": "^11.1.19",
|