nftables: ask converged through the node-engine seat's generated package
The holder's ask of the node-engine's converged takes the seat's name, the verb's name and the answer's form from the node-engine seat's TypeScript package, as the holder says its own event through its seat's package. Builds: design 33 control-verbs §10, §12; design 47 H H-A-316, H-A-321
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
// its own state, said and journalled, so no expired entry is kept or answered.
|
||||
|
||||
import { isIP } from "node:net";
|
||||
import type { ConvergedAnswer } from "@novox/mesh-contracts-node-engine";
|
||||
|
||||
/** The state the allowances are kept in, as the seat's definition names it (§7). */
|
||||
export const STATE = "allowances";
|
||||
@@ -55,13 +56,8 @@ export interface Changed {
|
||||
at: string;
|
||||
}
|
||||
|
||||
/** The node's convergence state as the node-engine seat's converged answers it (§10, H-A-316). */
|
||||
export interface Convergence {
|
||||
state: "adopted" | "converged";
|
||||
since?: string;
|
||||
/** The found firewall's kind, for an adopted node. */
|
||||
found?: string;
|
||||
}
|
||||
/** The node's convergence state as the node-engine seat's converged answers it (§10, H-A-316, H-A-321). */
|
||||
export type Convergence = ConvergedAnswer;
|
||||
|
||||
/** One act by hand, as the seat mesh-hand-acts' hand-act takes it (ADR 0565 §10): the SDK's views.HandAct. */
|
||||
export interface HandAct {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@novox/mesh-sdk": "^0.1.1",
|
||||
"@novox/mesh-connectivity-contracts-node-packet-filter": "^0.1.0"
|
||||
"@novox/mesh-connectivity-contracts-node-packet-filter": "^0.1.0",
|
||||
"@novox/mesh-contracts-node-engine": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.0.0",
|
||||
|
||||
@@ -8,6 +8,7 @@ import { broker } from "@novox/mesh-sdk/messaging";
|
||||
import { config, seatPublish } from "@novox/mesh-sdk/runtime";
|
||||
import { keeps, state } from "@novox/mesh-sdk/state";
|
||||
import { allowancesChangedSubject } from "@novox/mesh-connectivity-contracts-node-packet-filter";
|
||||
import { seat as nodeEngine, verbs as nodeEngineVerbs } from "@novox/mesh-contracts-node-engine";
|
||||
import { FirewallClient } from "../client.js";
|
||||
import { Allowances, MOST, STATE, markLoaded, type Convergence, type Store, type Value } from "../allowances.js";
|
||||
|
||||
@@ -127,7 +128,7 @@ const store: Store = {
|
||||
},
|
||||
};
|
||||
const allowances = new Allowances(store, node, (body) => seatPublish(allowancesChangedSubject(node), body), {
|
||||
converged: async () => (await broker().request<object, Convergence>(`seat:node-engine.converged@${node}`, {})),
|
||||
converged: async () => (await broker().request<object, Convergence>(`seat:${nodeEngine}.${nodeEngineVerbs.converged}@${node}`, {})),
|
||||
handAct: async (act) => { await broker().request("seat:mesh-hand-acts.hand-act", act); },
|
||||
most: async () => {
|
||||
const v = await config("allowances-max");
|
||||
|
||||
Reference in New Issue
Block a user