17 lines
No EOL
442 B
TypeScript
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);
|
|
}
|
|
} |