"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AzurePipelinesTasksDatasource = void 0;
const tslib_1 = require("tslib");
const data_files_generated_1 = tslib_1.__importDefault(require("../../../data-files.generated"));
const loose_1 = require("../../versioning/loose");
const datasource_1 = require("../datasource");
class AzurePipelinesTasksDatasource extends datasource_1.Datasource {
    static id = 'azure-pipelines-tasks';
    builtInTasks;
    marketplaceTasks;
    constructor() {
        super(AzurePipelinesTasksDatasource.id);
        this.builtInTasks = JSON.parse(data_files_generated_1.default.get('data/azure-pipelines-tasks.json'));
        this.marketplaceTasks = JSON.parse(data_files_generated_1.default.get('data/azure-pipelines-marketplace-tasks.json'));
    }
    customRegistrySupport = false;
    defaultVersioning = loose_1.id;
    getReleases({ packageName, }) {
        const versions = this.builtInTasks[packageName.toLowerCase()] ??
            this.marketplaceTasks[packageName.toLowerCase()];
        if (versions) {
            const releases = versions.map((version) => ({ version }));
            return Promise.resolve({ releases });
        }
        return Promise.resolve(null);
    }
}
exports.AzurePipelinesTasksDatasource = AzurePipelinesTasksDatasource;
//# sourceMappingURL=index.js.map