plugis-client/PlugisClass.ts
2025-03-22 18:51:17 +01:00

17 lines
No EOL
442 B
TypeScript

import { CloudEvent } from "cloudevents";
import NatsClass from "./NatsClass";
export class PlugisClass extends NatsClass {
constructor(server: string | string[]) {
super(server);
}
async variableSet(variable: string, value: string) {
const ce = new CloudEvent({
type: "com.plugis.variable.set",
source: "/plugis/variable",
data: { variable, value },
});
this.publishJson("variable.set.>", ce);
}
}