"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentPageCacheService = exports.ContentPageCacheRepository = exports.ContentPageCache = exports.PageCache = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@loopback/core");
const repository_1 = require("@loopback/repository");
const constants_1 = require("../../constants");
const db_datasource_1 = require("../../datasources/db.datasource");
const content_extension_definition_1 = require("../../integration/content-extension.definition");
const content_entity_service_1 = require("../../services/content-entity/content-entity.service");
const home_page_const_1 = require("./home-page.const");
let PageCache = class PageCache extends repository_1.Entity {
};
tslib_1.__decorate([
    repository_1.property({
        type: 'string',
    }),
    tslib_1.__metadata("design:type", String)
], PageCache.prototype, "body", void 0);
PageCache = tslib_1.__decorate([
    repository_1.model()
], PageCache);
exports.PageCache = PageCache;
let ContentPageCache = class ContentPageCache extends content_extension_definition_1.ContentExtension {
};
ContentPageCache = tslib_1.__decorate([
    repository_1.model({ settings: { strict: false } })
], ContentPageCache);
exports.ContentPageCache = ContentPageCache;
let ContentPageCacheRepository = class ContentPageCacheRepository extends content_extension_definition_1.ContentExtensionRepository {
    constructor(dataSource, objectNodeRepositoryGetter) {
        super(ContentPageCache, dataSource, objectNodeRepositoryGetter);
        this.objectNodeRepositoryGetter = objectNodeRepositoryGetter;
    }
};
ContentPageCacheRepository = tslib_1.__decorate([
    tslib_1.__param(0, core_1.inject(constants_1.DATASTORE_DB)),
    tslib_1.__param(1, repository_1.repository.getter('ObjectNodeRepository')),
    tslib_1.__metadata("design:paramtypes", [db_datasource_1.DbDataSource, Function])
], ContentPageCacheRepository);
exports.ContentPageCacheRepository = ContentPageCacheRepository;
let ContentPageCacheService = class ContentPageCacheService extends content_extension_definition_1.ContentExtensionService {
    constructor(contentEntityService, contentExtensionRepository) {
        super(home_page_const_1.HOME_PAGE_PROVIDER, ContentPageCacheService.name, contentEntityService, contentExtensionRepository, 'ContentPageCache');
        this.contentEntityService = contentEntityService;
        this.contentExtensionRepository = contentExtensionRepository;
    }
    async getContentDefinition() {
        return {
            properties: {
                contentPageCache: {
                    type: 'object',
                    title: 'Page cache',
                    properties: {
                        body: {
                            type: 'string',
                            title: 'Body response',
                            default: '',
                            required: true,
                            'x-schema-form': {
                                type: 'textarea',
                            },
                        },
                    },
                },
            },
        };
    }
};
ContentPageCacheService = tslib_1.__decorate([
    tslib_1.__param(0, core_1.service(content_entity_service_1.ContentEntityService)),
    tslib_1.__param(1, repository_1.repository(ContentPageCacheRepository)),
    tslib_1.__metadata("design:paramtypes", [content_entity_service_1.ContentEntityService,
        ContentPageCacheRepository])
], ContentPageCacheService);
exports.ContentPageCacheService = ContentPageCacheService;
//# sourceMappingURL=content-page-cache.definition.js.map