UNPKG

azdev-automation

Version:

Azure DevOps automation framework enables access control automation of projects, pipelines and repositories configuration in Azure DevOps Services

23 lines (22 loc) 954 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TaskAgentHelper = void 0; class TaskAgentHelper { constructor(taskAgentApi, logger) { this.debugLogger = logger.extend(this.constructor.name); this.taskAgentApi = taskAgentApi; } async findTasks(name) { var _a; const debug = this.debugLogger.extend(this.findTasks.name); const allTasks = await this.taskAgentApi.getTaskDefinitions(); debug(`Found <${allTasks.length}> available tasks`); const filteredTasks = allTasks.filter((t) => t.name.match(name)); debug(`Filtered <${filteredTasks.length}> tasks matching <${name}> name`); for (const task of filteredTasks) { debug(`Task <${task.name}@${(_a = task.version) === null || _a === void 0 ? void 0 : _a.major}> (${task.id}) found`); } return filteredTasks; } } exports.TaskAgentHelper = TaskAgentHelper;