chore: generate
This commit is contained in:
@@ -40,8 +40,11 @@ const FileReadCommand = effectCmd({
|
|||||||
handler: Effect.fn("Cli.debug.file.read")(function* (args) {
|
handler: Effect.fn("Cli.debug.file.read")(function* (args) {
|
||||||
const file = yield* filesystem(FileSystem.Service.use((svc) => svc.read({ path: RelativePath.make(args.path) })))
|
const file = yield* filesystem(FileSystem.Service.use((svc) => svc.read({ path: RelativePath.make(args.path) })))
|
||||||
process.stdout.write(
|
process.stdout.write(
|
||||||
JSON.stringify({ content: Buffer.from(file.content).toString("base64"), encoding: "base64", mime: file.mime }, null, 2) +
|
JSON.stringify(
|
||||||
EOL,
|
{ content: Buffer.from(file.content).toString("base64"), encoding: "base64", mime: file.mime },
|
||||||
|
null,
|
||||||
|
2,
|
||||||
|
) + EOL,
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12463,7 +12463,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/fs/read": {
|
"/api/fs/read/*": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": ["filesystem"],
|
"tags": ["filesystem"],
|
||||||
"operationId": "v2.fs.read",
|
"operationId": "v2.fs.read",
|
||||||
@@ -12486,14 +12486,6 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"style": "deepObject",
|
"style": "deepObject",
|
||||||
"explode": true
|
"explode": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"in": "query",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"required": true
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"security": [],
|
"security": [],
|
||||||
@@ -12501,19 +12493,10 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "Success",
|
"description": "Success",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/octet-stream": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "string",
|
||||||
"properties": {
|
"format": "binary"
|
||||||
"location": {
|
|
||||||
"$ref": "#/components/schemas/LocationInfo"
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"$ref": "#/components/schemas/FileSystemContent"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["location", "data"],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12539,7 +12522,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "Read one file relative to the requested location.",
|
"description": "Serve one file relative to the requested location.",
|
||||||
"summary": "Read file",
|
"summary": "Read file",
|
||||||
"x-codeSamples": [
|
"x-codeSamples": [
|
||||||
{
|
{
|
||||||
@@ -26560,29 +26543,6 @@
|
|||||||
"required": ["id", "projectID", "action", "resource"],
|
"required": ["id", "projectID", "action", "resource"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"FileSystemContent": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"uri": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"content": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"encoding": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["utf8", "base64"]
|
|
||||||
},
|
|
||||||
"mime": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["uri", "content", "encoding", "mime"],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"FileSystemEntry": {
|
"FileSystemEntry": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ export const FileSystemHandler = HttpApiBuilder.group(Api, "server.fs", (handler
|
|||||||
.handleRaw("fs.read", (ctx) =>
|
.handleRaw("fs.read", (ctx) =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const file = yield* (yield* FileSystem.Service).read({
|
const file = yield* (yield* FileSystem.Service).read({
|
||||||
path: RelativePath.make(decodeURIComponent(new URL(ctx.request.url, "http://localhost").pathname.slice(13))),
|
path: RelativePath.make(
|
||||||
|
decodeURIComponent(new URL(ctx.request.url, "http://localhost").pathname.slice(13)),
|
||||||
|
),
|
||||||
})
|
})
|
||||||
return HttpServerResponse.uint8Array(file.content, { contentType: file.mime })
|
return HttpServerResponse.uint8Array(file.content, { contentType: file.mime })
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user