UNPKG

@botonic/plugin-contentful

Version:

Botonic Plugin Contentful is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic. **[Contentful](http://www.contentful.com)** is a CMS (Content Management System) which manages contents of a great variet

78 lines 3.21 kB
export const DEFAULT_REFERENCES_TO_INCLUDE = 6; export var MessageContentType; (function (MessageContentType) { MessageContentType["CAROUSEL"] = "carousel"; MessageContentType["CHITCHAT"] = "chitchat"; MessageContentType["DOCUMENT"] = "document"; MessageContentType["IMAGE"] = "image"; MessageContentType["VIDEO"] = "video"; MessageContentType["TEXT"] = "text"; MessageContentType["STARTUP"] = "startUp"; })(MessageContentType || (MessageContentType = {})); // CHITCHAT removed because it's an alias for texts export const MESSAGE_CONTENT_TYPES = Object.values(MessageContentType).filter(m => m != MessageContentType.CHITCHAT); export var NonMessageTopContentType; (function (NonMessageTopContentType) { NonMessageTopContentType["DATE_RANGE"] = "dateRange"; NonMessageTopContentType["HANDOFF"] = "handoff"; NonMessageTopContentType["QUEUE"] = "queue"; NonMessageTopContentType["SCHEDULE"] = "schedule"; NonMessageTopContentType["URL"] = "url"; NonMessageTopContentType["PAYLOAD"] = "payload"; NonMessageTopContentType["INPUT"] = "user-input"; })(NonMessageTopContentType || (NonMessageTopContentType = {})); export const TopContentType = Object.assign(Object.assign({}, MessageContentType), NonMessageTopContentType); export const TOP_CONTENT_TYPES = [ ...MESSAGE_CONTENT_TYPES, ...Object.values(NonMessageTopContentType), ]; export var SubContentType; (function (SubContentType) { SubContentType["BUTTON"] = "button"; SubContentType["ELEMENT"] = "element"; })(SubContentType || (SubContentType = {})); export var CustomContentType; (function (CustomContentType) { CustomContentType["CUSTOM"] = "custom"; })(CustomContentType || (CustomContentType = {})); export const ContentType = Object.assign(Object.assign({}, TopContentType), SubContentType); export const CONTENT_TYPES = [ ...TOP_CONTENT_TYPES, ...Object.values(SubContentType), ]; export var AssetType; (function (AssetType) { AssetType["AUDIO"] = "audio"; AssetType["IMAGE"] = "image"; AssetType["VIDEO"] = "video"; AssetType["DOCUMENT"] = "document"; AssetType["SPREADSHEET"] = "spreadsheet"; AssetType["OTHER"] = "other"; })(AssetType || (AssetType = {})); export const ResourceType = Object.assign(Object.assign({}, ContentType), AssetType); export const BotonicContentType = Object.assign(Object.assign({}, MessageContentType), SubContentType); export const BOTONIC_CONTENT_TYPES = [ ...MESSAGE_CONTENT_TYPES, ...Object.values(SubContentType), ]; export function isCustomModel(cmsModelType, localModelType) { return (localModelType === CustomContentType.CUSTOM && (isSameModel(cmsModelType, CustomContentType.CUSTOM) || !CONTENT_TYPES.includes(cmsModelType))); } export function isSameModel(model1, model2) { switch (model1) { case ContentType.TEXT: case ContentType.CHITCHAT: return model2 == ContentType.TEXT || model2 == ContentType.CHITCHAT; default: return model1 == model2; } } export class PagingOptions { constructor(limit = 1000, skip = 0) { this.limit = limit; this.skip = skip; } } //# sourceMappingURL=cms.js.map