@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
79 lines • 2.7 kB
JavaScript
/**
* CMS decorator which allows delegating each method call to a different
* CMS instance depending on the context (eg. locale)
*/
export class MultiContextCms {
constructor(cmsFromContext) {
this.cmsFromContext = cmsFromContext;
}
asset(id, context) {
return this.cmsFromContext(context).asset(id, context);
}
button(id, context) {
return this.cmsFromContext(context).button(id, context);
}
carousel(id, context) {
return this.cmsFromContext(context).carousel(id, context);
}
chitchat(id, context) {
return this.cmsFromContext(context).chitchat(id, context);
}
content(id, context, referencesToInclude) {
return this.cmsFromContext(context).content(id, context, referencesToInclude);
}
contents(contentType, context, paging) {
return this.cmsFromContext(context).contents(contentType, context, paging);
}
assets(context) {
return this.cmsFromContext(context).assets(context);
}
contentsWithKeywords(context, paging) {
return this.cmsFromContext(context).contentsWithKeywords(context, paging);
}
dateRange(id, context) {
return this.cmsFromContext(context).dateRange(id, context);
}
document(id, context) {
return this.cmsFromContext(context).document(id, context);
}
element(id, context) {
return this.cmsFromContext(context).element(id, context);
}
image(id, context) {
return this.cmsFromContext(context).image(id, context);
}
video(id, context) {
return this.cmsFromContext(context).video(id, context);
}
queue(id, context) {
return this.cmsFromContext(context).queue(id, context);
}
schedule(id, context) {
return this.cmsFromContext(context).schedule(id, context);
}
startUp(id, context) {
return this.cmsFromContext(context).startUp(id, context);
}
text(id, context) {
return this.cmsFromContext(context).text(id, context);
}
handoff(id, context) {
return this.cmsFromContext(context).handoff(id, context);
}
input(id, context) {
return this.cmsFromContext(context).input(id, context);
}
custom(id, context) {
return this.cmsFromContext(context).custom(id, context);
}
topContents(model, context, filter, paging) {
return this.cmsFromContext(context).topContents(model, context, filter, paging);
}
url(id, context) {
return this.cmsFromContext(context).url(id, context);
}
payload(id, context) {
return this.cmsFromContext(context).payload(id, context);
}
}
//# sourceMappingURL=cms-multilocale.js.map