UNPKG

@botonic/plugin-flow-builder

Version:

Botonic plugin for **Hubtype Flow Builder**: run and bridge flow-driven logic from bots on the **current** line.

34 lines 1.25 kB
import { __awaiter } from "tslib"; import { BotServerMessageFactory, } from '@botonic/core'; import { trackOneContent } from '../tracking'; import { ContentFieldsBase } from './content-fields-base'; export class FlowVideo extends ContentFieldsBase { constructor() { super(...arguments); this.src = ''; } static fromHubtypeCMS(component, locale) { const newVideo = new FlowVideo(component.id); newVideo.code = component.code; newVideo.src = this.getVideoByLocale(locale, component.content.video); newVideo.followUp = component.follow_up; return newVideo; } trackFlow(botonicContext) { return __awaiter(this, void 0, void 0, function* () { yield trackOneContent(botonicContext, this); }); } processContent(botonicContext) { return __awaiter(this, void 0, void 0, function* () { yield this.trackFlow(botonicContext); return this.filterContent(botonicContext, this); }); } toBotonic() { return __awaiter(this, void 0, void 0, function* () { return BotServerMessageFactory.createVideo({ attachmentUrl: this.src }); }); } } //# sourceMappingURL=flow-video.js.map