@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
104 lines • 3.9 kB
JavaScript
import { ContentType, CustomContentType, } from './cms';
export class LogCMS {
constructor(cms, options, logger = console.log) {
this.cms = cms;
this.logger = logger;
this.logger('Creating Contentful with options: ' + JSON.stringify(options));
}
carousel(id, context) {
this.logContentDelivery(ContentType.CAROUSEL, id, context);
return this.cms.carousel(id, context);
}
document(id, context) {
this.logContentDelivery(ContentType.DOCUMENT, id, context);
return this.cms.document(id, context);
}
text(id, context) {
this.logContentDelivery(ContentType.TEXT, id, context);
return this.cms.text(id, context);
}
chitchat(id, context) {
this.logContentDelivery(ContentType.CHITCHAT, id, context);
return this.cms.text(id, context);
}
startUp(id, context) {
this.logContentDelivery(ContentType.STARTUP, id, context);
return this.cms.startUp(id, context);
}
url(id, context) {
this.logContentDelivery(ContentType.URL, id, context);
return this.cms.url(id, context);
}
payload(id, context) {
this.logContentDelivery(ContentType.PAYLOAD, id, context);
return this.cms.payload(id, context);
}
image(id, context) {
this.logContentDelivery(ContentType.IMAGE, id, context);
return this.cms.image(id, context);
}
video(id, context) {
this.logContentDelivery(ContentType.VIDEO, id, context);
return this.cms.video(id, context);
}
queue(id, context) {
this.logContentDelivery(ContentType.QUEUE, id, context);
return this.cms.queue(id, context);
}
button(id, context) {
this.logContentDelivery(ContentType.BUTTON, id, context);
return this.cms.button(id, context);
}
element(id, context) {
this.logContentDelivery(ContentType.ELEMENT, id, context);
return this.cms.element(id, context);
}
handoff(id, context) {
this.logContentDelivery(ContentType.HANDOFF, id, context);
return this.cms.handoff(id, context);
}
input(id, context) {
this.logContentDelivery(ContentType.INPUT, id, context);
return this.cms.input(id, context);
}
custom(id, context) {
this.logContentDelivery(CustomContentType.CUSTOM, id, context);
return this.cms.custom(id, context);
}
content(id, context, referencesToInclude) {
this.logContentDelivery('content', id, context);
return this.cms.content(id, context, referencesToInclude);
}
contentsWithKeywords(context, paging) {
this.logger('contentsWithKeywords');
return this.cms.contentsWithKeywords(context, paging);
}
topContents(model, context, filter, paging) {
this.logger(`topContents of model ${model}`);
return this.cms.topContents(model, context, filter, paging);
}
contents(contentType, context, paging) {
this.logger(`contents of model ${contentType}`);
return this.cms.contents(contentType, context, paging);
}
assets(context) {
this.logger(`assets`);
return this.cms.assets(context);
}
schedule(id, context) {
this.logContentDelivery(ContentType.SCHEDULE, id, context);
return this.cms.schedule(id, context);
}
dateRange(id, context) {
this.logContentDelivery(ContentType.DATE_RANGE, id, context);
return this.cms.dateRange(id, context);
}
asset(id, context) {
this.logger(`Delivery asset with id ${id}`);
return this.cms.asset(id, context);
}
logContentDelivery(contentType, id, context) {
this.logger(`Delivery ${contentType} model with id '${id}' and locale '${String(context === null || context === void 0 ? void 0 : context.locale)}'`);
}
}
//# sourceMappingURL=cms-log.js.map