intentful
Version:
Create Custom Skills with less headache
33 lines (32 loc) • 832 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Command = void 0;
class Command {
constructor(type, props) {
this.type = type;
this.props = props;
}
toJSON() {
return this.model();
}
model() {
return {
...this.convertCommandPropsToModel(),
...this.commandSpecificModel()
};
}
getRequestHandlers() {
return [...this.commandSpecificRequestHandlers()];
}
convertCommandPropsToModel() {
return {
description: this.props.description,
delay: this.props.delay,
screenLock: this.props.screenLock,
sequencer: this.props.sequencer,
when: this.props.when,
type: this.type
};
}
}
exports.Command = Command;