"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentImageService = exports.ContentImageRepository = exports.ContentImage = exports.Image = 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 content_image_const_1 = require("./content-image.const");
let Image = class Image extends repository_1.Entity {
};
tslib_1.__decorate([
    repository_1.property({
        type: 'string',
    }),
    tslib_1.__metadata("design:type", String)
], Image.prototype, "base64", void 0);
tslib_1.__decorate([
    repository_1.property({
        type: 'string',
    }),
    tslib_1.__metadata("design:type", String)
], Image.prototype, "size", void 0);
tslib_1.__decorate([
    repository_1.property({
        type: 'string',
    }),
    tslib_1.__metadata("design:type", String)
], Image.prototype, "name", void 0);
tslib_1.__decorate([
    repository_1.property({
        type: 'string',
    }),
    tslib_1.__metadata("design:type", String)
], Image.prototype, "type", void 0);
Image = tslib_1.__decorate([
    repository_1.model()
], Image);
exports.Image = Image;
let ContentImage = class ContentImage extends content_extension_definition_1.ContentExtension {
};
ContentImage = tslib_1.__decorate([
    repository_1.model({ settings: { strict: false } })
], ContentImage);
exports.ContentImage = ContentImage;
let ContentImageRepository = class ContentImageRepository extends content_extension_definition_1.ContentExtensionRepository {
    constructor(dataSource, objectNodeRepositoryGetter) {
        super(ContentImage, dataSource, objectNodeRepositoryGetter);
        this.objectNodeRepositoryGetter = objectNodeRepositoryGetter;
    }
};
ContentImageRepository = 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])
], ContentImageRepository);
exports.ContentImageRepository = ContentImageRepository;
let ContentImageService = class ContentImageService extends content_extension_definition_1.ContentExtensionService {
    constructor(contentEntityService, contentExtensionRepository) {
        super(content_image_const_1.CONTENT_IMAGE_PROVIDER, ContentImageService.name, contentEntityService, contentExtensionRepository, 'ContentImage');
        this.contentEntityService = contentEntityService;
        this.contentExtensionRepository = contentExtensionRepository;
    }
    async getContentDefinition() {
        return {
            properties: {
                contentImage: {
                    type: 'object',
                    title: 'Image',
                    'x-schema-form': {
                        type: 'image',
                    },
                    properties: {
                        base64: { type: 'string', required: false },
                        size: { type: 'string', required: false },
                        name: { type: 'string', required: false },
                        type: { type: 'string', required: false },
                        id: { type: 'string', required: false },
                        uri: { type: 'string', required: false },
                    },
                },
            },
        };
    }
};
ContentImageService = tslib_1.__decorate([
    tslib_1.__param(0, core_1.service(content_entity_service_1.ContentEntityService)),
    tslib_1.__param(1, repository_1.repository(ContentImageRepository)),
    tslib_1.__metadata("design:paramtypes", [content_entity_service_1.ContentEntityService,
        ContentImageRepository])
], ContentImageService);
exports.ContentImageService = ContentImageService;
//# sourceMappingURL=content-image.definition.js.map