Build checked portable package artifacts and shared runtime assets
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
export const transactionPortAbi = "quixos-transaction-ports-v1";
|
||||
export type PortAction =
|
||||
| { kind: "state"; primitive: "read" | "write" | "edit" }
|
||||
| { kind: "edge"; primitive: "resolve" | "connect" | "disconnect" }
|
||||
| { kind: "edge"; primitive: "resolve" | "disconnect" }
|
||||
| { kind: "edge"; primitive: "connect"; key: string }
|
||||
| { kind: "interface"; operationId: string; key?: string }
|
||||
| { kind: "query" }
|
||||
| { kind: "creation"; key: string };
|
||||
@@ -19,6 +20,7 @@ export interface PortInvocation {
|
||||
}
|
||||
export interface PackageInvocation {
|
||||
abi: typeof transactionPortAbi;
|
||||
workspace: string;
|
||||
frame: string;
|
||||
invocation: string;
|
||||
exportId: string;
|
||||
@@ -66,7 +68,8 @@ export function checkPortInvocation(value: unknown): PortInvocation {
|
||||
action.kind === "state"
|
||||
? exact(["kind", "primitive"]) && ["read", "write", "edit"].includes(action.primitive as string)
|
||||
: action.kind === "edge"
|
||||
? exact(["kind", "primitive"]) && ["resolve", "connect", "disconnect"].includes(action.primitive as string)
|
||||
? (exact(["kind", "primitive"]) && ["resolve", "disconnect"].includes(action.primitive as string)) ||
|
||||
(exact(["kind", "primitive", "key"]) && action.primitive === "connect" && identifier(action.key))
|
||||
: action.kind === "interface"
|
||||
? (exact(["kind", "operationId"]) || (exact(["kind", "operationId", "key"]) && identifier(action.key))) &&
|
||||
identifier(action.operationId)
|
||||
|
||||
Reference in New Issue
Block a user