mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
fix: Actions like the action don't give the results (#2770)
This commit is contained in:
@@ -136,11 +136,13 @@ const jsonParse = (x: string) => JSON.parse(x)
|
|||||||
|
|
||||||
const handleRpc = (id: IdType, result: Promise<RpcResult>) =>
|
const handleRpc = (id: IdType, result: Promise<RpcResult>) =>
|
||||||
result
|
result
|
||||||
.then((result) => ({
|
.then((result) => {
|
||||||
jsonrpc,
|
return {
|
||||||
id,
|
jsonrpc,
|
||||||
...result,
|
id,
|
||||||
}))
|
...result,
|
||||||
|
}
|
||||||
|
})
|
||||||
.then((x) => {
|
.then((x) => {
|
||||||
if (
|
if (
|
||||||
("result" in x && x.result === undefined) ||
|
("result" in x && x.result === undefined) ||
|
||||||
@@ -413,7 +415,6 @@ export class RpcListener {
|
|||||||
const ensureResultTypeShape = (
|
const ensureResultTypeShape = (
|
||||||
result: void | T.ActionInput | T.ActionResult | null,
|
result: void | T.ActionInput | T.ActionResult | null,
|
||||||
): { result: any } => {
|
): { result: any } => {
|
||||||
if (isResult(result)) return result
|
|
||||||
return { result }
|
return { result }
|
||||||
}
|
}
|
||||||
const callbacks = this.callbackHolderFor(procedure)
|
const callbacks = this.callbackHolderFor(procedure)
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import { ExecuteResult, Procedure, System } from "../../Interfaces/System"
|
import { System } from "../../Interfaces/System"
|
||||||
import { unNestPath } from "../../Models/JsonPath"
|
|
||||||
import matches, { any, number, object, string, tuple } from "ts-matches"
|
|
||||||
import { Effects } from "../../Models/Effects"
|
import { Effects } from "../../Models/Effects"
|
||||||
import { RpcResult, matchRpcResult } from "../RpcListener"
|
|
||||||
import { duration } from "../../Models/Duration"
|
|
||||||
import { T, utils } from "@start9labs/start-sdk"
|
import { T, utils } from "@start9labs/start-sdk"
|
||||||
import { Volume } from "../../Models/Volume"
|
|
||||||
import { CallbackHolder } from "../../Models/CallbackHolder"
|
|
||||||
import { Optional } from "ts-matches/lib/parsers/interfaces"
|
import { Optional } from "ts-matches/lib/parsers/interfaces"
|
||||||
|
|
||||||
export const STARTOS_JS_LOCATION = "/usr/lib/startos/package/index.js"
|
export const STARTOS_JS_LOCATION = "/usr/lib/startos/package/index.js"
|
||||||
|
|||||||
Reference in New Issue
Block a user