@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
JavaScript
import { __awaiter } from "tslib";
import { BotServerMessageFactory, } from '@botonic/core';
import { trackOneContent } from '../tracking';
import { ContentFieldsBase } from './content-fields-base';
export class FlowImage extends ContentFieldsBase {
constructor() {
super(...arguments);
this.src = '';
}
static fromHubtypeCMS(component, locale) {
const newImage = new FlowImage(component.id);
newImage.code = component.code;
newImage.src = this.getAssetByLocale(locale, component.content.image);
newImage.followUp = component.follow_up;
return newImage;
}
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.createImage({ attachmentUrl: this.src });
});
}
}
//# sourceMappingURL=flow-image.js.map