@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
31 lines (26 loc) • 853 B
text/typescript
import { IRWCAnswerComponent, IRWCMessage, IRWCMedia } from "../../types";
class RWCAnswerComponent implements IRWCAnswerComponent {
name = '';
vBind = {};
keepComponentInThreadAfterSubmit = true;
showComponentInMessage = true;
constructor(component, name?) {
this.name = component.name || name;
this.vBind = component;
}
}
class RWCv5Message implements IRWCMessage {
type: string;
message: string;
medias: Array<IRWCMedia> = [];
components: Array<IRWCAnswerComponent> = [];
text: string;
constructor(message, components? , medias?, type?) {
this.type = type || "message@message";
this.message = message;
this.medias = medias || [];
this.components = components || [];
this.text = message;
}
}
export { RWCv5Message, RWCAnswerComponent };