@botonic/plugin-contentful
Version:
## What Does This Plugin Do?
108 lines • 4.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogCMS = void 0;
const cms_1 = require("./cms");
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(cms_1.ContentType.CAROUSEL, id, context);
return this.cms.carousel(id, context);
}
document(id, context) {
this.logContentDelivery(cms_1.ContentType.DOCUMENT, id, context);
return this.cms.document(id, context);
}
text(id, context) {
this.logContentDelivery(cms_1.ContentType.TEXT, id, context);
return this.cms.text(id, context);
}
chitchat(id, context) {
this.logContentDelivery(cms_1.ContentType.CHITCHAT, id, context);
return this.cms.text(id, context);
}
startUp(id, context) {
this.logContentDelivery(cms_1.ContentType.STARTUP, id, context);
return this.cms.startUp(id, context);
}
url(id, context) {
this.logContentDelivery(cms_1.ContentType.URL, id, context);
return this.cms.url(id, context);
}
payload(id, context) {
this.logContentDelivery(cms_1.ContentType.PAYLOAD, id, context);
return this.cms.payload(id, context);
}
image(id, context) {
this.logContentDelivery(cms_1.ContentType.IMAGE, id, context);
return this.cms.image(id, context);
}
video(id, context) {
this.logContentDelivery(cms_1.ContentType.VIDEO, id, context);
return this.cms.video(id, context);
}
queue(id, context) {
this.logContentDelivery(cms_1.ContentType.QUEUE, id, context);
return this.cms.queue(id, context);
}
button(id, context) {
this.logContentDelivery(cms_1.ContentType.BUTTON, id, context);
return this.cms.button(id, context);
}
element(id, context) {
this.logContentDelivery(cms_1.ContentType.ELEMENT, id, context);
return this.cms.element(id, context);
}
handoff(id, context) {
this.logContentDelivery(cms_1.ContentType.HANDOFF, id, context);
return this.cms.handoff(id, context);
}
input(id, context) {
this.logContentDelivery(cms_1.ContentType.INPUT, id, context);
return this.cms.input(id, context);
}
custom(id, context) {
this.logContentDelivery(cms_1.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(cms_1.ContentType.SCHEDULE, id, context);
return this.cms.schedule(id, context);
}
dateRange(id, context) {
this.logContentDelivery(cms_1.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)}'`);
}
}
exports.LogCMS = LogCMS;
//# sourceMappingURL=cms-log.js.map