Implement Studio root and placement capabilities on the replica graph (WI-10)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* operation/port schema by the coordinator, not trusted because this header parsed. */
|
||||
export const transactionPortAbi = "quixos-transaction-ports-v1";
|
||||
export type PortAction =
|
||||
| { kind: "reflection"; selector: string }
|
||||
| { kind: "state"; primitive: "read" | "write" | "edit" }
|
||||
| { kind: "edge"; primitive: "resolve" | "disconnect" }
|
||||
| { kind: "edge"; primitive: "connect"; key: string }
|
||||
@@ -75,7 +76,9 @@ export function checkPortInvocation(value: unknown): PortInvocation {
|
||||
identifier(action.operationId)
|
||||
: action.kind === "creation"
|
||||
? exact(["kind", "key"]) && identifier(action.key)
|
||||
: action.kind === "query" && exact(["kind"]);
|
||||
: action.kind === "reflection"
|
||||
? exact(["kind", "selector"]) && identifier(action.selector)
|
||||
: action.kind === "query" && exact(["kind"]);
|
||||
if (!valid) throw new Error("Invalid port action");
|
||||
return { ...fields, action: { ...action } } as unknown as PortInvocation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user